Thread (48 messages) 48 messages, 7 authors, 15d ago

Re: [PATCH v18 11/23] KVM: arm64: Use kvm_vm_is_unprotected() for !kvm_vm_is_protected()

flat view

From: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: 2026-09-17 16:47:57
Also in: kvm, kvmarm, linux-arm-kernel, lkml

On 17/09/2026 12:47, Fuad Tabba wrote:
Hi Suzuki,

On Tue, 15 Sep 2026 17:01:29 +0100, Suzuki K Poulose
[off-list ref] wrote:
[...]
quoted
diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c
[...]
quoted
@@ -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;
Could the two pKVM-only helpers keep the static key in front? With
`is_protected_kvm_enabled() &&` inside kvm_vm_is_unprotected_pkvm()
and kvm_vm_is_protected_pkvm(), as kvm_vm_is_protected() had it before
patch 5, the boot-patched branch skips the load again for every user.
This runs on every exit: the old test is a cpucap, so on a host
without pKVM the function returns straight away, while the new one
loads vcpu->kvm->arch.vm_flavor on every host. The wide
kvm_vm_is_protected() can't have it, since Realms run without pKVM.
Ack

Suzuki
Cheers,
/fuad
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help