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
parent 8a717a85c5
commit 58004e1d0e
2 changed files with 11 additions and 6171 deletions

File diff suppressed because it is too large Load diff

View file

@ -203,8 +203,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
@ -353,7 +355,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 {
@ -512,7 +518,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 */