All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Toshi Kani" <toshi.kani@hp.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Juergen Gross" <jgross@suse.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	linux-fbdev <linux-fbdev@vger.kernel.org>,
	"Suresh Siddha" <sbsiddha@gmail.com>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Dave Airlie" <airlied@redhat.com>,
	"Antonino Daplas" <adaplas@gmail.com>,
	"Jean-Christophe Plagniol-Villard" <plagnioj@jcrosoft.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	venkatesh.pallipadi@intel.com,
	"Stefan Bader" <stefan.bader@canonical.com>,
	"Ville Syrjälä" <syrjala@sci.fi>, "Mel Gorman" <mgorman@suse.de>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Borislav Petkov" <bp@suse.de>,
	"Davidlohr Bueso" <dbueso@suse.de>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"David Vrabel" <david.vrabel@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants
Date: Thu, 25 Jun 2015 09:38:01 +1000	[thread overview]
Message-ID: <1435189081.3790.24.camel@kernel.crashing.org> (raw)
In-Reply-To: <CAB=NE6X0ySW=1udE3LCbo_eCjMfdrOMrceGsPvBZbDW+N-pLTw@mail.gmail.com>

On Wed, 2015-06-24 at 15:29 -0700, Luis R. Rodriguez wrote:

> Nope but at least what made me squint at this being a possible
> "feature" was that in practice when reviewing all of the kernels
> pending device drivers using MTRR (potential write-combine candidates)
> I encountered a slew of them which had the architectural unfortunate
> practice of combining PCI bars for MMIO and their respective
> write-combined desirable area (framebuffer for video, PIO buffers for
> infiniband, etc). Now, to me that read more as a practice for old
> school devices when such things were likely still being evaluated,
> more modern devices seem to adhere to sticking a full PCI bar with
> write-combining or not. Did you not encounter such mismatch splits on
> powerpc ? Was such possibility addressed?

Yes, I remember we dealt with some networking (or maybe IB) stuff back
in the day. We dealt with it by using a WC mapping and explicit barriers
to prevent combine when not wanted.

It is to be noted that on powerpc at least, writel() and co will never
combine due to the memory barriers in them. Only "normal" stores (or
__raw_writel) will.

On Intel things I different I assume...

The problem I see is that architectures can provide widely different
mechanisms and semantics in those areas and it's hard to define a
generic driver interface.

> If what you are implying here is applicable to the x86 world I'm all
> for enabling this as we'd have less code to maintain but I'll note
> that getting a clarification alone on that prefetchable !=
> write-combining was in and of itself hard, I'd be surprised if we
> could get full architectural buy-in to this as an immediate automatic
> feature.

I'm happy not to make it automatic for kernel space. As for user
mappings, maybe the right thing to do is to let us do what we do by
default with a quirk that can set a flag in pci_dev to disable that
behaviour (maybe on a per BAR basis ?). I think the common case is
that WC works.

>  Because of this and because PAT did have some errata as well,
> I would not be surprised if some PCI bridges / devices would end up
> finding corner cases, as such if we can really do what you're saying
> and unless we can get some super sane certainty over it across the
> board, I'd be inclined to leave such things as a part of a new API.
> Maybe have some folks test using the new API for all calls and after
> some sanity of testing / releases consider a full switch.
> 
> That is, unless of course you're sure all this is sane and would wager
> all-in on it from the get-go.

Cheers,
Ben.



WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Toshi Kani" <toshi.kani@hp.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Juergen Gross" <jgross@suse.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	linux-fbdev <linux-fbdev@vger.kernel.org>,
	"Suresh Siddha" <sbsiddha@gmail.com>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Dave Airlie" <airlied@redhat.com>,
	"Antonino Daplas" <adaplas@gmail.com>,
	"Jean-Christophe Plagniol-Villard" <plagnioj@jcrosoft.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	venkatesh.pallipadi@intel.com,
	"Stefan Bader" <stefan.bader@canonical.com>,
	"Ville Syrjälä" <syrjala@sci.fi>, "Mel Gorman" <mgorman@suse.de>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Borislav Petkov" <bp@suse.de>,
	"Davidlohr Bueso" <dbueso@suse.de>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"David Vrabel" <david.vrabel@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants
