All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: dri-devel@lists.freedesktop.org,
	Karol Herbst <kherbst@redhat.com>,
	nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	Ben Skeggs <bskeggs@redhat.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [Intel-gfx] susetting the remaining swioltb couplin in DRM
Date: Tue, 12 Jul 2022 07:00:55 +0200	[thread overview]
Message-ID: <20220712050055.GA4727@lst.de> (raw)
In-Reply-To: <YsyItfiuccW7iQln@intel.com>

On Mon, Jul 11, 2022 at 04:31:49PM -0400, Rodrigo Vivi wrote:
> On Mon, Jul 11, 2022 at 10:26:14AM +0200, Christoph Hellwig wrote:
> > Hi i915 and nouveau maintainers,
> > 
> > any chance I could get some help to remove the remaining direct
> > driver calls into swiotlb, namely swiotlb_max_segment and
> > is_swiotlb_active.  Either should not matter to a driver as they
> > should be written to the DMA API.
> 
> Hi Christoph,
> 
> while we take a look here, could you please share the reasons
> behind sunsetting this calls?

Because they are a completely broken layering violation.  A driver has
absolutely no business knowing the dma-mapping violation.  The DMA
API reports what we think is all useful constraints (e.g.
dma_max_mapping_size()), and provides useful APIs to (e.g.
dma_alloc_noncoherent or dma_alloc_noncontiguous) to allocate pages
that can be mapped without bounce buffering and drivers should use
the proper API instead of poking into one particular implementation
and restrict it from changing.

swiotlb_max_segment in particular returns a value that isn't actually
correct (a driver can't just use all of swiotlb) AND actually doesn't
work as is in various scenarious that are becoming more common,
most notably host with memory encryption schemes that always require
bounce buffering.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Ben Skeggs <bskeggs@redhat.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [Nouveau] susetting the remaining swioltb couplin in DRM
Date: Tue, 12 Jul 2022 07:00:55 +0200	[thread overview]
Message-ID: <20220712050055.GA4727@lst.de> (raw)
In-Reply-To: <YsyItfiuccW7iQln@intel.com>

On Mon, Jul 11, 2022 at 04:31:49PM -0400, Rodrigo Vivi wrote:
> On Mon, Jul 11, 2022 at 10:26:14AM +0200, Christoph Hellwig wrote:
> > Hi i915 and nouveau maintainers,
> > 
> > any chance I could get some help to remove the remaining direct
> > driver calls into swiotlb, namely swiotlb_max_segment and
> > is_swiotlb_active.  Either should not matter to a driver as they
> > should be written to the DMA API.
> 
> Hi Christoph,
> 
> while we take a look here, could you please share the reasons
> behind sunsetting this calls?

Because they are a completely broken layering violation.  A driver has
absolutely no business knowing the dma-mapping violation.  The DMA
API reports what we think is all useful constraints (e.g.
dma_max_mapping_size()), and provides useful APIs to (e.g.
dma_alloc_noncoherent or dma_alloc_noncontiguous) to allocate pages
that can be mapped without bounce buffering and drivers should use
the proper API instead of poking into one particular implementation
and restrict it from changing.

swiotlb_max_segment in particular returns a value that isn't actually
correct (a driver can't just use all of swiotlb) AND actually doesn't
work as is in various scenarious that are becoming more common,
most notably host with memory encryption schemes that always require
bounce buffering.

  reply	other threads:[~2022-07-12  5:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11  8:26 [Intel-gfx] susetting the remaining swioltb couplin in DRM Christoph Hellwig
2022-07-11  8:26 ` [Nouveau] " Christoph Hellwig
2022-07-11 20:31 ` [Intel-gfx] " Rodrigo Vivi
2022-07-11 20:31   ` Rodrigo Vivi
2022-07-11 20:31   ` [Nouveau] " Rodrigo Vivi
2022-07-12  5:00   ` Christoph Hellwig [this message]
2022-07-12  5:00     ` Christoph Hellwig
2022-07-18 11:36     ` [Intel-gfx] " Tvrtko Ursulin
2022-07-18 11:36       ` Tvrtko Ursulin
2022-07-18 11:36       ` [Nouveau] " Tvrtko Ursulin
2022-07-21 14:28       ` [Intel-gfx] " Robert Beckett
2022-07-21 14:28         ` Robert Beckett
2022-07-28 21:17 ` [Intel-gfx] " Lyude Paul
2022-07-28 21:17   ` Lyude Paul
2022-07-28 21:17   ` [Nouveau] " Lyude Paul
2022-07-28 21:55   ` [Intel-gfx] " Lyude Paul
2022-07-28 21:55     ` Lyude Paul
2022-07-28 21:55     ` [Nouveau] " Lyude Paul

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=20220712050055.GA4727@lst.de \
    --to=hch@lst.de \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kherbst@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.