[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231107202002.667900-10-aghulati@google.com>
Date: Tue, 7 Nov 2023 20:19:57 +0000
From: Anish Ghulati <aghulati@...gle.com>
To: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
hpa@...or.com, Vitaly Kuznetsov <vkuznets@...hat.com>,
peterz@...radead.org, paulmck@...nel.org,
Mark Rutland <mark.rutland@....com>
Cc: Venkatesh Srinivas <venkateshs@...omium.org>,
Anish Ghulati <aghulati@...gle.com>
Subject: [RFC PATCH 09/14] KVM: x86: Move shared KVM state into VAC
From: Venkatesh Srinivas <venkateshs@...omium.org>
Move kcpu_kick_mask and vm_running_vcpu* from arch neutral KVM code into
VAC.
TODO: Explain why this needs to be moved into VAC.
Signed-off-by: Venkatesh Srinivas <venkateshs@...omium.org>
Signed-off-by: Anish Ghulati <aghulati@...gle.com>
---
virt/kvm/kvm_main.c | 6 ++++--
virt/kvm/vac.c | 5 +++++
virt/kvm/vac.h | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index fb50deaad3fd..575f044fd842 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -108,7 +108,6 @@ LIST_HEAD(vm_list);
static struct kmem_cache *kvm_vcpu_cache;
static __read_mostly struct preempt_ops kvm_preempt_ops;
-static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_running_vcpu);
struct dentry *kvm_debugfs_dir;
EXPORT_SYMBOL_GPL(kvm_debugfs_dir);
@@ -150,7 +149,10 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm);
static unsigned long long kvm_createvm_count;
static unsigned long long kvm_active_vms;
-static DEFINE_PER_CPU(cpumask_var_t, cpu_kick_mask);
+__weak void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
+ unsigned long start, unsigned long end)
+{
+}
__weak void kvm_arch_guest_memory_reclaimed(struct kvm *kvm)
{
diff --git a/virt/kvm/vac.c b/virt/kvm/vac.c
index ff034a53af50..c628afeb3d4b 100644
--- a/virt/kvm/vac.c
+++ b/virt/kvm/vac.c
@@ -6,6 +6,11 @@
#include <linux/percpu.h>
#include <linux/mutex.h>
+DEFINE_PER_CPU(cpumask_var_t, cpu_kick_mask);
+EXPORT_SYMBOL(cpu_kick_mask);
+
+DEFINE_PER_CPU(struct kvm_vcpu *, kvm_running_vcpu);
+
#ifdef CONFIG_KVM_GENERIC_HARDWARE_ENABLING
DEFINE_MUTEX(vac_lock);
diff --git a/virt/kvm/vac.h b/virt/kvm/vac.h
index aed178a16bdb..f3e7b08168df 100644
--- a/virt/kvm/vac.h
+++ b/virt/kvm/vac.h
@@ -29,4 +29,7 @@ static inline void hardware_disable_all(void)
}
#endif /* CONFIG_KVM_GENERIC_HARDWARE_ENABLING */
+DECLARE_PER_CPU(cpumask_var_t, cpu_kick_mask);
+DECLARE_PER_CPU(struct kvm_vcpu *, kvm_running_vcpu);
+
#endif
--
2.42.0.869.gea05f2083d-goog
Powered by blists - more mailing lists