[PATCH v22 11/23] KVM: arm64: Add VM specific callback for S2 MMU operations

Suzuki K Poulose suzuki.poulose at arm.com
Tue Oct 6 03:36:59 PDT 2026


On 06/10/2026 10:24, Marc Zyngier wrote:
> On Mon, 05 Oct 2026 10:07:42 +0100,
> Suzuki K Poulose <suzuki.poulose at arm.com> wrote:
>>
>> Add VM type specific S2 MMU operation backends which can be initialized per
>> VM flavor, to keep the handling cleaner.
>>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose at arm.com>
>> ---
>> Change since v21:
>>   - Define all vm_s2_ops call back. All calls are mandatory.
>>   - Define callback for each flavor, disjointing the non-protetcted pKVM and
>>     normal KVM (VHE & nVHE) and remove the KVM_PGT_FN() hacks.
> 
> It is a bit annoying that we still have part of the operations being
> indirected by kvm_vm_s2_ops, and others by KVM_PGT_FN(), which is
> still there. I was hoping that we'd have only one indirection. after
> this patch.

I agree and I did think about it. The issue is, some of these calls are
deep burried from the higher leve dispatcher callbacks (e.g.,
user_mem_abort->kvm_pgtable_stage2_map). We could go all in and remove
all of them if you are happy with that change. Also, some of the call
paths aren't valid for certain VM types, that adds quite a lot of dummy
callbacks (now that they all are mandatory. e.g., pVM or Realms).


Cheers
Suzuki

> 
> 	M.
> 




More information about the linux-arm-kernel mailing list