HomeFreeBSD

x86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible

Description

x86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible

malloc_domainset_aligned() requires that alignment is less than
page size. Fall back to other allocation methods, most likely
kmem_alloc_contig(), when malloc_aligned() cannot fullfill the driver
request.

Reported by: Loic F <loic.f@hardenedbsd.org>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32127

Details

Provenance
kibAuthored on Sep 24 2021, 5:46 PM
Reviewer
markj
Differential Revision
D32127: Better handling for alignment requirements in x86 busdma bounce.
Parents
rG71d31f1cf601: malloc_aligned(9): allow zero size and alignment
Branches
Unknown
Tags
Unknown