ANDROID: KVM: arm64: Remove 'struct kvm_vcpu' from the KMI

With the addition of 'struct pkvm_module_ops' to the Android-14 KMI, we
inadvertently exposing a number of internal KVM data structures via the
unused '__hyp_running_vcpu' member of 'struct kvm_cpu_context'.

Fix up the KMI by making this field a 'void *' for everybody other than
genksyms.

Cc: Matthias Männich <maennich@google.com>
Cc: Quentin Perret <qperret@google.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 288146090
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I54b7fe055830e22e6118779617de2d9259501833
This commit is contained in:
Will Deacon
2023-06-29 13:54:24 +01:00
committed by Matthias Männich
parent aad223db39
commit ceb26af319
2 changed files with 11 additions and 6040 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -206,8 +206,10 @@ struct kvm_arch {
/* Mandated version of PSCI */
u32 psci_version;
#ifndef __GENKSYMS__
/* Protects VM-scoped configuration data */
struct mutex config_lock;
#endif
/*
* If we encounter a data abort without valid instruction syndrome
@@ -356,7 +358,11 @@ struct kvm_cpu_context {
u64 sys_regs[NR_SYS_REGS];
#ifdef __GENKSYMS__
struct kvm_vcpu *__hyp_running_vcpu;
#else
void *__hyp_running_vcpu;
#endif
};
struct kvm_host_data {
@@ -515,7 +521,9 @@ struct kvm_vcpu_arch {
/* vcpu power state */
struct kvm_mp_state mp_state;
#ifndef __GENKSYMS__
spinlock_t mp_state_lock;
#endif
union {
/* Cache some mmu pages needed inside spinlock regions */