RE: ibmvtpm byteswapping inconsistency
From: David Laight
Date: Thu Feb 02 2017 - 10:17:32 EST
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