Skip to contentSkip to conversation

Bug when disabling/enabling a PT device with MSI enabled

DISCUSSION Tom Rotenberg 4 participants 14 messages Nov 24, 2009 – Nov 25, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow - this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

#1 lore raw
Quoted 13 lines · Tom Rotenberg

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow - this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Quoted 1 line

Any ideas on how to solve this issue?

Looks like QEMU is not doing its job. It ought to be tracking when an MSI devices transforms to a INTx PCI device (and vice-versa) and make the appropiate Xen calls. Look in ioemu-dir/hw/pass-through.c

#2 lore raw

Can u please supply more details? how can i fix this issue? I think that when the hardware reset occured, the MSI was disabled, and that needs to be re-enabled again... no?

Quoted 20 lines · Konrad Rzeszutek Wilk
Quoted 13 lines · Tom Rotenberg

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Quoted 1 line

Any ideas on how to solve this issue?

Looks like QEMU is not doing its job. It ought to be tracking when an MSI devices transforms to a INTx PCI device (and vice-versa) and make the appropiate Xen calls. Look in ioemu-dir/hw/pass-through.c

#3 lore raw
Quoted 1 line · Tom Rotenberg

Can u please supply more details? how can i fix this issue?

.. snip ..

Quoted 1 line
Quoted 1 line

make the appropiate Xen calls. Look in ioemu-dir/hw/pass-through.c

Start digging in the code.

#4 lore raw
In reply to Tom Rotenberg

Couple of questions -

1) What kind of device are you referring to below? Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel. You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious. I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow - this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

Hi,

1) It's not display, i am using a wlan device (which Windows tends to disable and re-enable in certain cases)
2) I am using a 2.6.24 xen kernel

I will do the check with the 2.6.18 xen kernel, and see if it's responsible for this bug.

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below?  Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel.  You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious.  I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw
In reply to Kamala Narasimhan

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below?  Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel.  You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious.  I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw

This should be about qemu's MSI support. The code is in qemu/hw/pt-msi.c for all MSI emulation.
Windows XP does not support MSI if I remember correctly. SO this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below? Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel. You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious. I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow - this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#8 lore raw

Sorry send out the mail too quickly.
I realized it is MSI translation when I finished first section but forgot remove it, so please ignore first section. You only need care about MSI translation, the code is in hw/pass-through.c. You can check qemu's changelog at a8d1bd66.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Jiang, Yunhong [[email protected]]
Sent: Wednesday, November 25, 2009 2:10 AM
To: Tom Rotenberg; Kamala Narasimhan
Cc: [email protected]
Subject: RE: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

This should be about qemu's MSI support. The code is in qemu/hw/pt-msi.c for all MSI emulation.
Windows XP does not support MSI if I remember correctly. SO this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below? Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel. You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious. I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow - this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#9 lore raw

Well, to try and see if the problem is msi related or not, i registered the device with the option of 'msi_translate=0' to force the use of intx instead of MSI, and i still got the problem... so i guess it's not related to the MSI.

It looks like the IntX bit (bit 3 of status word) is runed on somehow outside qemu, and that's the problem... could that be?

Quoted 85 lines · Yunhong

Sorry send out the mail too quickly.
I realized it is MSI translation when I finished first section but forgot remove it, so please ignore  first section. You only need care about MSI translation, the code is in hw/pass-through.c.  You can check qemu's changelog at a8d1bd66.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Jiang, Yunhong [[email protected]]
Sent: Wednesday, November 25, 2009 2:10 AM
To: Tom Rotenberg; Kamala Narasimhan
Cc: [email protected]
Subject: RE: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

This should be about qemu's MSI support. The code is in qemu/hw/pt-msi.c for all MSI emulation.
Windows XP does not support MSI if I remember correctly. SO this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below?  Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel.  You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious.  I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#10 lore raw

If the msi_translate=0, why IntX bit is turned on is wrong? I assume guest should use intX in such situation.

