Page MenuHomeFreeBSD

efipart: use page-aligned buffer for BlockIO
AbandonedPublic

Authored by kevans on Sep 14 2019, 2:06 AM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 26491

Event Timeline

kevans created this revision.Sep 14 2019, 2:06 AM
bcran accepted this revision.Sep 14 2019, 2:24 AM
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.

bcran added a comment.Sep 14 2019, 3:14 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.)

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?

kevans abandoned this revision.Sep 17 2019, 2:50 PM

rS352446 should fix the alignment issues here.