lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 30 May 2010 17:18:21 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Borislav Petkov <bp@...en8.de>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Toralf Förster <toralf.foerster@....de>,
	Borislav Petkov <borislav.petkov@....com>,
	"H. Peter Anvin" <hpa@...or.com>,
	user-mode-linux-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Subject: Re: current git kernel crashes UML system during boot

On Sun, May 30, 2010 at 17:02, Borislav Petkov <bp@...en8.de> wrote:
> From: Geert Uytterhoeven <geert@...ux-m68k.org>
> Date: Sun, May 30, 2010 at 01:57:05PM +0200
>
>> On Sun, May 30, 2010 at 13:39, Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>> > 2010/5/27 Toralf Förster <toralf.foerster@....de>:
>> >> I bisected it to this :
>>
>> > After fixing the missing/superfluous slab inclusion issues, I bisected
>> > it further to
>> >
>> > commit d61931d89be506372d01a90d1755f6d0a9fafe2d
>> > Author: Borislav Petkov <borislav.petkov@....com>
>> > Date:   Fri Mar 5 17:34:46 2010 +0100
>> >
>> >    x86: Add optimized popcnt variants
>> >
>> >    Add support for the hardware version of the Hamming weight function,
>> >    popcnt, present in CPUs which advertize it under CPUID, Function
>> >    0x0000_0001_ECX[23]. On CPUs which don't support it, we fallback to the
>> >    default lib/hweight.c sw versions.
>> >
>> >    A synthetic benchmark comparing popcnt with __sw_hweight64 showed almost
>> >    a 3x speedup on a F10h machine.
>> >
>> >    Signed-off-by: Borislav Petkov <borislav.petkov@....com>
>> >    LKML-Reference: <20100318112015.GC11152@...ab>
>> >    Signed-off-by: H. Peter Anvin <hpa@...or.com>
>> >
>> > I reverted that commit on top of current mainline (and fixed up the
>> > conflicts), and now
>> > it boots again.
>>
>> I tried adding
>>
>> config ARCH_HWEIGHT_CFLAGS
>>         string
>>         default "-fcall-saved-ecx -fcall-saved-edx" if !64_BIT
>>         default "-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx
>> -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10
>> -fcall-saved-r11" if 64_BIT
>>
>> to arch/um/Kconfig.x86. Now it got a bit further, but it still crashes:
>
> Ok, this is a kinda stab in the dark but from what I could decypher
> from the include hell, one possible fix should be if UML didn't include
> <arch/x86/include/asm/arch_hweight.h> but use the software hweight
> version only.
>
> Can you guys check whether the following fixes the issue?

Works, thanks!

BTW, if you want to check yourself:

    make ARCH=um defconfig
    make ACH=um
    ./linux

If it panics because it cannot mount the root file system, it works.

> 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>

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists