]> git.proxmox.com Git - mirror_qemu.git/commitdiff
sysemu/kvm: Restrict hvf_get_supported_cpuid() to x86 targets
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 4 Oct 2023 09:25:09 +0000 (11:25 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 7 Oct 2023 17:02:32 +0000 (19:02 +0200)
hvf_get_supported_cpuid() is only defined for x86 targets
(in target/i386/hvf/x86_cpuid.c).
Its declaration is pointless on all other targets.

All the calls to it in target/i386/cpu.c are guarded by
a call on hvf_enabled(), so are elided when HVF is not
built in. Therefore we can remove the unnecessary function
stub.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231004092510.39498-3-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/sysemu/hvf.h
target/i386/cpu.c
target/i386/hvf/hvf-cpu.c
target/i386/hvf/hvf-i386.h
target/i386/hvf/x86_cpuid.c

index 4037cd6a738b025a2af012afbc6c11f0e28a3ab9..4a7c6af3a5f3b9f7e1548e045946827d7a1c02eb 100644 (file)
 #include "cpu.h"
 
 #ifdef CONFIG_HVF
-uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
-                                 int reg);
 extern bool hvf_allowed;
 #define hvf_enabled() (hvf_allowed)
 #else /* !CONFIG_HVF */
 #define hvf_enabled() 0
-#define hvf_get_supported_cpuid(func, idx, reg) 0
 #endif /* !CONFIG_HVF */
 
 #endif /* NEED_CPU_H */
index 9fad31b8db14164821ea32d3244ec58c0649bd04..ac0ae502f5d8292497122488cdac25bcc014d5af 100644 (file)
@@ -26,6 +26,7 @@
 #include "tcg/helper-tcg.h"
 #include "sysemu/reset.h"
 #include "sysemu/hvf.h"
+#include "hvf/hvf-i386.h"
 #include "kvm/kvm_i386.h"
 #include "sev.h"
 #include "qapi/error.h"
index bb0da3947a46a74786e37100a0e4a9493d37412f..ac617f17e7387067c6aa839fc8a2f73fea573b73 100644 (file)
@@ -15,6 +15,7 @@
 #include "hw/boards.h"
 #include "sysemu/hvf.h"
 #include "hw/core/accel-cpu.h"
+#include "hvf-i386.h"
 
 static void hvf_cpu_max_instance_init(X86CPU *cpu)
 {
index 243bc111ccc979f3ce3ed0ae394777109e735119..e99c02cd4bfe101a95ebc11e8f0bf5d337ef2899 100644 (file)
@@ -16,6 +16,8 @@
 #ifndef HVF_I386_H
 #define HVF_I386_H
 
+uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, int reg);
+
 void hvf_handle_io(CPUArchState *, uint16_t, void *, int, int, int);
 
 /* Host specific functions */
index 7323a7a94b1e69e1aa935907bac4454ce362a80e..9380b90496eb352163b5b3bec4770dfb9bf12836 100644 (file)
@@ -25,6 +25,7 @@
 #include "x86.h"
 #include "vmx.h"
 #include "sysemu/hvf.h"
+#include "hvf-i386.h"
 
 static bool xgetbv(uint32_t cpuid_ecx, uint32_t idx, uint64_t *xcr)
 {