Re: [PATCH v19 06/14] KVM: arm64: Validate GCS exception lock when emulating ERET
Mark Brown <[email protected]>
| Newsgroups | org.kernel.vger.linux-kselftest,dev.linux.lists.kvmarm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Aug 21, 2026 at 03:32:58PM +0100, Wei-Lin Chang wrote:
> On Wed, Aug 12, 2026 at 08:12:05PM +0100, Mark Brown wrote:
> > +/*
> > + * A subset of the pseudocode ELFromSPSR(), validity checks are
> > + * assumed to have been done in code that is not GCS specific.
> > + */
> > +static inline int exlock_el_from_spsr(u64 spsr)
> > +{
> > + return FIELD_GET(GENMASK(3, 2), spsr);
> > +}
> It feels a bit odd to me to have this function named exlock specific, as
> it's just spsr_to_el, right?
As the comment mentions it's not quite that - ELFromSPSR() in the
pseudocode has rather more going on in it that I'd managed to convince
myself wasn't relevant in this specific context. I didn't want to give
it a name that would cause someone to think it did the full thing and
trip them up using it in a different context where those things do
matter. I do agree that this results in awkward naming.
Please delete unneeded context from mails when replying. Doing this
makes it much easier to find your reply in the message, helping ensure
it won't be missed by people scrolling through the irrelevant quoted
material.
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmqIzvEACgkQJNaLcl1U h9BZIwf/ba+nE8Vy9gULofY3/WFN8ZxH4XRxW6e/DbaSGPJBBf2HHUHVp8/s5DLk oZUJmCtk/wioY00bc1GOA6wZ0tK8mPMpqB1suUh2OfsA39XPZc3uSIaP3Sc74Mwq 9h3hysTkO/9Ne86KmOkBq2Plkjc3M1fZok/SEgdkXW0mw5q3bfczzS9J+XaUZzN4 4liLWN5tx1n5E7tFE8f9UTU17cufCZGuCCWjOhBXR0iilRj6uvenzU1ioVpi7Z3g HDT/zdt1sylOzCwoKOWPe8mK0EQfTZSRgpJowSWzBhoPq4+VR3VmOd49XeFy+vzC uld3QEPfmTg0AP56dErhncG/Q2yZ8A== =qOw0 -----END PGP SIGNATURE-----