mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Loic Prylli <loic@myri.com>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org, gregkh@suse.de,
	linux-pci@atrey.karlin.mff.cuni.cz,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [patch] Make MMCONFIG space (extended PCI config space) a driver opt-in issue
Date: Mon, 24 Dec 2007 10:51:22 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.0.9999.0712241036040.21557@woody.linux-foundation.org> (raw)
In-Reply-To: <476F6047.50100@garzik.org>



On Mon, 24 Dec 2007, Jeff Garzik wrote:
> 
> Definitely.  So, two questions:
> 
> What's the preferred way to deal with the desire to view extended config space
> with "lspci -vvvxxx"?

Well, there's two issues right now with MMCONFIG

 - we've hit various bugs in it. The bugs are admittedly very rare, but 
   they are really painful when they happen.

   This is the more "fundamental" of the problems, and this is the one 
   that means that on some machines, the answer to the above question will 
   simply *always* be that we simply will never *ever* show the extended 
   config space - because even though it might work, we are going to 
   decide that it's simply too dangerous.

   (Hypothetical example: we might, for example, end up saying that we 
   will simply never enable mmconfig at all unless the BIOS DMI date says 
   that the motherboard was built in 2008 or later)

 - the (currently more common) problem that our initial probing is totally 
   screwed up with mmconfig.

   This is the thing that causes *most* of our current problems, and the 
   fact is, we absolutely cannot do the initial kernel PCI probing using 
   mmconfig accesses. Not only do we not have enough information about the 
   resources yet at that stage to decide sanely whether mmconfig can 
   really work, but it is my sincere hope that some day the mmconfig MMIO 
   region itself will be defined by some standard BAR etc, so trying to 
   probe the BARs using mmconfig would be a chicken-and-egg problem.

   There's also the issue that we want to often *validate* the mmconfig 
   address using config space accesses, and right now we have some really 
   ugly code that actually uses "pci_conf1_read()" _explicitly_ to avoid 
   using mmconfig for this (see arch/x86/pci/mmconfig-shared.c).

The *second* problem is entirely a kernel internal issue. It's the one 
that causes us the biggest issues right now, but it's also the one that 
will not impact user space at all once if is fixed. So once we do the 
*early* probing using anything but mmconfig accesses, we can then much 
more easily enable mmconfig later, and by the time the user does anything 
like "lspci -vvvxxxx", we could do those mmconfig accesses.

I also suspect that we *may* want to use a separate file for the extended 
config. Right now, things like lspci read the config space by accessing 
a file like

	/sys/bus/pci/devices/0000:00:00.0/config

and I'm not at all sure we want to extend that one past the first 256 
bytes of config space. Why? Because I don't want old programs that may not 
know how dangerous the rest of the space is to read extended config space 
by mistake when they don't know how to parse it anyway.

So I would *suggest* (but this may be overly cautious) that we at least 
consider forcing people who actually want to read extended config space to 
have to use a separate file for it ("/sys/.../extended-config"), because 
that would then also be a sign to the kernel that "ok, the user really 
asked for us to use mmconfig cycles here".

> Is there a path for hw vendors, after passing 1,001 anal checks, to maintain
> the current behavior as it exists today in arch/x86/pci/mmconfig_{32,64}.c?

Well, the *current* behaviour as far as setup is concerned is 
unacceptable. But yes, longer term, we should be able to just have quirk 
entries for saying "enable mmconfig because I know it's safe", except we 
should not enable them until after the core PCI probing has completed.

			Linus

  reply	other threads:[~2007-12-24 18:52 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-22 12:31 Arjan van de Ven
2007-12-22 12:35 ` [patch] opt the sky2 driver into using extended config space Arjan van de Ven
2007-12-22 20:28   ` Stephen Hemminger
2007-12-22 14:20 ` [patch] Make MMCONFIG space (extended PCI config space) a driver opt-in issue Jeff Garzik
2007-12-22 14:47   ` Arjan van de Ven
2007-12-22 15:54     ` Matthew Wilcox
2007-12-22 16:02       ` Arjan van de Ven
2007-12-22 21:10         ` Matthew Wilcox
2007-12-23 23:33           ` Benjamin Herrenschmidt
2007-12-22 18:06     ` Linus Torvalds
2007-12-22 19:30       ` Martin Mares
2007-12-22 20:15         ` Arjan van de Ven
2007-12-22 20:36           ` Martin Mares
2007-12-23  1:29           ` Jeff Garzik
2007-12-23  1:26       ` Jeff Garzik
2007-12-23  3:46         ` Linus Torvalds
2007-12-23  4:11           ` Jeff Garzik
2007-12-23  4:35             ` Linus Torvalds
2007-12-23  4:52               ` Jeff Garzik
2007-12-23  5:00                 ` Linus Torvalds
2007-12-23  5:09                   ` Jeff Garzik
2007-12-23 21:09                   ` Benjamin Herrenschmidt
2007-12-23 21:15                     ` Martin Mares
2007-12-23 22:32                       ` Ivan Kokshaysky
2007-12-23 23:06                       ` Benjamin Herrenschmidt
2007-12-23 23:19                         ` Benjamin Herrenschmidt
2007-12-23  5:27                 ` Loic Prylli
2007-12-23  5:44                   ` Jeff Garzik
2007-12-23  8:33                     ` Loic Prylli
2007-12-23 11:03                     ` Ivan Kokshaysky
2007-12-23 17:32                       ` Linus Torvalds
2007-12-24  7:31                         ` Jeff Garzik
2007-12-24 18:51                           ` Linus Torvalds [this message]
2007-12-24 21:22                             ` Matthew Wilcox
2007-12-27 11:46                             ` Jeff Garzik
2007-12-27 14:09                               ` Arjan van de Ven
2007-12-24  7:22                       ` Jeff Garzik
2007-12-24 15:47                         ` Ivan Kokshaysky
2007-12-23 21:13                     ` Benjamin Herrenschmidt
2007-12-23 10:33                 ` Arjan van de Ven
2007-12-24  7:04                   ` Jeff Garzik
2007-12-24 11:49                     ` Arjan van de Ven
2007-12-24 11:54                       ` Jeff Garzik
2007-12-24 12:00                         ` Arjan van de Ven
2007-12-25  9:22                           ` Martin Mares
2007-12-25  9:40                             ` Martin Mares
2007-12-23  4:13           ` Jeff Garzik
2007-12-23  4:18             ` Jeff Garzik
2007-12-23  4:44               ` Linus Torvalds
2007-12-23  5:04                 ` Jeff Garzik
2007-12-23  5:18                   ` Linus Torvalds
2007-12-23  5:22                     ` Jeff Garzik
2007-12-23  4:40             ` Linus Torvalds
2007-12-23 10:18               ` Martin Mares
2007-12-23  5:09             ` Loic Prylli
2007-12-23  5:57             ` H. Peter Anvin
2007-12-23  1:34     ` Jeff Garzik
2007-12-22 20:43 ` Benjamin Herrenschmidt
     [not found] <fa.pFsY/52FEkQYqrDPnPMxmcUOsRY@ifi.uio.no>
2007-12-22 16:22 ` Robert Hancock
2007-12-22 19:25   ` Greg KH
2007-12-23  0:56     ` Jeff Garzik

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=alpine.LFD.0.9999.0712241036040.21557@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=benh@kernel.crashing.org \
    --cc=gregkh@suse.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=loic@myri.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

all inboxes | Powered by JetHome®