Skip to contentSkip to conversation

In "pci_fixup_video" check if this is or should be the primaryvideo d

DISCUSSION Bjorn Helgaas 4 participants 10 messages Jan 17, 2014 – Jan 19, 2014 3 messages not in the archive PCI

lore
Share & tools
lore

Bjorn Helgaas

author maintainer
#1 lore raw
In reply to a message not in the archive
Quoted 2 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

author maintainer
#4 lore raw

Re: Re[2]: In "pci_fixup_video" check if this is or should be theprimaryvideo d

In reply to a message not in the archive

On Fri, Jan 17, 2014 at 3:43 AM, <[email protected]> wrote:

To make progress here, I think you'll have to be even more detailed.

Quoted 1 line

Because legacy VGA is only one device on x86 System,

Where is it documented that there can be only one legacy VGA device in an x86 system? I assume there exists a system with two slots on bus
0. What happens if a user installs two VGA cards in those slots? Does that prevent the system from working at all because it's an illegal configuration?

I think such a system could work correctly if the I/O Space and Memory Space bits in the command registers were only set on one of the VGA devices.

Quoted 2 lines

I think qemu has to emulate a bridge
for legacy VGA.

My Lenovo T410 has "00:02.0 VGA compatible controller," which I assume would qualify as a "legacy VGA device," and there's no bridge related to it.

Quoted 3 lines

The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device.

I think you meant to say that if there are two VGA cards, we need *one* bridge for each device, e.g., two bridges and two VGA cards. But where does the requirement for the bridges come from?

Quoted 3 lines

These bridges
need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

If you have a set of peer bridges, i.e., bridges on the same primary bus, I agree that at most one of them should have VGA Enable set. If more than one had VGA Enable set, a read on the primary bus could receive multiple responses, which would be a PCI protocol violation.

Similarly, if there are multiple VGA devices on the same bus, I believe that at most one could have I/O Space and Memory Space enabled in their command registers.

But I don't see the requirement for a bridge for every VGA device.

Quoted 28 lines
Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

author maintainer
#5 lore raw

Re: Re[2]: In "pci_fixup_video" check if this is or should be theprimaryvideo d

By the way, your emails are not being forwarded to the mailing lists, probably because they contain MIME or something else considered "fancy" by the mailing list manager.  So people reading this conversation via the list never see your emails.

There are some hints here:
  http://vger.kernel.org/majordomo-info.html
  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n228
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/email-clients.txt

#6 lore raw

Re: Re[2]: In "pci_fixup_video" check if this is or should be theprimaryvideo d

In reply to Bjorn Helgaas
Quoted 3 lines · Bjorn Helgaas

On Fri, Jan 17, 2014 at 3:43 AM, <[email protected]> wrote:

To make progress here, I think you'll have to be even more detailed.

sorry, could you restate what the problem is please?

It all started with Sander trying to have two
video cards on his VM.
I suggested several solutions.
See [email protected]

Is there any other problematic configuration that's not addressed by any of the suggested solutions?

Quoted 11 lines
Quoted 1 line

Because legacy VGA is only one device on x86 System,

Where is it documented that there can be only one legacy VGA device in an x86 system? I assume there exists a system with two slots on bus
0. What happens if a user installs two VGA cards in those slots? Does that prevent the system from working at all because it's an illegal configuration?

I think such a system could work correctly if the I/O Space and Memory Space bits in the command registers were only set on one of the VGA devices.

Yes.
If you like, this is a bios bug - it enabled both devices. But the disabled device would be completely non functional - one wonders why have it in the first place.
So the cure's worse than the illness - at the moment things actually kind of work because only one of the devices actually claims the VGA addresses.

Quoted 6 lines
Quoted 2 lines

I think qemu has to emulate a bridge
for legacy VGA.

My Lenovo T410 has "00:02.0 VGA compatible controller," which I assume would qualify as a "legacy VGA device," and there's no bridge related to it.

If it says (prog-if 00 [VGA controller]) then it is.

Quoted 6 lines
Quoted 3 lines

The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device.

I think you meant to say that if there are two VGA cards, we need *one* bridge for each device, e.g., two bridges and two VGA cards.

No, it's enough to have one device behind a bridge with disabled VGA forwarding.

Quoted 1 line

But where does the requirement for the bridges come from?

The bridge is just a way to filter out VGA addresses without disabling memory and IO on the device. PCI spec could include a device independent flag to disable VGA on the device, but it does not have that.

Quoted 9 lines
Quoted 3 lines

These bridges
need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

If you have a set of peer bridges, i.e., bridges on the same primary bus, I agree that at most one of them should have VGA Enable set. If more than one had VGA Enable set, a read on the primary bus could receive multiple responses, which would be a PCI protocol violation.

Quoted 5 lines

Similarly, if there are multiple VGA devices on the same bus, I believe that at most one could have I/O Space and Memory Space enabled in their command registers.

But I don't see the requirement for a bridge for every VGA device.

No, as long as you don't need all of them to work.

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

#7 lore raw

Re: In "pci_fixup_video" check if this is or should be theprimaryvideo d

