Use Memcpy to access the fw_versions member of RollbackSpaceFirmware.
This structure has two uint8_t members and then fw_versions which is a
uint32_t. That means that fw_versions is 32 bits wide but only has 16 bit
alignment, and architectures that care about that sort of thing won't be able
to access it. ARM generally cares about alignment, but there's a bit which
lets you select whether 32 bit accesses can be unaligned. In the past this bit
was ignored, and because this is a 32 bit data type the right load happened to
To avoid the unaligned access all together, this change makes vboot use Memcpy
to access fw_versions. The number of accesses should be very small so the
overhead should be minimal.
TEST=Built and booted depthcharge on Snow. Without this change, there was an
unaligned exception during SetupTPM when the fw_versions member was accessed
as part of a VBDEBUG call. With this change, the exception went away and the
TPM was initialized successfully.
Signed-off-by: Gabe Black <email@example.com>
Reviewed-by: Bill Richardson <firstname.lastname@example.org>
Reviewed-by: Randall Spangler <email@example.com>
Commit-Queue: Gabe Black <firstname.lastname@example.org>
Tested-by: Gabe Black <email@example.com>
1 file changed