[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/9] target/i386: Remove core_id assert check in CPUID 0x8000001E
From: |
Eduardo Habkost |
Subject: |
[PULL 3/9] target/i386: Remove core_id assert check in CPUID 0x8000001E |
Date: |
Thu, 15 Oct 2020 12:44:55 -0400 |
From: Babu Moger <babu.moger@amd.com>
With x2apic enabled, configurations can have more that 255 cores.
Noticed the device add test is hitting an assert when during cpu
hotplug with core_id > 255. This is due to assert check in the
CPUID 0x8000001E.
Remove the assert check and fix the problem.
Fixes the bug:
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1834200
Signed-off-by: Babu Moger <babu.moger@amd.com>
Message-Id: <160072824160.9666.8890355282135970684.stgit@naples-babu.amd.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a33af2359c..25ec64124e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5910,9 +5910,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
}
break;
case 0x8000001E:
- assert(cpu->core_id <= 255);
- encode_topo_cpuid8000001e(cpu, &topo_info,
- eax, ebx, ecx, edx);
+ if (cpu->core_id <= 255) {
+ encode_topo_cpuid8000001e(cpu, &topo_info, eax, ebx, ecx, edx);
+ } else {
+ *eax = 0;
+ *ebx = 0;
+ *ecx = 0;
+ *edx = 0;
+ }
break;
case 0xC0000000:
*eax = env->cpuid_xlevel2;
--
2.28.0
- [PULL 0/9] x86 queue, 2020-10-15, Eduardo Habkost, 2020/10/15
- [PULL 1/9] i386: drop x86_cpu_get_supported_feature_word() forward declaration, Eduardo Habkost, 2020/10/15
- [PULL 8/9] cpu: Introduce CPU model deprecation API, Eduardo Habkost, 2020/10/15
- [PULL 3/9] target/i386: Remove core_id assert check in CPUID 0x8000001E,
Eduardo Habkost <=
- [PULL 2/9] i386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case, Eduardo Habkost, 2020/10/15
- [PULL 4/9] i386/kvm: Require KVM_CAP_IRQ_ROUTING, Eduardo Habkost, 2020/10/15
- [PULL 5/9] i386/kvm: Remove IRQ routing support checks, Eduardo Habkost, 2020/10/15
- [PULL 6/9] i386/kvm: Delete kvm_allows_irq0_override(), Eduardo Habkost, 2020/10/15
- [PULL 7/9] kvm: Correct documentation of kvm_irqchip_*(), Eduardo Habkost, 2020/10/15
- [PULL 9/9] i386: Mark Icelake-Client CPU models deprecated, Eduardo Habkost, 2020/10/15
- Re: [PULL 0/9] x86 queue, 2020-10-15, Peter Maydell, 2020/10/17