Skip to contentSkip to conversation

xen: fix the check of e_pfn in xen_find_pfn_range

PATCH In review Zhenzhong Duan 2 participants 3 messages Sep 2, 2015 – Sep 15, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: fix the check of e_pfn in xen_find_pfn_range

On some numa system, after dom0 up, we see below warning even if there are enough pfn ranges could be used for remapping.
"Unable to find available pfn range, not remapping identity pages"

Fix it to avoid getting a memory region of zero size in xen_find_pfn_range.

---
 arch/x86/xen/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/xen/setup.c +1 -1
index a3a7546..c11f6b2 100644
@@ -178,7 +178,7 @@ static unsigned long __init xen_find_pfn_range(
 		e_pfn = PFN_DOWN(entry->addr + entry->size);
 
 		/* We only care about E820 after this */
-		if (e_pfn < *min_pfn)
+		if (e_pfn <= *min_pfn)
 			continue;
 
 		s_pfn = PFN_UP(entry->addr);
Signature · 1 line
1.7.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Zhenzhong Duan

On some numa system, after dom0 up, we see below warning even if there are enough pfn ranges could be used for remapping.
"Unable to find available pfn range, not remapping identity pages"

Fix it to avoid getting a memory region of zero size in xen_find_pfn_range.

Quoted 17 lines
---
  arch/x86/xen/setup.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/xen/setup.c +1 -1
index a3a7546..c11f6b2 100644
@@ -178,7 +178,7 @@ static unsigned long __init xen_find_pfn_range(
          e_pfn = PFN_DOWN(entry->addr + entry->size);
 
          /* We only care about E820 after this */
-        if (e_pfn < *min_pfn)
+        if (e_pfn <= *min_pfn)
              continue;
 
          s_pfn = PFN_UP(entry->addr);
#2 lore raw

Hi David

Konrad just ping me on this patch. I originally think I missed to cc you but I does. Could you ack or nak it?

thanks
zduan

Quoted 29 lines · Juergen Gross
Quoted 7 lines · Zhenzhong Duan

On some numa system, after dom0 up, we see below warning even if there are enough pfn ranges could be used for remapping.
"Unable to find available pfn range, not remapping identity pages"

Fix it to avoid getting a memory region of zero size in xen_find_pfn_range.

Quoted 17 lines
---
  arch/x86/xen/setup.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/xen/setup.c +1 -1
index a3a7546..c11f6b2 100644
@@ -178,7 +178,7 @@ static unsigned long __init xen_find_pfn_range(
          e_pfn = PFN_DOWN(entry->addr + entry->size);
 
          /* We only care about E820 after this */
-        if (e_pfn < *min_pfn)
+        if (e_pfn <= *min_pfn)
              continue;
 
          s_pfn = PFN_UP(entry->addr);