xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Comments on Xen bug 1732
@ 2011-01-31  4:54 Haitao Shan
  2011-01-31  8:23 ` Jan Beulich
  2011-01-31 13:18 ` Jan Beulich
  0 siblings, 2 replies; 21+ messages in thread
From: Haitao Shan @ 2011-01-31  4:54 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Jiang, Yunhong, Keir Fraser


[-- Attachment #1.1: Type: text/plain, Size: 2670 bytes --]

Hi, Jan,

As you may already notice the bug 1732, (
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1732), the culprit is
c/s 22182.

I see the following attached code in your patch. It is pointless to check
msi->table_base against the value read from physical device if this function
is a virtual function of SR-IOV device. VFs are required to have BARs zeroed
by specifications. And for VFs, unless you can read these values from
corresponding PF, you will have to trust the "table_base" passed from dom0
via hypercall. Actually, this parameter is specifically introduced for
enabling SR-IOV.

I am not familiar with this patch and hence its story. But I think it would
be very simple for you to fix this up?

BTW: I vaguely recall that MSI-X table base might not be the first page of
the corresponding BAR register.

Shan Haitao

+    if ( !dev->msix_nr_entries )
+    {
+        u64 pba_paddr;
+        u32 pba_offset;
+
+        ASSERT(!dev->msix_used_entries);
+        WARN_ON(msi->table_base != read_pci_mem_bar(bus, slot, func, bir));
+
+        dev->msix_nr_entries = nr_entries;
+        dev->msix_table.first = PFN_DOWN(table_paddr);
+        dev->msix_table.last = PFN_DOWN(table_paddr +
+                                        nr_entries * PCI_MSIX_ENTRY_SIZE -
1);
+        WARN_ON(rangeset_overlaps_range(mmio_ro_ranges,
dev->msix_table.first,
+                                        dev->msix_table.last));
+
+        pba_offset = pci_conf_read32(bus, slot, func,
+                                     msix_pba_offset_reg(pos));
+        bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
+        pba_paddr = read_pci_mem_bar(bus, slot, func, bir);
+        WARN_ON(!pba_paddr);
+        pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
+
+        dev->msix_pba.first = PFN_DOWN(pba_paddr);
+        dev->msix_pba.last = PFN_DOWN(pba_paddr +
+                                      BITS_TO_LONGS(nr_entries) - 1);
+        WARN_ON(rangeset_overlaps_range(mmio_ro_ranges,
dev->msix_pba.first,
+                                        dev->msix_pba.last));
+
+        if ( rangeset_add_range(mmio_ro_ranges, dev->msix_table.first,
+                                dev->msix_table.last) )
+            WARN();
+        if ( rangeset_add_range(mmio_ro_ranges, dev->msix_pba.first,
+                                dev->msix_pba.last) )
+            WARN();
+
+        if ( dev->domain )
+            p2m_change_entry_type_global(p2m_get_hostp2m(dev->domain),
+                                         p2m_mmio_direct, p2m_mmio_direct);
+        if ( !dev->domain || !paging_mode_translate(dev->domain) )
+        {
+            struct domain *d = dev->domain;

[-- Attachment #1.2: Type: text/html, Size: 3419 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-03-17 16:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31  4:54 Comments on Xen bug 1732 Haitao Shan
2011-01-31  8:23 ` Jan Beulich
2011-01-31  8:29   ` Jiang, Yunhong
2011-01-31  8:52   ` Haitao Shan
2011-01-31  9:02     ` Haitao Shan
2011-01-31 10:59       ` Keir Fraser
2011-01-31 12:02         ` Haitao Shan
2011-01-31 13:00           ` Jan Beulich
2011-01-31 14:54       ` Stefano Stabellini
2011-01-31  9:16     ` Jan Beulich
2011-01-31 13:18 ` Jan Beulich
2011-02-01  5:48   ` Haitao Shan
2011-02-01  8:05     ` Jan Beulich
2011-02-11  6:00       ` Haitao Shan
2011-02-11  8:58         ` Jan Beulich
2011-02-11 10:34           ` Li, Xin
2011-03-15 18:30   ` Gianni Tedesco
2011-03-16  8:22     ` Jan Beulich
2011-03-16 13:50       ` Gianni Tedesco
2011-03-17  7:48         ` Jan Beulich
2011-03-17 16:42           ` Gianni Tedesco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).