Re: [PATCH v21 10/23] KVM: arm64: Add VM specific callback for S2 MMU operations

From: Suzuki K Poulose

Date: Fri Oct 02 2026 - 06:35:10 EST


Hi Fuad

On 02/10/2026 11:19, Fuad Tabba wrote:
Hi Suzuki,

On Thu, 01 Oct 2026 22:06:50 +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.

The rows only differ where the base already branches (the pKVM TLB
flushes, the protected VM age and unmap, and from patch 12 its abort),
so the case for the table rests on the Realm row, which isn't
functional until the RMI backend lands. Beyond the flushes in patch
16, which operations do you expect it to override?

Thats it for now. But I also want to explore the flush_memslots() case,
where Realm doesn't need to do anything. May be it is easier to stub
that case out early.


[...]
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
[...]
int kvm_arch_flush_remote_tlbs(struct kvm *kvm)
[...]
+ if (!kvm->arch.vm_s2_ops->vm_flush_remote_tlbs)
+ return 1;

Every row sets it today, but returning 1 falls back to
KVM_REQ_TLB_FLUSH, which arm64 doesn't handle, so nothing would be
flushed. Could vm_flush_remote_tlbs be mandatory, checked in
kvm_vm_init_vm_s2_ops()?

Agree, we could make that mandatory.

Suzuki