Re: [PATCH v18 13/23] KVM: arm64: Add a helper for VMs running on hyp that don't trust the host
From: Fuad Tabba
Date: Thu Sep 17 2026 - 08:05:45 EST
Hi Suzuki,
On Tue, 15 Sep 2026 17:01:31 +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
[...]
> enum kvm_arm_vm_flavor {
> VM_NVHE,
> VM_VHE,
> + /* VMs running on a hyp that doesn't trust */
> + MARKER(__VM_DISTRUSTING_HYP),
> VM_PKVM, /* Normal guests on pKVM */
[...]
> +#define kvm_vm_hyp_is_distrusting(kvm) ((kvm)->arch.vm_flavor > __VM_DISTRUSTING_HYP)
I think this should be `>=`, as in kvm_vm_is_protected(): MARKER()
gives the marker the same value as the enumerator after it, so `>`
leaves out VM_PKVM. As posted, kvm_phys_addr_ioremap() no longer
returns -EPERM for non-protected VMs under pKVM (EL2 still rejects the
mapping, so it's only the errno that changes).
Cheers,
/fuad