Commit 3b1a690e authored by Fuad Tabba's avatar Fuad Tabba Committed by Marc Zyngier

KVM: arm64: Pass struct kvm to per-EC handlers

We need struct kvm to check for protected VMs to be able to pick
the right handlers for them in subsequent patches.
Signed-off-by: default avatarFuad Tabba <tabba@google.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-5-tabba@google.com
parent 8fb20461
...@@ -403,7 +403,7 @@ static bool kvm_hyp_handle_dabt_low(struct kvm_vcpu *vcpu, u64 *exit_code) ...@@ -403,7 +403,7 @@ static bool kvm_hyp_handle_dabt_low(struct kvm_vcpu *vcpu, u64 *exit_code)
typedef bool (*exit_handler_fn)(struct kvm_vcpu *, u64 *); typedef bool (*exit_handler_fn)(struct kvm_vcpu *, u64 *);
static const exit_handler_fn *kvm_get_exit_handler_array(void); static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm *kvm);
/* /*
* Allow the hypervisor to handle the exit with an exit handler if it has one. * Allow the hypervisor to handle the exit with an exit handler if it has one.
...@@ -413,7 +413,7 @@ static const exit_handler_fn *kvm_get_exit_handler_array(void); ...@@ -413,7 +413,7 @@ static const exit_handler_fn *kvm_get_exit_handler_array(void);
*/ */
static inline bool kvm_hyp_handle_exit(struct kvm_vcpu *vcpu, u64 *exit_code) static inline bool kvm_hyp_handle_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
{ {
const exit_handler_fn *handlers = kvm_get_exit_handler_array(); const exit_handler_fn *handlers = kvm_get_exit_handler_array(kern_hyp_va(vcpu->kvm));
exit_handler_fn fn; exit_handler_fn fn;
fn = handlers[kvm_vcpu_trap_get_class(vcpu)]; fn = handlers[kvm_vcpu_trap_get_class(vcpu)];
......
...@@ -169,7 +169,7 @@ static const exit_handler_fn hyp_exit_handlers[] = { ...@@ -169,7 +169,7 @@ static const exit_handler_fn hyp_exit_handlers[] = {
[ESR_ELx_EC_PAC] = kvm_hyp_handle_ptrauth, [ESR_ELx_EC_PAC] = kvm_hyp_handle_ptrauth,
}; };
static const exit_handler_fn *kvm_get_exit_handler_array(void) static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm *kvm)
{ {
return hyp_exit_handlers; return hyp_exit_handlers;
} }
......
...@@ -107,7 +107,7 @@ static const exit_handler_fn hyp_exit_handlers[] = { ...@@ -107,7 +107,7 @@ static const exit_handler_fn hyp_exit_handlers[] = {
[ESR_ELx_EC_PAC] = kvm_hyp_handle_ptrauth, [ESR_ELx_EC_PAC] = kvm_hyp_handle_ptrauth,
}; };
static const exit_handler_fn *kvm_get_exit_handler_array(void) static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm *kvm)
{ {
return hyp_exit_handlers; return hyp_exit_handlers;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment