[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 58/63] target/i386/host-cpu: Consolidate the use of warn_report_on
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 58/63] target/i386/host-cpu: Consolidate the use of warn_report_once() |
|
Date: |
Tue, 23 Apr 2024 17:09:46 +0200 |
From: Zhao Liu <zhao1.liu@intel.com>
Use warn_report_once() to get rid of the static local variable "warned".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240327103951.3853425-2-zhao1.liu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/host-cpu.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/target/i386/host-cpu.c b/target/i386/host-cpu.c
index 92ecb7254b8..280e427c017 100644
--- a/target/i386/host-cpu.c
+++ b/target/i386/host-cpu.c
@@ -55,18 +55,15 @@ static uint32_t host_cpu_adjust_phys_bits(X86CPU *cpu)
{
uint32_t host_phys_bits = host_cpu_phys_bits();
uint32_t phys_bits = cpu->phys_bits;
- static bool warned;
/*
* Print a warning if the user set it to a value that's not the
* host value.
*/
- if (phys_bits != host_phys_bits && phys_bits != 0 &&
- !warned) {
- warn_report("Host physical bits (%u)"
- " does not match phys-bits property (%u)",
- host_phys_bits, phys_bits);
- warned = true;
+ if (phys_bits != host_phys_bits && phys_bits != 0) {
+ warn_report_once("Host physical bits (%u)"
+ " does not match phys-bits property (%u)",
+ host_phys_bits, phys_bits);
}
if (cpu->host_phys_bits) {
--
2.44.0
- [PULL 32/63] confidential guest support: Add kvm_init() and kvm_reset() in class, (continued)
- [PULL 32/63] confidential guest support: Add kvm_init() and kvm_reset() in class, Paolo Bonzini, 2024/04/23
- [PULL 19/63] vga: optimize computation of dirty memory region, Paolo Bonzini, 2024/04/23
- [PULL 17/63] stubs: include stubs only if needed, Paolo Bonzini, 2024/04/23
- [PULL 21/63] kvm: use configs/ definition to conditionalize debug support, Paolo Bonzini, 2024/04/23
- [PULL 34/63] ppc/pef: switch to use confidential_guest_kvm_init/reset(), Paolo Bonzini, 2024/04/23
- [PULL 10/63] hw/usb: move stubs out of stubs/, Paolo Bonzini, 2024/04/23
- [PULL 11/63] hw/virtio: move stubs out of stubs/, Paolo Bonzini, 2024/04/23
- [PULL 29/63] pci-host/q35: Move PAM initialization above SMRAM initialization, Paolo Bonzini, 2024/04/23
- [PULL 36/63] scripts/update-linux-headers: Add setup_data.h to import list, Paolo Bonzini, 2024/04/23
- [PULL 56/63] kvm/tdx: Don't complain when converting vMMIO region to shared, Paolo Bonzini, 2024/04/23
- [PULL 58/63] target/i386/host-cpu: Consolidate the use of warn_report_once(),
Paolo Bonzini <=
- [PULL 41/63] KVM: remove kvm_arch_cpu_check_are_resettable, Paolo Bonzini, 2024/04/23
- [PULL 37/63] scripts/update-linux-headers: Add bits.h to file imports, Paolo Bonzini, 2024/04/23
- [PULL 44/63] target/i386: SEV: use KVM_SEV_INIT2 if possible, Paolo Bonzini, 2024/04/23
- [PULL 45/63] i386/sev: Add 'legacy-vm-type' parameter for SEV guest objects, Paolo Bonzini, 2024/04/23
- [PULL 46/63] hw/i386/sev: Use legacy SEV VM types for older machine types, Paolo Bonzini, 2024/04/23
- [PULL 50/63] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot, Paolo Bonzini, 2024/04/23
- [PULL 49/63] RAMBlock: Add support of KVM private guest memfd, Paolo Bonzini, 2024/04/23
- [PULL 51/63] kvm/memory: Make memory type private by default if it has guest memfd backend, Paolo Bonzini, 2024/04/23
- [PULL 62/63] pythondeps.toml: warn about updates needed to docs/requirements.txt, Paolo Bonzini, 2024/04/23
- [PULL 52/63] HostMem: Add mechanism to opt in kvm guest memfd via MachineState, Paolo Bonzini, 2024/04/23