Re: [PATCH] MdeModulePkg/FaultTolerantWriteDxe: Don't check for address alignment
toggle quoted messageShow quoted text
I think the point is shown in a comment from coreboot:
"As mentioned above, only the offsets need to be
aligned, not the absolute bases. Please, have a look for instance at
(FtwDevice->WorkSpaceAddress >= (FvbBaseAddress + BlockSize * (LbaIndex - 1)))
Things become more obvious if we remove the unnecessary parentheses:
FtwDevice->WorkSpaceAddress >= FvbBaseAddress + BlockSize * (LbaIndex - 1)
It's the same as:
FtwDevice->WorkSpaceAddress - FvbBaseAddress >= BlockSize * (LbaIndex - 1)
And _if_ aligned, the same as:
(FtwDevice->WorkSpaceAddress - FvbBaseAddress) / BlockSize >= LbaIndex - 1
Now it's easy to see: neither `FtwDevice->WorkSpaceAddress` nor `FvbBaseAddress`
have to be aligned, but their relative distance has to be."
So if this solution isn't acceptable, could you suggest one that would be?
On Tue, 17 May 2022 at 16:05, Zeng, Star <star.zeng@...> wrote: