Page MenuHomeFreeBSD

efipart: use page-aligned buffer for BlockIO
AbandonedPublic

Authored by kevans on Sep 14 2019, 2:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 10:45 PM
Unknown Object (File)
Dec 22 2023, 9:44 PM
Unknown Object (File)
Dec 21 2023, 2:38 PM
Unknown Object (File)
Nov 4 2023, 9:14 AM
Unknown Object (File)
Jul 12 2023, 2:58 PM
Unknown Object (File)
Apr 8 2023, 12:31 AM
Unknown Object (File)
Mar 21 2023, 8:28 PM
Subscribers

Details

Summary

Using non-page-aligned buffers should raise EFI_INVALID_PARAMETER according to the spec. I would suspect the efipart_readwrite call just above this is not necessarily kosher, but I have not thought about it too much.

PR: 240572

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 26491

Event Timeline

This revision is now accepted and ready to land.Sep 14 2019, 2:24 AM
tsoome requested changes to this revision.Sep 14 2019, 9:00 AM

Yes, this fix is not complete. We should always use "bounce buffer" here and only use aligned memory. Of course the disk write is also broken here (unless I'm mistaken)...

This revision now requires changes to proceed.Sep 14 2019, 9:00 AM

Yes, this fix is not complete. We should always use "bounce buffer" here and only use aligned memory. Of course the disk write is also broken here (unless I'm mistaken)...

Any chance you have a little bit for this? I've run out of time for loader stuff for now.

Actually yes, this change isn't correct. See https://github.com/tianocore/edk2/blob/master/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c for an example of how to allocate aligned memory (InternalAllocateAlignedPages etc.)

bcran requested changes to this revision.Sep 14 2019, 3:15 PM

Actually yes, this change isn't correct. See https://github.com/tianocore/edk2/blob/master/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c for an example of how to allocate aligned memory (InternalAllocateAlignedPages etc.)

It is not just about an allocation; we actually should check ioalign property...

kevans: Im not sure when exactly I can look on it, also I 'm not sure about testing - does the qemu help me there?

rS352446 should fix the alignment issues here.