[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/26] sysemu/kvm: Restrict hvf_get_supported_cpuid() to x86 targe
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 02/26] sysemu/kvm: Restrict hvf_get_supported_cpuid() to x86 targets |
|
Date: |
Fri, 6 Oct 2023 13:13:48 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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 | 3 ---
target/i386/cpu.c | 1 +
target/i386/hvf/hvf-cpu.c | 1 +
target/i386/hvf/hvf-i386.h | 2 ++
target/i386/hvf/x86_cpuid.c | 1 +
5 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h
index 4037cd6a738..4a7c6af3a5f 100644
--- a/include/sysemu/hvf.h
+++ b/include/sysemu/hvf.h
@@ -20,13 +20,10 @@
#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 */
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index ed72883bf33..5b620500abf 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -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"
diff --git a/target/i386/hvf/hvf-cpu.c b/target/i386/hvf/hvf-cpu.c
index 333db59898a..21c519be741 100644
--- a/target/i386/hvf/hvf-cpu.c
+++ b/target/i386/hvf/hvf-cpu.c
@@ -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)
{
diff --git a/target/i386/hvf/hvf-i386.h b/target/i386/hvf/hvf-i386.h
index 243bc111ccc..e99c02cd4bf 100644
--- a/target/i386/hvf/hvf-i386.h
+++ b/target/i386/hvf/hvf-i386.h
@@ -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 */
diff --git a/target/i386/hvf/x86_cpuid.c b/target/i386/hvf/x86_cpuid.c
index 7323a7a94b1..9380b90496e 100644
--- a/target/i386/hvf/x86_cpuid.c
+++ b/target/i386/hvf/x86_cpuid.c
@@ -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)
{
--
2.41.0
- [PULL 00/26] Audio, source reorg, HVF changes for 2023-10-06, Paolo Bonzini, 2023/10/06
- [PULL 01/26] target/i386/hvf: Remove unused includes in 'hvf-i386.h', Paolo Bonzini, 2023/10/06
- [PULL 04/26] target/i386: Check for USER_ONLY definition instead of SOFTMMU one, Paolo Bonzini, 2023/10/06
- [PULL 05/26] softmmu/trace-events: Fix a typo, Paolo Bonzini, 2023/10/06
- [PULL 08/26] fuzz: Correct invalid mentions of 'softmmu' by 'system', Paolo Bonzini, 2023/10/06
- [PULL 03/26] util/log: re-allow switching away from stderr log file, Paolo Bonzini, 2023/10/06
- [PULL 02/26] sysemu/kvm: Restrict hvf_get_supported_cpuid() to x86 targets,
Paolo Bonzini <=
- [PULL 09/26] tcg: Correct invalid mentions of 'softmmu' by 'system-mode', Paolo Bonzini, 2023/10/06
- [PULL 10/26] accel: Rename accel_softmmu* -> accel_system*, Paolo Bonzini, 2023/10/06
- [PULL 12/26] semihosting: Rename softmmu_FOO_user() -> uaccess_FOO_user(), Paolo Bonzini, 2023/10/06
- [PULL 07/26] cpu: Correct invalid mentions of 'softmmu' by 'system-mode', Paolo Bonzini, 2023/10/06
- [PULL 16/26] meson: Rename target_softmmu_arch -> target_system_arch, Paolo Bonzini, 2023/10/06
- [PULL 11/26] gdbstub: Rename 'softmmu' -> 'system', Paolo Bonzini, 2023/10/06
- [PULL 06/26] travis-ci: Correct invalid mentions of 'softmmu' by 'system', Paolo Bonzini, 2023/10/06
- [PULL 17/26] system: Rename softmmu/ directory as system/, Paolo Bonzini, 2023/10/06
- [PULL 19/26] cutils: squelch compiler warnings with custom paths, Paolo Bonzini, 2023/10/06
- [PULL 20/26] audio: error hints need a trailing \n, Paolo Bonzini, 2023/10/06