From nobody Sun Nov 24 19:34:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1721020840; cv=none; d=zohomail.com; s=zohoarc; b=akdq6eTy9O/RLi99K08BqlzdHLskmemO9qY6uZyRSokBaJLdRskXrUG0+LFOY12+TYVGpCE5lB9JOcZuF+vsDks7Wl+7Ttt5PPKpBHnWUdqOMc/1Q0+0z6rDtpD2Ev4BOGxN9bH9a5jOIGYvk77xcA5HhjOR9g7CUZi8YjdC3Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721020840; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kPbp030IzWtL72MPt2loFrgmtqrQcgrAaOwGHqsGR/E=; b=UfbenrzkNHh6x54xGlIu9kCGxhY8WPvdQDXKW/rOsR7awwXEGNUpl/sB0NI6S8fwC37pgQt9w5yV8OZaZ7glpoLkmAnYsDr7MpiNZvLah7UHR/qOIJfQA3Ws7v33tZeiRSnJGxL2Y2DYGQjxtKOcyaiXWKXBZi62x9pETtIxWgI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721020840684884.5069849165837; Sun, 14 Jul 2024 22:20:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTE86-0008G0-9l; Mon, 15 Jul 2024 01:20:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTE7z-0008DH-MC for qemu-devel@nongnu.org; Mon, 15 Jul 2024 01:20:00 -0400 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTE7w-0007Qd-Lg for qemu-devel@nongnu.org; Mon, 15 Jul 2024 01:19:59 -0400 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e026a2238d8so3673879276.0 for ; Sun, 14 Jul 2024 22:19:44 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-78e34d2c4edsm2656912a12.49.2024.07.14.22.19.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Jul 2024 22:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1721020783; x=1721625583; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kPbp030IzWtL72MPt2loFrgmtqrQcgrAaOwGHqsGR/E=; b=VEJteOypy3zMmF83N2dKEplvaOb5Zx3sfUtkjE5VZbrR4fvhJ20vcv93t2k53isbt7 h7bwsehTqegWoW7d3nBm1tqWtZLftZYxC+D82Yi8SRYxunvo7Z2hXD8HJmcY5cERizEi 3jeTGqEYHk3jtEl3trZYgi025hNiZ3cePmR0zG09gfe2T49KoAiCaosH2RxWAv/eA5t2 GbSagMV3+VdKSN1mj+ew57cQIiuMdL2MbZCdxR3riqVGH6v5IA2+MBv0Wv7pBmaZ1iIj pnZnmZl+VoLAKB8TOrV0s15VwTo2if9flwE8mxN7x3Rsr+x29eMEs4h6uPKLMpGFR8lA tpzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721020783; x=1721625583; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kPbp030IzWtL72MPt2loFrgmtqrQcgrAaOwGHqsGR/E=; b=uykd8rmwuN5svvg+u5TVc3noTZGB/zf1oqYFSj9owEEM6M7+prN+ApdegKlRLx8s2H kIi/Li1eaLZNTa7k5y4uZ/oJuUGNJ9Wp7jBag/xwarG2bbvSpsIMIiapqFhzOh+fPhCK Ntpsc69EWjRyCzzrPNG7Qi10aFqUmw6/+32Q6l2mQW1jQh32C1bjVSANwF8bMgSDO4ZI DjnjSSxbEtgZSOb0qoBIKPrFYBMEbOZI70qHSzLsp/P8Tltj7Dfv9fWcFrC5y91Me0jo Q8t4mgS4wrv+AYe3X8pDu2DpNXWisl0bNbFZT3qFlgSBnwCSkQJTFLe01k7c2T7r1Wnl uqMA== X-Gm-Message-State: AOJu0YzwAPb8nH9F9tFQjK9j7Ye4UePLEXZLrtkknhgb7YitpSd9Sa9h GEUBL/cEo0477TrWHD+b+ww20TmqiAfuPn3v+Pb+gXh7KmS/goVbtx+LU4bf5I8= X-Google-Smtp-Source: AGHT+IGHXfcBxvdInsneKiUR+e5sjfrNXmNmtZydJVSeJK4EZmxi2MMNUc4i6EeXIUCD9znliGOMyA== X-Received: by 2002:a5b:601:0:b0:dfa:4d12:7ee0 with SMTP id 3f1490d57ef6-e041b12b51emr20929361276.49.1721020783219; Sun, 14 Jul 2024 22:19:43 -0700 (PDT) From: Akihiko Odaki Date: Mon, 15 Jul 2024 14:19:07 +0900 Subject: [PATCH v5 1/8] hw/pci: Do not add ROM BAR for SR-IOV VF MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240715-sriov-v5-1-3f5539093ffc@daynix.com> References: <20240715-sriov-v5-0-3f5539093ffc@daynix.com> In-Reply-To: <20240715-sriov-v5-0-3f5539093ffc@daynix.com> To: "Michael S. Tsirkin" , Marcel Apfelbaum , Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Jason Wang , Sriram Yagnaraman , Keith Busch , Klaus Jensen Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yui Washizu , Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::b36; envelope-from=akihiko.odaki@daynix.com; helo=mail-yb1-xb36.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1721020842323116600 A SR-IOV VF cannot have a ROM BAR. Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index ca8fb5383765..497a057b79f9 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2412,6 +2412,14 @@ static void pci_add_option_rom(PCIDevice *pdev, bool= is_default_rom, return; } =20 + if (pci_is_vf(pdev)) { + if (pdev->rom_bar =3D=3D ON_OFF_AUTO_ON) { + error_setg(errp, "ROM BAR cannot be enabled for SR-IOV VF"); + } + + return; + } + if (load_file || pdev->romsize =3D=3D UINT32_MAX) { path =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, pdev->romfile); if (path =3D=3D NULL) { --=20 2.45.2