HomeFreeBSD

stand: Avoid unaligned access in smbios code

Description

stand: Avoid unaligned access in smbios code

This code was written on x86 where unaligned accesses were
easy. LinuxBoot running on aarch64 uses mmap of /dev/mem to read the
smbios table. Linux's mapping of this memory doesn't allow the normal
unaligned fixup, so we get a bus error instead. We can't use the more
natural le16dec and friends because they optimize into a single,
unaligned memory load. We don't see this issue on aarch64 UEFI because
memory is mapped such that unaligned accesses are fixed up.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39793

Details

Provenance
impAuthored on May 1 2023, 9:12 PM
Differential Revision
D39793: stand: Avoid unaligned access in smbios code
Parents
rGa083d0867635: kboot: Add smbios support
Branches
Unknown
Tags
Unknown