Skip to contentSkip to conversation

xen: correct xenheap_bits after "xen: support RAM at addresses 0 and 4096"

PATCH In review Ian Campbell 2 participants 2 messages Oct 3, 2013 – Oct 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: correct xenheap_bits after "xen: support RAM at addresses 0 and 4096"

This is incorrect after commit 1aac966e24e which shuffled the zones up by one. I've observed failures on arm64 systems with RAM at 0x8,00000000-0x8,7fffffff since xenheap_bits ends up as 35 instead of 36 (which is the zone with all the RAM).

---
I suppose that MEMZONE_XEN is not really useful when !CONFIG_SEPARATE_XENHEAP so in principal 1aac966e24e could be make conditional, but in reality MEMZONE_XEN is at least referenced when !CONFIG_SEPARATE_XENHEAP so at least some other cleanup would be needed. This fix seems simpler/clearer.

---
 xen/common/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/page_alloc.c +1 -1
index fb8187b..4c17fbd 100644
@@ -1364,7 +1364,7 @@ static unsigned int __read_mostly xenheap_bits;
 
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT - 1;
+    xenheap_bits = fls(mfn) + PAGE_SHIFT;
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines
Quoted 1 line
Quoted 1 line · Ian Campbell

This is incorrect after commit 1aac966e24e which shuffled the zones up by one.
I've observed failures on arm64 systems with RAM at 0x8,00000000-0x8,7fffffff since xenheap_bits ends up as 35 instead of 36 (which is the zone with all the
RAM).

Quoted 26 lines
Cc Tim Deegan <[email protected]>

---
I suppose that MEMZONE_XEN is not really useful when !CONFIG_SEPARATE_XENHEAP
so in principal 1aac966e24e could be make conditional, but in reality MEMZONE_XEN is at least referenced when !CONFIG_SEPARATE_XENHEAP so at least some other cleanup would be needed. This fix seems simpler/clearer.

---
 xen/common/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/page_alloc.c +1 -1
index fb8187b..4c17fbd 100644
@@ -1364,7 +1364,7 @@ static unsigned int __read_mostly xenheap_bits;
 
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT - 1;
+    xenheap_bits = fls(mfn) + PAGE_SHIFT;
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
Signature · 1 line
1.7.10.4