From: Gerd Hoffmann Date: Tue, 14 Jan 2020 09:12:01 +0000 (+0100) Subject: nvme: skip initializing non-bootable devices X-Git-Tag: rel-1.14.0~44 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=76551856b28d227cb0386a1ab0e774329b941f7d;p=seabios.git nvme: skip initializing non-bootable devices Check NVMe devices whenever they are bootable, skip initialization in case they are not. Signed-off-by: Gerd Hoffmann --- diff --git a/src/hw/nvme.c b/src/hw/nvme.c index 2e3aa38..41f3b76 100644 --- a/src/hw/nvme.c +++ b/src/hw/nvme.c @@ -586,8 +586,15 @@ nvme_controller_enable(struct nvme_ctrl *ctrl) static void nvme_controller_setup(void *opaque) { + u8 skip_nonbootable = is_bootprio_strict(); struct pci_device *pci = opaque; + if (skip_nonbootable && bootprio_find_pci_device(pci) < 0) { + dprintf(1, "skipping init of a non-bootable NVMe at %pP\n", + pci); + goto err; + } + struct nvme_reg volatile *reg = pci_enable_membar(pci, PCI_BASE_ADDRESS_0); if (!reg) return;