From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9E20606A322 for ; Fri, 4 Dec 2026 15:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Vl0llslO; dkim=pass (2048-bit key, unprotected) header.d=arndb.de header.i=@arndb.de header.a=rsa-sha256 header.s=fm3 header.b=f2P6zHz2; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=FA6d1V5B DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Subject:References:In-Reply-To:Message-Id:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=a7uxaNWy+eOP2ip/k35DvpPmovY252MxGfku3elxnSI=; b=Vl0llslOKgtDHZ T7jIdihBsE4dfFahyRdUFfbjqOSa2oRP09+O7KRbUsg+Xuec1J3VGeJysZQobF5BFtIrFc9hpwxyY vBDn9Rm3XdXRLprrIuZQA3Ei1fePYZqdj0BGFU0OSeqv8VK6aGcpQAs5yKRW+JMnzNp2h1WH/zVW5 HTPPQ5QYgzKgiYmv2m5OJtUlqX0QqK2NS6497F37B1rrDTswz3WddHXs9MbEqUQcCl1LTPcUDdERv TisaeWSWuRl+YZwjKajwYZcpuxMaZEfbi6IDhZKNVjW4KDh3DiNqAopSs+HPVkGWnGrFE5rtO982s ZtBjo2jcwSObkWtx3H1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZVIL-00000000lxe-14Tn; Fri, 04 Dec 2026 15:33:57 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZVDv-00000000l0V-2zCi for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 15:29:49 +0000 Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfhigh.stl.internal (Postfix) with ESMTP id 69C507A01D2 for ; Fri, 4 Dec 2026 10:29:22 -0500 (EST) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Fri, 04 Dec 2026 10:29:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1796398153; x=1796484553; bh=a7uxaNWy+eOP2ip/k35DvpPmovY252MxGfku3elxnSI=; b= f2P6zHz2Ff93DAJfJMdqAxJVNTYmCB798I+M+Yq6MydhzTr7jskpkQbLW02KiGfv jLzdq+Bb8lElP5Mj80xoHLWCILWMYdUuTw1lt/H1FDyTSsVrqXFk+3j3sckEDT4r 5EwTpnu1A9obKAV7PPnHGb+xwQ6UCgURN0X7xdQObY8ZY1y55+HD2w5XsT6MhOCd dvVhi3R6wzs4ewxU/qLOAu+ndzT2/HMNKPfkAV3zU92jBopoccUoauN4imw9lIKT mDmnbSsIddB9yzcki07/2FOCpa3CW2lOBXm18NOxTWSHZcJ2z8BI4JOdgx3Fv263 ejcegBiDqJpcDaMcdwlSKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1796398153; x= 1796484553; bh=a7uxaNWy+eOP2ip/k35DvpPmovY252MxGfku3elxnSI=; b=F A6d1V5BkCLSUd4mHFyW5XXO/SbQBuna0Hfier51Q++AzEL6Rp1/tWocA5371ZqJQ yshl0rVD+2MtCGm4T7Mcn4oYR/3n99bF3Gbnmq8LxF4n3VuBmXyPsQ8iZRrJy6fa PlctLy9i+1dhTlMZ231IaViEph+H6NwXw86kXmBf4ISH9RqMeXB5MLHqbbmFU7Qx G499dXgFudBermJc5Rr91nhxVrqTYjvheK7fT2qYYsEXFHs+svpCnON0j3ipTnM+ fnPNIGnDec2iP1B3UgNZCb43piNyDmo8+7i0h6LgacuiuIawx7YKWkyEb3aHjZ4c 3WJ0z16SpwbiYWiWiHXNA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=arndb.de a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796398153; d=arndb.de; mf=PGFybmRAYXJuZGIuZGU+; rt=PGxpbnV4LWFybS1rZXJuZWxAbGlzdHMuaW5mcmFkZWFkLm9yZz4=; s=fm3:rsa-sha256:SGnSxYEFgrniv+srCNwd6a5a0/QbmJJg929fzAGz5KyIgyC laLH/NEQg85SsMPdXbpf7qb2ODK04g9/QapCuGM/KDC8VQcnBOepuBpMyGCN84Hn iJgAl+cwsuEnb8QP9edlB5/35x5l6Kb4VRds1BGfAebLeNmWJ0QlFI8JWCttepk4 RbaoDPv9iaUrUPgyiA1lKK9oBJ/jOtP9NDb2/s1qkHNY1sBxomoUU/U/o202itq+ dpPUoU7VMkK/P2Zm5HyVf/AmXM5SJx45I2C/OJlwsMuLQlMyE+chzaAle7ijYMsw wdesjzeWzTJ1RFLRo8LMcRhohw9cXKBJfBEVCbQ==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:m8yOqn6whhiwuffxuO9252Jdl+Rc+/GFJIvJLXC3pcM=:qrRIUelZv5JjtcBLGC2Av5g31T44+JmXs0FVqH6tM+8=; X-ME-Sender: X-ME-Proxy-Cause: dmFkZTG4Aalr/FPjehTOrA/JJ05kUizlbZrUTttsjtyycusOWozqUaSUwDyc2kayHOMAYo gtYmF1mVelH6GVL7qeS+HGR/QH9x5AueCOdEuhIXQCpcfbfs1Jfdj/D1r61nfBSc3MXYql gT7YU2cPAjHtKpCc+sg+73o+WPdFCyJH7bkQP6yfUI0uUTz6wxpskWEvAxhEPjdVUiNcDw 7nZNIwvNN3hU/qiq6xZJoWsoGPeuwI7gLcqMWENCXDC6nbqb8thuWbshyxxmQXkwa46R1h I4Z7fpRzJgFyCpdgi72TlTd2cINyo/FvEB+nXI1s2enDfN7OPB+tT8YdwC2iu1YBHR+SLq 3HOvlpIQO+zi+7b6LeK5I4ljGgkTVvGK+R7GWUFXAZz0ha+Z2Axytf8kdKqNNmzLjfge2D 2NtCAn+VgdsegQHEpZuB0FDKmjvx2pfQQjDvbOiDKqh4D5tdSxTDqYJxPW2hUdZpv9QFS0 16+hEJcF7ry3BiUNVim0O/NJsysytDkw4JorXDftdrT/H79ZW8OYB/mlWYbtKqpfhavDhf QocPVv9ClPmNk3ndGgirtrCb1txWNWPG89XcCq+P/zdRicvGiXELV9TLUXM8/lDYZfE7iC bI3c4pvO3TWD1BexDAI4Fl4ImE6NGK4U2GNytEcnbjct4JAmclGW2CHSLmdQ X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id 257E732A0099; Fri, 4 Dec 2026 10:29:08 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface X-Archived-By: MIME-Version: 1.0 X-ThreadId: AIl51u1AkR0c Date: Fri, 04 Dec 2026 16:28:27 +0100 From: "Arnd Bergmann" To: "Sven Schnelle" , "Marc Zyngier" , "Mark Rutland" , "Joerg Roedel" , "Will Deacon" Cc: "Robin Murphy" , "Catalin Marinas" , "Sudeep Holla" , "Ard Biesheuvel" , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, "Christian Borntraeger" , "Hendrik Brueckner" , "Ulrich Weigand" , linux-s390@vger.kernel.org Message-Id: In-Reply-To: <20261204144529.960326-4-svens@linux.ibm.com> References: <20261204144529.960326-1-svens@linux.ibm.com> <20261204144529.960326-4-svens@linux.ibm.com> Subject: Re: [PATCH 3/3] drivers: firmware: add ARM on s390 accelerator driver Content-Type: text/plain Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_072937_493465_04E1C152 X-CRM114-Status: GOOD ( 24.45 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, Dec 4, 2026, at 15:45, Sven Schnelle wrote: > s390 support for ARM guests supports hardware acceleration for > crypto and other functions. This is implemented by providing a special > memory region that can be accessed via st64bv0. To allow userspace to > utilize this functionality, add a driver to map the accelerator memory > region into the userspace process. Note that the misc device files > are created with permission 0666 so all userspace processes can use > the driver without additional configuration. > > Signed-off-by: Sven Schnelle Hi Sven, I noticed a few details: > +config PLATFORM_ACCEL > + tristate "Acceleration driver for arm64" > + depends on ARM64 > + select IOMMU_SVA CONFIG_IOMMU_SVA depends on CONFIG_IOMMU_SUPPORT, so you need to make this depends on IOMMU_SUPPORT Ideally it would also be 'depends on ARM64 || COMPILE_TEST' to give it build test coverage on other architectures, but only if you can easily make it compile portably. > +static int platform_accel_mmap(struct file *filep, struct > vm_area_struct *vma) Lorenzo has been going through device drivers to convert the .mmap() callback to .mmap_prepare(), see https://lore.kernel.org/all/?q=mmap_prepare for recent patches. It's probably best to do the same thing here. > +static int platform_accel_probe(struct platform_device *pdev) > +{ > + struct platform_accel *dev; > + int err; > + > + if (!system_supports_ls64_accdata()) > + return -ENODEV; I think the system_supports_ls64_accdata() call is the only compile time dependency on my "arm64: dynamically enable st64bv0 for SVA" patch, but it's not actually a runtime dependency as the hypervisor platform should only provide the device if it can be used, and the failure mode should still be fine, as userspace should probably check the hwcap as well. If you take out this call or open-code the check for ARM64_HAS_LS64_ACCDATA, the series can be merged independently through another tree. > + dev_info(&pdev->dev, "mmio at %pR\n", r); I'd drop this from the production version, as working drivers are supposed to be quiet. > +#if IS_ENABLED(CONFIG_ACPI) > +static const struct acpi_device_id platform_accel_acpi_match[] = { > + { "IBM077A", (kernel_ulong_t)&platform_accel_dev_cpacf }, > + { "IBM077B", (kernel_ulong_t)&platform_accel_dev_dfltcc }, > + {}, > +}; > +MODULE_DEVICE_TABLE(acpi, platform_accel_acpi_match); > +#endif No need for the #if check here > +#if IS_ENABLED(CONFIG_ACPI) > + .acpi_match_table = ACPI_PTR(platform_accel_acpi_match), > +#endif or the ACPI_PTR() here, which just duplicates the #if check. I would just always leave the .acpi_match_table entry and waste a few bytes of .rodata in favor of readability. Arnd