From nobody Thu Apr 25 04:35:57 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=1577700507; cv=none; d=zohomail.com; s=zohoarc; b=hCkNypUUn+X5kNxFZnQkAJnlycMhBS3+/LwAT97BvXk976ls0HrP1YfgDLdH9BJ+orL3J2zrJnwNUfhNyv6lxHmtTUf5znuCJphXArI0dtU362Ion99P3fsRkOxEJ8MXTAVBacGt/Co8STNgzxsh78NBctqbjA93g5d+7uMYUFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577700507; 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=FJW7+GI1LcCJ7Ieqa9NDlBp9qVHLwO3JUnv8YpPlhzs=; b=HYy8adRrYflfypv03D72MLPCK1F3M4w4vLbb0LGk/j9IoSwJ4gmDlRy5RhGo4YcMmAqllbOiRkcYRtQwHRXRa9i9Gqzaxuf+f9R0SCl5CJAJbSq7QDr/jwF++t/dOMoeZtCTy5c51QWO+rWkwufZ+8UFERs323ZIzLvRjBVjqXE= 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 1577700507143536.53813530264; Mon, 30 Dec 2019 02:08:27 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 72EB726379; Mon, 30 Dec 2019 10:08:23 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 49CE2200DA for ; Mon, 30 Dec 2019 10:07:54 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id C235E2E1329; Mon, 30 Dec 2019 13:07:53 +0300 (MSK) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mxbackcorp1o.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id FbzEgNSsJi-7rvCtYm0; Mon, 30 Dec 2019 13:07:53 +0300 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by sas1-9998cec34266.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id SXOS8RIe1i-7rV0CN4W; Mon, 30 Dec 2019 13:07:53 +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=1577700473; bh=fbZ+7QCVJZBCzVFXPu2tQfdJISs7tJiZ1y4UOmT6mqA=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=vdl1sPsEwPxGMf9MfReObd6lErR8X3J6ZE+tatCX2GFXeogjTEfl5dGQR0jMTsm9g 5Z4zWhX27JqWvf0NxYnfRY3xLB0QkzbeP5gcI+UcVssgk0dovbjq9Oa/SdasJfrUWE UTYalLdAo3cjniet5E2UlhSQEdgS/zB9+/VSj7HA= From: Alexey Kirillov To: Gerd Hoffmann , seabios@seabios.org Date: Mon, 30 Dec 2019 13:07:38 +0300 Message-Id: <20191230100738.6797-3-lekiravi@yandex-team.ru> In-Reply-To: <20191230100738.6797-1-lekiravi@yandex-team.ru> References: <20191230100738.6797-1-lekiravi@yandex-team.ru> X-Spam-Level: *** Message-ID-Hash: J2P3SSISRBB7JCMRDOWQ7IKLENHDBZ7Z X-Message-ID-Hash: J2P3SSISRBB7JCMRDOWQ7IKLENHDBZ7Z 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 v2 2/2] 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 --- src/hw/virtio-blk.c | 11 ++++++++++- src/hw/virtio-scsi.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c index 3e615b2..a5e28fc 100644 --- a/src/hw/virtio-blk.c +++ b/src/hw/virtio-blk.c @@ -18,7 +18,7 @@ #include "stacks.h" // run_thread #include "std/disk.h" // DISK_RET_SUCCESS #include "string.h" // memset -#include "util.h" // usleep +#include "util.h" // usleep, bootprio_find_pci_device, is_bootprio_strict #include "virtio-pci.h" #include "virtio-ring.h" #include "virtio-blk.h" @@ -196,6 +196,8 @@ fail: void virtio_blk_setup(void) { + u8 skip_nonbootable =3D is_bootprio_strict(); + ASSERT32FLAT(); if (! CONFIG_VIRTIO_BLK) return; @@ -208,6 +210,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) < 0) { + 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..a27bdc1 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -18,7 +18,7 @@ #include "stacks.h" // run_thread #include "std/disk.h" // DISK_RET_SUCCESS #include "string.h" // memset -#include "util.h" // usleep +#include "util.h" // usleep, bootprio_find_pci_device, is_bootprio_strict #include "virtio-pci.h" #include "virtio-ring.h" #include "virtio-scsi.h" @@ -205,6 +205,8 @@ fail: void virtio_scsi_setup(void) { + u8 skip_nonbootable =3D is_bootprio_strict(); + ASSERT32FLAT(); if (! CONFIG_VIRTIO_SCSI) return; @@ -217,6 +219,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) < 0) { + 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