]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
x86 hvm: During task switch, LDT must be loaded before all other
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 27 Apr 2009 14:40:09 +0000 (15:40 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 27 Apr 2009 14:40:09 +0000 (15:40 +0100)
segments, as some may be loaded from the LDT.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/hvm.c

index 82b99ab761f43f41270e7eca6df05860c15316c3..a2c23e09f12b8eaabbbc378942fc9b7c2536cd1c 100644 (file)
@@ -1440,13 +1440,13 @@ void hvm_task_switch(
     }
 
     exn_raised = 0;
-    if ( hvm_load_segment_selector(v, x86_seg_es, tss.es) ||
+    if ( hvm_load_segment_selector(v, x86_seg_ldtr, tss.ldt) ||
+         hvm_load_segment_selector(v, x86_seg_es, tss.es) ||
          hvm_load_segment_selector(v, x86_seg_cs, tss.cs) ||
          hvm_load_segment_selector(v, x86_seg_ss, tss.ss) ||
          hvm_load_segment_selector(v, x86_seg_ds, tss.ds) ||
          hvm_load_segment_selector(v, x86_seg_fs, tss.fs) ||
-         hvm_load_segment_selector(v, x86_seg_gs, tss.gs) ||
-         hvm_load_segment_selector(v, x86_seg_ldtr, tss.ldt) )
+         hvm_load_segment_selector(v, x86_seg_gs, tss.gs) )
         exn_raised = 1;
 
     rc = hvm_copy_to_guest_virt(