[PATCH] x86, hweight: Fix UML boot crash

From: Borislav Petkov
Date: Sun May 30 2010 - 13:04:01 EST


Obviously UML cannot stomach callee reg-saving trickery
introduced with d61931d89be506372d01a90d1755f6d0a9fafe2d (x86:
Add optimized popcnt variants) and oopses during boot:
http://marc.info/?l=linux-kernel&m=127522065202435&w=2

Go ahead and fall back to the software hweight* routines on UML.

LKML-Reference: <201005271944.09541.toralf.foerster@xxxxxx>
Tested-by: Toralf FÃrster <toralf.foerster@xxxxxx>
Tested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxxxx>
---
arch/x86/include/asm/bitops.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 545776e..c9dad12 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -444,7 +444,11 @@ static inline int fls(int x)

#define ARCH_HAS_FAST_MULTIPLIER 1

+#ifdef CONFIG_UML
+#include <asm-generic/bitops/arch_hweight.h>
+#else
#include <asm/arch_hweight.h>
+#endif

#include <asm-generic/bitops/const_hweight.h>

--
1.7.1

--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/