Mailing List Archive

[xen-unstable] [qemu-xen] pci passthrough msi-x returns same pirq
Hi Stefano / Anthony,

With the debug output turned on i see some difference between qemu-traditional and qemu-upstream:

With the pci passthroughed device that fails with msi-x, in qemu-xen it seems to get the same pirq back for every entry

in qemu-traditional:

pt_msix_update_one: pt_msix_update_one requested pirq = 87
pt_msix_update_one: Update msix entry 0 with pirq 57 gvec 0
pt_msix_update_one: pt_msix_update_one requested pirq = 86
pt_msix_update_one: Update msix entry 1 with pirq 56 gvec 0
pt_msix_update_one: pt_msix_update_one requested pirq = 85
pt_msix_update_one: Update msix entry 2 with pirq 55 gvec 0
pt_msix_update_one: pt_msix_update_one requested pirq = 84
pt_msix_update_one: Update msix entry 3 with pirq 54 gvec 0


in qemu-xen (upstream):

[00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0)
[00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3057 (entry: 0)
[00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x1)
[00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3056 (entry: 0x1)
[00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x2)
[00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3055 (entry: 0x2)
[00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x3)
[00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3054 (entry: 0x3)

--
Sander


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [xen-unstable] [qemu-xen] pci passthrough msi-x returns same pirq [ In reply to ]
On Thu, 6 Dec 2012, Sander Eikelenboom wrote:
> Hi Stefano / Anthony,
>
> With the debug output turned on i see some difference between qemu-traditional and qemu-upstream:
>
> With the pci passthroughed device that fails with msi-x, in qemu-xen it seems to get the same pirq back for every entry
>
> in qemu-traditional:
>
> pt_msix_update_one: pt_msix_update_one requested pirq = 87
> pt_msix_update_one: Update msix entry 0 with pirq 57 gvec 0
> pt_msix_update_one: pt_msix_update_one requested pirq = 86
> pt_msix_update_one: Update msix entry 1 with pirq 56 gvec 0
> pt_msix_update_one: pt_msix_update_one requested pirq = 85
> pt_msix_update_one: Update msix entry 2 with pirq 55 gvec 0
> pt_msix_update_one: pt_msix_update_one requested pirq = 84
> pt_msix_update_one: Update msix entry 3 with pirq 54 gvec 0
>
>
> in qemu-xen (upstream):
>
> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0)
> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3057 (entry: 0)
> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x1)
> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3056 (entry: 0x1)
> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x2)
> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3055 (entry: 0x2)
> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x3)
> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3054 (entry: 0x3)

That is a good pointer, but unfortunately the code that parses those
entries look exactly alike in both QEMU trees:

qemu-xen-traditional/hw/pt-msi.c:pt_msix_update_one

if (!gvec) {
/* if gvec is 0, the guest is asking for a particular pirq that
* is passed as dest_id */
pirq = ((gaddr >> 32) & 0xffffff00) |
(((gaddr & 0xffffffff) >> MSI_TARGET_CPU_SHIFT) & 0xff);



qemu-xen/hw/xen_pt_msi.c:msi_msix_setup

if (gvec == 0) {
/* if gvec is 0, the guest is asking for a particular pirq that
* is passed as dest_id */
*ppirq = msi_ext_dest_id(addr >> 32) | msi_dest_id(addr);

given how msi_ext_dest_id and msi_dest_id are defined, they should
behave the same way.

Maybe adding a printk in msi_msix_setup to show addr would help
nonetheless...

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [xen-unstable] [qemu-xen] pci passthrough msi-x returns same pirq [ In reply to ]
Friday, December 7, 2012, 6:24:10 PM, you wrote:

> On Thu, 6 Dec 2012, Sander Eikelenboom wrote:
>> Hi Stefano / Anthony,
>>
>> With the debug output turned on i see some difference between qemu-traditional and qemu-upstream:
>>
>> With the pci passthroughed device that fails with msi-x, in qemu-xen it seems to get the same pirq back for every entry
>>
>> in qemu-traditional:
>>
>> pt_msix_update_one: pt_msix_update_one requested pirq = 87
>> pt_msix_update_one: Update msix entry 0 with pirq 57 gvec 0
>> pt_msix_update_one: pt_msix_update_one requested pirq = 86
>> pt_msix_update_one: Update msix entry 1 with pirq 56 gvec 0
>> pt_msix_update_one: pt_msix_update_one requested pirq = 85
>> pt_msix_update_one: Update msix entry 2 with pirq 55 gvec 0
>> pt_msix_update_one: pt_msix_update_one requested pirq = 84
>> pt_msix_update_one: Update msix entry 3 with pirq 54 gvec 0
>>
>>
>> in qemu-xen (upstream):
>>
>> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0)
>> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3057 (entry: 0)
>> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x1)
>> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3056 (entry: 0x1)
>> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x2)
>> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3055 (entry: 0x2)
>> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x3)
>> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3054 (entry: 0x3)

