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

Mark Brown <[email protected]>
Newsgroups dev.linux.lists.kvmarm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, Aug 13, 2026 at 03:54:09PM +0100, Marc Zyngier wrote:
> Mark Brown <[email protected]> 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/[email protected]
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmp96e8ACgkQJNaLcl1U
h9A80wgAha8llle9+QqQT+mJR2RuxsY6SQP/3Kj2ODe3Ammr9HvKe7VFlUnYcZf0
5oQVJfqxCR9Khm8XwlPTFbUnhRxNI2WHnwrIBoDULd1MK3EKjfpNNJrr9jOBS35a
XHX00r6VuPASZW5onDlxMgzEGQI0a0ngcUSUBH0YZcATe8BzpLBjTEhLAhhDBBrF
HNahJz6MNNtvPSoSyBe32zavOVQlSMaaY1YFoBxh0TGuym1Z9OH9n3p70mQBeN+T
9sIV0iJBdEjdPCcx75P+5P04cGp+XyjG3HE41FYAsqTZrKGsEAqUrk9NHqKBlomH
rzBBLk8MTWWmlEVKRz1p/gF2972u3g==
=uPvA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.