Page MenuHomeFreeBSD

physmem ram: Don't reserve excluded regions
ClosedPublic

Authored by jhb on Feb 14 2024, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 5:43 AM
Unknown Object (File)
Mon, Apr 29, 10:43 PM
Unknown Object (File)
Sat, Apr 27, 4:46 AM
Unknown Object (File)
Fri, Apr 26, 8:11 AM
Unknown Object (File)
Fri, Apr 26, 8:10 AM
Unknown Object (File)
Fri, Apr 26, 8:10 AM
Unknown Object (File)
Fri, Apr 26, 12:53 AM
Unknown Object (File)
Mar 30 2024, 4:01 AM
Subscribers

Details

Summary

These regions can conflict with I/O resources and prevent allocation
of those regions by other drivers. It may make sense to reserve them
after the boot-time probe of devices has concluded (or after an
initial pass to reserve firmware-assigned resources before "wildcard"
resources are allocated), but that would require additional changes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Feb 14 2024, 6:55 PM

On the Ampere machine I used to test this series, one of the excluded regions conflicted with a memory window on one of the Host-PCI bridges.

sys/kern/subr_physmem.c
631

Can you talk about why you removed this?

We specifically exclude a lot of regions for kboot because that's the old, running UEFI runtime services or are the gicv3 memory that's reserved in the memory maps we pass in. I want to make sure that this won't break things, but don't understand what you're trying to accomplish.

sys/kern/subr_physmem.c
631

Because reserving these devices in ram0 means other devices can't reserve them. Specifically as I noted in the comment above, a portion of a memory window for one of the Host-PCI bridge windows in the Ampere machine I tested on was listed as an excluded region, so the bridge couldn't allocate its window since it conflicted with a ram0 reservation.

The real fix is that we need to let the real I/O devices probe first before ram0 reserves things. The comment above about "best-effort" indicates the conflict, the problem is that ram0 probes before other devices, so it doesn't actually work as intended as instead ram0 preempts I/O devices.

imp added inline comments.
sys/kern/subr_physmem.c
631

OK. That makes sense and I don't think will interfere with the kboot stuff...

This revision is now accepted and ready to land.Feb 14 2024, 7:30 PM
This revision was automatically updated to reflect the committed changes.