Dan Magenheimer
2009-Nov-18 22:01 UTC
[Xen-devel] which cpuid bits are exposed to pv guest OS and why?
Is there any documentation of the logic behind what cpuid bits are exposed to a PV guest OS? It was reported to me that /proc/cpuinfo in a 32-bit PV guest running on a 64-bit Xen on a 64-bit hardware platform does NOT report "lm" (64-bit hardware). Although this might seem to make sense, since the cpuid instruction is unprivileged, userland apps testing the same cpuid bit will observe that the hardware is indeed 64-bit, even though the OS (which uses "pvcpuid") does not. This difference confused a user. So I compared /proc/cpuinfo in a 32-bit guest running on a 64-bit, ahem, distinguished competitor''s hypervisor, on a 64-bit hardware platform vs the same on Xen on identical hardware. The differences were: The "other" hypervisor reported these features that Xen did not: vme, pse, mtrr, pge, mca, pse36, lm. Xen reported these features that the "other" hypervisor did not: ht (only). I''m far from an x86 expert, so would need to look up most of these and all the differences may be perfectly defensible, but I thought I would ask the question so that the real x86 experts could comment, and possibly fix anything necessary prior to Xen 4.0. Unfortunately, I didn''t test an hvm domain on the Xen system and no longer have access to the "other" hypervisor to run further tests. Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Nov-18 22:32 UTC
Re: [Xen-devel] which cpuid bits are exposed to pv guest OS and why?
On 18/11/2009 22:01, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:> The "other" hypervisor reported these features that > Xen did not: vme, pse, mtrr, pge, mca, pse36, lm. > > Xen reported these features that the "other" hypervisor > did not: ht (only).None of these are really useful directly to userspace, so it probably doesn''t matter much what gets advertised there. To the guest kernel, most of the above stuff is paravirtualised or unavailable to it: - VME: vm86 cpu feature - entirely unavailable on 64-bit Xen - PSE: superpage support - unavailable to pv guests by default - MTRR: MTRRs - paravirtualised, so native MSR interface unavailable - PGE: global-page pte flag - unavailable to pv guests - MCA: machine-check architecture - paravirtualised, native interface unavailable - PSE36: Like PSE - LM: 64-bit support - unavailable to 32-bit guests - HT: Hyperthreading/multicore - vCPU probe and bringup is paravirtualised (so a bit weird we expose this one, but doesn''t matter really either way) -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel