Hi Keir, Ian, Attached is a patch to provide right view of cpuid to the HVM guests. Some of the CPU features such as APIC, PAE, MTRR, HT are virtualized; while others are not virtualized yet such as TM1, TM2, MCA and there are some features which do not need virtualization such as MMX. With the patch Guest sees only those processor features in the cpuid which are virtualized in the hyper visor, or do not need any virtualization in hyper visor. diffstat cpuid_13.patch arch/x86/hvm/hvm.c | 2 arch/x86/hvm/vmx/vmx.c | 96 +++++++++++++++++++++++++----------------- include/asm-x86/cpufeature.h | 3 - include/asm-x86/hvm/domain.h | 1 include/asm-x86/hvm/vmx/cpu.h | 17 +++++++ 5 files changed, 81 insertions(+), 38 deletions(-) Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-Off-By: Jun Nakajima <jun.nakajima@intel.com> Signed-Off-By: Asit Mallick <asit.k.mallick@intel.com> Thanks & Regards, Nitin ------------------------------------------------------------------------ ----------- Open Source Technology Center, Intel Corp _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> Attached is a patch to provide right view of cpuid to the HVMguests.> Some of the CPU features such as APIC, PAE, MTRR, HT are virtualized;while> others are not virtualized yet such as TM1, TM2, MCA and there aresome> features which do not need virtualization such as MMX. With the patchGuest> sees only those processor features in the cpuid which are virtualizedin> the hyper visor, or do not need any virtualization in hyper visor.It might still be useful to selectively hide features such as MMX from guests. Having something in the guest config to mask a set of feature flags from a guest would be useful IMO. Could you extend the patch to add this? Thanks, Ian> > > diffstat cpuid_13.patch > > arch/x86/hvm/hvm.c | 2 > > arch/x86/hvm/vmx/vmx.c | 96+++++++++++++++++++++++++------------> ----- > > include/asm-x86/cpufeature.h | 3 - > > include/asm-x86/hvm/domain.h | 1 > > include/asm-x86/hvm/vmx/cpu.h | 17 +++++++ > > 5 files changed, 81 insertions(+), 38 deletions(-) > > > > Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> > > Signed-Off-By: Jun Nakajima <jun.nakajima@intel.com> > > Signed-Off-By: Asit Mallick <asit.k.mallick@intel.com> > > > > Thanks & Regards, > > Nitin > >------------------------------------------------------------------------ ---> -------- > > Open Source Technology Center, Intel Corp > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 9 Jun 2006, at 21:12, Kamble, Nitin A wrote:> Hi Keir, Ian, > Attached is a patch to provide right view of cpuid to the HVM > guests. Some of the CPU features such as APIC, PAE, MTRR, HT are > virtualized; while others are not virtualized yet such as TM1, TM2, > MCA and there are some features which do not need virtualization such > as MMX. With the patch Guest sees only those processor features in the > cpuid which are virtualized in the hyper visor, or do not need any > virtualization in hyper visor.Accepted because it''s fine as far as it goes, but this emulation of CPUID is unsafe because you do not restrict the ''max leaf'' values (as returned in %eax by 0x0 and 0x80000000). So current HVM support cannot be guaranteed to work on future processors because they may have extra info leaves that you do not filter and emulate properly (because the code cannot know about them). At the very least you should be restricting max leaves to 0xA and 0x80000008 (highest documented leaves so far). You should also emulate native behaviour of returning info of max basic leaf for invalid CPUID indexes. But, while doing this you may as well make your lives easier and only advertise max leaves 0x3 and 0x80000004. This will avoid hassle of properly emulating other leaves, many of which contain performance info that may not be valid across save/restore and migration anyway. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi Ian, I plan to implement another patch to enable cpuid features filtering using config parameters from the xm config file. I will send another patch for that. Thanks & Regards, Nitin ------------------------------------------------------------------------ ----------- Open Source Technology Center, Intel Corp>-----Original Message----- >From: Ian Pratt [mailto:m+Ian.Pratt@cl.cam.ac.uk]>It might still be useful to selectively hide features such as MMX from >guests. Having something in the guest config to mask a set of feature >flags from a guest would be useful IMO. Could you extend the patch to >add this? > >Thanks, >Ian >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel