[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 59/63] target/i386/cpu: Consolidate the use of warn_report_once()
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 59/63] target/i386/cpu: Consolidate the use of warn_report_once() |
|
Date: |
Tue, 23 Apr 2024 17:09:47 +0200 |
From: Zhao Liu <zhao1.liu@intel.com>
The difference between error_printf() and error_report() is the latter
may contain more information, such as the name of the program
("qemu-system-x86_64").
Thus its variant error_report_once() and warn_report()'s variant
warn_report_once() can be used here to print the information only once
without a static local variable "ht_warned".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240327103951.3853425-3-zhao1.liu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index eda15b0d4c7..28452983786 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -7367,7 +7367,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
**errp)
X86CPUClass *xcc = X86_CPU_GET_CLASS(dev);
CPUX86State *env = &cpu->env;
Error *local_err = NULL;
- static bool ht_warned;
unsigned requested_lbr_fmt;
#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
@@ -7610,13 +7609,11 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
**errp)
*/
if (IS_AMD_CPU(env) &&
!(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) &&
- cs->nr_threads > 1 && !ht_warned) {
- warn_report("This family of AMD CPU doesn't support "
- "hyperthreading(%d)",
- cs->nr_threads);
- error_printf("Please configure -smp options properly"
- " or try enabling topoext feature.\n");
- ht_warned = true;
+ cs->nr_threads > 1) {
+ warn_report_once("This family of AMD CPU doesn't support "
+ "hyperthreading(%d).", cs->nr_threads);
+ error_report_once("Please configure -smp options properly"
+ " or try enabling topoext feature.");
}
#ifndef CONFIG_USER_ONLY
--
2.44.0
- [PULL 31/63] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled, (continued)
- [PULL 31/63] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled, Paolo Bonzini, 2024/04/23
- [PULL 40/63] KVM: track whether guest state is encrypted, Paolo Bonzini, 2024/04/23
- [PULL 47/63] trace/kvm: Split address space and slot id in trace_kvm_set_user_memory(), Paolo Bonzini, 2024/04/23
- [PULL 18/63] stubs: move monitor_fdsets_cleanup with other fdset stubs, Paolo Bonzini, 2024/04/23
- [PULL 16/63] stubs: split record/replay stubs further, Paolo Bonzini, 2024/04/23
- [PULL 26/63] target/i386: Introduce Icelake-Server-v7 to enable TSX, Paolo Bonzini, 2024/04/23
- [PULL 28/63] target/i386: Export RFDS bit to guests, Paolo Bonzini, 2024/04/23
- [PULL 35/63] s390: Switch to use confidential_guest_kvm_init(), Paolo Bonzini, 2024/04/23
- [PULL 43/63] target/i386: Implement mc->kvm_type() to get VM type, Paolo Bonzini, 2024/04/23
- [PULL 61/63] accel/tcg/icount-common: Consolidate the use of warn_report_once(), Paolo Bonzini, 2024/04/23
- [PULL 59/63] target/i386/cpu: Consolidate the use of warn_report_once(),
Paolo Bonzini <=
- [PULL 06/63] util/qemu-config: Extract QMP commands to qemu-config-qmp.c, Paolo Bonzini, 2024/04/23
- [PULL 20/63] vga: move dirty memory region code together, Paolo Bonzini, 2024/04/23
- [PULL 23/63] target/i386: add guest-phys-bits cpu property, Paolo Bonzini, 2024/04/23
- [PULL 25/63] i386/kvm: Move architectural CPUID leaf generation to separate helper, Paolo Bonzini, 2024/04/23
- [PULL 30/63] q35: Introduce smm_ranges property for q35-pci-host, Paolo Bonzini, 2024/04/23
- [PULL 39/63] runstate: skip initial CPU reset if reset is not actually possible, Paolo Bonzini, 2024/04/23
- [PULL 48/63] kvm: Introduce support for memory_attributes, Paolo Bonzini, 2024/04/23
- [PULL 38/63] linux-headers: update to current kvm/next, Paolo Bonzini, 2024/04/23
- [PULL 53/63] RAMBlock: make guest_memfd require uncoordinated discard, Paolo Bonzini, 2024/04/23