[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: extend frame table virtual space


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 04 Feb 2013 15:44:09 +0000
  • Delivery-date: Mon, 04 Feb 2013 15:44:38 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1358946274 -3600
# Node ID 9cfcd0e94d1416cbf6359eb12a93d025bfffa6a6
# Parent  140f1b5182f5d022badbf94af4dc3b51993be19c
x86: extend frame table virtual space

... to allow frames for up to 16Tb.

At the same time, add the super page frame table coordinates to the
comment describing the address space layout.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 140f1b5182f5 -r 9cfcd0e94d14 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Wed Jan 23 14:03:25 2013 +0100
+++ b/xen/arch/x86/mm.c Wed Jan 23 14:04:34 2013 +0100
@@ -146,8 +146,7 @@ unsigned long max_page;
 unsigned long total_pages;
 
 unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
-    (FRAMETABLE_SIZE / sizeof(*frame_table) + PDX_GROUP_COUNT - 1)
-    / PDX_GROUP_COUNT)] = { [0] = 1 };
+    (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };
 
 bool_t __read_mostly machine_to_phys_mapping_valid = 0;
 
@@ -218,7 +217,7 @@ static void __init init_spagetable(void)
     BUILD_BUG_ON(XEN_VIRT_END > SPAGETABLE_VIRT_START);
 
     init_frametable_chunk(spage_table,
-                          mem_hotplug ? (void *)SPAGETABLE_VIRT_END
+                          mem_hotplug ? spage_table + SPAGETABLE_NR
                                       : pdx_to_spage(max_pdx - 1) + 1);
 }
 
diff -r 140f1b5182f5 -r 9cfcd0e94d14 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Wed Jan 23 14:03:25 2013 +0100
+++ b/xen/arch/x86/setup.c      Wed Jan 23 14:04:34 2013 +0100
@@ -378,8 +378,8 @@ static void __init setup_max_pdx(void)
     if ( max_pdx > (DIRECTMAP_SIZE >> PAGE_SHIFT) )
         max_pdx = DIRECTMAP_SIZE >> PAGE_SHIFT;
 
-    if ( max_pdx > FRAMETABLE_SIZE / sizeof(*frame_table) )
-        max_pdx = FRAMETABLE_SIZE / sizeof(*frame_table);
+    if ( max_pdx > FRAMETABLE_NR )
+        max_pdx = FRAMETABLE_NR;
 
     max_page = pdx_to_pfn(max_pdx - 1) + 1;
 }
diff -r 140f1b5182f5 -r 9cfcd0e94d14 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c  Wed Jan 23 14:03:25 2013 +0100
+++ b/xen/arch/x86/x86_64/mm.c  Wed Jan 23 14:04:34 2013 +0100
@@ -958,7 +958,7 @@ static int extend_frame_table(struct mem
     nidx = cidx = pfn_to_pdx(spfn)/PDX_GROUP_COUNT;
 
     ASSERT( pfn_to_pdx(epfn) <= (DIRECTMAP_SIZE >> PAGE_SHIFT) &&
-         (pfn_to_pdx(epfn) <= FRAMETABLE_SIZE / sizeof(struct page_info)) );
+            pfn_to_pdx(epfn) <= FRAMETABLE_NR );
 
     if ( test_bit(cidx, pdx_group_valid) )
         cidx = find_next_zero_bit(pdx_group_valid, eidx, cidx);
@@ -1406,7 +1406,7 @@ int mem_hotadd_check(unsigned long spfn,
     if ( (spfn >= epfn) )
         return 0;
 
-    if (pfn_to_pdx(epfn) > (FRAMETABLE_SIZE / sizeof(*frame_table)))
+    if (pfn_to_pdx(epfn) > FRAMETABLE_NR)
         return 0;
 
     if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
diff -r 140f1b5182f5 -r 9cfcd0e94d14 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h      Wed Jan 23 14:03:25 2013 +0100
+++ b/xen/include/asm-x86/config.h      Wed Jan 23 14:04:34 2013 +0100
@@ -152,9 +152,11 @@ extern unsigned char boot_edid_info[128]
  *    High read-only compatibility machine-to-phys translation table.
  *  0xffff82c480000000 - 0xffff82c4bfffffff [1GB,   2^30 bytes, PML4:261]
  *    Xen text, static data, bss.
- *  0xffff82c4c0000000 - 0xffff82f5ffffffff [197GB,             PML4:261]
+ *  0xffff82c4c0000000 - 0xffff82dffbffffff [109GB - 64MB,      PML4:261]
  *    Reserved for future use.
- *  0xffff82f600000000 - 0xffff82ffffffffff [40GB,  2^38 bytes, PML4:261]
+ *  0xffff82dffc000000 - 0xffff82dfffffffff [64MB,  2^26 bytes, PML4:261]
+ *    Super-page information array.
+ *  0xffff82e000000000 - 0xffff82ffffffffff [128GB, 2^37 bytes, PML4:261]
  *    Page-frame information array.
  *  0xffff830000000000 - 0xffff87ffffffffff [5TB, 5*2^40 bytes, PML4:262-271]
  *    1:1 direct mapping of all physical memory.
@@ -218,15 +220,17 @@ extern unsigned char boot_edid_info[128]
 /* Slot 261: xen text, static data and bss (1GB). */
 #define XEN_VIRT_START          (HIRO_COMPAT_MPT_VIRT_END)
 #define XEN_VIRT_END            (XEN_VIRT_START + GB(1))
-/* Slot 261: superpage information array (20MB). */
+/* Slot 261: superpage information array (64MB). */
 #define SPAGETABLE_VIRT_END     FRAMETABLE_VIRT_START
-#define SPAGETABLE_SIZE         ((DIRECTMAP_SIZE >> SUPERPAGE_SHIFT) * \
-                                 sizeof(struct spage_info))
-#define SPAGETABLE_VIRT_START   (SPAGETABLE_VIRT_END - SPAGETABLE_SIZE)
-/* Slot 261: page-frame information array (40GB). */
+#define SPAGETABLE_NR           (((FRAMETABLE_NR - 1) >> (SUPERPAGE_SHIFT - \
+                                                          PAGE_SHIFT)) + 1)
+#define SPAGETABLE_SIZE         (SPAGETABLE_NR * sizeof(struct spage_info))
+#define SPAGETABLE_VIRT_START   ((SPAGETABLE_VIRT_END - SPAGETABLE_SIZE) & \
+                                 (-1UL << SUPERPAGE_SHIFT))
+/* Slot 261: page-frame information array (128GB). */
 #define FRAMETABLE_VIRT_END     DIRECTMAP_VIRT_START
-#define FRAMETABLE_SIZE         ((DIRECTMAP_SIZE >> PAGE_SHIFT) * \
-                                 sizeof(struct page_info))
+#define FRAMETABLE_SIZE         GB(128)
+#define FRAMETABLE_NR           (FRAMETABLE_SIZE / sizeof(*frame_table))
 #define FRAMETABLE_VIRT_START   (FRAMETABLE_VIRT_END - FRAMETABLE_SIZE)
 /* Slot 262-271: A direct 1:1 mapping of all of physical memory. */
 #define DIRECTMAP_VIRT_START    (PML4_ADDR(262))

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.