From c99986fa168ef79b1ea6c071f57017e40b367383 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 15 Jul 2016 13:12:01 +0000 Subject: [PATCH] x86/pv: Support do_set_segment_base() for compat guests set_segment_base is the only hypercall exists in only one of the two modes guests might run in; all other hypercalls are either implemented, or unimplemented in both modes. Remove this split, by allowing do_set_segment_base() to be called in the compat hypercall path. This change will simplify the verification logic in a later change. No behavioural change from a guests point of view. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/x86_64/compat/entry.S | 2 +- xen/arch/x86/x86_64/mm.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S index e80c53cc71..1b6a482b9c 100644 --- a/xen/arch/x86/x86_64/compat/entry.S +++ b/xen/arch/x86/x86_64/compat/entry.S @@ -456,7 +456,7 @@ ENTRY(compat_hypercall_table) .quad compat_update_va_mapping_otherdomain .quad compat_iret .quad compat_vcpu_op - .quad compat_ni_hypercall /* 25 */ + .quad do_set_segment_base /* 25 */ .quad compat_mmuext_op .quad compat_xsm_op .quad compat_nmi_op diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 7f858fb2fc..250d3e0025 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -1031,6 +1031,9 @@ long do_set_segment_base(unsigned int which, unsigned long base) struct vcpu *v = current; long ret = 0; + if ( is_pv_32bit_vcpu(v) ) + return -ENOSYS; /* x86/64 only. */ + switch ( which ) { case SEGBASE_FS: -- 2.30.2