obj-bin-y += clear_page.o
obj-bin-y += copy_page.o
obj-y += cpuid.o
-obj-$(CONFIG_PV) += compat.o x86_64/compat.o
+obj-$(CONFIG_PV) += compat.o
+obj-$(CONFIG_PV32) += x86_64/compat.o
obj-$(CONFIG_KEXEC) += crash.o
obj-$(CONFIG_GDBSX) += debug.o
obj-y += delay.o
#define do_arch_1 paging_domctl_continuation
-static const hypercall_table_t hvm_hypercall_table[] = {
+static const struct {
+ hypercall_fn_t *native, *compat;
+} hvm_hypercall_table[] = {
HVM_CALL(memory_op),
#ifdef CONFIG_GRANT_TABLE
HVM_CALL(grant_table_op),
return rc;
}
+#endif /* CONFIG_PV */
+#ifdef CONFIG_PV32
int compat_update_va_mapping(unsigned int va, uint32_t lo, uint32_t hi,
unsigned int flags)
{
return rc;
}
-#endif /* CONFIG_PV */
+#endif /* CONFIG_PV32 */
typedef struct e820entry e820entry_t;
DEFINE_XEN_GUEST_HANDLE(e820entry_t);
#include <xen/event.h>
#include <xen/hypercall.h>
#include <xen/guest_access.h>
-#include <compat/callback.h>
-#include <compat/nmi.h>
#include <asm/shared.h>
#include <public/callback.h>
+#include <public/nmi.h>
static int register_guest_nmi_callback(unsigned long address)
{
return 0;
}
+#ifdef CONFIG_PV32
+
+#include <compat/callback.h>
+#include <compat/nmi.h>
+
static long compat_register_guest_callback(struct compat_callback_register *reg)
{
long ret = 0;
return 0;
}
+#endif /* CONFIG_PV32 */
+
long do_set_trap_table(XEN_GUEST_HANDLE_PARAM(const_trap_info_t) traps)
{
struct trap_info cur;
return rc;
}
+#ifdef CONFIG_PV32
int compat_set_trap_table(XEN_GUEST_HANDLE(trap_info_compat_t) traps)
{
struct vcpu *curr = current;
return rc;
}
+#endif
long do_nmi_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
{
return rc;
}
+#ifdef CONFIG_PV32
int compat_nmi_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
{
struct compat_nmi_callback cb;
return rc;
}
+#endif
/*
* Local variables:
return ret;
}
+#ifdef CONFIG_PV32
+
int compat_set_gdt(XEN_GUEST_HANDLE_PARAM(uint) frame_list,
unsigned int entries)
{
return ret;
}
+int compat_update_descriptor(uint32_t pa_lo, uint32_t pa_hi,
+ uint32_t desc_lo, uint32_t desc_hi)
+{
+ seg_desc_t d;
+
+ d.raw = ((uint64_t)desc_hi << 32) | desc_lo;
+
+ return do_update_descriptor(pa_lo | ((uint64_t)pa_hi << 32), d);
+}
+
+#endif /* CONFIG_PV32 */
+
static bool check_descriptor(const struct domain *dom, seg_desc_t *d)
{
unsigned int a = d->a, b = d->b, cs, dpl;
return ret;
}
-int compat_update_descriptor(uint32_t pa_lo, uint32_t pa_hi,
- uint32_t desc_lo, uint32_t desc_hi)
-{
- seg_desc_t d;
-
- d.raw = ((uint64_t)desc_hi << 32) | desc_lo;
-
- return do_update_descriptor(pa_lo | ((uint64_t)pa_hi << 32), d);
-}
-
/*
* Local variables:
* mode: C
return cr4;
}
+#ifdef CONFIG_PV32
int switch_compat(struct domain *d)
{
struct vcpu *v;
return rc;
}
+#endif
static int pv_create_gdt_ldt_l1tab(struct vcpu *v)
{
#include <xen/trace.h>
#include <irq_vectors.h>
+#ifdef CONFIG_PV32
#define HYPERCALL(x) \
[ __HYPERVISOR_ ## x ] = { (hypercall_fn_t *) do_ ## x, \
(hypercall_fn_t *) do_ ## x }
#define COMPAT_CALL(x) \
[ __HYPERVISOR_ ## x ] = { (hypercall_fn_t *) do_ ## x, \
(hypercall_fn_t *) compat_ ## x }
+#else
+#define HYPERCALL(x) \
+ [ __HYPERVISOR_ ## x ] = { (hypercall_fn_t *) do_ ## x }
+#define COMPAT_CALL(x) HYPERCALL(x)
+#endif
#define do_arch_1 paging_domctl_continuation
}
#endif
}
+#ifdef CONFIG_PV32
else
{
unsigned int ebx = regs->ebx;
}
#endif
}
+#endif /* CONFIG_PV32 */
/*
* PV guests use SYSCALL or INT $0x82 to make a hypercall, both of which
else
call->result = -ENOSYS;
}
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_PV32
else
{
struct compat_multicall_entry *call = &state->compat_call;
return 0;
}
+#ifdef CONFIG_PV32
unsigned int compat_iret(void)
{
struct cpu_user_regs *regs = guest_cpu_user_regs();
*/
return regs->eax;
}
+#endif
/*
* Local variables:
*/
rw_pv_hypercall_table = __va(__pa(pv_hypercall_table));
rw_pv_hypercall_table[__HYPERVISOR_event_channel_op].native =
- rw_pv_hypercall_table[__HYPERVISOR_event_channel_op].compat =
(hypercall_fn_t *)pv_shim_event_channel_op;
-
rw_pv_hypercall_table[__HYPERVISOR_grant_table_op].native =
- rw_pv_hypercall_table[__HYPERVISOR_grant_table_op].compat =
(hypercall_fn_t *)pv_shim_grant_table_op;
+#ifdef CONFIG_PV32
+ rw_pv_hypercall_table[__HYPERVISOR_event_channel_op].compat =
+ (hypercall_fn_t *)pv_shim_event_channel_op;
+ rw_pv_hypercall_table[__HYPERVISOR_grant_table_op].compat =
+ (hypercall_fn_t *)pv_shim_grant_table_op;
+#endif
+
guest = d;
/*
typedef uint32_t compat_ptr_t;
typedef unsigned long full_ptr_t;
+
+struct domain;
+#ifdef CONFIG_PV32
+int switch_compat(struct domain *);
+#else
+#include <xen/errno.h>
+static inline int switch_compat(struct domain *d) { return -EOPNOTSUPP; }
+#endif
unsigned long, unsigned long, unsigned long);
typedef struct {
- hypercall_fn_t *native, *compat;
+ hypercall_fn_t *native;
+#ifdef CONFIG_PV32
+ hypercall_fn_t *compat;
+#endif
} hypercall_table_t;
typedef struct {
struct vcpu_runstate_info;
void xlat_vcpu_runstate_info(struct vcpu_runstate_info *);
-struct domain;
-int switch_compat(struct domain *);
-
#else
#define compat_handle_is_null(hnd) 0