I have finally gotten off the pot and finished writing up my new CPUID/MSR driver, which contains support for registers that need arbitrary GPRs touched. For i386 vs x86-64 compatibility, both use an x86-64 register image (16 64-bit register fields); this allows 32-bit userspace to access the full 64-bit image if the kernel is 64 bits. Anyway, this presumably requires new paravirtualization hooks. The patch is at: http://www.kernel.org/pub/linux/kernel/people/hpa/new-cpuid-msr.patch ... and a git tree is at ... http://git.kernel.org/?p=linux/kernel/git/hpa/linux-2.6-cpuidmsr.git;a=summary I'm posting this here to give the paravirt maintainers an opportunity to comment. Presumably the functions that need to be paravirtualized are the ones represented by the functions do_cpuid(), do_rdmsr() and do_wrmsr(): they take a cpu number, an input register image, and an output register image, and return either 0 or -EIO (in case of a trap.) -hpa
On Wed, Apr 04, 2007 at 05:50:58PM -0700, H. Peter Anvin wrote:> I have finally gotten off the pot and finished writing up my new > CPUID/MSR driver, which contains support for registers that need > arbitrary GPRs touched. For i386 vs x86-64 compatibility, both use an > x86-64 register image (16 64-bit register fields); this allows 32-bit > userspace to access the full 64-bit image if the kernel is 64 bits. > > Anyway, this presumably requires new paravirtualization hooks. The > patch is at: > > http://www.kernel.org/pub/linux/kernel/people/hpa/new-cpuid-msr.patchI think you mean? http://www.kernel.org/pub/linux/kernel/people/hpa/new-msr-cpuid.patch Yours Tony linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/ Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
* H. Peter Anvin (hpa@zytor.com) wrote:> I have finally gotten off the pot and finished writing up my new > CPUID/MSR driver, which contains support for registers that need > arbitrary GPRs touched. For i386 vs x86-64 compatibility, both use an > x86-64 register image (16 64-bit register fields); this allows 32-bit > userspace to access the full 64-bit image if the kernel is 64 bits. > > Anyway, this presumably requires new paravirtualization hooks. The > patch is at: > > http://www.kernel.org/pub/linux/kernel/people/hpa/new-cpuid-msr.patchNot mirrored out yet> > ... and a git tree is at ... > > http://git.kernel.org/?p=linux/kernel/git/hpa/linux-2.6-cpuidmsr.git;a=summaryBleah, and gitweb is unhappy ATM too.> I'm posting this here to give the paravirt maintainers an opportunity to > comment. Presumably the functions that need to be paravirtualized are > the ones represented by the functions do_cpuid(), do_rdmsr() and > do_wrmsr(): they take a cpu number, an input register image, and an > output register image, and return either 0 or -EIO (in case of a trap.)Yes, so currently cpuid, for example, is like this: do_cpuid cpuid __cpuid Where __cpuid is native_cpuid() on !CONFIG_PARAVIRT (include/asm-i386/processor.h) (and this is real asm("cpuid")) and paravirt_ops.cpuid() on CONFIG_PARAVIRT ( Without having seen the patch yet, you'll need to make sure that the final point which is issuing asm("cpuid") is wrapped and split to CONFIG_PARAVIRT and non CONFIG_PARAVIRT modes. Similar for rdmsr: do_rdmsr rdmsr_eio rdmsr_safe Where rdmsr is paravirtualized rdmsr is asm("rdmsr") on !CONFIG_PARAVIRT (include/asm-i386/msr.h) and paravirt_ops.read_msr() on CONFIG_PARAVIRT (include/asm-i386/paravirt.h) Similar for do_wrmsr. Does that answer your question? thanks, -chris
H. Peter Anvin wrote:> I have finally gotten off the pot and finished writing up my new > CPUID/MSR driver, which contains support for registers that need > arbitrary GPRs touched. For i386 vs x86-64 compatibility, both use an > x86-64 register image (16 64-bit register fields); this allows 32-bit > userspace to access the full 64-bit image if the kernel is 64 bits. > > Anyway, this presumably requires new paravirtualization hooks. The > patch is at: > > http://www.kernel.org/pub/linux/kernel/people/hpa/new-cpuid-msr.patch >The requested URL /pub/linux/kernel/people/hpa/new-cpuid-msr.patch was not found on this server.> ... and a git tree is at ... > > http://git.kernel.org/?p=linux/kernel/git/hpa/linux-2.6-cpuidmsr.git;a=summary > > I'm posting this here to give the paravirt maintainers an opportunity to > comment. Presumably the functions that need to be paravirtualized are > the ones represented by the functions do_cpuid(), do_rdmsr() and >rdmsr / wrmsr can be dropped from paravirt-ops; at least for us (they will trap and emulate just fine, and this driver is not performance critical), and I think for the others as well. CPUID, however, does require a hook. Zach
Reasonably Related Threads
- New CPUID/MSR driver; virtualization hooks
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?