In reply to a message not in the archive
Quoted 36 lines · On Fri, Jan 17, 2014 at 07:43:30PM +0900, [email protected] wrote:

Because legacy VGA is only one device on x86 System, I think qemu has to emulate a bridge for legacy VGA. The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device. These bridges need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

None of the bridges included in QEMU implements VGA support. The spec explicitly says its optional, so that's ok.

As a result, you need to put device which has to work in VGA mode on the root bus, any device behind a bridge won't work in VGA mode (but might work in non VGA mode).

Signature · 1 line
MST
#8 lore raw

Re: In "pci_fixup_video" check if this is or should be theprimaryvideo d

Quoted 38 lines · Michael S. Tsirkin
Quoted 36 lines · On Fri, Jan 17, 2014 at 07:43:30PM +0900, [email protected] wrote:

Because legacy VGA is only one device on x86 System, I think qemu has to emulate a bridge for legacy VGA. The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device. These bridges need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

Quoted 6 lines

None of the bridges included in QEMU implements VGA support. The spec explicitly says its optional, so that's ok.

As a result, you need to put device which has to work in VGA mode on the root bus, any device behind a bridge won't work in VGA mode (but might work in non VGA mode).

The ioh3420 root ports support VGA, so a q35 model is an option for multiple VGA devices.

#9 lore raw

Re: In "pci_fixup_video" check if this is or should be theprimaryvideo d

Quoted 42 lines · Alex Williamson
Quoted 41 lines · Michael S. Tsirkin
Quoted 36 lines · On Fri, Jan 17, 2014 at 07:43:30PM +0900, [email protected] wrote:

Because legacy VGA is only one device on x86 System, I think qemu has to emulate a bridge for legacy VGA. The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device. These bridges need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

None of the bridges included in QEMU implements VGA support. The spec explicitly says its optional, so that's ok.

Quoted 6 lines
Quoted 3 lines

As a result, you need to put device which has to work in VGA mode on the root bus, any device behind a bridge won't work in VGA mode (but might work in non VGA mode).

The ioh3420 root ports support VGA, so a q35 model is an option for multiple VGA devices.

Hmm, you are right, I forgot you implemented this in March. In fact, I see that you updated bridges to support VGA so if user wants to put both devices behind bridges, that's also possible.

Signature · 1 line
MST
#10 lore raw

Re: In "pci_fixup_video" check if this is or should be theprimaryvideo d

Quoted 47 lines · you
Quoted 46 lines · Alex Williamson
Quoted 44 lines · Michael S. Tsirkin
Quoted 36 lines · On Fri, Jan 17, 2014 at 07:43:30PM +0900, [email protected] wrote:

Because legacy VGA is only one device on x86 System, I think qemu has to emulate a bridge for legacy VGA. The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device. These bridges need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

None of the bridges included in QEMU implements VGA support. The spec explicitly says its optional, so that's ok.

As a result, you need to put device which has to work in VGA mode on the root bus, any device behind a bridge won't work in VGA mode (but might work in non VGA mode).

Quoted 7 lines
Quoted 2 lines

The ioh3420 root ports support VGA, so a q35 model is an option for multiple VGA devices.

Hmm, you are right, I forgot you implemented this in March. In fact, I see that you updated bridges to support VGA so if user wants to put both devices behind bridges, that's also possible.

Unfortunately Xen seems to be old "pc" for the moment and the passthrough implementation doesn't seem to have the support for defining and using bridges either. With my limited c coding skills i also can't find how in hw/xen_pt.c it actually inits a pci device in Qemu.

Although I still find it strange that the pci_video_fixup is ignoring the decisions that the vga arbitration code has already made .. (make the device with the vgacon be the
primary card unless arch code overrides), for the moment i will keep my patch in my private patch queue then :-)

#11 lore raw

Re: In "pci_fixup_video" check if this is or should be theprimaryvideo d

Quoted 53 lines · Sander Eikelenboom
Quoted 49 lines · you
Quoted 48 lines · Alex Williamson
Quoted 38 lines · Michael S. Tsirkin
Quoted 36 lines · On Fri, Jan 17, 2014 at 07:43:30PM +0900, [email protected] wrote:

Because legacy VGA is only one device on x86 System, I think qemu has to emulate a bridge for legacy VGA. The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device. These bridges need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

Quoted 6 lines

None of the bridges included in QEMU implements VGA support. The spec explicitly says its optional, so that's ok.

As a result, you need to put device which has to work in VGA mode on the root bus, any device behind a bridge won't work in VGA mode (but might work in non VGA mode).

The ioh3420 root ports support VGA, so a q35 model is an option for multiple VGA devices.

Quoted 8 lines
Quoted 4 lines

Hmm, you are right, I forgot you implemented this in March. In fact, I see that you updated bridges to support VGA so if user wants to put both devices behind bridges, that's also possible.

Unfortunately Xen seems to be old "pc" for the moment and the passthrough implementation doesn't seem to have the support for defining and using bridges either.

