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)
Sun, Oct 13, 1:22 PM
Unknown Object (File)
Sep 24 2024, 6:58 PM
Unknown Object (File)
Sep 24 2024, 4:05 PM
Unknown Object (File)
Sep 24 2024, 4:11 AM
Unknown Object (File)
Sep 23 2024, 3:26 AM
Unknown Object (File)
Sep 22 2024, 10:57 PM
Unknown Object (File)
Sep 18 2024, 2:28 PM
Unknown Object (File)
Sep 18 2024, 12:24 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.