lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Dec 2014 11:56:50 -0800
From:	Guenter Roeck <groeck@...iper.net>
To:	Jesse Barnes <jbarnes@...tuousgeek.org>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Dely Sy <dely.l.sy@...el.com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	Rajat Jain <rajatxjain@...il.com>,
	Kristen Carlson Accardi <kristen.c.accardi@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Special handling of display/VGA devices in hotplug drivers

On Thu, Dec 11, 2014 at 11:32:43AM -0800, Jesse Barnes wrote:
> On Thu, 11 Dec 2014 13:11:36 -0500
> Greg Kroah-Hartman <gregkh@...uxfoundation.org> wrote:
> 
> > On Thu, Dec 11, 2014 at 10:34:30AM -0700, Bjorn Helgaas wrote:
> > > It looks like you added the initial pciehp driver [1], which
> > > includes the following code in pciehp_disable_slot():
> > > 
> > > + if (class_code == PCI_BASE_CLASS_DISPLAY) {
> > > + /* Display/Video adapter (not supported) */
> > > + rc = REMOVE_NOT_SUPPORTED;
> > > 
> > > + /* If it's a bridge, check the VGA Enable bit */
> > > + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
> > > + rc = pci_bus_read_config_byte (pci_bus, devfn,
> > > PCI_BRIDGE_CONTROL, &BCR);
> > > + if (rc)
> > > + return rc;
> > > +
> > > + /* If the VGA Enable bit is set, remove isn't supported */
> > > + if (BCR & PCI_BRIDGE_CTL_VGA) {
> > > + rc = REMOVE_NOT_SUPPORTED;
> > > 
> > > I'm trying to figure out why VGA devices are handled specially.  I
> > > can't find anything in the PCI specs that mentions this.  Most of
> > > the other PCI hotplug drivers have similar code.  Do you remember
> > > anything about this?
> > 
> > The PCI spec said that you were not allowed to hotplug VGA drivers.
> > The big issue is that POST usually needs to run on those things, and
> > there is no way to POST a PCI hotplugged device.
> > 
> > Does the spec not say that anymore?  I haven't looked in years at
> > it...
> > 
> > Do you want to hot-add a VGA device?  Are these lines causing a
> > problem with something?
> 
> Yeah, the legacy I/O regions get routed through the bridge with the VGA
> bit set, and most legacy code probably can't handle that (whether POST,
> VBIOS, or VGA drivers).
> 
> There is some code for moving the VGA routing around, so that might be
> an option if you wanted to remove such a bridge.  You'd have to find a
> VGA device under another bridge, and enable routing to that first, then
> you could do the remove.
> 

The problem at hand though is that the current code may mis-detect a device as
VGA device after it was removed. In that case, reading a configuration register
returns 0xff, meaning the VGA bit is set, and the kernel refuses to remove it.

See [1] for a description of the problem and its impact.

Guenter
---
[1] https://lkml.org/lkml/2014/11/20/714
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