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

Suzuki K Poulose suzuki.poulose at arm.com
Fri Oct 2 22:53:35 PDT 2026


On 02/10/2026 16:29, Marc Zyngier wrote:
> On Fri, 02 Oct 2026 15:37:00 +0100,
> Fuad Tabba <tabba at google.com> wrote:
>>
>> Hi Marc,
>>
>> On Fri, 02 Oct 2026 15:15:06 +0100, Marc Zyngier <maz at kernel.org> wrote:
>> [...]
>>> Honestly, we introduce the flavor stuff to make it easy to match
>>> things on a particular VM type in a readable way. So why isn't this
>>> reading:
>>>
>>>          if (vcpu->kvm->arch.vm_flavor != VM_PROTECTED_PKVM)
>>>                  return;
>>
>> I know this is a sketch, but just in case: that's inverted. The sync
>> only applies to non-protected pKVM VMs (EL2 ignores it for protected
>> ones), so it would be != VM_PKVM.
> 
> See what I meant about this stuff being completely intractable? I
> still have no idea what it means! ;-)
> 

Just to be clear: unprotected_pkvm() != (vm_flavor != VM_PROTECED_PKVM).
Rather, unprotected_pkvm => (vm_flavor == VM_PKVM).

And the code wanted to bail out early for !unprotected_pkvm(). We can
stick in "is_protected_kvm_enabled()" for unprotected_pkvm predicate

But, I can drop the helper and use the vm_flavor check.

Cheers
Suzuki

> 	M.
> 




More information about the linux-arm-kernel mailing list