Re: [PATCHv2] x86info: dump kvm cpuid's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-05-01 at 16:04 +0300, Gleb Natapov wrote:
> > BTW, according to arch/x86/include/asm/kvm_para.h unsurprisingly KVM has
> > a signature too 'KVMKVMKVM'.
> > 
> > >  	cpu->stepping = eax & 0xf;
> > >  	cpu->model = (eax >> 4) & 0xf;
> > >  	cpu->family = (eax >> 8) & 0xf;
> > > @@ -29,6 +29,19 @@ void get_cpu_info_basics(struct cpudata *cpu)
> > >  
> > >  	cpuid(cpu->number, 0xC0000000, &maxei, NULL, NULL, NULL);
> > >  	cpu->maxei2 = maxei;
> > > +	if (ecx & 0x80000000) {
> > > +		cpuid(cpu->number, 0x40000000, &maxhv, NULL, NULL, NULL);
> > > +		/*
> > > +		 * KVM up to linux 3.4 reports 0 as the max hypervisor leaf,
> > > +		 * where it really means 0x40000001.
> > 
> > This is something where I definitely think you want to check the
> > signature first.
> In theory yes, but in practice what will this break?

I've got no idea -- but what's the harm in checking?

Ian.

-- 
Ian Campbell
Current Noise: Hypocrisy - Roswell 47

Angels we have heard on High
Tell us to go out and Buy.
		-- Tom Lehrer

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux