]> xenbits.xensource.com Git - xen.git/commitdiff
xen/pv: Construct d0v0's GDT properly
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 20 Dec 2017 15:22:27 +0000 (16:22 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Dec 2017 15:22:27 +0000 (16:22 +0100)
c/s cf6d39f8199 "x86/PV: properly populate descriptor tables" changed the GDT
to reference zero_page for intermediate frames between the guest and Xen
frames.

Because dom0_construct_pv() doesn't call arch_set_info_guest(), some bits of
initialisation are missed, including the pv_destroy_gdt() which initially
fills the references to zero_page.

In practice, this means there is a window between starting and the first call
to HYPERCALL_set_gdt() were lar/lsl/verr/verw suffer non-architectural
behaviour.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 08f27f4468eedbeccaac9fdda4ef732247efd74e
master date: 2017-12-01 19:03:26 +0000

xen/arch/x86/domain_build.c

index 1661ad495acbc4c8c515a1bc88d8991bcffbf39c..d449535891829665fdc29e780270a69dcdb7719c 100644 (file)
@@ -1512,6 +1512,13 @@ int __init construct_dom0(
     regs->esi = vstartinfo_start;
     regs->eflags = X86_EFLAGS_IF;
 
+    /*
+     * We don't call arch_set_info_guest(), so some initialisation needs doing
+     * by hand:
+     *  - Reset the GDT to reference zero_page
+     */
+    destroy_gdt(v);
+
 #ifdef CONFIG_SHADOW_PAGING
     if ( opt_dom0_shadow )
     {