linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Tony Camuso <tcamuso@redhat.com>
Cc: Greg KH <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Subject: Re: [Fwd: Re: [PATCH 0/5]PCI: x86 MMCONFIG]
Date: Thu, 20 Dec 2007 13:04:14 -0700	[thread overview]
Message-ID: <20071220200413.GI29690@parisc-linux.org> (raw)
In-Reply-To: <476AC48D.6000103@redhat.com>

On Thu, Dec 20, 2007 at 02:37:49PM -0500, Tony Camuso wrote:
> Matthew Wilcox wrote:
> 
> >Bad deduction.  What's happening is that the write to the BAR is causing
> >it to overlap the decode for mmconfig space.  So the mmconfig write to
> >set the BAR back never gets through.
> >
> >I have a different idea to fix this problem.  Instead of writing
> >0xffffffff, we could look for an unused bit of space in the E820 map and
> >write, say, 0xdfffffff to the low 32-bits of a BAR.  Then it wouldn't
> >overlap, and we could find its size using MMCONFIG.
> >
> Let me see if I understand this correctly.
> 
> Writing this BAR with 0xffffffff causes it to decode all further mmconfig
> references based at addr 0xfxxxxxxx as its own?
> 
> If I've got that right, then why don't any of the other BARs do that? Is
> it because this one's a 64-bit BAR?

Here's how BARs work ... when you write 0xffffffff to the BAR, it
ignores all the set bits that are less than the size of the BAR.  So,
assuming this is a 256MB BAR (like my G33 is), what ends up written to
this BAR is 0xf0000000.  Now, because this is graphics, apparently it's
special and embedded in the chipset, even though it looks like it's a
PCI device.  So it actually gets priority over MMCONFIG which is also
mapped to 0xf0000000.

For your case of a 64-bit BAR, you could write 0xffffffff to the high
32-bits first, then write to the low 32-bits, then reset the low, then
high bits, and you'd avoid the problem.  But the G33 has a 32-bit BAR
with the same problem, so it won't work for that case.

BARs that are behind bridges don't have this problem (they can't decode
memory accesses that aren't forwarded to them).  BARs on devices which
have memory IO disabled also don't have theis problem, but disabling
devices has its problems (as does probing BARs for active devices anyway
...).

> AFIK, there are no devices out there that require 32-bits of address
> space, so using 0xdfffffff in the low register would certainly work.

The question is how large can 32-bit BARs get.  As we've seen, 256MB
exist, and are causing pain.  I can't imagine any PCI device
manufacturer thinks they can allocate 2GB of the low space, but we could
potentially mis-size a large BAR by not using 0xffffffff.

> Does anybody see that change as being within the purview of the patch-set
> I am proposing? Or is that another patch for another time?

I'm really not clear on the purpose of your patchset.  Was it all to
address this one problem?

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2007-12-20 20:04 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-20 12:28 [Fwd: Re: [PATCH 0/5]PCI: x86 MMCONFIG] Tony Camuso
2007-12-20 17:22 ` Greg KH
2007-12-20 17:35   ` Matthew Wilcox
2007-12-20 18:04     ` Tony Camuso
2007-12-20 18:16       ` Matthew Wilcox
2007-12-20 18:30         ` Tony Camuso
2007-12-20 18:36           ` Matthew Wilcox
2007-12-20 18:49         ` Loic Prylli
2007-12-20 19:04           ` Tony Camuso
2007-12-20 19:08             ` Matthew Wilcox
2007-12-20 19:50               ` Ivan Kokshaysky
2007-12-20 20:17                 ` Tony Camuso
2007-12-20 20:27                 ` Tony Camuso
2008-01-08  3:41                 ` Tony Camuso
2007-12-20 20:05               ` Loic Prylli
2007-12-20 20:15                 ` Matthew Wilcox
2007-12-20 20:56                   ` Loic Prylli
2007-12-20 21:00                     ` Matthew Wilcox
2007-12-20 21:55                       ` Loic Prylli
2007-12-20 19:37         ` Tony Camuso
2007-12-20 20:04           ` Matthew Wilcox [this message]
2007-12-20 20:15             ` Tony Camuso
2007-12-23 20:16         ` Loic Prylli
2007-12-23 20:55           ` Matthew Wilcox
2007-12-23 22:40             ` Loic Prylli
2007-12-24  8:09           ` Grant Grundler
2007-12-20 18:25   ` Tony Camuso
2007-12-20 21:57     ` Greg KH
2007-12-20 22:36       ` Tony Camuso
2007-12-20 22:40         ` Greg KH
2007-12-20 23:21           ` Tony Camuso
2007-12-21  2:07             ` Loic Prylli
2007-12-24  8:28           ` Grant Grundler
2008-01-08  3:20           ` [PATCH 0/5]PCI: x86 MMCONFIG Tony Camuso
2008-01-08  4:56             ` Greg KH
2008-01-08 13:14               ` Tony Camuso
2008-01-08 13:36                 ` Greg KH
2008-01-08 13:44                   ` Tony Camuso
  -- strict thread matches above, loose matches on Subject: below --
2007-12-20 12:28 [Fwd: Re: [PATCH 0/5]PCI: x86 MMCONFIG] Tony Camuso
     [not found] <fa.HvUNJ45qy60H427u0v9fNt3Gc7E@ifi.uio.no>
     [not found] ` <fa.uuzqvr64HFsgxfiWwhEmE16Di6c@ifi.uio.no>
     [not found]   ` <fa.zhxdNN/1rfQhfJLVmdGBjvKYrCM@ifi.uio.no>
     [not found]     ` <fa.z1qlON6DA9ubBPFdrEcaFTMgYOY@ifi.uio.no>
     [not found]       ` <fa.U/SCC1Gvd3nSOpkMu5vcsSPYyPE@ifi.uio.no>
     [not found]         ` <fa.d8kGTkzOZH22bXRIRiakqgOPBM4@ifi.uio.no>
2007-12-21  0:44           ` Robert Hancock
2007-12-21  1:35             ` Tony Camuso
2007-12-21  1:42               ` Tony Camuso
2007-12-21 14:59                 ` Bhavana Nagendra
2007-12-21  2:15               ` Robert Hancock
2007-12-21  2:44                 ` Tony Camuso
2007-12-21  3:40                 ` Loic Prylli
2007-12-21  4:07                   ` Tony Camuso
2007-12-21  2:09             ` Tony Camuso
2007-12-21 14:11             ` Andi Kleen
     [not found]           ` <fa.pdOcVPk2gFn5iK76ExRH6Ow+NPw@ifi.uio.no>
2007-12-22 16:41             ` Robert Hancock
     [not found] ` <fa.AlLzUeumrcT2SswgOn6MxKfDE0U@ifi.uio.no>
     [not found]   ` <fa.wIE0QfzMAxr82X049FecszlEnQY@ifi.uio.no>
     [not found]     ` <fa.2jJbe4cdXLfOVhNWVxdIjsW8GQc@ifi.uio.no>
     [not found]       ` <fa.JiW7yU0G/EdLOCYcPOacl/XVocc@ifi.uio.no>
     [not found]         ` <fa.PI93hBriZRT9ggytQ5eY/446Tno@ifi.uio.no>
2007-12-24 17:13           ` Robert Hancock

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=20071220200413.GI29690@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=tcamuso@redhat.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).