public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Robert Hancock <hancockr@shaw.ca>,
	Olivier Galibert <galibert@pobox.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>, Chuck Ebbert <cebbert@redhat.com>,
	Len Brown <lenb@kernel.org>
Subject: Re: [RFC PATCH] PCI MMCONFIG: add validation against ACPI motherboard resources
Date: Wed, 23 May 2007 15:06:33 -0700	[thread overview]
Message-ID: <200705231506.36229.jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <alpine.LFD.0.98.0705231444200.3890@woody.linux-foundation.org>

On Wednesday, May 23, 2007 2:54 pm Linus Torvalds wrote:
> On Wed, 23 May 2007, Jesse Barnes wrote:
> > > You told it to not forward memory. Why complain when it does as
> > > told?
> >
> > Well, because that's not actually very useful functionality, and
> > likely makes software that seems "obviously" correct wrt the PCI
> > spec break.
>
> I agree that a chip that doesn't do it isn't broken either, but the
> fact is, there is never any reason to disable MEM/IO on a host
> bridge. Doing so is senseless - it can never be a valid operation. So
> I duspute the "obviously correct" part. It's _not_ obviously correct
> at all.
>
> To get back to the MMIO example: even if you were to never shut off
> RAM, if you turn off just PCI MMIO on the northbridge, what is a
> mmconfig cycle supposed to do? It's not going to _work_ if you
> disable MEM accesses.
>
> So again, the only sane situation is: don't do it then! You claim
> that hardware shouldn't do it, but I don't think software is in any
> different situation at all! If it's insane to do, then software
> shouldn't do it.
>
> It's just insane to turn off the MEM bit. There's simply no valid
> reason to. And any PCI spec that says you should is *broken*, or
> written by somebody who really only meant to talk about normal PCI
> devices, not bridges.

Well theoretically for just sizing BARs, turning off the MEM bit should 
be fine, since your next accesses should only be to config space until 
the MEM bit is reenabled.  But if RAM accesses really are disabled, 
then you'd better be sure all the code you need is already in cache, or 
you'll get into trouble.

So yeah, I guess special handling for host bridges is needed, but that 
doesn't seem like a big deal.

> > Apparently Vista will move away from using type 1 config space
> > accesses though, so if we keep using it, we'll probably run into
> > some lame board that assumes you're using mmconfig at some point in
> > the near future.
>
> How are those boards going to set up mmconfig? The whole standard is
> broken, since there is no way to set it up.
>
> Trust the firmware? What a piece of crap!

What do you mean?  You set it up the normal way, by poking at config 
space to see what's there, then size the BARs (disabling mem and I/O 
accesses in PCI_COMMAND shouldn't affect config space cycles afaik).  
You just have to be careful to disable decoding for I/O and memory 
regions, especially if your mmconfig space overlaps with what the 
devices end up with in their BARs.  Which is why my initial patch works 
ok (because fortunately the Intel host bridges hard code the mem decode 
bit to 1 too).

Jesse


  reply	other threads:[~2007-05-23 22:07 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30  2:14 [RFC PATCH] PCI MMCONFIG: add validation against ACPI motherboard resources Robert Hancock
2007-04-30  2:59 ` Randy Dunlap
2007-04-30 22:59 ` Olivier Galibert
2007-04-30 23:26   ` Robert Hancock
2007-05-01 16:48   ` Jesse Barnes
2007-05-02  2:41   ` Jesse Barnes
2007-05-02  2:56     ` Jesse Barnes
2007-05-02  5:27       ` Jesse Barnes
2007-05-02 14:34         ` Robert Hancock
2007-05-02 17:57           ` Jesse Barnes
2007-05-02 23:45             ` Robert Hancock
2007-05-02 23:54               ` Jesse Barnes
2007-05-04 21:06                 ` Jesse Barnes
2007-05-05  0:22                   ` Robert Hancock
2007-05-21 19:10                   ` Jesse Barnes
2007-05-21 19:26                     ` Robert Hancock
2007-05-21 20:07                       ` Jesse Barnes
2007-05-21 20:22                         ` Jesse Barnes
2007-05-23  0:31                           ` Robert Hancock
2007-05-23  0:38                             ` Jesse Barnes
2007-05-23  0:53                               ` Robert Hancock
2007-05-23  0:56                                 ` Jesse Barnes
2007-05-23  1:06                               ` Robert Hancock
2007-05-23 18:52                                 ` Jesse Barnes
2007-05-23 20:20                                   ` Linus Torvalds
2007-05-23 20:38                                     ` Alan Cox
2007-05-23 20:45                                       ` Linus Torvalds
2007-05-23 20:49                                     ` Jesse Barnes
2007-05-23 20:56                                       ` Linus Torvalds
2007-05-23 21:03                                         ` Jesse Barnes
2007-05-23 21:09                                           ` Jeff Garzik
2007-05-23 21:35                                             ` Alan Cox
2007-05-23 21:35                                               ` Jeff Garzik
2007-05-23 21:37                                               ` Jesse Barnes
2007-05-23 21:42                                                 ` Jeff Garzik
2007-05-23 23:07                                             ` Stephen Hemminger
2007-05-23 21:54                                           ` Linus Torvalds
2007-05-23 22:06                                             ` Jesse Barnes [this message]
2007-05-23 22:16                                               ` Linus Torvalds
2007-05-23 22:28                                                 ` Jesse Barnes
2007-05-23 23:04                                                 ` David Miller
2007-05-23 23:11                                                   ` Jesse Barnes
2007-05-23 23:15                                                     ` Robert Hancock
2007-05-23 23:21                                                       ` Jesse Barnes
2007-05-23 21:20                                         ` Jesse Barnes
2007-05-23 22:24                                           ` Olivier Galibert
2007-05-23 22:31                                             ` Jesse Barnes
2007-05-23 22:48                                             ` Linus Torvalds
2007-05-23 22:55                                               ` Jesse Barnes
2007-05-24  0:21                                                 ` Linus Torvalds
2007-05-24  2:59                                                   ` Jesse Barnes
2007-05-24  3:18                                                     ` Linus Torvalds
2007-05-24  3:20                                                       ` Linus Torvalds
2007-05-24  3:40                                                         ` Jesse Barnes
2007-05-24  5:19                                                           ` Robert Hancock
2007-05-24  6:18                                                   ` Jeff Garzik
2007-05-24 15:42                                                     ` Linus Torvalds
2007-05-23 23:04                                     ` Robert Hancock
2007-05-23 23:04                                   ` Robert Hancock
2007-05-23 23:06                                     ` Jesse Barnes
2007-05-24  0:02 ` Jesse Barnes

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=200705231506.36229.jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=ak@suse.de \
    --cc=cebbert@redhat.com \
    --cc=galibert@pobox.com \
    --cc=hancockr@shaw.ca \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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