linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* In "pci_fixup_video" check if this is or should be the primary video device to prevent setting the IORESOURCE_ROM_SHADOW flag on a secondary VGA card
@ 2014-01-12  4:10 Sander Eikelenboom
  2014-01-12  4:10 ` [PATCH] " Sander Eikelenboom
       [not found] ` <XNM1$9$0$4$$3$3$7$A$9006858U52d4d109@hitachi.com>
  0 siblings, 2 replies; 15+ messages in thread
From: Sander Eikelenboom @ 2014-01-12  4:10 UTC (permalink / raw)
  To: Dave Airlie, Eiichiro Oiwa, Greg Kroah-Hartman
  Cc: Sander Eikelenboom, Konrad Rzeszutek Wilk,
	linux-kernel @ vger . kernel . org

Hi Eiichiro / Dave / Greg,

While trying to get secondary PCI/VGA passthrough of a AMD 6570 card to a Xen guest with the radeon driver and modesetting
i'm running into the problem that the driver says the BIOS is a COMBIOS while it expects a ATOMBIOS for the cards.

So the Guest uses both it's normal emulated VGA card provided by Qemu (f.e. cirrus logic) and a real VGA card via
PCI passthrough.

While debugging it turned out that the bios that the driver read was not the AMD bios, but the bios from the emulated card.
(so it wasn't a COMBIOS either ..)

I first thought the culprit was with Xen, Seabios or Qemu ..
So it took quite a while and debugging, but finally my eye fell on this in the guest dmesg:

[    2.545728] pci 0000:00:00.0: calling quirk_natoma+0x0/0x40
[    2.545730] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    2.558998] pci 0000:00:00.0: calling quirk_passive_release+0x0/0x90
[    2.559121] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    2.572412] pci 0000:00:01.0: calling quirk_isa_dma_hangs+0x0/0x40
[    2.572415] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    2.586527] pci 0000:00:03.0: calling pci_fixup_video+0x0/0xd0
[    2.586609] pci 0000:00:03.0: Boot video device
[    2.586696] pci 0000:00:05.0: calling pci_fixup_video+0x0/0xd0
[    2.586827] pci 0000:00:05.0: Boot video device
[    2.586928] pci 0000:00:06.0: calling quirk_e100_interrupt+0x0/0x1c0

It's calling the "pci_fixup_video" quirk ... and it's calling it twice ..
which if i read the comment correctly .. shouldn't be the case:

 /*
 * Fixup to mark boot BIOS video selected by BIOS before it changes
 *
 * From information provided by "Jon Smirl" <jonsmirl@gmail.com>
 *
 * The standard boot ROM sequence for an x86 machine uses the BIOS
 * to select an initial video card for boot display. This boot video
 * card will have it's BIOS copied to C0000 in system RAM.
 * IORESOURCE_ROM_SHADOW is used to associate the boot video
 * card with this copy. On laptops this copy has to be used since
 * the main ROM may be compressed or combined with another image.
 * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW
 * is marked here since the boot video device will be the only enabled
 * video device at this point.
 */


But the code doesn't check if it's actually the only enabled (or first) video device at that point ..
and it's setting 2 boot video devices and setting both to use the IORESOURCE_ROM_SHADOW at C000 ..
which happens to be the bios from the emulated card.

With this patch applied the passthrough of the card works fine in the guest and dmesg reports:

[    2.167076] pci 0000:00:00.0: calling quirk_natoma+0x0/0x40
[    2.167078] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    2.179807] pci 0000:00:00.0: calling quirk_passive_release+0x0/0x90
[    2.179953] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    2.192953] pci 0000:00:01.0: calling quirk_isa_dma_hangs+0x0/0x40
[    2.192955] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    2.206543] pci 0000:00:03.0: calling pci_fixup_video+0x0/0xe0
[    2.206623] pci 0000:00:03.0: Boot video device
[    2.206710] pci 0000:00:05.0: calling pci_fixup_video+0x0/0xe0
[    2.206842] pci 0000:00:06.0: calling quirk_e100_interrupt+0x0/0x1c0

--
Sander

Sander Eikelenboom (1):
  In "pci_fixup_video" check if this is or should be the primary video
    device to prevent setting the IORESOURCE_ROM_SHADOW flag on a
    secondary VGA card

 arch/x86/pci/fixup.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-02-14 20:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-12  4:10 In "pci_fixup_video" check if this is or should be the primary video device to prevent setting the IORESOURCE_ROM_SHADOW flag on a secondary VGA card Sander Eikelenboom
2014-01-12  4:10 ` [PATCH] " Sander Eikelenboom
     [not found] ` <XNM1$9$0$4$$3$3$7$A$9006858U52d4d109@hitachi.com>
2014-01-14 15:26   ` In "pci_fixup_video" check if this is or should be the primary video device t Sander Eikelenboom
     [not found]     ` <XNM1$9$0$4$$3$3$7$A$9006860U52d614ca@hitachi.com>
2014-01-15  8:40       ` In "pci_fixup_video" check if this is or should be the primary video devi Sander Eikelenboom
2014-01-15 19:36       ` Sander Eikelenboom
2014-01-15 21:50         ` Bjorn Helgaas
2014-01-15 22:25           ` Sander Eikelenboom
     [not found]             ` <XNM1$9$0$4$$3$3$7$A$9006862U52d758ed@hitachi.com>
2014-01-16 13:19               ` In "pci_fixup_video" check if this is or should be the primary video d Bjorn Helgaas
2014-01-30  0:08             ` In "pci_fixup_video" check if this is or should be the primary video devi Bjorn Helgaas
2014-01-31  9:28               ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it from reading it's own rom. It will get the content of the shadowrom at C000 instead, which is of the primary VGA card and the driver of the secondary card will bail out Sander Eikelenboom
2014-01-31  9:28                 ` Sander Eikelenboom
2014-02-03 14:52                 ` Konrad Rzeszutek Wilk
2014-02-07 11:03                   ` Sander Eikelenboom
2014-02-13  9:48                   ` Sander Eikelenboom
2014-02-14 20:26                     ` Bjorn Helgaas

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).