From nobody Thu Apr 25 14:01:35 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1576504119; cv=none; d=zohomail.com; s=zohoarc; b=P8Ql+NYfKdEWBtlyiqZpRRTBRW8wgiVOaSjUz+fRE+0nzFFrVXLnExNhlUpgPUV9YVT1aIQJ4N7orWhJUdcju4/aOWlYOYwN5fWeSNis7l6b+uHMoaKFOybr/YsTEUjCBeULUXsWzmfYjPgeE5q9KfM4u7m9MjIDsLeOqKzcnX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576504119; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To; bh=WLCKcjlPnpv4qSxKPsuv9FxH0DUAJ1R0o0TA6X0S3g8=; b=JDTCvG4DWfPwcHXUfp7kLGRmWlCzCA0xZ1K1B3rgqNrfGjhtHgtqK5pvkN+m6p1TU3AG7OuJ81tKif7AlNgUDmzYH012UfU+etDtcP04/s22b+Li1XMInJvTu8iOj243WdpDfCtQaaR72uCHjjkpcpxlqEcinQS5pckJNKGKRKI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1576504118752272.71883987183446; Mon, 16 Dec 2019 05:48:38 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 660CF20558; Mon, 16 Dec 2019 13:48:35 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id B9A6E2010E for ; Mon, 16 Dec 2019 13:48:14 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id D191C2E0985 for ; Mon, 16 Dec 2019 16:48:13 +0300 (MSK) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mxbackcorp1j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id ARoVHEzuBu-mDM85rIi; Mon, 16 Dec 2019 16:48:13 +0300 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by sas2-a1baadf75138.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id hHyxx3C6RR-mDSW268N; Mon, 16 Dec 2019 16:48:13 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Precedence: bulk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1576504093; bh=xnKPIE2cNew/3wXGBbF4G8pVPrX+84DTCLx48ynAKdI=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=q1WS0xzdtDFHD5nFf/BrBNHE+FvxagMdL/RAnFVhcA+mdKIavwHLJX5XnybnJIw1I Dzvo17U3OGHrzhFhRFwzJZdk7JOOOn3TAeHneTg9OQROXBF21S/XVGoCaupAU+4rCc ND0Vz3ubAT0+g+VWeZRL8ySKrvYgtVJwZYYqBUm8= From: Alexey Kirillov To: seabios@seabios.org Date: Mon, 16 Dec 2019 16:47:18 +0300 Message-Id: <20191216134718.15767-2-lekiravi@yandex-team.ru> In-Reply-To: <20191216134718.15767-1-lekiravi@yandex-team.ru> References: <20191216134718.15767-1-lekiravi@yandex-team.ru> X-Spam-Level: *** Message-ID-Hash: KT6SP4D23EEWIPOJJ5WZRBRJ2NJZDXQF X-Message-ID-Hash: KT6SP4D23EEWIPOJJ5WZRBRJ2NJZDXQF X-MailFrom: lekiravi@yandex-team.ru X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: yc-core@yandex-team.ru, Alexey Kirillov X-Mailman-Version: 3.3.1 Subject: [SeaBIOS] [PATCH 1/1] virtio: do not init non-bootable devices List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Because initializing a virtio-blk or virtio-scsi device requires a large amount of memory, you cannot create more than about 10 virtio devices. Since initialization is required for booting from media, we will not initialize those devices that are not in the boot order list. Signed-off-by: Alexey Kirillov --- docs/Runtime_config.md | 1 + src/hw/virtio-blk.c | 10 ++++++++++ src/hw/virtio-scsi.c | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/docs/Runtime_config.md b/docs/Runtime_config.md index 6747e2a..08f6e66 100644 --- a/docs/Runtime_config.md +++ b/docs/Runtime_config.md @@ -191,3 +191,4 @@ There are several additional configuration options avai= lable in the | threads | By default, SeaBIOS will parallelize hardware init= ialization during bootup to reduce boot time. Multiple hardware devices can= be initialized in parallel between vga initialization and option rom initi= alization. One can set this file to a value of zero to force hardware initi= alization to run serially. Alternatively, one can set this file to 2 to ena= ble early hardware initialization that runs in parallel with vga, option ro= m initialization, and the boot menu. | sdcard* | One may create one or more files with an "sdcard" = prefix (eg, "etc/sdcard0") with the physical memory address of an SDHCI con= troller (one memory address per file). This may be useful for SDHCI contro= llers that do not appear as PCI devices, but are mapped to a consistent mem= ory address. If this option is used then SeaBIOS will not scan for PCI SHDC= I controllers. | usb-time-sigatt | The USB2 specification requires devices to signal = that they are attached within 100ms of the USB port being powered on. Some = USB devices are known to require more time. Prior to receiving an attachmen= t signal there is no way to know if a USB port is empty or if it has a devi= ce attached. One may specify an amount of time here (in milliseconds, defau= lt 100) to wait for a USB device attachment signal. Increasing this value w= ill also increase the overall machine bootup time. +| skip-non-bootable-virtio | If this item presented, initialization of non= -bootable (i.e. not presented in bootorder) virtio-blk and virtio-scsi will= be skipped. diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c index 3e615b2..2112112 100644 --- a/src/hw/virtio-blk.c +++ b/src/hw/virtio-blk.c @@ -15,6 +15,7 @@ #include "pcidevice.h" // foreachpci #include "pci_ids.h" // PCI_DEVICE_ID_VIRTIO_BLK #include "pci_regs.h" // PCI_VENDOR_ID +#include "romfile.h" // romfile_find #include "stacks.h" // run_thread #include "std/disk.h" // DISK_RET_SUCCESS #include "string.h" // memset @@ -196,6 +197,8 @@ fail: void virtio_blk_setup(void) { + u8 skip_nonbootable =3D romfile_find("etc/skip-non-bootable-virtio") != =3D NULL; + ASSERT32FLAT(); if (! CONFIG_VIRTIO_BLK) return; @@ -208,6 +211,13 @@ virtio_blk_setup(void) (pci->device !=3D PCI_DEVICE_ID_VIRTIO_BLK_09 && pci->device !=3D PCI_DEVICE_ID_VIRTIO_BLK_10)) continue; + + if (skip_nonbootable && bootprio_find_pci_device(pci) =3D=3D -1) { + dprintf(1, "skipping init of a non-bootable virtio-blk at %pP\= n", + pci); + continue; + } + run_thread(init_virtio_blk, pci); } } diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index e1e2f5d..70dfaa2 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -15,6 +15,7 @@ #include "pcidevice.h" // foreachpci #include "pci_ids.h" // PCI_DEVICE_ID_VIRTIO_BLK #include "pci_regs.h" // PCI_VENDOR_ID +#include "romfile.h" // romfile_find #include "stacks.h" // run_thread #include "std/disk.h" // DISK_RET_SUCCESS #include "string.h" // memset @@ -205,6 +206,8 @@ fail: void virtio_scsi_setup(void) { + u8 skip_nonbootable =3D romfile_find("etc/skip-non-bootable-virtio") != =3D NULL; + ASSERT32FLAT(); if (! CONFIG_VIRTIO_SCSI) return; @@ -217,6 +220,13 @@ virtio_scsi_setup(void) (pci->device !=3D PCI_DEVICE_ID_VIRTIO_SCSI_09 && pci->device !=3D PCI_DEVICE_ID_VIRTIO_SCSI_10)) continue; + + if (skip_nonbootable && bootprio_find_pci_device(pci) =3D=3D -1) { + dprintf(1, "skipping init of a non-bootable virtio-scsi at %pP= \n", + pci); + continue; + } + run_thread(init_virtio_scsi, pci); } } --=20 2.17.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org