mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@infradead.org>,
	"T.J. Mercier" <tjmercier@google.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	isaacmanjarres@google.com, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/dma: Respect SWIOTLB force_bounce
Date: Thu, 2 May 2024 13:50:46 +0100	[thread overview]
Message-ID: <b4b11ebb-4e42-402c-8e9e-48eb57ef34d5@arm.com> (raw)
In-Reply-To: <ZjMfl2G377qexhi-@infradead.org>

On 02/05/2024 6:07 am, Christoph Hellwig wrote:
> On Wed, May 01, 2024 at 08:13:18PM +0000, T.J. Mercier wrote:
>> iommu_dma_map_page and iommu_dma_map_sg conditionally use SWIOTLB, but
>> checking if force_bounce is set for the device is not part of that
>> condition. Check if devices have requested to force SWIOTLB use as part
>> of deciding to take the existing SWIOTLB paths.
> 
> This fails to explain why you'd want this somewhat surprising behavior,
> and why you consider it a bug fix.

Indeed, it's rather intentional that the "swiotlb=force" argument 
doesn't affect iommu-dma, since that's primarily for weeding out drivers 
making dodgy assumptions about DMA addresses, and iommu-dma is 
inherently even better at that already.

Beyond that I think this change also seems likely to interact badly with 
CC_ATTR_GUEST_MEM_ENCRYPT on x86, where we invoke the SWIOTLB_FORCE flag 
for dma-direct, but expect that an IOMMU can provide a decrypted view 
in-place, thus bouncing in that path would be unnecessarily detrimental.

Thanks,
Robin.

  reply	other threads:[~2024-05-02 12:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01 20:13 T.J. Mercier
2024-05-02  5:07 ` Christoph Hellwig
2024-05-02 12:50   ` Robin Murphy [this message]
2024-05-02 16:02     ` T.J. Mercier
2024-05-02 16:54       ` Robin Murphy
2024-05-02 17:54         ` T.J. Mercier

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=b4b11ebb-4e42-402c-8e9e-48eb57ef34d5@arm.com \
    --to=robin.murphy@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux.dev \
    --cc=isaacmanjarres@google.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tjmercier@google.com \
    --cc=will@kernel.org \
    /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

all inboxes | Powered by JetHome®