> That is a good pointer, but unfortunately the code that parses those
> entries look exactly alike in both QEMU trees:

> qemu-xen-traditional/hw/pt-msi.c:pt_msix_update_one

> if (!gvec) {
> /* if gvec is 0, the guest is asking for a particular pirq that
> * is passed as dest_id */
> pirq = ((gaddr >> 32) & 0xffffff00) |
> (((gaddr & 0xffffffff) >> MSI_TARGET_CPU_SHIFT) & 0xff);



> qemu-xen/hw/xen_pt_msi.c:msi_msix_setup

> if (gvec == 0) {
> /* if gvec is 0, the guest is asking for a particular pirq that
> * is passed as dest_id */
> *ppirq = msi_ext_dest_id(addr >> 32) | msi_dest_id(addr);

> given how msi_ext_dest_id and msi_dest_id are defined, they should
> behave the same way.

> Maybe adding a printk in msi_msix_setup to show addr would help
> nonetheless...

Hi Stefano,

I have added some printk's attached i have:

- qemu-upstream.log boot of the guest with qemu upstream, device not working
- qemu-traditional.log boot of the same guest with qemu traditional, device is working

- xl-dmesg-upstream.txt part of xl-dmesg related to boot of guest with qemu-upstream
- xl-dmesg-traditional.txt part of xl-dmesg related to boot of sameguest with qemu-traditional
- xl-dmesg.txt complete xl-dmesg

- interrupts-dom0.txt /proc/interrupts of dom0
- interrupts-upstream.txt /proc/interrupts of guest with qemu-upstream

--
Sander
Re: [xen-unstable] [qemu-xen] pci passthrough msi-x returns same pirq [ In reply to ]
On Fri, 7 Dec 2012, Sander Eikelenboom wrote:
> Friday, December 7, 2012, 6:24:10 PM, you wrote:
>
> > On Thu, 6 Dec 2012, Sander Eikelenboom wrote:
> >> Hi Stefano / Anthony,
> >>
> >> With the debug output turned on i see some difference between qemu-traditional and qemu-upstream:
> >>
> >> With the pci passthroughed device that fails with msi-x, in qemu-xen it seems to get the same pirq back for every entry
> >>
> >> in qemu-traditional:
> >>
> >> pt_msix_update_one: pt_msix_update_one requested pirq = 87
> >> pt_msix_update_one: Update msix entry 0 with pirq 57 gvec 0
> >> pt_msix_update_one: pt_msix_update_one requested pirq = 86
> >> pt_msix_update_one: Update msix entry 1 with pirq 56 gvec 0
> >> pt_msix_update_one: pt_msix_update_one requested pirq = 85
> >> pt_msix_update_one: Update msix entry 2 with pirq 55 gvec 0
> >> pt_msix_update_one: pt_msix_update_one requested pirq = 84
> >> pt_msix_update_one: Update msix entry 3 with pirq 54 gvec 0
> >>
> >>
> >> in qemu-xen (upstream):
> >>
> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0)
> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3057 (entry: 0)
> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x1)
> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3056 (entry: 0x1)
> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x2)
> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3055 (entry: 0x2)
> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x3)
> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3054 (entry: 0x3)
>
> > That is a good pointer, but unfortunately the code that parses those
> > entries look exactly alike in both QEMU trees:
>
> > qemu-xen-traditional/hw/pt-msi.c:pt_msix_update_one
>
> > if (!gvec) {
> > /* if gvec is 0, the guest is asking for a particular pirq that
> > * is passed as dest_id */
> > pirq = ((gaddr >> 32) & 0xffffff00) |
> > (((gaddr & 0xffffffff) >> MSI_TARGET_CPU_SHIFT) & 0xff);
>
>
>
> > qemu-xen/hw/xen_pt_msi.c:msi_msix_setup
>
> > if (gvec == 0) {
> > /* if gvec is 0, the guest is asking for a particular pirq that
> > * is passed as dest_id */
> > *ppirq = msi_ext_dest_id(addr >> 32) | msi_dest_id(addr);
>
> > given how msi_ext_dest_id and msi_dest_id are defined, they should
> > behave the same way.
>
> > Maybe adding a printk in msi_msix_setup to show addr would help
> > nonetheless...
>
> Hi Stefano,
>
> I have added some printk's attached i have:
>
> - qemu-upstream.log boot of the guest with qemu upstream, device not working
> - qemu-traditional.log boot of the same guest with qemu traditional, device is working
>
> - xl-dmesg-upstream.txt part of xl-dmesg related to boot of guest with qemu-upstream
> - xl-dmesg-traditional.txt part of xl-dmesg related to boot of sameguest with qemu-traditional
> - xl-dmesg.txt complete xl-dmesg
>
> - interrupts-dom0.txt /proc/interrupts of dom0
> - interrupts-upstream.txt /proc/interrupts of guest with qemu-upstream

Thank you very much!
Could it be that the error is just due to a typo?

---

diff --git a/hw/xen_pt_msi.c b/hw/xen_pt_msi.c
index 6807672..db757cd 100644
--- a/hw/xen_pt_msi.c
+++ b/hw/xen_pt_msi.c
@@ -321,7 +321,7 @@ static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)

pirq = entry->pirq;

- rc = msi_msix_setup(s, entry->data, entry->data, &pirq, true, entry_nr,
+ rc = msi_msix_setup(s, entry->addr, entry->data, &pirq, true, entry_nr,
entry->pirq == XEN_PT_UNASSIGNED_PIRQ);
if (rc) {
return rc;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [xen-unstable] [qemu-xen] pci passthrough msi-x returns same pirq [ In reply to ]
Monday, December 10, 2012, 4:48:32 PM, you wrote:

> On Fri, 7 Dec 2012, Sander Eikelenboom wrote:
>> Friday, December 7, 2012, 6:24:10 PM, you wrote:
>>
>> > On Thu, 6 Dec 2012, Sander Eikelenboom wrote:
>> >> Hi Stefano / Anthony,
>> >>
>> >> With the debug output turned on i see some difference between qemu-traditional and qemu-upstream:
>> >>
>> >> With the pci passthroughed device that fails with msi-x, in qemu-xen it seems to get the same pirq back for every entry
>> >>
>> >> in qemu-traditional:
>> >>
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 87
>> >> pt_msix_update_one: Update msix entry 0 with pirq 57 gvec 0
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 86
>> >> pt_msix_update_one: Update msix entry 1 with pirq 56 gvec 0
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 85
>> >> pt_msix_update_one: Update msix entry 2 with pirq 55 gvec 0
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 84
>> >> pt_msix_update_one: Update msix entry 3 with pirq 54 gvec 0
>> >>
>> >>
>> >> in qemu-xen (upstream):
>> >>
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3057 (entry: 0)
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x1)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3056 (entry: 0x1)
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x2)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3055 (entry: 0x2)
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x3)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3054 (entry: 0x3)
>>
>> > That is a good pointer, but unfortunately the code that parses those
>> > entries look exactly alike in both QEMU trees:
>>
>> > qemu-xen-traditional/hw/pt-msi.c:pt_msix_update_one
>>
>> > if (!gvec) {
>> > /* if gvec is 0, the guest is asking for a particular pirq that
>> > * is passed as dest_id */
>> > pirq = ((gaddr >> 32) & 0xffffff00) |
>> > (((gaddr & 0xffffffff) >> MSI_TARGET_CPU_SHIFT) & 0xff);
>>
>>
>>
>> > qemu-xen/hw/xen_pt_msi.c:msi_msix_setup
>>
>> > if (gvec == 0) {
>> > /* if gvec is 0, the guest is asking for a particular pirq that
>> > * is passed as dest_id */
>> > *ppirq = msi_ext_dest_id(addr >> 32) | msi_dest_id(addr);
>>
>> > given how msi_ext_dest_id and msi_dest_id are defined, they should
>> > behave the same way.
>>
>> > Maybe adding a printk in msi_msix_setup to show addr would help
>> > nonetheless...
>>
>> Hi Stefano,
>>
>> I have added some printk's attached i have:
>>
>> - qemu-upstream.log boot of the guest with qemu upstream, device not working
>> - qemu-traditional.log boot of the same guest with qemu traditional, device is working
>>
>> - xl-dmesg-upstream.txt part of xl-dmesg related to boot of guest with qemu-upstream
>> - xl-dmesg-traditional.txt part of xl-dmesg related to boot of sameguest with qemu-traditional
>> - xl-dmesg.txt complete xl-dmesg
>>
>> - interrupts-dom0.txt /proc/interrupts of dom0
>> - interrupts-upstream.txt /proc/interrupts of guest with qemu-upstream

> Thank you very much!
> Could it be that the error is just due to a typo?

Hmmm that i didn't notice that :-)
Must be it .. will give it a go !

Thx !

> ---

> diff --git a/hw/xen_pt_msi.c b/hw/xen_pt_msi.c
> index 6807672..db757cd 100644
> --- a/hw/xen_pt_msi.c
> +++ b/hw/xen_pt_msi.c
> @@ -321,7 +321,7 @@ static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)
>
> pirq = entry->pirq;
>
> - rc = msi_msix_setup(s, entry->data, entry->data, &pirq, true, entry_nr,
> + rc = msi_msix_setup(s, entry->addr, entry->data, &pirq, true, entry_nr,
> entry->pirq == XEN_PT_UNASSIGNED_PIRQ);
> if (rc) {
> return rc;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [xen-unstable] [qemu-xen] pci passthrough msi-x returns same pirq [ In reply to ]
Monday, December 10, 2012, 4:48:32 PM, you wrote:

> On Fri, 7 Dec 2012, Sander Eikelenboom wrote:
>> Friday, December 7, 2012, 6:24:10 PM, you wrote:
>>
>> > On Thu, 6 Dec 2012, Sander Eikelenboom wrote:
>> >> Hi Stefano / Anthony,
>> >>
>> >> With the debug output turned on i see some difference between qemu-traditional and qemu-upstream:
>> >>
>> >> With the pci passthroughed device that fails with msi-x, in qemu-xen it seems to get the same pirq back for every entry
>> >>
>> >> in qemu-traditional:
>> >>
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 87
>> >> pt_msix_update_one: Update msix entry 0 with pirq 57 gvec 0
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 86
>> >> pt_msix_update_one: Update msix entry 1 with pirq 56 gvec 0
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 85
>> >> pt_msix_update_one: Update msix entry 2 with pirq 55 gvec 0
>> >> pt_msix_update_one: pt_msix_update_one requested pirq = 84
>> >> pt_msix_update_one: Update msix entry 3 with pirq 54 gvec 0
>> >>
>> >>
>> >> in qemu-xen (upstream):
>> >>
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3057 (entry: 0)
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x1)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3056 (entry: 0x1)
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x2)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3055 (entry: 0x2)
>> >> [00:05.0] msi_msix_setup: requested pirq 4 for MSI-X (vec: 0, entry: 0x3)
>> >> [00:05.0] msi_msix_update: Updating MSI-X with pirq 4 gvec 0 gflags 0x3054 (entry: 0x3)
>>
>> > That is a good pointer, but unfortunately the code that parses those
>> > entries look exactly alike in both QEMU trees:
>>
>> > qemu-xen-traditional/hw/pt-msi.c:pt_msix_update_one
>>
>> > if (!gvec) {
>> > /* if gvec is 0, the guest is asking for a particular pirq that
>> > * is passed as dest_id */
>> > pirq = ((gaddr >> 32) & 0xffffff00) |
>> > (((gaddr & 0xffffffff) >> MSI_TARGET_CPU_SHIFT) & 0xff);
>>
>>
>>
>> > qemu-xen/hw/xen_pt_msi.c:msi_msix_setup
>>
>> > if (gvec == 0) {
>> > /* if gvec is 0, the guest is asking for a particular pirq that
>> > * is passed as dest_id */
>> > *ppirq = msi_ext_dest_id(addr >> 32) | msi_dest_id(addr);
>>
>> > given how msi_ext_dest_id and msi_dest_id are defined, they should
>> > behave the same way.
>>
>> > Maybe adding a printk in msi_msix_setup to show addr would help
>> > nonetheless...
>>
>> Hi Stefano,
>>
>> I have added some printk's attached i have:
>>
>> - qemu-upstream.log boot of the guest with qemu upstream, device not working
>> - qemu-traditional.log boot of the same guest with qemu traditional, device is working
>>
>> - xl-dmesg-upstream.txt part of xl-dmesg related to boot of guest with qemu-upstream
>> - xl-dmesg-traditional.txt part of xl-dmesg related to boot of sameguest with qemu-traditional
>> - xl-dmesg.txt complete xl-dmesg
>>
>> - interrupts-dom0.txt /proc/interrupts of dom0
>> - interrupts-upstream.txt /proc/interrupts of guest with qemu-upstream

> Thank you very much!
> Could it be that the error is just due to a typo?

Tested-By .. yes it was that simple ;-)
Thx !


> ---

> diff --git a/hw/xen_pt_msi.c b/hw/xen_pt_msi.c
> index 6807672..db757cd 100644
> --- a/hw/xen_pt_msi.c
> +++ b/hw/xen_pt_msi.c
> @@ -321,7 +321,7 @@ static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)
>
> pirq = entry->pirq;
>
> - rc = msi_msix_setup(s, entry->data, entry->data, &pirq, true, entry_nr,
> + rc = msi_msix_setup(s, entry->addr, entry->data, &pirq, true, entry_nr,
> entry->pirq == XEN_PT_UNASSIGNED_PIRQ);
> if (rc) {
> return rc;



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel