Page MenuHomeFreeBSD

Clean up a couple of MD warts in vm_fault_populate():
ClosedPublic

Authored by jah on Mar 27 2021, 3:17 AM.
Tags
None
Referenced Files
F106638206: D29439.diff
Fri, Jan 3, 4:09 AM
Unknown Object (File)
Fri, Dec 6, 1:31 AM
Unknown Object (File)
Nov 20 2024, 9:00 AM
Unknown Object (File)
Nov 17 2024, 3:15 AM
Unknown Object (File)
Sep 15 2024, 11:11 PM
Unknown Object (File)
Sep 5 2024, 4:13 PM
Unknown Object (File)
Sep 3 2024, 3:21 PM
Unknown Object (File)
Aug 30 2024, 5:09 PM

Details

Summary

--Eliminate a big ifdef that encompassed all currently-supported
architectures except mips and powerpc32. This applied to the case
in which we've allocated a superpage but the pager-populated range
is insufficient for a superpage mapping. For platforms that don't
support superpages the check should be inexpensive as we shouldn't
get a superpage in the first place. Make the normal-page fallback
logic identical for all platforms and provide a simple implementation
of pmap_ps_enabled() for MIPS and Book-E/AIM32 powerpc.

--Apply the logic for handling pmap_enter() failure if a superpage
mapping can't be supported due to higher-level protection policy.
Use KERN_PROTECTION_FAILURE instead of KERN_FAILURE for this case,
and note Intel PKU on amd64 as the first example of such protection
policy.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38119
Build 35008: arc lint + arc unit

Event Timeline

jah requested review of this revision.Mar 27 2021, 3:17 AM
sys/powerpc/aim/mmu_oea.c
1128

For PowerPC I believe pmap_nomethod() dispatch should work for the purpose of this change without needing these added functions. In fact it seems that it already is for 64-bit Book E MMUs. But it seemed less fragile to provide the real dispatch entries since we already allocate them anyway.

sys/amd64/amd64/pmap.c
7150

This is fine and makes things consistent with pmap_enter_largepage(), but now I see that there are some issues with KERN_PROTECTION_FAILURE.

Since they are mine and pre-existing, I propose D29442.

This revision is now accepted and ready to land.Mar 27 2021, 3:07 PM
sys/vm/vm_fault.c
560

I would say 'lower-level', since PKRU is somewhere below pmap. Or remove the 'higher-level' words.

576–577

IMO it would be cleaner to assert rv value right after pmap_enter(). Something like
MPASS(rv == KERN_SUCCESS || (psind > 0 && rv == KERN_PROTECTION_FAILURE);

Adjust wording in comment, rearrange return value assertion

This revision now requires review to proceed.Mar 27 2021, 8:42 PM
This revision is now accepted and ready to land.Mar 27 2021, 9:30 PM
bdragon added a subscriber: bdragon.

OK PowerPC