Account for the "plus 1" encoding of the CPUID Function 4 reported

core per package and cache sharing values.

Approved by:	grehan (co-mentor)
This commit is contained in:
Tycho Nightingale 2014-04-11 18:19:21 +00:00
parent ea8577c712
commit e0f210e6ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=264347

View file

@ -219,9 +219,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
/*
* Do not expose topology.
*
* The maximum number of processor cores in
* this physical processor package and the
* maximum number of threads sharing this
* cache are encoded with "plus 1" encoding.
* Adding one to the value in this register
* field to obtains the actual value.
*
* Therefore 0 for both indicates 1 core per
* package and no cache sharing.
*/
regs[0] &= 0xffff8000;
regs[0] |= 0x04008000;
break;
case CPUID_0000_0007: