Jordan Hargrave writes:

> This is the first patch for adding PCI passthrough support to VMD.
> I am splitting up the necessary changes into smaller patches.
>
> This code fixes the pci device union for accessing PCI config space >= 0x40
> pcidump -xxx would return garbage data due to union overlap

I can confirm at least in an OpenBSD guest that pcidump is returning
something different for the virtio devices:

24,26c24,26
<       0x0040: 00000001 00000000 00000000 00000000
<       0x0050: 00000010 00000000 00000000 00000000
<       0x0060: 00000000 20000000 ff4188fd 0000000b
---
>       0x0040: 00000000 00000000 00000000 00000000
>       0x0050: 00000000 00000000 00000000 00000000
>       0x0060: 00000000 00000000 00000000 00000000
41,43c41,43
<       0x0040: 00000001 00000000 00000000 00000000
<       0x0050: 00000010 00000000 00000000 00000000
<       0x0060: 00000000 10000000 ff418911 0000000b
---
>       0x0040: 00000000 00000000 00000000 00000000
>       0x0050: 00000000 00000000 00000000 00000000
>       0x0060: 00000000 00000000 00000000 00000000
46c46
<       0x0090: 00000000 00000000 01d25048 0000000c
---
>       0x0090: 00000000 00000000 00000000 00000000
58,60c58,60
<       0x0040: 00000001 00000000 00000000 00000000
<       0x0050: 00000010 00000000 00000000 00000000
<       0x0060: 00000000 d0000000 ff418909 0000000b
---
>       0x0040: 00000000 00000000 00000000 00000000
>       0x0050: 00000000 00000000 00000000 00000000
>       0x0060: 00000000 00000000 00000000 00000000
63c63
<       0x0090: 00000000 00000000 019adaf5 0000000c
---
>       0x0090: 00000000 00000000 00000000 00000000
75,77c75,77
<       0x0040: 00000001 00000000 00000000 00000000
<       0x0050: 00000010 00000000 00000000 00000000
<       0x0060: 00000000 20000000 ff418924 0000000b
---
>       0x0040: 00000000 00000000 00000000 00000000
>       0x0050: 00000000 00000000 00000000 00000000
>       0x0060: 00000000 00000000 00000000 00000000


I'll apply it to my other system where I keep a mix of OpenBSD and Linux
guests running.

>
> pci_add_bar now requires specifying the BAR area size to allocate
>
> Extra cookie argument added to pci_add_device
>

PCI isn't something I grok, so hopefully someone else can take a look at
this to see if it makes sense.

-Dave Voutila

Reply via email to