From: Andrew Cooper Date: Mon, 21 Dec 2015 19:01:58 +0000 (+0000) Subject: Alter pv64 kernel selectors to be rpl0 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=39ebd7ef4d924d5cd3ab5465b1f44cd97a7de92b;p=people%2Froyger%2Fxen-test-framework.git Alter pv64 kernel selectors to be rpl0 Signed-off-by: Andrew Cooper --- diff --git a/include/arch/x86/segment.h b/include/arch/x86/segment.h index 5a96f60..b34bce4 100644 --- a/include/arch/x86/segment.h +++ b/include/arch/x86/segment.h @@ -38,8 +38,14 @@ */ #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)