Now that we have a flavor to check, use the helper to explicitly check
the type for an unprotected PKVM guest. We don't convert all of the
!kvm_vm_is_protected(), but only the ones that target unprotected PKVM
guests.
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arch/arm64/include/asm/kvm_pkvm.h | 2 +-
arch/arm64/kvm/arm.c | 2 +-
arch/arm64/kvm/handle_exit.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h
index a1f3e05e75dc1..e4ea80711bec6 100644
--- a/arch/arm64/include/asm/kvm_pkvm.h
+++ b/arch/arm64/include/asm/kvm_pkvm.h
@@ -49,7 +49,7 @@ static inline bool kvm_pkvm_ext_allowed(struct kvm *kvm, long ext)
case KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES:
return false;
default:
- return !kvm || !kvm_vm_is_protected(kvm);
+ return !kvm || kvm_vm_is_unprotected_pkvm(kvm);
}
}
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 36bd1c6c04899..42d9385f5e329 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -1082,7 +1082,7 @@ int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu)
if (is_protected_kvm_enabled()) {
/* Start with the vcpu in a dirty state */
- if (!kvm_vm_is_protected(vcpu->kvm))
+ if (kvm_vm_is_unprotected_pkvm(vcpu->kvm))
vcpu_set_flag(vcpu, PKVM_HOST_STATE_DIRTY);
ret = pkvm_create_hyp_vm(kvm);
if (ret)diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c
index db37678dcb05c..384c5d258c7f8 100644
--- a/arch/arm64/kvm/handle_exit.c
+++ b/arch/arm64/kvm/handle_exit.c
@@ -490,7 +490,7 @@ static void handle_exit_pkvm_state(struct kvm_vcpu *vcpu, int exception_index)
{
int exception_code = ARM_EXCEPTION_CODE(exception_index);
- if (!is_protected_kvm_enabled() || kvm_vm_is_protected(vcpu->kvm))
+ if (!kvm_vm_is_unprotected_pkvm(vcpu->kvm))
return;
/*--
2.43.0