Skip to contentSkip to conversation

xen/arm: pfn_to_mfn and mfn_to_pfn return the argument if nothing is in the p2m

PATCH In review Stefano Stabellini 2 participants 2 messages Nov 11, 2013

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

PATCH 1/1 xen/arm: pfn_to_mfn and mfn_to_pfn return the argument if nothing is in the p2m

Some common Xen drivers, like balloon.c, call pfn_to_mfn and mfn_to_pfn even for autotranslate guests, expecting the argument back. The following commit broke these drivers by changing the behavior of pfn_to_mfn and mfn_to_pfn:

commit 4a19138c6505e224d9f4cc2fe9ada9188d7100ea

Author: Stefano Stabellini <[email protected]>
Date:   Thu Oct 17 16:22:27 2013 +0000

arm/xen,arm64/xen: introduce p2m

They now return INVALID_P2M_ENTRY if Linux doesn't actually know what is the mfn backing a pfn or what is the pfn corresponding to an mfn. Fix the regression by switching to the old behavior.

---
 arch/arm/include/asm/xen/page.h |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
arch/arm/include/asm/xen/page.h +2 -8
index 5d0e4c5..f891925 100644
@@ -46,10 +46,7 @@ static inline unsigned long pfn_to_mfn(unsigned long pfn)
 			return mfn;
 	}
 
-	if (xen_initial_domain())
-		return pfn;
-	else
-		return INVALID_P2M_ENTRY;
+	return pfn;
 }
 
 static inline unsigned long mfn_to_pfn(unsigned long mfn)
@@ -62,10 +59,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 			return pfn;
 	}
 
-	if (xen_initial_domain())
-		return mfn;
-	else
-		return INVALID_P2M_ENTRY;
+	return mfn;
 }
 
 #define mfn_to_local_pfn(mfn) mfn_to_pfn(mfn)
Signature · 1 line
1.7.2.5
Acked-by Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Stefano Stabellini

Some common Xen drivers, like balloon.c, call pfn_to_mfn and mfn_to_pfn even for autotranslate guests, expecting the argument back. The following commit broke these drivers by changing the behavior of pfn_to_mfn and mfn_to_pfn:

commit 4a19138c6505e224d9f4cc2fe9ada9188d7100ea

Author: Stefano Stabellini <[email protected]>
Date:   Thu Oct 17 16:22:27 2013 +0000
Quoted 7 lines

arm/xen,arm64/xen: introduce p2m

They now return INVALID_P2M_ENTRY if Linux doesn't actually know what is the mfn backing a pfn or what is the pfn corresponding to an mfn. Fix the regression by switching to the old behavior.

I tripped over this on Friday and my local hack was identical, hence also:

Ian.