From nobody Sun Nov 24 15:43:04 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=1722581504; cv=none; d=zohomail.com; s=zohoarc; b=OSAprLvSBl6ffnFg3YW1r8yssUrap7LqqyxZO/gojqlcsTbCiKbXZdif6q2eL7OisBfPZxBSn+8KHv5/ETXsOlgkx+ZcdxZpCPxcre8BS2CwDJhynaR714EGKEcXNu88yQrqbiBMyWYuz+PQ5qLsN6+kHNE2wkeP1hpkoGCmtw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722581504; 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=eIrCsb1ntTQZ4u2QiCIc/D2bj4QGskaeiB3kw7Zorrg=; b=cF9Utvz+0mF1if5iu4GSjlmTStuustfJ2q8hd7YT85UIieZD+megSKQU+kmRSFELncj63MdxCL0jfiszwjeA3T++0QvnDCY0QHNRUDa/dBuHcad85XODoAH0l032hTvKPZDLBhK7J9JJflwDyB9zMkfAT7iNzDtpzm0/OjfN4j8= 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 1722581504631387.2117042368799; Thu, 1 Aug 2024 23:51:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZm7d-0001fn-RA; Fri, 02 Aug 2024 02:50:41 -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 1sZm7c-0001Zi-JJ for qemu-devel@nongnu.org; Fri, 02 Aug 2024 02:50:40 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZm7b-0000x1-5M for qemu-devel@nongnu.org; Fri, 02 Aug 2024 02:50:40 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7a2123e9ad5so1988952a12.1 for ; Thu, 01 Aug 2024 23:50:38 -0700 (PDT) Received: from localhost ([157.82.201.15]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-7b830f296d4sm99471a12.68.2024.08.01.23.50.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Aug 2024 23:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1722581438; x=1723186238; 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=eIrCsb1ntTQZ4u2QiCIc/D2bj4QGskaeiB3kw7Zorrg=; b=wrIJkb77fV18QDf5DtFAoE8uznHpY3dOyWm12Zkx2c455DTeSzvj9f+A1eEIyDQCzC gsmSC5DAznkvbIP1GaQh2s5/UHkCW0GTVv7DxvJHKBnNuhns0AEjiCkVBjowL/fvv2Jf C0wqwBgk45YARvEe6pijBx1RTwI0vs9LkRrx2eOzTTWOjpb+8oFQdUZL/dYXVqny1N9W m0qivEpKS7HWAjKccQNHVs5vAYsaZjX4LLwlXYLR2t7VJYy5h9/KY3WmMQpDHD+rrdjE TlVM4Xw95+qLti5yqEcim2+eTc9M997Y079BEQVAWGijSbUXVgT6Mp6PGoTfbCAu01Dk hwYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722581438; x=1723186238; 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=eIrCsb1ntTQZ4u2QiCIc/D2bj4QGskaeiB3kw7Zorrg=; b=UNdEKUE9Q22ZBnZzF7Aq+rAz5dVeYooCNvSxyqXMvobImoskm+Sx+KGoj/Heq82YBL LCBGyTexztylhc7YubFDetSJ25KprqKVqtmpbe8XmWhEINiv9IXXHGyEgAIigflaPneT Kq7VadFDlsAYu73LAc7L+LPnCGkNIm6lUlhiqrkhNy3SBLaeIyyZlgU3vT4GVypF/rXA tiLpkgr6XskMAX9bKNgm1dkAvmAHcy5hE9vmVvygzG5B/m5YjMNNFf0EyDIZFTq9uTnn OvBXlTZG51unG9p1CHjadT8XFWqNk5wkfQuGR+SWwA97kHUEBEzgfg8IqL0mkZ007nkP MAHw== X-Gm-Message-State: AOJu0Yw1SJFQ1p0mL0T1V1mvkxyF20ZgfawSYCJOPlpTczrmUGEeS9Ci MhmwdKtPtuifmDEUoJfxxeRz21VIP17bbo5EgKS+USGDrATPJ4Et6/Cpr+JzcPA= X-Google-Smtp-Source: AGHT+IEft9ZxxwTiurDIjItlQ1rzd+ViC1S7qUUBS0dXQB1N27yx6aJgikarHd3qTbPwcMKLTK6/mw== X-Received: by 2002:a05:6a21:32a4:b0:1c0:f09c:1b98 with SMTP id adf61e73a8af0-1c69434da17mr6864668637.16.1722581437947; Thu, 01 Aug 2024 23:50:37 -0700 (PDT) From: Akihiko Odaki Date: Fri, 02 Aug 2024 15:49:48 +0900 Subject: [PATCH for-9.2 v6 4/9] pcie_sriov: Check PCI Express for SR-IOV PF MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240802-sriov-v6-4-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::52a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52a.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: 1722581506092116600 SR-IOV requires PCI Express. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index ec8fc0757b92..3af0cc7d560a 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -42,6 +42,11 @@ bool pcie_sriov_pf_init(PCIDevice *dev, uint16_t offset, uint8_t *cfg =3D dev->config + offset; uint8_t *wmask; =20 + if (!pci_is_express(dev)) { + error_setg(errp, "PCI Express is required for SR-IOV PF"); + return false; + } + if (pci_is_vf(dev)) { error_setg(errp, "a device cannot be a SR-IOV PF and a VF at the s= ame time"); return false; --=20 2.45.2