From nobody Sun Nov 24 19:27:25 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=1721020875; cv=none; d=zohomail.com; s=zohoarc; b=j1kdXQY7bGmFR7pJPiboXXZCRFQPjkBCrxgBheiE9B4Z9h18V0mFASt1tjEcBnbG06x2h2nd02pDDb2m7PLy2Rf5FLB3W63j26whEScdFeNa2LDvSuzNz2/hFNYwG/HvKwGFwKM9eKhOEWKMzScknplknIO7IWcG5Yaw8zlf5EE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721020875; 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=G1AjyumaMsIp4M4ltlckfEdijTIz1ClMBjVQsAQZuSE2yVs05Kz0EJLRcDW/FgDb1ve/KvZXJoJ1YMBj95rDbPCivsV73cXq/pkXehYau8Xt6qARZg1uRXPb1fsdRoaEkzHU0Oon7J5tPznbgxsuk51q+hG/ajYoXV2N2B6PiEU= 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 1721020875067562.3081638440295; Sun, 14 Jul 2024 22:21:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTE88-0008Oe-Gi; Mon, 15 Jul 2024 01:20:13 -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 1sTE82-0008FB-UK for qemu-devel@nongnu.org; Mon, 15 Jul 2024 01:20:06 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTE80-0007Sg-SW for qemu-devel@nongnu.org; Mon, 15 Jul 2024 01:20:02 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7669d62b5bfso2226314a12.1 for ; Sun, 14 Jul 2024 22:20:00 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2cacd3e5a87sm5430253a91.14.2024.07.14.22.19.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Jul 2024 22:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1721020799; x=1721625599; 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=ncqbhm6eHRDzmRZflRXi7eqrkjbrD+Dl88qNh/oUrlWzjVVyyF3N1u1oiClj/K7SF8 q7yAm15R43pxUSfMukKWSvivYgBjs7trccqT25Pjex0OImxO7dZCdPOyHpjTh/SnC2pP 9YNmo0LI+71W0keNAZS7y3QMI8scdNxE6tYIXQp5HsPa6cl881mN1EkaMomv43cmY8PD mf4mVBkozz1G4K4lz5b86lecZXzb+/xSBduzB5EBhCanuTeNJP0HNpBCp4zVWxJkY94q ma53AT9IN/l74t/d8/SwA70IfBAFN1T/fI2COlbuTWj4nrx3GfAcpo2T3nhGZnIJ4KRj Lu/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721020799; x=1721625599; 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=HILa0o0v67vE0jxubSOQAwu6TFWUnoLvJLrxGh1HdQbTEzd3Cv3cwxXr28gnBDDE3n 4y6oTNReTBrlOaJKuYk+zdXQJZV9xs3FfSipuOzngZitkRzJdwSeUBaqsgQUd6ZLqrFk PoRZ+xQJVwG6cj/JpGqop4l3dYwAW/HMNNcpvXDGSlbF6Jb5fHv1pQTjXUi4H2DLSaSD YZU45zVfOCuerW5zFOBySeQEhzpFVzMcCQvAKB6fB9oNr8GkIrKXamu7Rahb/IXbvKVf 8UL+AAKa0ywN25sYlWeY4SOlfY8LQgK782YSlhxjh9LYb6KYDDCuNlarV+fc5XAAMPPu B4Hg== X-Gm-Message-State: AOJu0YxePa2s+C3w9c2M/XuNDC7dq7C6ajPrBjPhe6peSXMAraVVDfQN WH5vtnOpofAMbDyV7bUNEo5wB4L2pS8GxnCZ4M+d68TJ5j0QjtRzIZ96SsIw8dc= X-Google-Smtp-Source: AGHT+IFib7LEFM18p1VEiwK50F5jIM8zxzKC7ZaQb9YCDW0n1iSyWhpeQ8eQ4kfcat+6QasdswQ2zw== X-Received: by 2002:a05:6a20:7b2a:b0:1c2:8f07:579e with SMTP id adf61e73a8af0-1c2984d7835mr14019965637.52.1721020798928; Sun, 14 Jul 2024 22:19:58 -0700 (PDT) From: Akihiko Odaki Date: Mon, 15 Jul 2024 14:19:10 +0900 Subject: [PATCH v5 4/8] 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: <20240715-sriov-v5-4-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::52f; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52f.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=unavailable 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: 1721020876313116600 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