From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BC023939BA for ; Wed, 14 Jan 2026 15:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768404076; cv=none; b=qikvE2Dh+Ya9+EjHvcDcS6BP2DU/uSPeW7kSP6EsA8j3OWpJuj7Aax8XXnjFvoGpksxvNJdHgRQUvKbLOQcKo+Fntjt5voo0CXQ/MLVilxYtQecQo7EwJ3vZIRvzjQsa9ca9YE75Ui58TNlS51YcW6EhT9ZbmD3OLHLdBO/aPD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768404076; c=relaxed/simple; bh=EeEjZ2cLiQDmy17uYLRmZNhGOEhvFkx8Gp2/TDxeCy8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=llK9Vl9e+58Ej3t2prEVaxoqpdvXX7QVcLOfm+zHq/9JVtpkixb+zSgPKQJ+KezgolCGac2ltvLShP7f683iAYOUvcrQzTSRNdpf3UO3seC/Tc5/XBLwBXGhwrtIO6oEPwJYkxuMjLIcYW/Vf8jzGrD52Idv1fRQZ8/HABO4sE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GRNOpuCs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GRNOpuCs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D57B9C2BC9E for ; Wed, 14 Jan 2026 15:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768404074; bh=EeEjZ2cLiQDmy17uYLRmZNhGOEhvFkx8Gp2/TDxeCy8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GRNOpuCsmpq0A8zCa8W5IOALs62icnyX4Jl/oQUaTkS2hO5QVU2sDgSkJUDAYO7JF 3+g+cyb9eZRwBz9LpAAk7dP5OwmcbPcpa0dEjhPtqqQ56fU/Z0Q6sHDGVNkL9SE4gD GvXT2CZkHkdcRaujyV02VZrpl8UFLWFU7Bv2sk/OJjsz9CKro7Eu6El/LqvXWfbQZB rAsKjTncNz3c3Xj84RYZ8gCgZLPjXycMKdd7niEBQQS1xRSIvdIeKuWJnlotbDaBp7 D16x5WjGcBJ9szWHxP0ykiO/+P9pDKMeCS30SLP3HCIfdut9QrrFSifyu/2kw4MmQA y/vZg5R8hhOhw== Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-34c71f462d2so7217063a91.0 for ; Wed, 14 Jan 2026 07:21:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWxjlTHdOIF1WY5dNcVfdzD+peRYcBLap7qT3dft8Jl57lKttir1ToC3bUWVhyn9XvVetQcui1p9VJuk2c=@vger.kernel.org X-Gm-Message-State: AOJu0YwjP7tYZpLRHkJMF/i556njDiIv0IJnpdjSamo0LOp2MEdEJLY1 CRvYpsDrebUPkh42RfbTT+rsLNvMsDAjmZL4Q3jNFYO4shtD5+R+GG4gvsNYHvdUpQMpHExbBSL 9Sf7mSLW5oIFO3M/zBJ/4TaCOtmtd6Vc= X-Received: by 2002:a17:90b:38ce:b0:34c:904a:d92 with SMTP id 98e67ed59e1d1-3510913ccf0mr3199402a91.26.1768404074331; Wed, 14 Jan 2026 07:21:14 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260110114705.681676-1-rrichter@amd.com> <20260110114705.681676-11-rrichter@amd.com> In-Reply-To: From: Ard Biesheuvel Date: Wed, 14 Jan 2026 16:21:03 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: AZwV_QhE5x3u7M_MSiNN6vXntJPsoNGg-mpnp4GPlfV7TglKxwvzSf1QstpYyvY Message-ID: Subject: Re: [PATCH v9 10/13] cxl: Enable AMD Zen5 address translation using ACPI PRMT To: Robert Richter Cc: Peter Zijlstra , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn Content-Type: text/plain; charset="UTF-8" On Wed, 14 Jan 2026 at 15:00, Robert Richter wrote: > > On Wed, Jan 14, 2026 at 08:47:22AM +0100, Ard Biesheuvel wrote: > > (cc Peter) > > > > On Sat, 10 Jan 2026 at 12:46, Robert Richter wrote: > > > > > > Add AMD Zen5 support for address translation. > > > > > ... > > > Do the following to implement AMD Zen5 address translation: > > > > > > Introduce a new file core/atl.c to handle ACPI PRM specific address > > > translation code. Naming is loosely related to the kernel's AMD > > > Address Translation Library (CONFIG_AMD_ATL) but implementation does > > > not depend on it, nor it is vendor specific. Use Kbuild and Kconfig > > > options respectively to enable the code depending on architecture and > > > platform options. > > > > > > AMD Zen5 systems support the ACPI PRM CXL Address Translation firmware > > > call (see ACPI v6.5 Porting Guide, Address Translation - CXL DPA to > > > System Physical Address). Firmware enables the PRM handler if the > > > platform has address translation implemented. Check firmware and > > > kernel support of ACPI PRM using the specific GUID. On success enable > > > address translation by setting up the earlier introduced root port > > > callback, see function cxl_prm_setup_translation(). Setup is done in > > > cxl_setup_prm_address_translation(), it is the only function that > > > needs to be exported. For low level PRM firmware calls, use the ACPI > > > framework. > > > > > > > Does the PRM service in question tolerate being invoked unprivileged? > > The PRM spec requires this, and this is something we may need to > > enforce at some point. > > > > cc'ing Peter with whom I've discussed this just recently. > > Interesting appoach, need to check if that works. I haven't tried that > yet. Though, that needs some rework of the kernel code as some high > priority code depends on the translation and that would cause kind of > priority inversion. E.g. an interrupt handler cannot wait until a > dpa-to-spa conversion is done. > This is not about running it in user space, but about running the code in an unprivileged sandbox. So scheduling wpuldn't really come into play here. > For CXL it is only used for region setup in the init path and process > context. For tracing and error handling those translations are > disabled. See patch 13/13. >