Date: Wed, 24 Jun 2015 23:38:01 +0000	[thread overview]
Message-ID: <1435189081.3790.24.camel@kernel.crashing.org> (raw)
In-Reply-To: <CAB=NE6X0ySW=1udE3LCbo_eCjMfdrOMrceGsPvBZbDW+N-pLTw@mail.gmail.com>

On Wed, 2015-06-24 at 15:29 -0700, Luis R. Rodriguez wrote:

> Nope but at least what made me squint at this being a possible
> "feature" was that in practice when reviewing all of the kernels
> pending device drivers using MTRR (potential write-combine candidates)
> I encountered a slew of them which had the architectural unfortunate
> practice of combining PCI bars for MMIO and their respective
> write-combined desirable area (framebuffer for video, PIO buffers for
> infiniband, etc). Now, to me that read more as a practice for old
> school devices when such things were likely still being evaluated,
> more modern devices seem to adhere to sticking a full PCI bar with
> write-combining or not. Did you not encounter such mismatch splits on
> powerpc ? Was such possibility addressed?

Yes, I remember we dealt with some networking (or maybe IB) stuff back
in the day. We dealt with it by using a WC mapping and explicit barriers
to prevent combine when not wanted.

It is to be noted that on powerpc at least, writel() and co will never
combine due to the memory barriers in them. Only "normal" stores (or
__raw_writel) will.

On Intel things I different I assume...

The problem I see is that architectures can provide widely different
mechanisms and semantics in those areas and it's hard to define a
generic driver interface.

> If what you are implying here is applicable to the x86 world I'm all
> for enabling this as we'd have less code to maintain but I'll note
> that getting a clarification alone on that prefetchable !> write-combining was in and of itself hard, I'd be surprised if we
> could get full architectural buy-in to this as an immediate automatic
> feature.

I'm happy not to make it automatic for kernel space. As for user
mappings, maybe the right thing to do is to let us do what we do by
default with a quirk that can set a flag in pci_dev to disable that
behaviour (maybe on a per BAR basis ?). I think the common case is
that WC works.

>  Because of this and because PAT did have some errata as well,
> I would not be surprised if some PCI bridges / devices would end up
> finding corner cases, as such if we can really do what you're saying
> and unless we can get some super sane certainty over it across the
> board, I'd be inclined to leave such things as a part of a new API.
> Maybe have some folks test using the new API for all calls and after
> some sanity of testing / releases consider a full switch.
> 
> That is, unless of course you're sure all this is sane and would wager
> all-in on it from the get-go.

Cheers,
Ben.



WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Toshi Kani <toshi.kani@hp.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Juergen Gross <jgross@suse.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	linux-fbdev <linux-fbdev@vger.kernel.org>,
	Suresh Siddha <sbsiddha@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Dave Airlie <airlied@redhat.com>,
	Antonino Daplas <adaplas@gmail.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	venkatesh.pallipadi@intel.com,
	Stefan Bader <stefan.bader@canonical.com>,
	Ville
Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants
Date: Thu, 25 Jun 2015 09:38:01 +1000	[thread overview]
Message-ID: <1435189081.3790.24.camel@kernel.crashing.org> (raw)
In-Reply-To: <CAB=NE6X0ySW=1udE3LCbo_eCjMfdrOMrceGsPvBZbDW+N-pLTw@mail.gmail.com>

On Wed, 2015-06-24 at 15:29 -0700, Luis R. Rodriguez wrote:

> Nope but at least what made me squint at this being a possible
> "feature" was that in practice when reviewing all of the kernels
> pending device drivers using MTRR (potential write-combine candidates)
> I encountered a slew of them which had the architectural unfortunate
> practice of combining PCI bars for MMIO and their respective
> write-combined desirable area (framebuffer for video, PIO buffers for
> infiniband, etc). Now, to me that read more as a practice for old
> school devices when such things were likely still being evaluated,
> more modern devices seem to adhere to sticking a full PCI bar with
> write-combining or not. Did you not encounter such mismatch splits on
> powerpc ? Was such possibility addressed?

