From nobody Wed May 8 13:54:26 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=1577700497; cv=none; d=zohomail.com; s=zohoarc; b=dpt9CzkexruyCe1gEXDXrnb6/sUnrm2Zg7vucscaV76/I8vsu/Ts4X+giPlJZvDqlgj0YqHwH5tsa/667T5L0JXxXSpapg2a85LHdkUhanBivw6UaO4uRd52GUq76umZ/bcLDiOt88bmS8WmxZcnuybWEOVpAcaHazwp6JxcHNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577700497; 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=jq/8hfz3GKdn9dsPYsvQAWmjbkrVxeMI9GJwoRmLi7o=; b=IhJPjhvYBPoTrzIKBChb/By32SJyraRQzVuDkfwORbX3T0WFxfV8apgHBs6UEMU9wB8d1IKNCVeCRTDfQkeWNDkRINWW9UVpZEgTpG7ZOSmZlACmrKU/FbpHgAS0ZV/Ee6D53dTYwmy5VZ4AU3RRalFDbzhdjoAFMqJ5xTxEHFs= 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 157770049713933.89491305792785; Mon, 30 Dec 2019 02:08:17 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 47C8420A03; Mon, 30 Dec 2019 10:08:13 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 42577215E2 for ; Mon, 30 Dec 2019 10:07:53 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id 3FB5C2E0DE3; Mon, 30 Dec 2019 13:07:52 +0300 (MSK) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mxbackcorp2j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id vzGMf2SzAB-7pPGUUs3; Mon, 30 Dec 2019 13:07:52 +0300 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by sas1-9998cec34266.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id SXOS8RIe1i-7pV0vXiq; Mon, 30 Dec 2019 13:07:51 +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=1577700472; bh=fsI6DwBkxuX/a3LAtPvC9MzN3OZJlwm1d7HT9108N1c=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=xCTJUxjBBETaNoQddMAzvUYf1t4y5hdaR6iwX8JrQFXzHu0z9DYsITppIusmjxZVP jfba+0LUWBbgCCjA9mFPIsxreegdABa3BbzAD6GLCDQlwFfc529DNlsI8MMsPugzUU emNfWAQkEU2yrIcLRLcsL2M+UBx7ba28bj5BOPp8= From: Alexey Kirillov To: Gerd Hoffmann , seabios@seabios.org Date: Mon, 30 Dec 2019 13:07:37 +0300 Message-Id: <20191230100738.6797-2-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: Z67JB5IRTFLXFMT42VYWGJCIFCQI4H6T X-Message-ID-Hash: Z67JB5IRTFLXFMT42VYWGJCIFCQI4H6T 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 1/2] boot: Detect strict boot order (HALT record) in function 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" Introduce is_bootprio_strict(). We will reuse this function in the next commit. Signed-off-by: Alexey Kirillov --- src/boot.c | 5 +++++ src/util.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/boot.c b/src/boot.c index ea18194..e9b2cd0 100644 --- a/src/boot.c +++ b/src/boot.c @@ -295,6 +295,11 @@ find_prio(const char *glob) return -1; } =20 +u8 is_bootprio_strict() +{ + return find_prio("HALT") >=3D 0; +} + int bootprio_find_pci_device(struct pci_device *pci) { if (CONFIG_CSM) diff --git a/src/util.h b/src/util.h index b173fa8..566883c 100644 --- a/src/util.h +++ b/src/util.h @@ -27,6 +27,7 @@ void boot_add_cd(struct drive_s *drive_g, const char *des= c, int prio); void boot_add_cbfs(void *data, const char *desc, int prio); void interactive_bootmenu(void); void bcv_prepboot(void); +u8 is_bootprio_strict(); struct pci_device; int bootprio_find_pci_device(struct pci_device *pci); int bootprio_find_scsi_device(struct pci_device *pci, int target, int lun); --=20 2.17.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Wed May 8 13:54:26 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