> From: Kyle Huey [mailto:m...@kylehuey.com] > Sent: Tuesday, October 18, 2016 2:51 AM > > On HVM guests, the cpuid triggers a vm exit, so we can check the emulated > faulting state in vmx_do_cpuid and hvmemul_cpuid. A new function, > hvm_check_cpuid_fault will check if cpuid faulting is enabled and the CPL > 0. > When it returns true, the cpuid handling functions will inject a GP(0). > Notably > no hardware support for faulting on cpuid is necessary to emulate support with > an HVM guest. > > On PV guests, hardware support is required so that userspace cpuid will trap > to Xen. Xen already enables cpuid faulting on supported CPUs for pv guests > (that > aren't the control domain, see the comment in intel_ctxt_switch_levelling). > Every PV guest cpuid will trap via a GP(0) to emulate_privileged_op (via > do_general_protection). Once there we simply decline to emulate cpuid if the > CPL > 0 and faulting is enabled, leaving the GP(0) for the guest kernel to > handle. > > Signed-off-by: Kyle Huey <kh...@kylehuey.com>
Reviewed-by: Kevin Tian <kevin.t...@intel.com>, assuming you'll fix cosmetic comments in next version. Thanks Kevin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel