Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Sep 2019 21:54:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 240572] [boot] FreeBSD cannot boot with U-Boot patch efi_loader: parameter checks BLOCK_IO_PROTOCOL
Message-ID:  <bug-240572-99@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240572

            Bug ID: 240572
           Summary: [boot] FreeBSD cannot boot with U-Boot patch
                    efi_loader: parameter checks BLOCK_IO_PROTOCOL
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Keywords: uefi
          Severity: Affects Some People
          Priority: ---
         Component: standards
          Assignee: standards@FreeBSD.org
          Reporter: xypron.glpk@gmx.de
                CC: manu@freebsd.org

Booting current FreeBSD fails since patch
f59f0825e8b9fdeb8abe43ffd10c5119ca1a032f
efi_loader: parameter checks BLOCK_IO_PROTOCOL

The reason is that the buffer used by FreeBSD to read is not block aligned.

The UEFI spec requires that EFI_BLOCK_IO_PROTOCOL.ReadBlocks() returns
EFI_INVALID_PARAMETER if the buffer is not properly aligned (i.e. is not
a multiple of EFI_BLOCK_IO_MEDIA.IoAlign)

FreeBSD does not guarantee this alignment, e.g. efi_disk_read_blocks()
is called with buffer 00000000995b08d0 which is not aligned to a
multiple of 512.

FreeBSD function efipart_readwrite writes this error message:
efipart_readwrite: rw=3D1, blk=3D62333952 size=3D1 status=3D2

The problem can be traced back to the FreeBSD line:

stand/efi/libefi/efipart.c(1043) efipart_realstrategy():
blkbuf =3D malloc(blkio->Media->BlockSize);

U-Boot does not yet implement the EFI_DISK_IO_PROTOCOL which is a
wrapper for the EFI_BLOCK_IO_PROTOCOL allowing unaligned access.

malloc() could be replaced in FreeBSD by AllocatePages() which returns a
4096 byte aligned memory block.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240572-99>