Re: [PATCH v22 11/23] KVM: arm64: Add VM specific callback for S2 MMU operations
From: Suzuki K Poulose
Date: Tue Oct 06 2026 - 11:14:50 EST
On 06/10/2026 11:36, Suzuki K Poulose wrote:
On 06/10/2026 10:24, Marc Zyngier wrote:
On Mon, 05 Oct 2026 10:07:42 +0100,
Suzuki K Poulose <suzuki.poulose@xxxxxxx> 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@xxxxxxx>
---
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).
For the record, as discussed, there are callbacks that don't have a kvm
instance available, e.g. kvm_pgtable_stage2_free_unlinked() where we
only have a page and level. Further abstractions will be explored in a
future series.
Suzuki
Cheers
Suzuki
M.