On 12/02/2016 06:44 AM, Andrew Cooper wrote: > On 02/12/16 00:35, Andy Lutomirski wrote: >> On Xen PV, CPUID is likely to trap, and Xen hypercalls aren't >> guaranteed to serialize. (Even CPUID isn't *really* guaranteed to >> serialize on Xen PV, but, in practice, any trap it generates will >> serialize.) > Well, Xen will enabled CPUID Faulting wherever it can, which is > realistically all IvyBridge hardware and newer. > > All hypercalls are a privilege change to cpl0. I'd hope this condition > is serialising, but I can't actually find any documentation proving or > disproving this. > >> On my laptop, CPUID(eax=1, ecx=0) is ~83ns and IRET-to-self is >> ~110ns. But Xen PV will trap CPUID if possible, so IRET-to-self >> should end up being a nice speedup. >> >> Cc: Andrew Cooper <andrew.coop...@citrix.com> >> Signed-off-by: Andy Lutomirski <l...@kernel.org>
Executing CPUID in an HVM guest is quite expensive since it will cause a VMEXIT. (And that should be true for any hypervisor, at least on Intel. On AMD it's configurable) -boris _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel