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]
Message-Id: <20230814073854.13444-1-falcon@tinylab.org>
Date:   Mon, 14 Aug 2023 15:38:54 +0800
From:   Zhangjin Wu <falcon@...ylab.org>
To:     w@....eu
Cc:     falcon@...ylab.org, linux-kernel@...r.kernel.org,
        linux-kselftest@...r.kernel.org, tanyuan@...ylab.org,
        thomas@...ch.de
Subject: Re: [PATCH v2 0/7] selftests/nolibc: customize CROSS_COMPILE for all supported architectures

> On Sun, Aug 13, 2023 at 06:05:03PM +0800, Zhangjin Wu wrote:
> > > I think that later I'll further extend XARCH with new variants to
> > > support ARMv5 and Thumb2, because we have different code for this
> > > and I continue to manually change the CFLAGS to test both.
> > >
> > 
> > Ok, what about further add x86_64 as the default variant for x86 (like ppc for
> > powerpc)? and then it is able to only resereve the variables for x86_64. I have
> > prepared a patch for this goal in our new tinyconfig patchset, it will further
> > avoid adding the same nolibc-test-x86.config and nolibc-test-x86_64.config.
> 
> I'm confused, x86 already defaults to x86_64, it's just that it depends
> on the .config itself to figure whether to produce a 32- or 64-bit kernel.
> But for example it starts qemu in 64-bit mode. Am I missing anything ?
>

In kernel side, it is, but in our nolibc-test, we have added a copy of x86_64
for x86:

    $ grep -E "_x86" tools/testing/selftests/nolibc/Makefile 
    IMAGE_x86_64     = arch/x86/boot/bzImage
    IMAGE_x86        = arch/x86/boot/bzImage
    CROSS_COMPILE_x86_64    ?= x86_64-linux- x86_64-linux-gnu-
    CROSS_COMPILE_x86       ?= x86_64-linux- x86_64-linux-gnu-
    DEFCONFIG_x86_64     = defconfig
    DEFCONFIG_x86        = defconfig
    QEMU_ARCH_x86_64     = x86_64
    QEMU_ARCH_x86        = x86_64
    QEMU_ARGS_x86_64     = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(TEST:%=NOLIBC_TEST=%)"
    QEMU_ARGS_x86        = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(TEST:%=NOLIBC_TEST=%)"

With 'XARCH', the "_x86" copy of them can be simply replaced with such a line:

     # configure default variants for target kernel supported architectures
     XARCH_powerpc    = ppc
    +XARCH_x86        = x86_64
     XARCH            = $(or $(XARCH_$(ARCH)),$(ARCH))

And therefore, the future nolibc-test-x86_64.config is also enough for x86.

But I have seen the 'x86' exception in tools/include/nolibc/Makefile, just a
confirm on if this replacement is ok.

BR,
Zhangjin

> Willy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