ibmvtpm byteswapping inconsistency
David Laight
David.Laight at ACULAB.COM
Fri Feb 3 02:17:19 AEDT 2017
From: Michal Suchánek
> Sent: 02 February 2017 11:30
...
> The word is marked correctly as __be64 in that patch because count and
> handle are swapped to BE when saved to it and the whole word is then
> swapped again when loaded. If you just load ((u64)IBMVTPM_VALID_CMD <<
> 56 | ((u64)VTPM_TPM_COMMAND << 48) | ((u64)count << 32) |
> ibmvtpm->rtce_dma_handle in a register it works equally well
> without any __be and swaps involved.
And that version will almost certainly generate much better code.
David
More information about the Linuxppc-dev
mailing list