Yes, I remember we dealt with some networking (or maybe IB) stuff back
in the day. We dealt with it by using a WC mapping and explicit barriers
to prevent combine when not wanted.

It is to be noted that on powerpc at least, writel() and co will never
combine due to the memory barriers in them. Only "normal" stores (or
__raw_writel) will.

On Intel things I different I assume...

The problem I see is that architectures can provide widely different
mechanisms and semantics in those areas and it's hard to define a
generic driver interface.

> If what you are implying here is applicable to the x86 world I'm all
> for enabling this as we'd have less code to maintain but I'll note
> that getting a clarification alone on that prefetchable !=
> write-combining was in and of itself hard, I'd be surprised if we
> could get full architectural buy-in to this as an immediate automatic
> feature.

I'm happy not to make it automatic for kernel space. As for user
mappings, maybe the right thing to do is to let us do what we do by
default with a quirk that can set a flag in pci_dev to disable that
behaviour (maybe on a per BAR basis ?). I think the common case is
that WC works.

>  Because of this and because PAT did have some errata as well,
> I would not be surprised if some PCI bridges / devices would end up
> finding corner cases, as such if we can really do what you're saying
> and unless we can get some super sane certainty over it across the
> board, I'd be inclined to leave such things as a part of a new API.
> Maybe have some folks test using the new API for all calls and after
> some sanity of testing / releases consider a full switch.
> 
> That is, unless of course you're sure all this is sane and would wager
> all-in on it from the get-go.

