#include <xen/hypercall.h>
#include <xen/nospec.h>
#include <xen/trace.h>
+#include <asm/apic.h>
#include <asm/multicall.h>
#include <irq_vectors.h>
#undef COMPAT_CALL
#undef HYPERCALL
-void pv_hypercall(struct cpu_user_regs *regs)
+/* Forced inline to cause 'compat' to be evaluated at compile time. */
+static void always_inline
+_pv_hypercall(struct cpu_user_regs *regs, bool compat)
{
struct vcpu *curr = current;
- unsigned long eax;
+ unsigned long eax = compat ? regs->eax : regs->rax;
ASSERT(guest_kernel_mode(curr, regs));
- eax = is_pv_32bit_vcpu(curr) ? regs->eax : regs->rax;
-
BUILD_BUG_ON(ARRAY_SIZE(pv_hypercall_table) >
ARRAY_SIZE(hypercall_args_table));
curr->hcall_preempted = false;
- if ( !is_pv_32bit_vcpu(curr) )
+ if ( !compat )
{
unsigned long rdi = regs->rdi;
unsigned long rsi = regs->rsi;
*(u8 *)(p+ 7) = 0xc3; /* ret */
}
}
+
+void do_entry_int82(struct cpu_user_regs *regs)
+{
+ if ( unlikely(untrusted_msi) )
+ check_for_unexpected_msi((uint8_t)regs->entry_vector);
+
+ _pv_hypercall(regs, true /* compat */);
+}
#endif
+void pv_hypercall(struct cpu_user_regs *regs)
+{
+ _pv_hypercall(regs, false /* native */);
+}
+
/*
* Local variables:
* mode: C
#include <xen/lib.h>
#include <xen/softirq.h>
-#include <asm/apic.h>
#include <asm/pv/trace.h>
#include <asm/shared.h>
#include <asm/traps.h>
#include <irq_vectors.h>
-#ifdef CONFIG_PV32
-void do_entry_int82(struct cpu_user_regs *regs)
-{
- if ( unlikely(untrusted_msi) )
- check_for_unexpected_msi((uint8_t)regs->entry_vector);
-
- pv_hypercall(regs);
-}
-#endif
-
void pv_inject_event(const struct x86_event *event)
{
struct vcpu *curr = current;