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
F99188956: D43277.diff
Mon, Oct 7, 4:21 AM
Unknown Object (File)
Wed, Oct 2, 6:03 AM
Unknown Object (File)
Mon, Sep 23, 11:00 PM
Unknown Object (File)
Mon, Sep 23, 12:20 AM
Unknown Object (File)
Sun, Sep 22, 7:44 PM
Unknown Object (File)
Sun, Sep 22, 3:34 AM
Unknown Object (File)
Sat, Sep 21, 5:00 AM
Unknown Object (File)
Wed, Sep 18, 2:32 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 55201
Build 52090: arc lint + arc unit

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.