Re: [PATCH v3] KVM: arm64: nv: Keep the shadow S2 MMUs at fixed addresses

From: Karl Mehltretter

Date: Thu Aug 06 2026 - 21:13:34 EST


On Thu, Aug 06, 2026 at 10:54:03PM +0100, Wei-Lin Chang wrote:
>
> Hey sorry for nitpicking once more, I actually like v2 more, as this
> version splits the error handling to two places. Marc's implementation
> [1] is also good, but that requires a twist in kvm_arch_flush_shadow_all().
> So I'd personally go with v2 (+my suggestions for it :)), but also fine if
> others have other opinions.
>
> I also think the comment in kvm_vcpu_init_nested() is worth adjusting
> slightly, too.
>

No worries, thanks for taking another look.

I was following the guidance in include/linux/cleanup.h:

the expectation is that usage of "goto" and cleanup helpers is never
mixed in the same function.

But maybe keeping goto is better. I'll wait a bit for others
to comment.

For the comment, I propose replacing the current text with:

/*
* If allocating an MMU object fails, keep the VNCR page alive so
* that userspace can retry vCPU initialisation without affecting
* the VM.
*/

Is that the adjustment you had in mind?

Thanks,
Karl