On 01/06/16 05:58, Luwei Kang wrote: > CPUID.0XD.0X0.EAX is from machine value for dom0, and dom0 kernel will xsetbv > with xfeatures_mask that is from CPUID.0XD.0X0.EAX, but handle_xsetbv has > ingored XSTATE_PKRU with hardware protection fault emulation, so dom0 kernel > will crash on skylake machine with PKRU support. > > Signed-off-by: Luwei Kang > --- > xen/arch/x86/traps.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c > index 1ef8401..5e72e44 100644 > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -1100,6 +1100,9 @@ void pv_cpuid(struct cpu_user_regs *regs) > */ > if ( !is_control_domain(currd) && !is_hardware_domain(currd) ) > cpuid_count(leaf, subleaf, &tmp, &b, &tmp, &tmp); > + > + /* PV is not supported by XSTATE_PKRU. */ > + a &= ~XSTATE_PKRU; > break; > } > While this does work, it undoes some of the work I started with my cpuid improvements in 4.7 Does the attached patch also resolve your issue? ~Andrew