From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bjorn Helgaas <helgaas@kernel.org>,
Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
Cc: Logan Gunthorpe <logang@deltatee.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [nicholas.johnson-opensource@outlook.com.au: [PATCH v6 3/4] PCI: Fix bug resulting in double hpmemsize being assigned to MMIO window]
Date: Fri, 21 Jun 2019 09:24:48 +1000 [thread overview]
Message-ID: <59c6111e9567d8f03c4b03caeb1020df51b0fb4c.camel@kernel.crashing.org> (raw)
In-Reply-To: <20190620134346.GH143205@google.com>
On Thu, 2019-06-20 at 08:43 -0500, Bjorn Helgaas wrote:
> This is as it should be. Non-prefetchable windows are 32 bits, and
> in general non-prefetchable BARs must be placed there.
>
> There is some wiggle room in pure PCIe systems because PCIe reads
> always contain an explicit length, so in some cases it is safe to
> put a non-prefetchable BAR in a prefetchable window (see the
> implementation note in sec 7.5.1.2.1). But I don't think Linux
> currently implements this.
We don't, we probably should, but seeing our current allocation code, I
dread of the end result ...
We would need a host bridge flag to indicate it's safe (no byte merging
at the PHB). I know most host bridge implementations don't
differenciate prefetchable from non-prefetchable outbound windows so
should be fine, and the other side effects are generally attributes of
the mapping done in the MMU and thus depend on the device BAR
attribute, not the bridge windows in the way.
I'm not 100% sure how/if x86 throws a wrench into this with MTRRs
(could a BIOS setup one of these things to cover a bridge/switch
prefetchable window ? That would be a bad idea but bad ideas is what
BIOS vendors often come up with).
Cheers,
Ben.
next prev parent reply other threads:[~2019-06-20 23:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <SL2P216MB01874DFDDBDE49B935A9B1B380E50@SL2P216MB0187.KORP216.PROD.OUTLOOK.COM>
2019-06-19 16:21 ` [nicholas.johnson-opensource@outlook.com.au: [PATCH v6 3/4] PCI: Fix bug resulting in double hpmemsize being assigned to MMIO window] Logan Gunthorpe
2019-06-20 0:44 ` Nicholas Johnson
2019-06-20 0:49 ` Logan Gunthorpe
2019-06-23 5:01 ` Nicholas Johnson
2019-06-24 9:13 ` Multitude of resource assignment functions Benjamin Herrenschmidt
2019-06-24 16:45 ` Logan Gunthorpe
2019-06-27 7:40 ` Nicholas Johnson
2019-06-27 8:48 ` Benjamin Herrenschmidt
2019-06-30 2:40 ` Nicholas Johnson
2019-06-27 16:35 ` Logan Gunthorpe
2019-06-27 20:26 ` Benjamin Herrenschmidt
2019-06-30 2:57 ` Nicholas Johnson
2019-07-01 4:33 ` Oliver O'Halloran
2019-07-02 21:39 ` Bjorn Helgaas
2019-07-03 13:43 ` Nicholas Johnson
2019-07-03 14:19 ` Bjorn Helgaas
2019-07-03 22:54 ` Benjamin Herrenschmidt
2019-06-20 13:43 ` [nicholas.johnson-opensource@outlook.com.au: [PATCH v6 3/4] PCI: Fix bug resulting in double hpmemsize being assigned to MMIO window] Bjorn Helgaas
2019-06-20 23:24 ` Benjamin Herrenschmidt [this message]
2019-06-27 7:50 ` Nicholas Johnson
2019-06-27 16:54 ` Logan Gunthorpe
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=59c6111e9567d8f03c4b03caeb1020df51b0fb4c.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=nicholas.johnson-opensource@outlook.com.au \
/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).