From nobody Fri Apr 4 21:32:32 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=1741933006; cv=none; d=zohomail.com; s=zohoarc; b=QgWsicqtX4aGzS6J9SCMQjqg4Ud0iwtkNk/nWP83vUTWsGwDdslbsECpcVswjF9Fy3rgFcTvxUYRSTCD9Tx7N++To+G9o1b+3VKQdoR9SXYHZt/PhBM9cYvqOq20LdPZ4LCs+70Pln5XIVXzEp6/Xy/fi8TB+Veno4viEKAGD0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741933006; 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=yCDjOO/ynZyfiOssUp+ZtbkI9iAK3kJTcWDHc04ncl0=; b=Lh2AJHatgsPXndw9H/5dmvcbAnr3WEc+QLSQmnwBiuo5F71gWPLxJMCcEK2JfaroFp54wqR0OD1bpD848FeY7VqzX+n+BneZHl8WNn9zt2++1pqMcgEmZYmHD4EdFh89dj5M45CYbm1HHvb6dy9RLYWm3BO6L3kXxTI722tbQGs= 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 1741933006541645.7821704702526; Thu, 13 Mar 2025 23:16:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tsyL5-000553-PZ; Fri, 14 Mar 2025 02:16:11 -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 1tsyKQ-0004Si-2O for qemu-devel@nongnu.org; Fri, 14 Mar 2025 02:15:32 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tsyKN-0005OB-Ue for qemu-devel@nongnu.org; Fri, 14 Mar 2025 02:15:29 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-22403cbb47fso34150825ad.0 for ; Thu, 13 Mar 2025 23:15:25 -0700 (PDT) Received: from localhost ([157.82.205.237]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-7371167d764sm2398912b3a.98.2025.03.13.23.15.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Mar 2025 23:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1741932925; x=1742537725; 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=yCDjOO/ynZyfiOssUp+ZtbkI9iAK3kJTcWDHc04ncl0=; b=aUCNg8iRbZ7OmSYp6XDBoQAAl+fG2MSyAN9MjSRss20wOYdi8BJCrmD1M8nFuu67fZ CILA6062P8i1Vfwb758oHkwsFM88/dvHwDeCGUKYGH7rty2q4cCDssXAl6xXsEXbcOGF mKxbS46cYdGDUCnR0veqqUcTqIHRFpA+gH+56sFN2TIeG3oxlgiV7GYPhT7CkuKP7Ttr o9Ldlh4TB7uzU/rgCgw15HHRDStvlG+w9MgurT6eI8eJYPkOmPJ61DBvocubrO1sdPXa aC60C9YKJso8jF9rjFkpJ6EeBAt0a8ssIqeI6KDsu/IH+aBp/HjVypI9bt0JoHQ55dhJ j7Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741932925; x=1742537725; 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=yCDjOO/ynZyfiOssUp+ZtbkI9iAK3kJTcWDHc04ncl0=; b=rJRtX3YPfo0wEMoq/CLZ/r06nc5XuymgrBDSRu0trht5tm55rh8z13xgQmg7bULHD3 XafVZkHqkpEgxz4wwOt/2192/omxuQCm+5xFrOxDLACMnM+QAWEkSLNC7AmyDQN29lEf a2obv1mM+2TT+89bgWuy8oguETwFMKg8QAuSLG/Xbn8a4SJMk21pHy9hnelc9QKmFvRB P5QKIAUlLihXiGV1/osSXhjGFugbiAHmEr6Po6sqKfED+yg+qJSqIC/AZ86mtkUEQL1g HLWudk+ZJeuUiivqfEX1WrBBIDyHyYGHkQMi5oApJuKpA37lVhcj7QamC2eBABLSD2Ze DKMw== X-Gm-Message-State: AOJu0YyPyzwrHUGloq6Sp21jtoshhlq9VYfSvflqg7/Tu1sEoEL0CEXP ZfalkLIZ1VtFhZOX6iyI3IWa7jrZlbmJI8iIZ/fW8VSDTEu16XDiXPS/QAZbtMHtoC6YaVLv3Nd AyTY= X-Gm-Gg: ASbGncsqhnaVe0G4AI4JNZYlhvUOojPoyrVYj5IwZfGqdI6kyQthEr3QGnXtAxTXlxK pFslApTTo0+zGBTMyaud3unbNot9F5B5pkmu9HvEMEusGmUGWY0hllXm8pHEPCRtmnVqI9+wvZ1 9Kp1A75UywVYi+QArDLDMt9HrWtimNt9yt6s6TSSYCMzTVttFXjHPk4dF0EOayxjQ4uUjUVxLPw ZH/F4zvGLf/NvCq/KDLMdtD4zL1erUktFPNmcJfTz3HPMWA/8VW4XftTP0JgCpOWkgPqByyhniI XDOYgg2pEyYYReFvyXMK2ww4fotBbpkLQ1XG475ezV/hZPCFN/5Fc7SEpEQ= X-Google-Smtp-Source: AGHT+IGek+mzx/grqWHgVMop1t6poUGkkk4XgknPycNrFOntZA1E1wpES5gT8YuoqPYb1llZfbc1tg== X-Received: by 2002:a05:6a00:1411:b0:736:4b6d:82dd with SMTP id d2e1a72fcca58-7372233494dmr1271761b3a.2.1741932925002; Thu, 13 Mar 2025 23:15:25 -0700 (PDT) From: Akihiko Odaki Date: Fri, 14 Mar 2025 15:14:53 +0900 Subject: [PATCH for-10.1 v9 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: <20250314-sriov-v9-4-57dae8ae3ab5@daynix.com> References: <20250314-sriov-v9-0-57dae8ae3ab5@daynix.com> In-Reply-To: <20250314-sriov-v9-0-57dae8ae3ab5@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 , Pasha Tatashin Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, devel@daynix.com, Yui Washizu , Akihiko Odaki X-Mailer: b4 0.15-dev-edae6 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: pass client-ip=2607:f8b0:4864:20::636; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x636.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_PASS=-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: 1741933008170019100 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 109b2ebcccba..a5b546abe8bb 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.48.1