From nobody Mon Apr 7 15:48:50 2025 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=1702181249; cv=none; d=zohomail.com; s=zohoarc; b=PGedae8zWsiK+iBGiSG/w96iiFue+x9ePkE2sXtLgMCkfeMHQQ+qahY1Cw6GAI3UXdTINSMPv7WTxAnZCYi192hIlaYbU0bpI720ae4q5ZJsFQhqGKeB124lbJ0tJD8uBKokIPx75NFJvNPI4hIT4PRU6bcVb+3x8btcmYBOVvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702181249; 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=COhlOMuqAZTZiov08lDQfsiw4tBT53dAEaOcH/oormY=; b=XdwE7zQu7yxbPQ7iZEbbpb7NKMVcdO5Xphgw8ReoOszfDvdQivWieklLgnj8El8YHsPM4a65972Z9LAhBH98LDuGnU/qH3cz99zIu/WbMQ5LOwAEQmdy7zDulbsMgPTa2XX/Lo1lSDcfyDSogP9zVQmUPxO5hqeZsbY1EDnmdDw= 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 1702181249931764.2761709671868; Sat, 9 Dec 2023 20:07:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCB5o-0005Xz-Sf; Sat, 09 Dec 2023 23:07:00 -0500 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 1rCB5m-0005XS-FC for qemu-devel@nongnu.org; Sat, 09 Dec 2023 23:06:58 -0500 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCB5j-0005WI-TI for qemu-devel@nongnu.org; Sat, 09 Dec 2023 23:06:58 -0500 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-59067f03282so1847453eaf.0 for ; Sat, 09 Dec 2023 20:06:55 -0800 (PST) Received: from localhost ([157.82.205.15]) by smtp.gmail.com with UTF8SMTPSA id w4-20020aa78584000000b006ce5c583c89sm4062831pfn.15.2023.12.09.20.06.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Dec 2023 20:06:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1702181214; x=1702786014; 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=COhlOMuqAZTZiov08lDQfsiw4tBT53dAEaOcH/oormY=; b=SPH5imc04sPStnm9aOeclRhJjVJg//IONl5NUs3r+yEBZaoCyJz3+Zj14y+yBiISLf lrILJB8D3LX0tm1I/0wSytURSHvG3zMCs/fbyrykbtp1vZtKmqsAPtZacE0NzgI68hkq uNMmOWuJNZAgtaQyjmY2xmSkhUbfUvG2f5F3PuCNvNhRfwID0EroqVigwj2XFagO2Xr/ pz9sCoLc6hDcu2Mlm60iA1McByNjZaOhw0M8pZ0V1bpARkIqzVu9wNRGWb2PMxIW124z fprWdjKvmTCjE9Mbdj40UVef80Md6CkgnnW4Gi8YU8huxukgm5XJ+KAnbu/UhXK4smQA 7FdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702181214; x=1702786014; 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=COhlOMuqAZTZiov08lDQfsiw4tBT53dAEaOcH/oormY=; b=Xk7gZoXokVm9AZ+UZC/Vh//5uUPIYCaE2lMBXJi5uAquCUDU/nxRvHcR3gHDt3YFP7 D2s+78D8dWqMTtRX2wexuVrcOlHMD3qFwUcL0ATlabZpdUfirsUd3sU6xN6w1EAhB+B3 gp/j5xV4VDav/bSRCpK0F3N3ORw9l6CSm+zNO3FzHUh5f+Heaf4RikW/lYveuZ0M/YJ7 xmDtJbpcc33PHejWo1iI6/c8SDmLJsfwsIM3DT2hnDwAAn447UrsnzMjeKWCzGW3hIvz DPquAREEfo6pv3yVHnNI3ddkW4yTLea6GkL+KvRJyc/osZqlE8apkNtKMQhki29j30YX 35hg== X-Gm-Message-State: AOJu0Yx6tPyYDFsH8XCGJnvy4+IkI/8ewPkdgQ50JiGH99R/XNQ2Zh3A UABENJVkxBXRliKQGkcN7fLIXg== X-Google-Smtp-Source: AGHT+IGqHwL3efw/4tRWevbkqOfR3RA1NrZUQfu/QzJsk++6fLjQFXQ9v30al6iT7aK1c7IinDK8ug== X-Received: by 2002:a05:6358:cd15:b0:16e:29cf:33b3 with SMTP id gv21-20020a056358cd1500b0016e29cf33b3mr2615267rwb.30.1702181214199; Sat, 09 Dec 2023 20:06:54 -0800 (PST) From: Akihiko Odaki Date: Sun, 10 Dec 2023 13:05:52 +0900 Subject: [PATCH RFC v2 09/12] 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: <20231210-sriov-v2-9-b959e8a6dfaf@daynix.com> References: <20231210-sriov-v2-0-b959e8a6dfaf@daynix.com> In-Reply-To: <20231210-sriov-v2-0-b959e8a6dfaf@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.12.4 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::c36; envelope-from=akihiko.odaki@daynix.com; helo=mail-oo1-xc36.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: 1702181251516100001 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 160dfc84ec..8272916cf3 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -46,6 +46,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.43.0