From 9f7b00f2304d9db2984bd2291b501d9dfc8fafa3 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 30 Aug 2019 20:54:30 +0000 Subject: [PATCH] qemu-system-aarch64 does list block device with very large block size Also insert Vendor device as "parent" disk (found in qemu-system-aarch64 -cpu cortex-a57). This does fix lsdev in loader.efi on this platform. --- stand/efi/libefi/efipart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c index 3d7ac1367fff..a92e16c07799 100644 --- a/stand/efi/libefi/efipart.c +++ b/stand/efi/libefi/efipart.c @@ -255,10 +255,12 @@ efipart_inithandles(void) /* * We assume the block size 512 or greater power of 2. + * Also skip devices with block size > 32k. * iPXE is known to insert stub BLOCK IO device with * BlockSize 1. */ if (blkio->Media->BlockSize < 512 || + blkio->Media->BlockSize > (1 << 15) || !powerof2(blkio->Media->BlockSize)) { continue; } @@ -603,7 +605,8 @@ efipart_updatehd(void) continue; if (DevicePathType(node) == HARDWARE_DEVICE_PATH && - DevicePathSubType(node) == HW_PCI_DP) { + (DevicePathSubType(node) == HW_PCI_DP || + DevicePathSubType(node) == HW_VENDOR_DP)) { STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); efipart_hdinfo_add(hd, NULL); goto restart;