]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
Alter pv64 kernel selectors to be rpl0
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 21 Dec 2015 19:01:58 +0000 (19:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 22 Dec 2015 20:47:58 +0000 (20:47 +0000)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
include/arch/x86/segment.h

index 5a96f603e97973a3813be887e70103eac9efdf3a..b34bce408970d99ddfe64f26031b6623daebb878 100644 (file)
  */
 #if defined(CONFIG_ENV_pv64)
 
-#define __KERN_CS FLAT_RING3_CS64
-#define __KERN_DS FLAT_RING3_DS64
+/*
+ * 64bit PV guest kernels run in cpl3, but exception frames generated by Xen
+ * report cpl0 when interrupting kernel mode.  Trim the kernel selectors down
+ * to rpl0 so they match the exception frames; Xen will take care of bumping
+ * rpl back to 3 when required.
+ */
+#define __KERN_CS (FLAT_RING3_CS64 & ~3)
+#define __KERN_DS (FLAT_RING3_DS64 & ~3)
 
 #elif defined(CONFIG_ENV_pv32)