Attention is currently required from: Joel Bueno, Maximilian Brune, Philipp Hug, ron minnich.
Julius Werner has posted comments on this change by Joel Bueno. ( https://review.coreboot.org/c/coreboot/+/85800?usp=email )
Change subject: commonlib/device_tree: fix 64-bit misaligned member access ......................................................................
Patch Set 5: Code-Review-1
(1 comment)
Patchset:
PS5: I don't think we should make changes to architecture-independent code to support the quirks of a single architecture. Generally, we expect all coreboot architectures to be able to support native unaligned accesses. There are plenty of other common code examples that rely on this as well, e.g. in CBFS code or in libpayload's USB driver.
Didn't we solve this on RISC-V by implementing an exception handler for the unaligned access exception that reconstructed the value manually? I feel like this has come up before. Maybe that was only done for 4-byte accesses and needs to be expanded to 8-byte?
Alternatively, since we're using `be64dec()` here anyway, I think one straight-forward solution would be to just modify the RISC-V specific implementation of those macros (with an `#if` in the header) to do two 32-bit accesses, while the other architectures retain their more performant single-access implementations.