From patchwork Mon Apr 29 11:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 13646679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B648C4345F for ; Mon, 29 Apr 2024 11:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tBlKeCpJI7pJRSHFdV1OkLj2wfImu/1VARxwnaOdCps=; b=D9A8431u4iVcOJ Pr4j1SkFUpT7TPmNTHdylvkrbnUfmy+CZDDVVSpopAQnyba8I5H3S4AQ0FOwjLojJOuTz6nHPndG/ Mk/UvIwvS//KwIrb6ZE6MDQ/sPtPaqJnjtYAtoDU+IlQNC42JZbBcc1AifA9jl4Py2mQrJw7YNXzu U0O5g72aWxe1fXBR/4zuRZy9ssanbmRo+vYqLAhR1SMQ6gaTFwfPOMdsycdt+gzhyaER89PmjdXKO YmVj9fhB/LtZID9zHTHV5C1nWghpuA1t+SOkuhYHqSksZk83wwaSW8Q3rix89SaIEVDfFxIWHBw5u 0Fs2jsm43poqBVus8bnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PPf-00000002V1I-2W58; Mon, 29 Apr 2024 11:43:15 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PPa-00000002UzW-2Nm1 for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 11:43:13 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-41adf3580dbso24812135e9.0 for ; Mon, 29 Apr 2024 04:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714390987; x=1714995787; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eSPLQ0aSiWlUkLotmQUKbdSZn8q1v5DF9gInw6B0dXM=; b=fg27b1J/iOolzGoK47WowiJ0dTly/tOsLW0UMUhhR0JDwPjXwscLNS3fyfhTm1I36x AqHAShI97Xik7N+HW2PGtNAiEXFyCIzEJLtZ9QxfxVjh1rsjfupMEFFChbv8xZwxOf0y PlW4zt+UYk4iyqy0iL1iF7l3TbeYkIN1ClwO8UfiOK8WaIwJIPt/9DMbiIDFIhO5bgd5 oLFXpsm6iwfQZl9VI8/OsOd9CtvTuBgGQFqDK8nkdqrfPk3Wvd8wLhjb7r8z3y5qwPSz o8w+idf0d2hYMWSq1HmcoWkD+8kot/JJQQz9GFwUQDXcZCq1fw7G6CfZZFFcMf265Nbu RVnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714390987; x=1714995787; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eSPLQ0aSiWlUkLotmQUKbdSZn8q1v5DF9gInw6B0dXM=; b=NSf224QDvn4lgp6r/L8nxDYJwnNuCwMfA2HsjL6wsfktDDfuSsgdnFgZ16cF8LmrA7 XJtMpH8Cv2e8j0dvBdlvQ8CsjxiyW0hDfGm4Jt1cyvkHDY6Orh0lkR7+vNY6Tzu8PLBg 4wIe8/Is1MAXNKTckJlzn0xbb4RnPPz6ufadsASgKfJSvRVlF+ARpMnf2js/18hk9pUN RDZt5sslqbA7k6m+FtU7oPX+iNvfV84xxZrYgn8U1KvYSZCQoNvPAPU/bNRf9GpIv2py crPyindeCrHnfQPTIAz4w+7OHluMoRHDiLdzqo/HD3arIqGjCSFvIf/qMvpq+sPBhUO3 o+bw== X-Forwarded-Encrypted: i=1; AJvYcCWRV7humK73U1QLaBwE5WxFmYEiWLc3x9qk2JJr5C7izClD5Yq3JCimyqgmViQWl2WJBHKyEuV+1ar33QWFGMPMpnjs2boVGnAaJsA5EfDXZ+PRxps= X-Gm-Message-State: AOJu0YxVhmFGopfc5rnGysEDczVxEv3ZChSKjf1UB44nNBkMLG3LEZ/k PW0ffEJPUJ9Ll1x6gRsJbIyOajftAbSP7qPSba9wkB8Wp7vRONfYuyudceJGk9g= X-Google-Smtp-Source: AGHT+IELIaH77G+cqO9Ae4tGmjB9R1iygWxsWgrPpSX+Zo6NaBJo82SewNNgw3IJ4qO6Jw9lSBHdQQ== X-Received: by 2002:a05:600c:1d16:b0:418:5ef3:4a04 with SMTP id l22-20020a05600c1d1600b004185ef34a04mr9650703wms.18.1714390987239; Mon, 29 Apr 2024 04:43:07 -0700 (PDT) Received: from localhost.localdomain ([2.221.137.100]) by smtp.gmail.com with ESMTPSA id j28-20020a05600c1c1c00b0041bfb176a87sm7006611wms.27.2024.04.29.04.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 04:43:06 -0700 (PDT) From: Jean-Philippe Brucker To: will@kernel.org, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, krzk+dt@kernel.org, conor+dt@kernel.org, liviu.dudau@arm.com, sudeep.holla@arm.com, joro@8bytes.org Cc: robin.murphy@arm.com, nicolinc@nvidia.com, ketanp@nvidia.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH 0/3] Enable PCIe ATS for devicetree boot Date: Mon, 29 Apr 2024 12:39:36 +0100 Message-ID: <20240429113938.192706-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_044310_983708_9C23A1B7 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Before enabling Address Translation Support (ATS) in endpoints, the OS needs to confirm that the Root Complex supports it. Obtain this information from the firmware description since there is no architected method. ACPI provides a bit via IORT tables, so add the devicetree equivalent. It was discussed a while ago [1], but at the time only a software model supported it. Respin it now that hardware is available [2]. To test this with the Arm RevC model, enable ATS in the endpoint and note that ATS is enabled. Address translation is transparent to the OS. -C pci.pcie_rc.ahci0.endpoint.ats_supported=1 $ lspci -s 00:1f.0 -vv Capabilities: [100 v1] Address Translation Service (ATS) ATSCap: Invalidate Queue Depth: 00 ATSCtl: Enable+, Smallest Translation Unit: 00 [1] https://lore.kernel.org/linux-iommu/20200213165049.508908-1-jean-philippe@linaro.org/ [2] https://lore.kernel.org/linux-arm-kernel/ZeJP6CwrZ2FSbTYm@Asurada-Nvidia/ Jean-Philippe Brucker (3): dt-bindings: PCI: generic: Add ats-supported property iommu/of: Support ats-supported device-tree property arm64: dts: fvp: Enable PCIe ATS for Base RevC FVP .../devicetree/bindings/pci/host-generic-pci.yaml | 6 ++++++ drivers/iommu/of_iommu.c | 9 +++++++++ arch/arm64/boot/dts/arm/fvp-base-revc.dts | 1 + 3 files changed, 16 insertions(+)