]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
target/i386: Allow elision of kvm_hv_vpindex_settable()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 4 Sep 2023 12:43:19 +0000 (14:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Sep 2023 11:32:37 +0000 (13:32 +0200)
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
target/i386/kvm/kvm-stub.c [deleted file]
target/i386/kvm/meson.build

index 3e86cf3060f9f9a0acff64e363eb4d99344ed68d..f034df8bf628a7e1a02c2a5f137e8667a4c7a6c9 100644 (file)
@@ -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 (file)
index 62ccceb..0000000
+++ /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;
-}
index 40fbde96cac6dd6f994dfad3e1e31f385372c8d7..5d9174bbb5d8153b39a5c48a362f18fd7a8df21f 100644 (file)
@@ -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(