From nobody Thu Mar 28 13:06:37 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=1578417590; cv=none; d=zohomail.com; s=zohoarc; b=L0KiD9LBSEjb1WdNLNJroR1flAZpFH2EBXvGviqvkdJas15pyIY60USIBxqBJrGzsYT19Ks3sKlZ55t5HOFbrVpFmwn5xePb5NvvGYCOgazLEeOY4dFZoZxGG2rN17v1QihZbSUd7pfjjdqFpo8wcoDn1X/R9GlbSaGHOjOcIZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578417590; 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=Vk2BMjgmSTlqcbnJfK/MoHR9fIJxDBfbNQzpG4HDzq8=; b=m/dIalp2LnCK5pspM89TiuMHhkdPZ8E6mVCqzfjUmpFIJxB6mqBi1Pzk7HaC9UNQthlClH2p/AT9apCSYy5Fr2aJVZFprr3nFWA9+/AfsSWX4FHk9cq2s4a462MvZRZb3SUyUYSP2cjKJyS+SK2vzHtcq30rmT707EXjPd6tE+8= 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 1578417589934624.008817159727; Tue, 7 Jan 2020 09:19:49 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 196D938585; Tue, 7 Jan 2020 17:19:45 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 8EA2138584 for ; Tue, 7 Jan 2020 17:19:32 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 8ABF32E142F; Tue, 7 Jan 2020 20:19:31 +0300 (MSK) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mxbackcorp2j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id xVLaN7lzSp-JVP0NXRr; Tue, 07 Jan 2020 20:19:31 +0300 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id FEjVOum9ph-JVVGVruO; Tue, 07 Jan 2020 20:19:31 +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=1578417571; bh=oH3pwNbZ3eTq24q3mJdKXx0obhzvaPnqM/0PpmIFY24=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=jc9KdYfAnFMWoIsJ+ItB+x6Dlz3sw1R6uSaGVjDCNGPGLtYd24grRmir3edv0wbNY h4PmuxvqVUQFgEmPiVzZiKhWuAH1Zh5BgyiM/y0021thnREzBrbE9LWos1Ygd8TDYC LFtEkYQ9g1MkxYnPgzy/n1/YKK8FXUMImRtebVrk= From: Alexey Kirillov To: Gerd Hoffmann , seabios@seabios.org Date: Tue, 7 Jan 2020 20:19:16 +0300 Message-Id: <20200107171917.7535-2-lekiravi@yandex-team.ru> In-Reply-To: <20200107171917.7535-1-lekiravi@yandex-team.ru> References: <20200107171917.7535-1-lekiravi@yandex-team.ru> Message-ID-Hash: YVX77ZWPCG3QC7QYZCUDSDGAHUB7MRLE X-Message-ID-Hash: YVX77ZWPCG3QC7QYZCUDSDGAHUB7MRLE 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 v3 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 X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org 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..5182ab4 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(void) +{ + 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..d96db78 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(void); 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 Thu Mar 28 13:06:37 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=1578417601; cv=none; d=zohomail.com; s=zohoarc; b=I3ow88x8FeX6Af0D7WqTX1AoC7io2M27HorhnQ6H2ZTxXQGP4XhpXvT64f5uE0ffMxRnJBgcq8xauQXH14CCqckWg3OHaCqTKWDs2QfVfL/MYadBza+78Z3iWykibIaA4BKg7GUeP4HPRVSLqk3V1OjLZJcVVIk5gRlePjFXe6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578417601; 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=TykF+H5ktzkeYF7UoEJobj5xTl9v/9jqNfFTO2soGni7c960oGiCiIcHEDvjCng6fsgI6LV4XDH3NXlgDL2z83PPXd2QzrVnZOtFninp8egvkZz8z9lSQQpDnfgwXmlKd06EAyJvRqCuXKXbo6Lst1yKHeGuUN6dM52J9vh+xDU= 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 1578417601513629.4168479995183; Tue, 7 Jan 2020 09:20:01 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 2EE403862D; Tue, 7 Jan 2020 17:19:58 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id D921838584 for ; Tue, 7 Jan 2020 17:19:33 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 669A22E1478; Tue, 7 Jan 2020 20:19:33 +0300 (MSK) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mxbackcorp1j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id F4TvBkbkX3-JXxOGgqd; Tue, 07 Jan 2020 20:19:33 +0300 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id FEjVOum9ph-JXVGvSG2; Tue, 07 Jan 2020 20:19:33 +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=1578417573; bh=fbZ+7QCVJZBCzVFXPu2tQfdJISs7tJiZ1y4UOmT6mqA=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=t0zTIDfx5r5g4bv9bSUDFPyiq9Hs6Ot5VGWx6YkwMSVT/uMPtHrNdW10Aesl96TcC NM72QAzroYQoIJ3aw07/EEtWqmVScpdzR3taZyooqUBxst91gYGZVeYY+dJpik43Dp vfIjTTE5ohPt9qm9TmXumERGXEir2TOO4gF3a5qQ= From: Alexey Kirillov To: Gerd Hoffmann , seabios@seabios.org Date: Tue, 7 Jan 2020 20:19:17 +0300 Message-Id: <20200107171917.7535-3-lekiravi@yandex-team.ru> In-Reply-To: <20200107171917.7535-1-lekiravi@yandex-team.ru> References: <20200107171917.7535-1-lekiravi@yandex-team.ru> Message-ID-Hash: Z7R36TZMPLPMWHKBBWCDNUKNQGLUAVTL X-Message-ID-Hash: Z7R36TZMPLPMWHKBBWCDNUKNQGLUAVTL 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 v3 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 X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org 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