[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/29] x86: cpu: make sure number of addressable IDs for processor
From: |
Paolo Bonzini |
Subject: |
[PULL 16/29] x86: cpu: make sure number of addressable IDs for processor cores meets the spec |
Date: |
Mon, 6 Jun 2022 16:36:31 +0200 |
From: Igor Mammedov <imammedo@redhat.com>
Accourding Intel's CPUID[EAX=04H] resulting bits 31 - 26 in EAX
should be:
"
**** The nearest power-of-2 integer that is not smaller than (1 + EAX[31:26])
is the number of unique
Core_IDs reserved for addressing different processor cores in a physical
package. Core ID is a subset of
bits of the initial APIC ID.
"
ensure that values stored in EAX[31-26] always meets this condition.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20220524151020.2541698-2-imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 9fdfec9d8b..94cc4a8700 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5287,7 +5287,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
/* QEMU gives out its own APIC IDs, never pass down bits 31..26.
*/
*eax &= ~0xFC000000;
if ((*eax & 31) && cs->nr_cores > 1) {
- *eax |= (cs->nr_cores - 1) << 26;
+ *eax |= (pow2ceil(cs->nr_cores) - 1) << 26;
}
} else if (cpu->vendor_cpuid_only && IS_AMD_CPU(env)) {
*eax = *ebx = *ecx = *edx = 0;
--
2.36.1
- [PULL 08/29] replay: rewrite async event handling, (continued)
- [PULL 08/29] replay: rewrite async event handling, Paolo Bonzini, 2022/06/06
- [PULL 15/29] tests/Makefile.include: Fix 'make check-help' output, Paolo Bonzini, 2022/06/06
- [PULL 20/29] tests: use python3 as the python executable name, Paolo Bonzini, 2022/06/06
- [PULL 19/29] tests: add "TESTS_PYTHON" variable to Makefile, Paolo Bonzini, 2022/06/06
- [PULL 11/29] docs: move replay docs to docs/system/replay.rst, Paolo Bonzini, 2022/06/06
- [PULL 22/29] tests: add quiet-venv-pip macro, Paolo Bonzini, 2022/06/06
- [PULL 23/29] tests: install "qemu" namespace package into venv, Paolo Bonzini, 2022/06/06
- [PULL 24/29] tests: use tests/venv to run basevm.py-based scripts, Paolo Bonzini, 2022/06/06
- [PULL 26/29] tests: run 'device-crash-test' from tests/venv, Paolo Bonzini, 2022/06/06
- [PULL 21/29] tests: silence pip upgrade warnings during venv creation, Paolo Bonzini, 2022/06/06
- [PULL 16/29] x86: cpu: make sure number of addressable IDs for processor cores meets the spec,
Paolo Bonzini <=
- [PULL 25/29] tests: add python3-venv to debian10.docker, Paolo Bonzini, 2022/06/06
- [PULL 28/29] configure: remove reference to removed option, Paolo Bonzini, 2022/06/06
- [PULL 27/29] regenerate meson-buildoptions.sh, Paolo Bonzini, 2022/06/06
- [PULL 29/29] meson: qga: do not use deprecated meson.build_root(), Paolo Bonzini, 2022/06/06
- [PULL 12/29] tests/avocado: update replay_linux test, Paolo Bonzini, 2022/06/06
- Re: [PULL 00/29] Misc patches for 2022-06-06, Richard Henderson, 2022/06/06