Cheers,
Ben.

  reply	other threads:[~2015-06-24 23:40 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 22:08 [PATCH v7 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() Luis R. Rodriguez
2015-06-19 22:08 ` Luis R. Rodriguez
2015-06-19 22:08 ` Luis R. Rodriguez
2015-06-19 22:08 ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 1/9] pci: add pci_ioremap_wc_bar() Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 2/9] video: fbdev: i740fb: use arch_phys_wc_add() and pci_ioremap_wc_bar() Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 3/9] video: fbdev: kyrofb: " Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 4/9] video: fbdev: gxt4500: use pci_ioremap_wc_bar() for framebuffer Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-23 22:42   ` Benjamin Herrenschmidt
2015-06-23 22:42     ` Benjamin Herrenschmidt
2015-06-23 22:42     ` Benjamin Herrenschmidt
2015-06-24 16:38     ` Luis R. Rodriguez
2015-06-24 16:38       ` Luis R. Rodriguez
2015-06-24 16:38       ` Luis R. Rodriguez
2015-06-24 22:05       ` Benjamin Herrenschmidt
2015-06-24 22:05         ` Benjamin Herrenschmidt
2015-06-24 22:05         ` Benjamin Herrenschmidt
2015-06-24 22:29         ` Luis R. Rodriguez
2015-06-24 22:29           ` Luis R. Rodriguez
2015-06-24 22:29           ` Luis R. Rodriguez
2015-06-24 23:38           ` Benjamin Herrenschmidt [this message]
2015-06-24 23:38             ` Benjamin Herrenschmidt
2015-06-24 23:38             ` Benjamin Herrenschmidt
2015-06-25  0:08             ` Luis R. Rodriguez
2015-06-25  0:08               ` Luis R. Rodriguez
2015-06-25  0:08               ` Luis R. Rodriguez
2015-06-25  0:52               ` Benjamin Herrenschmidt
2015-06-25  0:52                 ` Benjamin Herrenschmidt
2015-06-25  0:52                 ` Benjamin Herrenschmidt
2015-06-25  0:58                 ` [Xen-devel] " Luis R. Rodriguez
2015-06-25  0:58                   ` Luis R. Rodriguez
2015-06-25  0:58                   ` Luis R. Rodriguez
2015-06-25  1:12                   ` Benjamin Herrenschmidt
2015-06-25  1:12                     ` Benjamin Herrenschmidt
2015-06-25  1:12                     ` Benjamin Herrenschmidt
2015-06-25 15:01             ` Casey Leedom
2015-06-25 15:01               ` Casey Leedom
2015-06-25 20:44               ` Arnd Bergmann
2015-06-25 20:44                 ` Arnd Bergmann
2015-06-25 20:44                 ` Arnd Bergmann
2015-06-25 21:40                 ` Casey Leedom
2015-06-25 21:40                   ` Casey Leedom
2015-06-25 22:51                   ` Benjamin Herrenschmidt
2015-06-25 22:51                     ` Benjamin Herrenschmidt
2015-06-25 22:51                     ` Benjamin Herrenschmidt
2015-06-26 19:31                     ` Luis R. Rodriguez
2015-06-26 19:31                       ` Luis R. Rodriguez
2015-06-26 19:31                       ` Luis R. Rodriguez
2015-06-26 22:04                       ` Benjamin Herrenschmidt
2015-06-26 22:04                         ` Benjamin Herrenschmidt
2015-06-26 22:04                         ` Benjamin Herrenschmidt
2015-06-26 22:41                         ` Luis R. Rodriguez
2015-06-26 23:54                           ` [Xen-devel] " Benjamin Herrenschmidt
2015-06-26 23:54                             ` Benjamin Herrenschmidt
2015-06-26 23:54                             ` [Xen-devel] " Benjamin Herrenschmidt
2015-06-27  1:16                             ` Luis R. Rodriguez
2015-06-27  1:16                               ` Luis R. Rodriguez
2015-06-27  1:16                               ` [Xen-devel] " Luis R. Rodriguez
2015-06-26  2:02                   ` Benjamin Herrenschmidt
2015-06-26  2:02                     ` Benjamin Herrenschmidt
2015-06-26  2:02                     ` Benjamin Herrenschmidt
2015-06-26 16:24                     ` Casey Leedom
2015-06-26 16:24                       ` Casey Leedom
2015-06-26 22:00                       ` Benjamin Herrenschmidt
2015-06-26 22:00                         ` Benjamin Herrenschmidt
2015-06-26 22:00                         ` Benjamin Herrenschmidt
2015-07-02 18:49                         ` Luis R. Rodriguez
2015-07-02 18:49                           ` Luis R. Rodriguez
2015-07-02 18:49                           ` Luis R. Rodriguez
2015-07-02 22:26                           ` Benjamin Herrenschmidt
2015-07-02 22:26                             ` Benjamin Herrenschmidt
2015-07-02 22:26                             ` Benjamin Herrenschmidt
2015-07-03  0:14                           ` Casey Leedom
2015-07-03  0:14                             ` Casey Leedom
2015-07-03  0:14                             ` Casey Leedom
2015-06-19 22:08 ` [PATCH v7 6/9] lib: devres: add pcim_iomap_wc() variants Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 7/9] video: fbdev: arkfb: use arch_phys_wc_add() and pci_iomap_wc() Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 8/9] video: fbdev: s3fb: " Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 9/9] video: fbdev: vt8623fb: " Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-19 22:08   ` Luis R. Rodriguez
2015-06-23 10:53 ` [PATCH v7 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() Arnd Bergmann
2015-06-23 10:53   ` Arnd Bergmann

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=1435189081.3790.24.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=adaplas@gmail.com \
    --cc=airlied@redhat.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=bp@suse.de \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.vrabel@citrix.com \
    --cc=dbueso@suse.de \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mcgrof@suse.com \
    --cc=mgorman@suse.de \
    --cc=mingo@elte.hu \
    --cc=mst@redhat.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=roger.pau@citrix.com \
    --cc=sbsiddha@gmail.com \
    --cc=stefan.bader@canonical.com \
    --cc=syrjala@sci.fi \
    --cc=tglx@linutronix.de \
    --cc=tomi.valkeinen@ti.com \
    --cc=toshi.kani@hp.com \
    --cc=vbabka@suse.cz \
    --cc=venkatesh.pallipadi@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=xen-devel@lists.xensource.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.