--jyh
________________________________________
From: Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 2:29 AM
To: Jiang, Yunhong
Cc: Kamala Narasimhan; [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Well, to try and see if the problem is msi related or not, i registered the device with the option of 'msi_translate=0' to force the use of intx instead of MSI, and i still got the problem... so i guess it's not related to the MSI.

It looks like the IntX bit (bit 3 of status word) is runed on somehow outside qemu, and that's the problem... could that be?

Quoted 85 lines · Yunhong

Sorry send out the mail too quickly.
I realized it is MSI translation when I finished first section but forgot remove it, so please ignore first section. You only need care about MSI translation, the code is in hw/pass-through.c. You can check qemu's changelog at a8d1bd66.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Jiang, Yunhong [[email protected]]
Sent: Wednesday, November 25, 2009 2:10 AM
To: Tom Rotenberg; Kamala Narasimhan
Cc: [email protected]
Subject: RE: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

This should be about qemu's MSI support. The code is in qemu/hw/pt-msi.c for all MSI emulation.
Windows XP does not support MSI if I remember correctly. SO this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below? Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel. You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious. I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow - this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#11 lore raw

Well, you are correct... however, the situation is that the bgefore the disable the intx bit was turned off, and only after disable and then re-enable it was turned on, and that's the strange part of it...

Quoted 106 lines · Yunhong

If the msi_translate=0, why IntX bit is turned on is wrong? I assume guest should use intX in such situation.

--jyh
________________________________________
From: Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 2:29 AM
To: Jiang, Yunhong
Cc: Kamala Narasimhan; [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, to try and see if the problem is msi related or not, i registered the device with the option of 'msi_translate=0' to force the use of intx instead of MSI, and i still got the problem... so i guess it's not related to the MSI.

It looks like the IntX bit (bit 3 of status word) is runed on somehow outside qemu, and that's the problem... could that be?

Quoted 85 lines · Yunhong

Sorry send out the mail too quickly.
I realized it is MSI translation when I finished first section but forgot remove it, so please ignore  first section. You only need care about MSI translation, the code is in hw/pass-through.c.  You can check qemu's changelog at a8d1bd66.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Jiang, Yunhong [[email protected]]
Sent: Wednesday, November 25, 2009 2:10 AM
To: Tom Rotenberg; Kamala Narasimhan
Cc: [email protected]
Subject: RE: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

This should be about qemu's MSI support. The code is in qemu/hw/pt-msi.c for all MSI emulation.
Windows XP does not support MSI if I remember correctly. SO this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

--jyh
________________________________________
From: [email protected] [[email protected]] On Behalf Of Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 40 lines · Kamala Narasimhan

Couple of questions -

1) What kind of device are you referring to below?  Display by any chance?
2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your dom0 kernel.  You might want to do a quick search for msi patches in http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious.  I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Kamala

Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction.
After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#12 lore raw
Quoted 3 lines · Tom Rotenberg

Well, you are correct... however, the situation is that the bgefore the disable the intx bit was turned off, and only after disable and then re-enable it was turned on, and that's the strange part of it...

You mean even if the msi_translate == 0? That's strange. If this happens only under msi_translate, it is reasonable and maybe something wrong. So can you give me a confirmation?

--jyh

Quoted 129 lines
Quoted 1 line · Yunhong

If the msi_translate=0, why IntX bit is turned on is wrong?

I assume guest should use intX in such situation.

Quoted 15 lines

--jyh
________________________________________
From: Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 2:29 AM
To: Jiang, Yunhong
Cc: Kamala Narasimhan; [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, to try and see if the problem is msi related or not, i registered the device with the option of 'msi_translate=0' to force the use of intx instead of MSI, and i still got the problem... so i guess it's not related to the MSI.

Quoted 7 lines

It looks like the IntX bit (bit 3 of status word) is runed on somehow outside qemu, and that's the problem... could that be?

Quoted 2 lines · Yunhong

Sorry send out the mail too quickly.
I realized it is MSI translation when I finished first

section but forgot remove it, so please ignore  first section.

Quoted 1 line
Quoted 1 line

You only need care about MSI translation, the code is in

hw/pass-through.c.  You can check qemu's changelog at a8d1bd66.

Quoted 4 lines
Quoted 4 lines

--jyh
________________________________________
From: [email protected]

[[email protected]] On Behalf Of Jiang, Yunhong [[email protected]]

Quoted 7 lines
Quoted 7 lines

Sent: Wednesday, November 25, 2009 2:10 AM
To: Tom Rotenberg; Kamala Narasimhan
Cc: [email protected]
Subject: RE: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

This should be about qemu's MSI support. The code is in

qemu/hw/pt-msi.c for all MSI emulation.

Quoted 1 line
Quoted 1 line

Windows XP does not support MSI if I remember correctly. SO

this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

Quoted 4 lines
Quoted 4 lines

--jyh
________________________________________
From: [email protected]

[[email protected]] On Behalf Of Tom Rotenberg [[email protected]]

Quoted 19 lines
Quoted 19 lines

Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 1 line · Kamala Narasimhan
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Couple of questions -

1) What kind of device are you referring to below? Display by any chance? 2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your

dom0 kernel.  You might want to do a quick search for msi patches in
http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious.  I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Quoted 44 lines
Quoted 44 lines
Quoted 34 lines

Kamala

Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction. After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#13 lore raw

It happens also when msi_translte = 0 , and i think that it's not related to the MSI at all... i also checked other devices which use MSI (like the audio device), and they worked fine.
You can take a look at the new mail i sent, which incorporates more details about this problem.

Quoted 138 lines · Yunhong
Quoted 3 lines · Tom Rotenberg

Well, you are correct... however, the situation is that the bgefore the disable the intx bit was turned off, and only after disable and then re-enable it was turned on, and that's the strange part of it...

You mean even if the msi_translate == 0? That's strange. If this happens only under msi_translate, it is reasonable and maybe something wrong. So can you give me a confirmation?

--jyh

Quoted 129 lines
Quoted 1 line · Yunhong

If the msi_translate=0, why IntX bit is turned on is wrong?

I assume guest should use intX in such situation.

Quoted 15 lines

--jyh
________________________________________
From: Tom Rotenberg [[email protected]]
Sent: Wednesday, November 25, 2009 2:29 AM
To: Jiang, Yunhong
Cc: Kamala Narasimhan; [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, to try and see if the problem is msi related or not, i registered the device with the option of 'msi_translate=0' to force the use of intx instead of MSI, and i still got the problem... so i guess it's not related to the MSI.

Quoted 7 lines

It looks like the IntX bit (bit 3 of status word) is runed on somehow outside qemu, and that's the problem... could that be?

Quoted 2 lines · Yunhong

Sorry send out the mail too quickly.
I realized it is MSI translation when I finished first

section but forgot remove it, so please ignore  first section.

Quoted 1 line
Quoted 1 line

You only need care about MSI translation, the code is in

hw/pass-through.c.  You can check qemu's changelog at a8d1bd66.

Quoted 4 lines
Quoted 4 lines

--jyh
________________________________________
From: [email protected]

[[email protected]] On Behalf Of Jiang, Yunhong [[email protected]]

Quoted 7 lines
Quoted 7 lines

Sent: Wednesday, November 25, 2009 2:10 AM
To: Tom Rotenberg; Kamala Narasimhan
Cc: [email protected]
Subject: RE: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

This should be about qemu's MSI support. The code is in

qemu/hw/pt-msi.c for all MSI emulation.

Quoted 1 line
Quoted 1 line

Windows XP does not support MSI if I remember correctly. SO

this issue should be about MSI translation, i.e. guest is using IOAPIC while host is using MSI. Xen hypervisor will translate the MSI to guest's IOAPIC.

Quoted 4 lines
Quoted 4 lines

--jyh
________________________________________
From: [email protected]

[[email protected]] On Behalf Of Tom Rotenberg [[email protected]]

Quoted 19 lines
Quoted 19 lines

Sent: Wednesday, November 25, 2009 1:27 AM
To: Kamala Narasimhan
Cc: [email protected]
Subject: Re: [Xen-devel] Bug when disabling/enabling a PT device with MSI       enabled

Well, just tested it with the 2.6.18 latest kernel, and the bug still exists. Also, i think that iit's more related to how qemu handles the "disable/enable" of domU for PT devices with MSI... but i don't know where to start from? it looks like when re-enabling a PT device with MSI, we need qemu to re-initialize the device according to it's original MSI state (and not to what it was resetted before).

Does anyone has any clue about it?

Quoted 1 line · Kamala Narasimhan
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Couple of questions -

1) What kind of device are you referring to below? Display by any chance? 2) Which tree is your dom0 kernel based on?

There is a chance you are missing some msi patches in your

dom0 kernel.  You might want to do a quick search for msi patches in
http://xenbits.xen.org/staging/linux-2.6.18-xen.hg?rev=msi and see if you are missing anything obvious.  I recently encountered a similar issue in a slightly different situation, a subset of the problem was caused because of missing msi patches.

Quoted 44 lines
Quoted 44 lines
Quoted 34 lines

Kamala

Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Tom Rotenberg
Sent: Tuesday, November 24, 2009 1:43 PM
To: [email protected]
Subject: [Xen-devel] Bug when disabling/enabling a PT device with MSI enabled

Hi,

I am using the xen-3,4, and i am doing pass-through for a device with MSI enabled (the device of-course supports MSI) to a domU with Windows XP. When i disable and then re-enable the device using Windows device manager, everything looks like it's working fine, but the device seems to malfunction. After digging a little bit, i saw that the problem is, because the bit of the interrupt-status (bit 3) in the status register (offset 0x6 in the PCI config space) was turned on somehow -  this proibably caused the MSI to malfunction (because the IntX assertion was enabled - thus disabling the MSI) - and this lead to the problem i experienced.

Any ideas on how to solve this issue?

Tom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel