Revert "ANDROID: KVM: arm64: Introduce vcpu_is_protected() helper"

This reverts commit 9c2007f6d5.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Iff965ea172cc70be200263b6bb3905e098d43b48
This commit is contained in:
Will Deacon
2022-07-07 15:51:20 +01:00
parent fe3d8d0610
commit aaa1536fde
2 changed files with 4 additions and 10 deletions

View File

@@ -52,14 +52,6 @@ struct kvm_shadow_vm {
struct shadow_vcpu_state shadow_vcpus[0];
};
static inline bool vcpu_is_protected(struct kvm_vcpu *vcpu)
{
if (!is_protected_kvm_enabled())
return false;
return vcpu->arch.pkvm.shadow_vm->arch.pkvm.enabled;
}
extern struct kvm_shadow_vm **shadow_table;
extern phys_addr_t pvmfw_base;

View File

@@ -216,7 +216,7 @@ static const exit_handler_fn pvm_exit_handlers[] = {
static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu)
{
if (unlikely(vcpu_is_protected(vcpu)))
if (unlikely(kvm_vm_is_protected(kern_hyp_va(vcpu->kvm))))
return pvm_exit_handlers;
return hyp_exit_handlers;
@@ -235,7 +235,9 @@ static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu)
*/
static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code)
{
if (unlikely(vcpu_is_protected(vcpu) && vcpu_mode_is_32bit(vcpu))) {
struct kvm *kvm = kern_hyp_va(vcpu->kvm);
if (kvm_vm_is_protected(kvm) && vcpu_mode_is_32bit(vcpu)) {
/*
* As we have caught the guest red-handed, decide that it isn't
* fit for purpose anymore by making the vcpu invalid. The VMM