iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: will.deacon@arm.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com
Cc: zhongmiao@hisilicon.com, okaya@kernel.org, rjw@rjwysocki.net,
	linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
	iommu@lists.linux-foundation.org, sudeep.holla@arm.com,
	robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org,
	lenb@kernel.org
Subject: [PATCH v3 9/9] iommu/arm-smmu-v3: Disable tagged pointers
Date: Wed, 17 Apr 2019 19:24:48 +0100	[thread overview]
Message-ID: <20190417182448.12382-10-jean-philippe.brucker@arm.com> (raw)
Message-ID: <20190417182448.3GOAWxr2I2qwJVEDRuvloOIzBP0X8zzo9B2FfepTfes@z> (raw)
In-Reply-To: <20190417182448.12382-1-jean-philippe.brucker@arm.com>

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.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 3bde137a3755..99b83fda11e4 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1057,7 +1057,6 @@ static u64 arm_smmu_cpu_tcr_to_cd(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);
 
 	return val;
 }
-- 
2.21.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2019-04-17 18:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 18:24 [PATCH v3 0/9] Add PCI ATS support to Arm SMMUv3 Jean-Philippe Brucker
2019-04-17 18:24 ` Jean-Philippe Brucker
     [not found] ` <20190417182448.12382-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2019-04-17 18:24   ` [PATCH v3 1/9] PCI: Move ATS declarations outside of CONFIG_PCI Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
     [not found]     ` <20190417182448.12382-2-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2019-04-17 19:47       ` Bjorn Helgaas
2019-04-17 19:47         ` Bjorn Helgaas
2019-04-17 18:24   ` [PATCH v3 2/9] PCI: Add a stub for pci_ats_disabled() Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
     [not found]     ` <20190417182448.12382-3-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2019-04-17 19:48       ` Bjorn Helgaas
2019-04-17 19:48         ` Bjorn Helgaas
2019-04-17 18:24   ` [PATCH v3 3/9] ACPI/IORT: Check ATS capability in root complex nodes Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
2019-04-18 11:20     ` Lorenzo Pieralisi
2019-04-18 11:20       ` Lorenzo Pieralisi
2019-04-17 18:24   ` [PATCH v3 4/9] iommu/arm-smmu-v3: Rename arm_smmu_master_data to arm_smmu_master Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
2019-04-17 18:24   ` [PATCH v3 5/9] iommu/arm-smmu-v3: Store SteamIDs in master Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
2019-04-17 18:24   ` [PATCH v3 6/9] iommu/arm-smmu-v3: Add a master->domain pointer Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
2019-04-17 18:24   ` [PATCH v3 7/9] iommu/arm-smmu-v3: Link domains and devices Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
2019-04-17 18:24   ` [PATCH v3 8/9] iommu/arm-smmu-v3: Add support for PCI ATS Jean-Philippe Brucker
2019-04-17 18:24     ` Jean-Philippe Brucker
2019-07-01 17:41     ` Robin Murphy
2019-07-02 14:59       ` Jean-Philippe Brucker
2019-04-17 18:24   ` Jean-Philippe Brucker [this message]
2019-04-17 18:24     ` [PATCH v3 9/9] iommu/arm-smmu-v3: Disable tagged pointers Jean-Philippe Brucker
2019-04-23 11:21 ` [PATCH v3 0/9] Add PCI ATS support to Arm SMMUv3 Will Deacon
2019-04-23 11:21   ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190417182448.12382-10-jean-philippe.brucker@arm.com \
    --to=jean-philippe.brucker@arm.com \
    --cc=bhelgaas@google.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=okaya@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robin.murphy@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=will.deacon@arm.com \
    --cc=zhongmiao@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).