Re: [PATCH v21 05/23] KVM: arm64: Track the type of VM in kvm_arch

From: Fuad Tabba

Date: Fri Oct 02 2026 - 06:13:48 EST


Hi Suzuki,

On Thu, 01 Oct 2026 22:06:45 +0100, Suzuki K Poulose
<suzuki.poulose@xxxxxxx> wrote:
[...]
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
[...]
> +#define vcpu_is_protected(vcpu) \
[...]
> + if (is_nvhe_hyp_code() && \
> + !is_protected_kvm_enabled()) \
> + __kvm = kern_hyp_va(__kvm); \

On a non-pKVM nVHE host, the hyp callers of this in switch.c and
timer-sr.c now translate vcpu->kvm and load vm_flavor on every guest
entry and exit, where the is_protected_kvm_enabled() check used to
short-circuit. Could they use vcpu_is_protected_pkvm(), and drop the
kern_hyp_va() here?

With that:
Reviewed-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>

Cheers,
/fuad