From nobody Sun Nov 24 17:05:53 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=1722581525; cv=none; d=zohomail.com; s=zohoarc; b=j95VhwU1lPGSPrR4njSSYhzpnuABcvgehBZHiOoQKDB63kphItEofAtMzg42n/9tB9jes/Gm9Xn2Lm+pa48QMnadLGH86LYbCr05o+ma5m9y5Lynidqem30TZI0P8wqMonhs756NX/E2EFmqhbaPY9GWaQe0Z+R//1s8Q/6IFuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722581525; 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=p/xbyP1Am7mZb37ldbOaJNJuDRPmUAjsJzjuyi2y2fE=; b=foeA/6S0rsjN+6hk9SPRGTuosymsKgEF28fmxEtWcHwiseiCYq+KOB44T4lDqpV8TDhPFjG+AyMFBWwANfiiWbVr2Xz9NmjPxBfuLhd2PO3hvQRQ6K01FZ7Cqx69OYVlo5mSgJmbP8lDm1pJ73adLT35PWgDsn1nfn2o66RXK6c= 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 1722581525938864.1203318494977; Thu, 1 Aug 2024 23:52:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZm7P-0000gw-Hd; Fri, 02 Aug 2024 02:50:27 -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 1sZm7O-0000cT-DU for qemu-devel@nongnu.org; Fri, 02 Aug 2024 02:50:26 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZm7N-0000ux-0X for qemu-devel@nongnu.org; Fri, 02 Aug 2024 02:50:26 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1fd9e6189d5so63245215ad.3 for ; Thu, 01 Aug 2024 23:50:24 -0700 (PDT) Received: from localhost ([157.82.201.15]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1ff58f29f96sm9849195ad.1.2024.08.01.23.50.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Aug 2024 23:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1722581424; x=1723186224; 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=p/xbyP1Am7mZb37ldbOaJNJuDRPmUAjsJzjuyi2y2fE=; b=FrwFPgl66Z6pS1y5+q3LNUYtWsGaoUYHAktUklxR0edxdcpV4b09AYsBnvqbUFSwFc apC/pkEjfsPZhabYm8ao+AEfpImUqgB79dOM7fpRbA3xtiijsAuTIm0Hth2uSHOO2ath ZP2i3D/Mc8XSvSXoTneDP55fmnZGplm+iMTT9OL+z2HvpUtdkm2hS8kXFmWbhN8OYkkz GU10jNWeN5CMEZiMbc3pdnUxeVGL5Nmg/kRKfe16P6hIco67uPG7e4ds9nYowyhhkmEq P1RTo7/yLxA+KmANkrLs3c+HqhnoKsMznzPVNfQxlUDwuWqbEn5+hSIxyTWe19T0cm3A iE3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722581424; x=1723186224; 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=p/xbyP1Am7mZb37ldbOaJNJuDRPmUAjsJzjuyi2y2fE=; b=l9rH1z8pGgxLDBoUu4DJshYU+BJwB6W0Uu81KBamPsxg0ByAUpM7zu7pJ2O0+wwGMR 3Gwe5kp32kscdZfhOSU+F0/5GBeyiWMKu/XFUVH0iFDKvVf5ndOn3rjJrAMdJuImC9iE DHO4bUA+YF+cwI0h852rsHIcQmyi8jKMnxHcq9oUMkVDMgbpEdTvVlF9kWBFM0H2pMPq PJI9IinTNvW5oHdU5PtVazsu2QWTI67FxdNjgHZdGOsJP5qXjxKTZ6AJdL5rqwMQAAkt CF3QQDHOYk490+ckU5/KI2bsKXpVA8gPmxSxpbTDmKitBVdCbyvYnziVlvhvCjd57z2K kyWA== X-Gm-Message-State: AOJu0Yzl7djOFfv3FptDDAnfP6+JaJX2aTwTo159QKfgYBFTwW+ifRXB 8JrzO0KPHwZ24rfGtQ/wpEuOig5yENZ0pdAtFpqxtzs/VekH4S2yEVV3zhxGJw8= X-Google-Smtp-Source: AGHT+IF4K/OW5vEQiPX+KgI0NvYOBhps/u8u1mGGK7gKTtlJPt1SaQCaqpv/gG9LvXmg6hnZ+opmDQ== X-Received: by 2002:a17:902:ecd2:b0:1fd:64d2:62da with SMTP id d9443c01a7336-1ff572c4e13mr37040385ad.29.1722581423720; Thu, 01 Aug 2024 23:50:23 -0700 (PDT) From: Akihiko Odaki Date: Fri, 02 Aug 2024 15:49:45 +0900 Subject: [PATCH for-9.2 v6 1/9] 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: <20240802-sriov-v6-1-0c8ff49c4276@daynix.com> References: <20240802-sriov-v6-0-0c8ff49c4276@daynix.com> In-Reply-To: <20240802-sriov-v6-0-0c8ff49c4276@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::635; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x635.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: 1722581526335116600 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 d2eaf0c51dde..60b1747d60e6 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2359,6 +2359,14 @@ static void pci_add_option_rom(PCIDevice *pdev, bool= is_default_rom, return; } =20 + if (pci_is_vf(pdev)) { + if (pdev->rom_bar > 0) { + 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