Message ID | 20180511190641.23008-38-jean-philippe.brucker@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 648B260153 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 11 May 2018 19:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5515428F8B for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 11 May 2018 19:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4930528F95; Fri, 11 May 2018 19:11:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1EBC28F8B for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 11 May 2018 19:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9799B6B06C8; Fri, 11 May 2018 15:10:58 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 927E46B06CB; Fri, 11 May 2018 15:10:58 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F9D26B06C8; Fri, 11 May 2018 15:10:58 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by kanga.kvack.org (Postfix) with ESMTP id 4FAAA6B06C8 for <linux-mm@kvack.org>; Fri, 11 May 2018 15:10:58 -0400 (EDT) Received: by mail-oi0-f72.google.com with SMTP id k186-v6so3445296oib.7 for <linux-mm@kvack.org>; Fri, 11 May 2018 12:10:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=VWMsV0seKmk6qSUb3IrrDmydO6L06aJHARXkArabHi0=; b=cfgrEdFvapKfotFjBLedL9Uc4L4fgQrKJRpd4Two9jeXb14X3w+xnABmYj9HSgap7K 2dflXxTzU+jymElDP2YvpgpCuEnh0DNE2OaQtkHheX3Pso28rMVOKJWnaBfgEjMsWi2t eHXMSBG1Tr8+X0vwWYdnCUxJ9QGtI+wDDawyD79U2UTJ2bUNlZKKNXJpKF8+EihE3LCV gl2J1e1EpMU/XP3HIo4kUkLjOk+TMwh6df5Jgr3xaFengbjBt6X4yBYXffWtVkOe2zHk 3rp4BpmzP2LqVQZClR8bvS3t+CkupJxLcwSz6eTU9C5WN8XP4JTU/fRZo9qakLIW9Rrq y1Xg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=jean-philippe.brucker@arm.com X-Gm-Message-State: ALKqPwforkHdxrx6dU4wIQvWCfloCYh0y9qPXiPk8I/vyK2jwZ+FL5lj E0MrrHqinTbrmaVQoxs4TjyADKPh8KDsE6np7Vkz3Zv74j1LFX07mQxLP/7swizzayikahRYBxu J6mRyblPvBmAEv63eMva/XOfZ2br9rSyn8/FpBoPu7xeLgYy09AwOk2AKY/cvazjzEw== X-Received: by 2002:a9d:354a:: with SMTP id l10-v6mr1240754ote.15.1526065858117; Fri, 11 May 2018 12:10:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo0XYOIkhid72PmKdwiGyPsmfF/964K4KehBTg4ROCnsbP4FR3t0ZVTdwx3pido33+lcDnE X-Received: by 2002:a9d:354a:: with SMTP id l10-v6mr1240718ote.15.1526065857410; Fri, 11 May 2018 12:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526065857; cv=none; d=google.com; s=arc-20160816; b=xCRIw1x8k7EFRlCCRSwz0R+SmC0rcw7a4/skha+qQf/NoG7ZMou/7sFXJefStIlP+5 oEQCGffh2wAEj4hIERwlpFQU7P05AzxR78BRbCOTeF16ta2ksvozcA4HYSwGw2zBiisZ c5/ahL/Se4nOy8TqZtP/C/yKux2YUb512izqqTYGCOvA1h7wcEL/fJmDHl791yBtTLcz grVTALlnQ7b+mOxYRr+iaje/nTxB7FwxcMyI2McXjv6Ia3kUbjXhBT/vSVQYhJ385bJx 2uMtBuukk8XQvqsG6IPZQShCl2DNo/HJzhw+GXeyuO2K9S2/3utbZLoX0Ujq3t+0mL2T azGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=VWMsV0seKmk6qSUb3IrrDmydO6L06aJHARXkArabHi0=; b=pRFg84InAl2HbURKmq3wGjd3SxVcoVwXRVol8vbKufPYWroxhk8dzR7JdmzLQitw/9 Vjsl2wqDC/TX3nDBys9U7zelr9VLKbAdJHeunOBMTIqZLob6xMZwzEpoL715rnPeql4p BTuLuUNUlh9EO/c/9TbwV03g6UGvFVZV1wANHnkdkc5rCtRLg8xSwtaERaP+y/ff6ExT v7VgVNxGfq+0B5Tk+92dvBUjZFO6AruXw5Qhr1opiJqf9kbzAaYDvXdDahkvRAFfEhVg 8fFf88jxjFDPh5tnE+JUitPpbPIsBujZe51IIJFhbGP8HG5OGdIteey6eGu+7FEeZoLT HQ+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=jean-philippe.brucker@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id 188-v6si1180271oig.76.2018.05.11.12.10.57 for <linux-mm@kvack.org>; Fri, 11 May 2018 12:10:57 -0700 (PDT) Received-SPF: pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=jean-philippe.brucker@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0B41719BF; Fri, 11 May 2018 12:10:57 -0700 (PDT) Received: from ostrya.cambridge.arm.com (ostrya.cambridge.arm.com [10.1.210.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C20C93F23C; Fri, 11 May 2018 12:10:51 -0700 (PDT) From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-mm@kvack.org Cc: joro@8bytes.org, will.deacon@arm.com, robin.murphy@arm.com, alex.williamson@redhat.com, tn@semihalf.com, liubo95@huawei.com, thunder.leizhen@huawei.com, xieyisheng1@huawei.com, xuzaibo@huawei.com, ilias.apalodimas@linaro.org, jonathan.cameron@huawei.com, liudongdong3@huawei.com, shunyong.yang@hxt-semitech.com, nwatters@codeaurora.org, okaya@codeaurora.org, jcrouse@codeaurora.org, rfranz@cavium.com, dwmw2@infradead.org, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, ashok.raj@intel.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, robdclark@gmail.com, christian.koenig@amd.com, bharatku@xilinx.com, rgummal@xilinx.com Subject: [PATCH v2 37/40] iommu/arm-smmu-v3: Disable tagged pointers Date: Fri, 11 May 2018 20:06:38 +0100 Message-Id: <20180511190641.23008-38-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511190641.23008-1-jean-philippe.brucker@arm.com> References: <20180511190641.23008-1-jean-philippe.brucker@arm.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/iommu/arm-smmu-v3-context.c b/drivers/iommu/arm-smmu-v3-context.c index bdc9bfd1f35d..22e7b80a7682 100644 --- a/drivers/iommu/arm-smmu-v3-context.c +++ b/drivers/iommu/arm-smmu-v3-context.c @@ -200,7 +200,6 @@ static u64 arm_smmu_cpu_tcr_to_cd(struct arm_smmu_context_cfg *cfg, u64 tcr) val |= ARM_SMMU_TCR2CD(tcr, EPD0); val |= ARM_SMMU_TCR2CD(tcr, EPD1); val |= ARM_SMMU_TCR2CD(tcr, IPS); - val |= ARM_SMMU_TCR2CD(tcr, TBI0); if (cfg->hw_access) val |= ARM_SMMU_TCR2CD(tcr, HA);
The ARM architecture has a "Top Byte Ignore" (TBI) option that makes the MMU mask out bits [63:56] of an address, allowing a userspace application to store data in its pointers. This option is incompatible with PCI ATS. If TBI is enabled in the SMMU and userspace triggers DMA transactions on tagged pointers, the endpoint might create ATC entries for addresses that include a tag. Software would then have to send ATC invalidation packets for each 255 possible alias of an address, or just wipe the whole address space. This is not a viable option, so disable TBI. The impact of this change is unclear, since there are very few users of tagged pointers, much less SVA. But the requirement introduced by this patch doesn't seem excessive: a userspace application using both tagged pointers and SVA should now sanitize addresses (clear the tag) before using them for device DMA. Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> --- drivers/iommu/arm-smmu-v3-context.c | 1 - 1 file changed, 1 deletion(-)