HomeFreeBSD

amd64: add LASS support

Description

amd64: add LASS support

In short, LASS enforces all kernel memory accesses to have bit 63 set to
1, and all userspace accesses have bit 63 set to 0. Violations of these
rules cause #GP. There are natural loopholes, like SMAP with rflags.AC=1
allows kernel to access userspace.

Enablement is simple, we need to set CR4.LASS bit on all CPUs. There
are complications when kernel has to execute code at low addresses, e.g.
for la57 trampoline, or calling into EFI RT. The patch turns CR4.LASS
off around these regions.

LASS is officially documented in SDM, since at least rev. 085, October

  1. Tested in simics.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55218

Details

Provenance
kibAuthored on Oct 24 2024, 2:12 AM
Reviewer
markj
Differential Revision
D55218: amd64: add LASS support
Parents
rG097458ac665d: freebsd-update: Error for -b basedir without UNAME_r set
Branches
Unknown
Tags
Unknown