xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] x86: allow the MSI-X table to reside beyond 4G even on 32-bit systems
@ 2010-07-12  9:37 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-07-12  9:37 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

Underlying interfaces allow this, and unduly (and silently) truncating
addresses doesn't seem nice.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/arch/x86/msi.c	2010-07-09 14:49:25.000000000 +0200
+++ 2010-06-15/xen/arch/x86/msi.c	2010-07-09 15:14:43.000000000 +0200
@@ -57,10 +57,11 @@ static void msix_fixmap_free(int idx)
     spin_unlock(&msix_fixmap_lock);
 }
 
-static int msix_get_fixmap(struct pci_dev *dev, unsigned long table_paddr,
-                           unsigned long entry_paddr)
+static int msix_get_fixmap(struct pci_dev *dev, u64 table_paddr,
+                           u64 entry_paddr)
 {
-    int nr_page, idx;
+    long nr_page;
+    int idx;
 
     nr_page = (entry_paddr >> PAGE_SHIFT) - (table_paddr >> PAGE_SHIFT);
 
@@ -536,7 +537,7 @@ static int msix_capability_init(struct p
     struct msi_desc *entry;
     int pos;
     u16 control;
-    unsigned long table_paddr, entry_paddr;
+    u64 table_paddr, entry_paddr;
     u32 table_offset, entry_offset;
     u8 bir;
     void __iomem *base;
@@ -571,7 +572,8 @@ static int msix_capability_init(struct p
         xfree(entry);
         return idx;
     }
-    base = (void *)(fix_to_virt(idx) + (entry_paddr & ((1UL << PAGE_SHIFT) - 1)));
+    base = (void *)(fix_to_virt(idx) +
+        ((unsigned long)entry_paddr & ((1UL << PAGE_SHIFT) - 1)));
 
     entry->msi_attrib.type = PCI_CAP_ID_MSIX;
     entry->msi_attrib.is_64 = 1;




[-- Attachment #2: x86-msix-table-64bit.patch --]
[-- Type: text/plain, Size: 1480 bytes --]

Underlying interfaces allow this, and unduly (and silently) truncating
addresses doesn't seem nice.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/arch/x86/msi.c	2010-07-09 14:49:25.000000000 +0200
+++ 2010-06-15/xen/arch/x86/msi.c	2010-07-09 15:14:43.000000000 +0200
@@ -57,10 +57,11 @@ static void msix_fixmap_free(int idx)
     spin_unlock(&msix_fixmap_lock);
 }
 
-static int msix_get_fixmap(struct pci_dev *dev, unsigned long table_paddr,
-                           unsigned long entry_paddr)
+static int msix_get_fixmap(struct pci_dev *dev, u64 table_paddr,
+                           u64 entry_paddr)
 {
-    int nr_page, idx;
+    long nr_page;
+    int idx;
 
     nr_page = (entry_paddr >> PAGE_SHIFT) - (table_paddr >> PAGE_SHIFT);
 
@@ -536,7 +537,7 @@ static int msix_capability_init(struct p
     struct msi_desc *entry;
     int pos;
     u16 control;
-    unsigned long table_paddr, entry_paddr;
+    u64 table_paddr, entry_paddr;
     u32 table_offset, entry_offset;
     u8 bir;
     void __iomem *base;
@@ -571,7 +572,8 @@ static int msix_capability_init(struct p
         xfree(entry);
         return idx;
     }
-    base = (void *)(fix_to_virt(idx) + (entry_paddr & ((1UL << PAGE_SHIFT) - 1)));
+    base = (void *)(fix_to_virt(idx) +
+        ((unsigned long)entry_paddr & ((1UL << PAGE_SHIFT) - 1)));
 
     entry->msi_attrib.type = PCI_CAP_ID_MSIX;
     entry->msi_attrib.is_64 = 1;

[-- Attachment #3: 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] only message in thread

only message in thread, other threads:[~2010-07-12  9:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-12  9:37 [PATCH 2/3] x86: allow the MSI-X table to reside beyond 4G even on 32-bit systems Jan Beulich

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).