Page MenuHomeFreeBSD

i386: Always bounce DMA requests above 4G for !PAE kernels
ClosedPublic

Authored by jhb on Jan 2 2024, 8:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 1:12 PM
Unknown Object (File)
Mon, Oct 21, 6:01 PM
Unknown Object (File)
Oct 7 2024, 6:31 AM
Unknown Object (File)
Oct 7 2024, 4:21 AM
Unknown Object (File)
Oct 2 2024, 6:03 AM
Unknown Object (File)
Sep 23 2024, 11:00 PM
Unknown Object (File)
Sep 23 2024, 12:20 AM
Unknown Object (File)
Sep 22 2024, 7:44 PM
Subscribers

Details

Summary

i386 kernels without 'options PAE' will still use PAE page tables if
the CPU supports PAE both to support larger amounts of RAM and for
PG_NX permissions. However, to avoid changing the API, bus_addr_t and
related constants (e.g. BUS_SPACE_MAXADDR) are still limited to
32-bits.

To cope with this, the x86 bus_dma code included an extra check to
bounce requests for addresses above BUS_SPACE_MAXADDR. This check was
elided (probably because it looks always-true on its face and had no
comment explaining its purpose) in recent refactoring. To fix,
restore a custom address-validation function for i386 kernels without
options PAE that includes this check.

Fixes: 3933ff56f9b6 busdma: tidy bus_dma_run_filter() functions

Diff Detail

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

Event Timeline

jhb requested review of this revision.Jan 2 2024, 8:48 PM
This revision is now accepted and ready to land.Jan 2 2024, 9:00 PM
sys/x86/x86/busdma_bounce.c
130

I'd add a line in the comment above saying that you have to check here as a special case because we can't do it as part of the busdma API so the normal tags and such can't cover this.

Thanks for noticing this! I meant to call attention to the removal of the MAXADDR check in the other review, but missed it. As you speculate it seemed innocent to me at the time.