[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable()
From: |
Paolo Bonzini |
Subject: |
[PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable() |
Date: |
Thu, 7 Sep 2023 14:59:53 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Call kvm_enabled() before kvm_hv_vpindex_settable()
to let the compiler elide its call.
kvm-stub.c is now empty, remove it.
Suggested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904124325.79040-9-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/x86.c | 2 +-
target/i386/kvm/kvm-stub.c | 18 ------------------
target/i386/kvm/meson.build | 2 --
3 files changed, 1 insertion(+), 21 deletions(-)
delete mode 100644 target/i386/kvm/kvm-stub.c
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 3e86cf3060f..f034df8bf62 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -421,7 +421,7 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
cpu->thread_id = topo_ids.smt_id;
if (hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX) &&
- !kvm_hv_vpindex_settable()) {
+ kvm_enabled() && !kvm_hv_vpindex_settable()) {
error_setg(errp, "kernel doesn't allow setting HyperV VP_INDEX");
return;
}
diff --git a/target/i386/kvm/kvm-stub.c b/target/i386/kvm/kvm-stub.c
deleted file mode 100644
index 62cccebee4f..00000000000
--- a/target/i386/kvm/kvm-stub.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * QEMU KVM x86 specific function stubs
- *
- * Copyright Linaro Limited 2012
- *
- * Author: Peter Maydell <peter.maydell@linaro.org>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-#include "qemu/osdep.h"
-#include "kvm_i386.h"
-
-bool kvm_hv_vpindex_settable(void)
-{
- return false;
-}
diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.build
index 40fbde96cac..5d9174bbb5d 100644
--- a/target/i386/kvm/meson.build
+++ b/target/i386/kvm/meson.build
@@ -1,5 +1,3 @@
-i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
-
i386_softmmu_kvm_ss = ss.source_set()
i386_softmmu_kvm_ss.add(files(
--
2.41.0
- [PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header, (continued)
- [PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header, Paolo Bonzini, 2023/09/07
- [PULL 28/51] configure: unify recursion into sub-Makefiles, Paolo Bonzini, 2023/09/07
- [PULL 36/51] Revert "mkvenv: work around broken pip installations on Debian 10", Paolo Bonzini, 2023/09/07
- [PULL 37/51] hw/i386/pc: Include missing 'sysemu/tcg.h' header, Paolo Bonzini, 2023/09/07
- [PULL 41/51] target/i386/cpu-sysemu: Inline kvm_apic_in_kernel(), Paolo Bonzini, 2023/09/07
- [PULL 40/51] target/i386/helper: Restrict KVM declarations to system emulation, Paolo Bonzini, 2023/09/07
- [PULL 46/51] sysemu/kvm: Restrict kvm_arch_get_supported_cpuid/msr() to x86 targets, Paolo Bonzini, 2023/09/07
- [PULL 48/51] sysemu/kvm: Restrict kvm_has_pit_state2() to x86 targets, Paolo Bonzini, 2023/09/07
- [PULL 47/51] sysemu/kvm: Restrict kvm_get_apic_state() to x86 targets, Paolo Bonzini, 2023/09/07
- [PULL 42/51] target/i386: Remove unused KVM stubs, Paolo Bonzini, 2023/09/07
- [PULL 44/51] target/i386: Allow elision of kvm_hv_vpindex_settable(),
Paolo Bonzini <=
- [PULL 51/51] docs/system/replay: do not show removed command line option, Paolo Bonzini, 2023/09/07
- [PULL 49/51] sysemu/kvm: Restrict kvm_pc_setup_irq_routing() to x86 targets, Paolo Bonzini, 2023/09/07
- [PULL 50/51] subprojects: add wrap file for libblkio, Paolo Bonzini, 2023/09/07
- [PULL 45/51] target/i386: Restrict declarations specific to CONFIG_KVM, Paolo Bonzini, 2023/09/07
- [PULL 43/51] target/i386: Allow elision of kvm_enable_x2apic(), Paolo Bonzini, 2023/09/07
- Re: [PULL 00/51] Build system, i386 changes for 2023-09-07, Stefan Hajnoczi, 2023/09/07