What do you base this claim on?
Did you actually try?
Bridges work fine for pc too.
See this for how to create a bridge and put a device behind it:
http://lists.gnu.org/archive/html/qemu-devel/2012-02/msg02765.html
this should work for all pci devices.

Quoted 2 lines

With my limited c coding skills i also can't find how in hw/xen_pt.c it actually inits a pci device in Qemu.

hw/xen_pt.c means you use an old Qemu. It's now in hw/xen/xen_pt.c
This is the relevant code:

    type_register_static(&xen_pci_passthrough_info);

As you can see parent is TYPE_PCI_DEVICE which will make xen-pci-passthrough a pci device.

Quoted 3 lines

Although I still find it strange that the pci_video_fixup is ignoring the decisions that the vga arbitration code has already made .. (make the device with the vgacon be the
primary card unless arch code overrides), for the moment i will keep my patch in my private patch queue then :-)

#12 lore raw

Re: In "pci_fixup_video" check if this is or should be theprimaryvideo d

Quoted 63 lines · you
Quoted 53 lines · Sander Eikelenboom
Quoted 49 lines · you
Quoted 48 lines · Alex Williamson
Quoted 38 lines · Michael S. Tsirkin
Quoted 36 lines · On Fri, Jan 17, 2014 at 07:43:30PM +0900, [email protected] wrote:

Because legacy VGA is only one device on x86 System, I think qemu has to emulate a bridge for legacy VGA. The VGA Enable bit on its bridge control register has to set to 1. The VGA Enable bit describes in Table 3-10 Bridge Control register. When there are two VGA cards on the same system, I think its system needs two bridges for each device. These bridges need bridge control registers. One VGA Enable bit on its bridge for legacy VGA has to set to 1. Another VGA Enable bit for second VGA has to set to 0.

Quoted 28 lines · On Thu, Jan 16, 2014 at 7:16 PM, <[email protected]> wrote:
Quoted 2 lines

I think qemu is breaking "PCI-to-PCI Bridge Architecture Specification Revison 1.2 June 9, 2003 Chapter 12. VGA Support".

And what exactly do you think qemu is doing wrong? Chapter 12 is ten pages long. Is there something there that prohibits two VGA devices on the same bus? I'm not a qemu developer, but if I were, I would need a better hint about what is wrong before I could fix it.

Again, sorry if you said this already and I missed it.

Quoted 16 lines
Quoted 16 lines

[+cc Michael, Jesse, David, qemu-devel]

Quoted 5 lines · On Wed, Jan 15, 2014 at 8:58 PM, <[email protected]> wrote:

I suggest you should not break the PCI specification, as a developer of proprietary hypervisor, but I think your patch is no problem.
Your PCI structure is specialized structure for your virtual machine. Maybe, your virtual machine will be causing another problem on Linux or other kernels because of breaking the PCI specification.

I assume you think qemu is breaking the PCI spec. What exactly do you think is broken? Please give specific references to the spec. This conversation is pretty fragmented, and I came in late, so I apologize if I missed this.

Bjorn

Quoted 6 lines

None of the bridges included in QEMU implements VGA support. The spec explicitly says its optional, so that's ok.

As a result, you need to put device which has to work in VGA mode on the root bus, any device behind a bridge won't work in VGA mode (but might work in non VGA mode).

The ioh3420 root ports support VGA, so a q35 model is an option for multiple VGA devices.

Quoted 8 lines
Quoted 4 lines

Hmm, you are right, I forgot you implemented this in March. In fact, I see that you updated bridges to support VGA so if user wants to put both devices behind bridges, that's also possible.

Unfortunately Xen seems to be old "pc" for the moment and the passthrough implementation doesn't seem to have the support for defining and using bridges either.

Quoted 6 lines

What do you base this claim on?
Did you actually try?
Bridges work fine for pc too.
See this for how to create a bridge and put a device behind it:
http://lists.gnu.org/archive/html/qemu-devel/2012-02/msg02765.html
this should work for all pci devices.

I was saying Xen (and it's toolstack incombination with it's specific xen pci passthrough implementation), not Qemu .. Creating a bridge is not that difficult as you can easily let xen add things to the commandline that's being generated to start Qemu. Changing things is more difficult and the pci passthrough stuff is going with QMP anyway.

Quoted 9 lines
Quoted 2 lines

With my limited c coding skills i also can't find how in hw/xen_pt.c it actually inits a pci device in Qemu.

hw/xen_pt.c means you use an old Qemu. It's now in hw/xen/xen_pt.c
This is the relevant code:

    type_register_static(&xen_pci_passthrough_info);

As you can see parent is TYPE_PCI_DEVICE which will make xen-pci-passthrough a pci device.

A sorry no i'm using Qemu pulled from the Qemu git tree .. just typed that path from memory ..

Ok thx for the pointer, hope i can find how to add it to a specific bridge instead of the root bus.

Quoted 3 lines
Quoted 3 lines

Although I still find it strange that the pci_video_fixup is ignoring the decisions that the vga arbitration code has already made .. (make the device with the vgacon be the
primary card unless arch code overrides), for the moment i will keep my patch in my private patch queue then :-)