From 9c88e61dc0891a7f4781aff2a06a1de8ae86ea93 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 21 Jul 2014 18:26:51 +0000 Subject: [PATCH] MFC 264347: Account for the "plus 1" encoding of the CPUID Function 4 reported core per package and cache sharing values. git-svn-id: svn://svn.freebsd.org/base/stable/10@268952 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/amd64/vmm/x86.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index e81b43e85..ef1557f85 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -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: -- 2.45.0