From nobody Fri Nov 14 09:20:17 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=pass (i=1 dmarc=pass fromdomain=nvidia.com); dmarc=pass(p=reject dis=none) header.from=nvidia.com ARC-Seal: i=2; a=rsa-sha256; t=1761908907; cv=pass; d=zohomail.com; s=zohoarc; b=O9A3NgXQexm0MiFki4EHuqbLoGUL/qEsm4vCQdNDCzCUOdWKxS46xMEKHlMkj11eGa5ZnUFyQEOBtkq72WLdNXz+lg81C+3jOkvZh2CE9mpmiuTS7w/o9wjjhD1zVcmD4fbPQABUhOiahbvQ0Op65XFGSNAsm+0anMMGc+4qGow= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761908907; 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=3xx7t1bIM6tzdozXR3/ut9c9HKLMHGPRjcrZna1gvaM=; b=Y8q1Jion08y0tZ+o5bjochQ5b538uhldIS3L6d3J3oh6p6rhkK0j9k3K0kBWyE7A5hFNWU7LMGjhoWjQB+mG61x2JjwQDeXs3filmk7DID940lUhLkR47ATZ8yDTFACNA6XKrtYYDmWikPXmJP5JKtvrnO4hsqt4j60HoXkP4qI= ARC-Authentication-Results: i=2; 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=pass (i=1 dmarc=pass fromdomain=nvidia.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761908907287200.99262435161927; Fri, 31 Oct 2025 04:08:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vEmmX-0006RV-Or; Fri, 31 Oct 2025 06:54:58 -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 1vEmm9-0004oJ-D2; Fri, 31 Oct 2025 06:54:37 -0400 Received: from mail-westusazlp170120002.outbound.protection.outlook.com ([2a01:111:f403:c001::2] helo=SJ2PR03CU001.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vEmm3-00031G-8f; Fri, 31 Oct 2025 06:54:32 -0400 Received: from MN2PR12CA0020.namprd12.prod.outlook.com (2603:10b6:208:a8::33) by CH2PR12MB4149.namprd12.prod.outlook.com (2603:10b6:610:7c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9253.19; Fri, 31 Oct 2025 10:54:17 +0000 Received: from BL02EPF0001A0FB.namprd03.prod.outlook.com (2603:10b6:208:a8:cafe::e1) by MN2PR12CA0020.outlook.office365.com (2603:10b6:208:a8::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9275.15 via Frontend Transport; Fri, 31 Oct 2025 10:54:21 +0000 Received: from mail.nvidia.com (216.228.117.161) by BL02EPF0001A0FB.mail.protection.outlook.com (10.167.242.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9275.10 via Frontend Transport; Fri, 31 Oct 2025 10:54:16 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Fri, 31 Oct 2025 03:54:07 -0700 Received: from NV-2Y5XW94.nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Fri, 31 Oct 2025 03:54:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vHJ5jObU8DgS4UK1ybfW9KYCwMS1aAZse6CvzdjU/1/vD4DcH3OBHNbFKAZg0oQEo+EoAIgtiRaFMuhs8/SbMaIBNb4wGPV/kOl2Ybx5Xrcp6MyFjPi/6BxK0mlKEUfUQEM0kVy2+2to7e+uTC2I9zlnW0zL22Qz3J3La+MMiJjIVugskewDnEQH2mzT7sPVDtcoM4pSfqwLmDT9ip61ZO1+xpcsHwLkzEQs6czi1+lOHwblYOaAyllp8lRlUMNSCZBvFXl04FRlyqGmkidCy9zwnFAoQ7L+2L3qT6w5JZvVeTsP8v0c3iGpqtye+NfP5JS1uK3IbbdXHKWi4QfejQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3xx7t1bIM6tzdozXR3/ut9c9HKLMHGPRjcrZna1gvaM=; b=zQQSLnPPXXcmnBCFcM7xNjKsuBZiR/aZ2jDx0a6G8XvGqsWuvG/B04bN+U38DObHdFCPy0l5+M5AcoaUdSzaCKD8zwMgjdOvoSL4pzz+ijjDDpnInXfB0MIWqfJMYA46KFhigFSrHbpgyC/pQjTCWLTyENo6fZs+oITxk+Y3ZpQ3p7kBftm3LaK9cFuwoSeyu0tP8LxB1Qv4VnK8bQUXmrIew8V7cLJH7fHaZuJnYwd5+T5edEJa55V6xtC8l6RHo+uFRDTEetYlaECNeEetdtiRxJym4MwJGkFgzhkf6Bpf2cx92px1iFhbrE9lKdmtZA8T1iQXJDXQZFlUCDe/Iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3xx7t1bIM6tzdozXR3/ut9c9HKLMHGPRjcrZna1gvaM=; b=WvK9wQw9c5tAKAP1hQENHREdt33hkRiB2pUbaulv6Q9SSrPNB/qQx/PIEwxG/LPCVzPU4+HfbSHN1LimoxTl8ZEa4ZXTuh9D2dAgDxlr837FBj12JM5wVN0FLj1VSgFWg9m7bALu1zRG5e6GksGkjoO7OI68pCRB3dB46S22AjCEKEZiPdFdCohiP92pYggtgcTEnCiCNDwMRQAaa9ILJR5sWFx1YhgPL/sCiWkHcGsEGBn6QAgAV1zPeN4FkPe1glNV2JGnm6rweNWCektk8WK4bdBXBwhhaQJhz1s0O9enyiE6VcmW1XqULBW5KZnONZSUHQsW2ALrLZicM2+TlQ== X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; 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 (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C From: Shameer Kolothum To: , CC: , , , , , , , , , , , , , , , Subject: [PATCH v5 20/32] hw/pci-host/gpex: Allow to generate preserve boot config DSM #5 Date: Fri, 31 Oct 2025 10:49:53 +0000 Message-ID: <20251031105005.24618-21-skolothumtho@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251031105005.24618-1-skolothumtho@nvidia.com> References: <20251031105005.24618-1-skolothumtho@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FB:EE_|CH2PR12MB4149:EE_ X-MS-Office365-Filtering-Correlation-Id: 35a271f2-9182-4ab8-3243-08de186bd649 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|7416014|1800799024|13003099007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YjhNSHdVYU1VR1Fkb3dEdldOTzlaMUpQMnV2UDBZNFovQUJRNnVla3dmUndG?= =?utf-8?B?Vld1c0xMbkRNSWFuemcrV1NPZnBoNzZKQzJhWHNJZWcyS29tTTMvblNsalFy?= =?utf-8?B?azc5ZDlJU1VjclowTU1uYVVUbnFabEoxM3d3QmZHeHJGeVpud2xJNjF4NjNh?= =?utf-8?B?a3NlN0IwdzY5a296a3FtV08zY1dlZHBWY2FjcWtITDJ1ZDZvbWliWXNEOWND?= =?utf-8?B?UnFZNjFqRzRwSzdUZTVqT1lXTGRxdWRlbWtLcmVkZTNqQUFIYUo0aXYxeTg1?= =?utf-8?B?SVB5Tm00R1hYaW8wTXd0d0VNTUZMK1haWTdQMndYS1hSblFQcGplZUtBTlJH?= =?utf-8?B?d2N6NUV0ai9pcVhVdHhKQUU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ANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(7416014)(1800799024)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2025 10:54:16.7083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35a271f2-9182-4ab8-3243-08de186bd649 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A0FB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4149 Received-SPF: permerror client-ip=2a01:111:f403:c001::2; envelope-from=skolothumtho@nvidia.com; helo=SJ2PR03CU001.outbound.protection.outlook.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_SPF_HELO=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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 @Nvidia.com) X-ZM-MESSAGEID: 1761908910661158500 From: Eric Auger Add a 'preserve_config' field in struct GPEXConfig and, if set, generate the _DSM function #5 for preserving PCI boot configurations. This will be used for SMMUv3 accel=3Don support in subsequent patch. When SMMUv3 acceleration (accel=3Don) is enabled, QEMU exposes IORT Reserved Memory Region (RMR) nodes to support MSI doorbell translations. As per the Arm IORT specification, using IORT RMRs mandates the presence of _DSM function #5 so that the OS retains the firmware-assigned PCI configuration. Hence, this patch adds conditional support for generating _DSM #5. According to the ACPI Specification, Revision 6.6, Section 9.1.1 - =E2=80=9C_DSM (Device Specific Method)=E2=80=9D, " If Function Index is zero, the return is a buffer containing one bit for each function index, starting with zero. Bit 0 indicates whether there is support for any functions other than function 0 for the specified UUID and Revision ID. If set to zero, no functions are supported (other than function zero) for the specified UUID and Revision ID. If set to one, at least one additional function is supported. For all other bits in the buffer, a bit is set to zero to indicate if that function index is not supported for the specific UUID and Revision ID. (For example, bit 1 set to 0 indicates that function index 1 is not supported for the specific UUID and Revision ID.) " Please refer PCI Firmware Specification, Revision 3.3, Section 4.6.5 =E2=80= =94 "_DSM for Preserving PCI Boot Configurations" for Function 5 of _DSM method. Also, while at it, move the byte_list declaration to the top of the function for clarity. At the moment, DSM generation is not yet enabled. The resulting AML when preserve_config=3Dtrue is: Method (_DSM, 4, NotSerialized) { If ((Arg0 =3D=3D ToUUID ("e5c937d0-3553-4d7a-9117-ea4d19c3434d"= ))) { If ((Arg2 =3D=3D Zero)) { Return (Buffer (One) { 0x21 }) } If ((Arg2 =3D=3D 0x05)) { Return (Zero) } } ... } Cc: Michael S. Tsirkin Signed-off-by: Eric Auger [Shameer: Removed possible duplicate _DSM creations] Signed-off-by: Shameer Kolothum Tested-by: Zhangfei Gao Signed-off-by: Shameer Kolothum Reviewed-by: Jonathan Cameron --- Previously, QEMU reverted an attempt to enable DSM #5 because it caused a regression, https://lore.kernel.org/all/20210724185234.GA2265457@roeck-us.net/. However, in this series, we enable it selectively, only when SMMUv3 is in accelerator mode. The devices involved in the earlier regression are not expected in accelerated SMMUv3 use cases. --- hw/pci-host/gpex-acpi.c | 29 +++++++++++++++++++++++------ include/hw/pci-host/gpex.h | 1 + 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index 4587baeb78..d9820f9b41 100644 --- a/hw/pci-host/gpex-acpi.c +++ b/hw/pci-host/gpex-acpi.c @@ -51,10 +51,11 @@ static void acpi_dsdt_add_pci_route_table(Aml *dev, uin= t32_t irq, } } =20 -static Aml *build_pci_host_bridge_dsm_method(void) +static Aml *build_pci_host_bridge_dsm_method(bool preserve_config) { Aml *method =3D aml_method("_DSM", 4, AML_NOTSERIALIZED); Aml *UUID, *ifctx, *ifctx1, *buf; + uint8_t byte_list[1] =3D {0}; =20 /* PCI Firmware Specification 3.0 * 4.6.1. _DSM for PCI Express Slot Information @@ -64,10 +65,23 @@ static Aml *build_pci_host_bridge_dsm_method(void) UUID =3D aml_touuid("E5C937D0-3553-4D7A-9117-EA4D19C3434D"); ifctx =3D aml_if(aml_equal(aml_arg(0), UUID)); ifctx1 =3D aml_if(aml_equal(aml_arg(2), aml_int(0))); - uint8_t byte_list[1] =3D {0}; + if (preserve_config) { + /* support functions other than 0, specifically function 5 */ + byte_list[0] =3D 0x21; + } buf =3D aml_buffer(1, byte_list); aml_append(ifctx1, aml_return(buf)); aml_append(ifctx, ifctx1); + if (preserve_config) { + Aml *ifctx2 =3D aml_if(aml_equal(aml_arg(2), aml_int(5))); + /* + * 0 - The operating system must not ignore the PCI configuration = that + * firmware has done at boot time. + */ + aml_append(ifctx2, aml_return(aml_int(0))); + aml_append(ifctx, ifctx2); + } + aml_append(method, ifctx); =20 byte_list[0] =3D 0; @@ -77,12 +91,13 @@ static Aml *build_pci_host_bridge_dsm_method(void) } =20 static void acpi_dsdt_add_host_bridge_methods(Aml *dev, - bool enable_native_pcie_hotp= lug) + bool enable_native_pcie_hotp= lug, + bool preserve_config) { /* Declare an _OSC (OS Control Handoff) method */ aml_append(dev, build_pci_host_bridge_osc_method(enable_native_pcie_hotplug= )); - aml_append(dev, build_pci_host_bridge_dsm_method()); + aml_append(dev, build_pci_host_bridge_dsm_method(preserve_config)); } =20 void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg) @@ -152,7 +167,8 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *= cfg) build_cxl_osc_method(dev); } else { /* pxb bridges do not have ACPI PCI Hot-plug enabled */ - acpi_dsdt_add_host_bridge_methods(dev, true); + acpi_dsdt_add_host_bridge_methods(dev, true, + cfg->preserve_config); } =20 aml_append(scope, dev); @@ -227,7 +243,8 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *= cfg) } aml_append(dev, aml_name_decl("_CRS", rbuf)); =20 - acpi_dsdt_add_host_bridge_methods(dev, cfg->pci_native_hotplug); + acpi_dsdt_add_host_bridge_methods(dev, cfg->pci_native_hotplug, + cfg->preserve_config); =20 Aml *dev_res0 =3D aml_device("%s", "RES0"); aml_append(dev_res0, aml_name_decl("_HID", aml_string("PNP0C02"))); diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index feaf827474..7eea16e728 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -46,6 +46,7 @@ struct GPEXConfig { int irq; PCIBus *bus; bool pci_native_hotplug; + bool preserve_config; }; =20 typedef struct GPEXIrq GPEXIrq; --=20 2.43.0