Re: [PATCHv6 01/16] x86/cpu: Enumerate the LASS feature bits
From: Dave Hansen
Date: Fri Jun 20 2025 - 14:24:55 EST
On 6/20/25 11:14, Sohil Mehta wrote:
> @Dave Hansen, you had suggested separating out the SMAP/LASS AC toggle
> functions. But, the difference in usage between both of them seems very
> subtle. Could this be easily misused?
Logically there are two completely different things:
1. Touching userspace
2. Touching the lower half of the address space
If it's only userspace in the lower half of the address space, then
there's no controversy. But the problem obviously occurs when you want
to touch kernel mappings in the lower half of the address space.
I want to preserve the "stac/clas" meaning as just "touch userspace".
The new functions should be for "touch the lower half of the address
space" alone. Maybe it should be:
lass_disable_enforcement()
lass_enable_enforcement()
The only downside of not having stac/clac in the names is that it's not
obvious that they have an impact on SMAP because they're named to be
LASS-only. But I'm not super worried about this. If we have a
proliferation of call sites we have bigger problem on our hands.