Page MenuHomeFreeBSD

Fix an off-by-one in vm_map_pmap_enter().
ClosedPublic

Authored by markj on Dec 4 2019, 5:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 4, 10:57 PM
Unknown Object (File)
Mon, Nov 24, 1:41 PM
Unknown Object (File)
Wed, Nov 19, 11:47 AM
Unknown Object (File)
Oct 29 2025, 4:48 PM
Unknown Object (File)
Oct 29 2025, 4:48 PM
Unknown Object (File)
Oct 29 2025, 11:00 AM
Unknown Object (File)
Oct 29 2025, 4:46 AM
Unknown Object (File)
Oct 26 2025, 9:50 AM
Subscribers

Details

Summary

The set of valid pindices in an object of size N is [0, N-1]. I
believe this bug is harmless: we would set psize = 0, causing the
remainder of vm_map_pmap_enter() to do nothing.

Submitted by: Wuyang Chung <wuyang.chung1@gmail.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Dec 4 2019, 5:45 PM
alc added inline comments.
sys/vm/vm_map.c
2459–2460 ↗(On Diff #65218)

As an aside, I want to ask if we can't retire pmap_object_init_pt(). More precisely, hasn't vm_fault_populate() subsumed the essential point of pmap_object_init_pt(), to create superpage mappings for some devices, like frame buffers?

This revision was automatically updated to reflect the committed changes.
sys/vm/vm_map.c
2459–2460 ↗(On Diff #65218)

Would the idea be to provide a default populate method for DEVICE and SG objects?