[PATCH v2 2/2] KVM: arm64: Block ID register changes after we rely on the values

Mark Brown broonie at kernel.org
Thu Aug 13 08:59:44 PDT 2026


On Thu, Aug 13, 2026 at 03:54:09PM +0100, Marc Zyngier wrote:
> Mark Brown <broonie at kernel.org> wrote:

> > Avoid these issues by adding a new flag that we set when we finalize the
> > system registers, blocking ID register changes after that has been set
> > even if something fails later on. Do this in kvm_vm_finalize_sys_regs(),

> We already have KVM_ARCH_FLAG_ID_REGS_INITIALIZED. Why do we need
> another flag for something that appears to be similar? Why can't we
> broaden the scope of the existing flag to cover the above?

That looked like it was for the other end of the process, where we set
up initial values, and that userspace should still be able to configure
values afterwards.  A combination of the naming of the flag and the fact
that it was introduced as part of the writable ID registers series[1]
but didn't block ID register writes made it seem like it was intentional
that userspace should be continue to be able to write to the registers
after the flag has been set.  I have to confess to being unclear what
the intent with that would be, but as this is ABI I was trying to err on
the side of minimal changes.  

I would be unsurprised to learn that it's just an oversight, in which
case we should just use the same flag instead as you suggest.

[1] https://lore.kernel.org/r/20230609190054.1542113-7-oliver.upton@linux.dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260813/e3c1f3ff/attachment.sig>


More information about the linux-arm-kernel mailing list