Yuji Shimada
2008-Sep-05 07:48 UTC
[Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memory mapped table.
This patch fixes offset of MSI-X memory mapped table. Current code does not set dev->msix->table_off variable. The offset of MSI-X memory mapped table is treated as 0. The wrong region is unmapped from guest physical memory space. As a result, guest device driver can''t access memory mapped resource. The patch fixes this issue. My MegaRAID SAS assigned to guest domain becomes working with the patch. Thanks, Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp> diff --git a/hw/pt-msi.c b/hw/pt-msi.c index 511eb56..c515c02 100644 --- a/hw/pt-msi.c +++ b/hw/pt-msi.c @@ -313,7 +313,7 @@ int pt_msix_init(struct pt_dev *dev, int pos) table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE); bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR; - table_off &= table_off & ~PCI_MSIX_BIR; + table_off = dev->msix->table_off = table_off & ~PCI_MSIX_BIR; dev->msix->table_base = dev->pci_dev->base_addr[bar_index]; PT_LOG("get MSI-X table bar base %llx\n", (unsigned long long)dev->msix->table_base); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Cui, Dexuan
2008-Sep-05 08:37 UTC
RE: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table.
Great! I can confirm this patch fixes the issue I meet with. Thanks! -- Dexuan -----Original Message----- From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Yuji Shimada Sent: 2008年9月5日 15:48 To: Ian Jackson; Keir Fraser; xen-devel@lists.xensource.com Subject: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table. This patch fixes offset of MSI-X memory mapped table. Current code does not set dev->msix->table_off variable. The offset of MSI-X memory mapped table is treated as 0. The wrong region is unmapped from guest physical memory space. As a result, guest device driver can''t access memory mapped resource. The patch fixes this issue. My MegaRAID SAS assigned to guest domain becomes working with the patch. Thanks, Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp> diff --git a/hw/pt-msi.c b/hw/pt-msi.c index 511eb56..c515c02 100644 --- a/hw/pt-msi.c +++ b/hw/pt-msi.c @@ -313,7 +313,7 @@ int pt_msix_init(struct pt_dev *dev, int pos) table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE); bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR; - table_off &= table_off & ~PCI_MSIX_BIR; + table_off = dev->msix->table_off = table_off & ~PCI_MSIX_BIR; dev->msix->table_base = dev->pci_dev->base_addr[bar_index]; PT_LOG("get MSI-X table bar base %llx\n", (unsigned long long)dev->msix->table_base); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Yuji Shimada
2008-Sep-05 08:58 UTC
Re: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table.
Hi Cui, Thank you for testing. But my FC-HBA(Emulex LPe1150) does not work with this patch, because it is not designed to be virtualized friendly. Thanks, -- Yuji Shimada On Fri, 5 Sep 2008 16:37:45 +0800 "Cui, Dexuan" <dexuan.cui@intel.com> wrote:> Great! I can confirm this patch fixes the issue I meet with. > > Thanks! > -- Dexuan > > > -----Original Message----- > From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Yuji Shimada > Sent: 2008トヤツ5ネユ 15:48 > To: Ian Jackson; Keir Fraser; xen-devel@lists.xensource.com > Subject: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table. > > This patch fixes offset of MSI-X memory mapped table. > > Current code does not set dev->msix->table_off variable. > The offset of MSI-X memory mapped table is treated as 0. > The wrong region is unmapped from guest physical memory space. > As a result, guest device driver can''t access memory mapped resource. > > The patch fixes this issue. My MegaRAID SAS assigned to guest domain > becomes working with the patch. > > Thanks, > > Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp> > > diff --git a/hw/pt-msi.c b/hw/pt-msi.c > index 511eb56..c515c02 100644 > --- a/hw/pt-msi.c > +++ b/hw/pt-msi.c > @@ -313,7 +313,7 @@ int pt_msix_init(struct pt_dev *dev, int pos) > > table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE); > bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR; > - table_off &= table_off & ~PCI_MSIX_BIR; > + table_off = dev->msix->table_off = table_off & ~PCI_MSIX_BIR; > dev->msix->table_base = dev->pci_dev->base_addr[bar_index]; > PT_LOG("get MSI-X table bar base %llx\n", > (unsigned long long)dev->msix->table_base); > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Cui, Dexuan
2008-Sep-05 09:12 UTC
RE: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table.
Hi Keir, Ian, Please also push the fix to xen-3.3-testing.hg and qemu-xen-3.3-testing respectively. :-) Thanks, -- Dexuan -----Original Message----- From: Yuji Shimada [mailto:shimada-yxb@necst.nec.co.jp] Sent: 2008年9月5日 16:59 To: Cui, Dexuan Cc: Ian Jackson; Keir Fraser; xen-devel@lists.xensource.com Subject: Re: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table. Hi Cui, Thank you for testing. But my FC-HBA(Emulex LPe1150) does not work with this patch, because it is not designed to be virtualized friendly. Thanks, -- Yuji Shimada On Fri, 5 Sep 2008 16:37:45 +0800 "Cui, Dexuan" <dexuan.cui@intel.com> wrote:> Great! I can confirm this patch fixes the issue I meet with. > > Thanks! > -- Dexuan > > > -----Original Message----- > From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Yuji Shimada > Sent: 2008ト・ヤツ5ネユ 15:48 > To: Ian Jackson; Keir Fraser; xen-devel@lists.xensource.com > Subject: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table. > > This patch fixes offset of MSI-X memory mapped table. > > Current code does not set dev->msix->table_off variable. > The offset of MSI-X memory mapped table is treated as 0. > The wrong region is unmapped from guest physical memory space. > As a result, guest device driver can''t access memory mapped resource. > > The patch fixes this issue. My MegaRAID SAS assigned to guest domain > becomes working with the patch. > > Thanks, > > Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp> > > diff --git a/hw/pt-msi.c b/hw/pt-msi.c > index 511eb56..c515c02 100644 > --- a/hw/pt-msi.c > +++ b/hw/pt-msi.c > @@ -313,7 +313,7 @@ int pt_msix_init(struct pt_dev *dev, int pos) > > table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE); > bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR; > - table_off &= table_off & ~PCI_MSIX_BIR; > + table_off = dev->msix->table_off = table_off & ~PCI_MSIX_BIR; > dev->msix->table_base = dev->pci_dev->base_addr[bar_index]; > PT_LOG("get MSI-X table bar base %llx\n", > (unsigned long long)dev->msix->table_base); > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2008-Sep-05 09:34 UTC
RE: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table.
Cui, Dexuan writes ("RE: [Xen-devel] [PATCH] ioemu-remote&ioemu: fix offset of MSI-X memorymapped table."):> Please also push the fix to xen-3.3-testing.hg and > qemu-xen-3.3-testing respectively. :-)Committed to xen-unstable and cherry-picked into 3.3-testing. Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel