From nobody Sun Nov 24 13:56:34 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=1723531141; cv=none; d=zohomail.com; s=zohoarc; b=L29mOBgEuC9+Z2Ls5bhhoxiLc3yhV2sJPM+S+gItUWXOb4rwxBY/cER6UAnBBZBDyv6BmZKXGo+umvUVYk6l1YZVNnVy2qW8Y/9ySvUYS11NzC409Ni1+oqItY+tpHvi7QkHeuO+NnrU+40ifzMY5ZXMDMRFiCJ7oBriFoA4W5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723531141; 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=vA26nEU65dtwvWJQIJNPD+i6nbzwt/Hl37bWV6eE0XI=; b=YDaqgMHzS3SnelSIGEm5MUnCgsktMVQIaFwO06yV4tGnskc8hajQm4fqjupJoJIs/8TRuvsyQ0x/7rPaHe6ew+tXjprGX4AkcrsPYcgjbN7w4avAj2TzqsG8BnbN81/VIoELWGAALF5mxKc+nE8x7o3WOy014IHhW54zhUJIayI= 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 1723531141538272.4792960481965; Mon, 12 Aug 2024 23:39:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdl9y-0006e1-JK; Tue, 13 Aug 2024 02:37:34 -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 1sdl9w-0006Ts-2d for qemu-devel@nongnu.org; Tue, 13 Aug 2024 02:37:32 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdl9t-0006Qh-Fv for qemu-devel@nongnu.org; Tue, 13 Aug 2024 02:37:30 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1ff67158052so32851905ad.0 for ; Mon, 12 Aug 2024 23:37:29 -0700 (PDT) Received: from localhost ([157.82.202.230]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-201cd1a9215sm6609885ad.153.2024.08.12.23.37.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Aug 2024 23:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1723531048; x=1724135848; 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=vA26nEU65dtwvWJQIJNPD+i6nbzwt/Hl37bWV6eE0XI=; b=O/Nd1IcrHMkzaYNfjMjaqsSps+7yBjK+7igfeNnCQwl8IbzisIhQgcRYRYuj6cp2el ETjXD7mbox1JDgTqRpsg93VYSV6UbVDQcBRp1yERKDKXaZYes536NdoSoygVfFnow9H8 TwGiP50fD0EI9Xwbu+HhkFu+ZU5kB8fJWoidZ+C2dpACUabvpmfZSZO9Dw4i04953RHn 5aRGb7bOCc6AgT9OR6ZZA5CT5eAI1c8wfgqQj8kiVgnoxO68jcTKZvPj4cm7RuU0FRLt gEosAgG1bn2gqaoBLa8bNJpCLmcyw+5Y1ZYlR6oUT55tOnAH2cRlXuoD3bmvoaIhXr1Z 9LDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723531048; x=1724135848; 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=vA26nEU65dtwvWJQIJNPD+i6nbzwt/Hl37bWV6eE0XI=; b=Ow+jkNkwPX1PyKZHguziaq4OzX4Zke1w/K935gtbXHux8gADQj7N17DcUOsyNWzy7A oQQGGTsso269PvZ2OrTjLme2Xr5pRa444qwr3qxhh/EXFOTqG4KQVU+HKCYyScmWaYFw Gd+3BIPHHLWee9u88UzYY5PbGorzZpQqsV3Bs8/PBdKMz9NhOgl8VhTvFEktTf/hvmFF GwG9sDE1YY0U3sTyuVpVLVPUPPHE4tFYdQtVIRHwrTQVP2X+9ZKNG8/1ZJ6RGQOObst/ NDwHu0zEXnV3cttgtsUBn1BJ4OmEhyOEkN4/ig2BblFSxjW7Eiok3Fz1X69rV847jMvR 3M5g== X-Gm-Message-State: AOJu0Yz3s16Om3MJ2BjFn/0MA0M7X14+NwHxXbPbWZJVk23TG2/CjqzX OOP44Fl9YlVgMCSbXmy4sG1sV7+tj608wkaC/jDC1WIBkiDL0K97KmR5fcvc0yM= X-Google-Smtp-Source: AGHT+IF3zbsteBl/roY0i9ig54NZa83VT030hPoJA9+VEYyaQhCYX8aLn34bWM95k6bRMMAxt3QTdw== X-Received: by 2002:a17:902:f651:b0:1fc:4763:445c with SMTP id d9443c01a7336-201ca175c46mr29679955ad.32.1723531048182; Mon, 12 Aug 2024 23:37:28 -0700 (PDT) From: Akihiko Odaki Date: Tue, 13 Aug 2024 15:37:03 +0900 Subject: [PATCH for-9.2 v7 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: <20240813-sriov-v7-4-8515e3774df7@daynix.com> References: <20240813-sriov-v7-0-8515e3774df7@daynix.com> In-Reply-To: <20240813-sriov-v7-0-8515e3774df7@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::632; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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: 1723531142319116600 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 e1b4ecf79ff9..2daea6ecdb6a 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.46.0