2010-06-09 22:43:12

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [tip:x86/urgent] x86, hweight: Fix UML boot crash

Note: I have applied this because it fixes a regression, but it bugs
the living bejeezus out of me that the saner patch:

diff --git a/arch/um/include/asm/arch_hweight.h
b/arch/um/include/asm/arch_hweight.h
new file mode 100644
index 0000000..c656cf4
--- /dev/null
+++ b/arch/um/include/asm/arch_hweight.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_UM_HWEIGHT_H
+#define _ASM_UM_HWEIGHT_H
+
+#include <asm-generic/bitops/arch_hweight.h>
+
+#endif

... supposedly didn't work. As such, I consider this a temporary kluge
until a proper solution is found. From a code-cleanliness perspective,
this patch is awful.

-hpa


On 06/09/2010 03:07 PM, tip-bot for Borislav Petkov wrote:
> Commit-ID: cc7f0a7b3004a4ca0bfef0e1ca79f2e0da6ca1b0
> Gitweb: http://git.kernel.org/tip/cc7f0a7b3004a4ca0bfef0e1ca79f2e0da6ca1b0
> Author: Borislav Petkov <[email protected]>
> AuthorDate: Sun, 30 May 2010 19:03:46 +0200
> Committer: H. Peter Anvin <[email protected]>
> CommitDate: Wed, 9 Jun 2010 14:23:29 -0700
>
> x86, hweight: Fix UML boot crash
>
> UML apparently cannot stomach callee reg-saving trickery introduced
> with d61931d89be506372d01a90d1755f6d0a9fafe2d (x86: Add optimized
> popcnt variants) for reasons currently unknown, 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: <[email protected]>
> Tested-by: Toralf Förster <[email protected]>
> Tested-by: Geert Uytterhoeven <[email protected]>
> LKML-Reference: <[email protected]>
> Signed-off-by: Borislav Petkov <[email protected]>
> Signed-off-by: H. Peter Anvin <[email protected]>
> Cc: Boaz Harrosh <[email protected]>
> Cc: Jeff Dike <[email protected]>
> Cc: Andrew Morgon <[email protected]>
> ---
> 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>
>


2010-06-10 05:32:23

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [tip:x86/urgent] x86, hweight: Fix UML boot crash

On Thu, Jun 10, 2010 at 00:43, H. Peter Anvin <[email protected]> wrote:
> Note: I have applied this  because it fixes a regression, but it bugs

You seem to have pushed the wrong one, from this/the old thread (new one has
`resent' in the subject)?

> the living bejeezus out of me that the saner patch:
>
> diff --git a/arch/um/include/asm/arch_hweight.h
> b/arch/um/include/asm/arch_hweight.h
> new file mode 100644
> index 0000000..c656cf4
> --- /dev/null
> +++ b/arch/um/include/asm/arch_hweight.h
> @@ -0,0 +1,6 @@
> +#ifndef _ASM_UM_HWEIGHT_H
> +#define _ASM_UM_HWEIGHT_H
> +
> +#include <asm-generic/bitops/arch_hweight.h>
> +
> +#endif
>
> ... supposedly didn't work.  As such, I consider this a temporary kluge
> until a proper solution is found.  From a code-cleanliness perspective,
> this patch is awful.

It does work, but it needs `make clean' first.

Probably the kbuild dependency system doesn't handle new include files
appearing earlier in the include path than an existing include file.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2010-06-10 06:28:27

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [tip:x86/urgent] x86, hweight: Fix UML boot crash

On 06/09/2010 10:32 PM, Geert Uytterhoeven wrote:
> On Thu, Jun 10, 2010 at 00:43, H. Peter Anvin <[email protected]> wrote:
>> Note: I have applied this because it fixes a regression, but it bugs
>
> You seem to have pushed the wrong one, from this/the old thread (new one has
> `resent' in the subject)?
>

I tried to make sure I wouldn't get bad metadata, and found that the
newer patch was supposedly marked "doesn't work".

If it was a build dependency issue that is one thing. I'll replace the
patch tomorrow.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.