mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: LEROY Christophe <christophe.leroy2@cs-soprasteria.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	LEROY Christophe <christophe.leroy2@cs-soprasteria.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Xi Ruoyao <xry111@xry111.site>,
	"broonie@kernel.org" <broonie@kernel.org>
Subject: Re: [PATCH] selftests: vDSO: Do not rely on $ARCH for vdso_test_getrandom && vdso_test_chacha
Date: Mon, 2 Sep 2024 12:39:17 +0000	[thread overview]
Message-ID: <74494efd-7cfc-4535-a33d-b86fbae1c322@cs-soprasteria.com> (raw)
In-Reply-To: <ZtUS3TecFTjE5A94@zx2c4.com>



Le 02/09/2024 à 03:20, Jason A. Donenfeld a écrit :
> On Sun, Sep 01, 2024 at 08:43:10PM +0200, Christophe Leroy wrote:
>>>> How would this fit in the logic where IIUC you just remove '_64' from
>>>> 'x86_64' to get 'x86'
>>>
>>> Huh? That's not what tools/scripts/Makefile.arch does.
>>
>> Hum ... yes sorry I looked at it too quickly and mixed things up with
>> the other patch.
>>
>> Nevertheless, if I understand well what tools/scripts/Makefile.arch does
>> on an x86_64 for instance:
>>
>> uname -m returns x86_64
>> HOSTARCH = x86 (sed -e s/x86_64/x86)
>> ARCH = x86
>> SRCARCH = x86
>>
>> If you build with make ARCH=x86_64,
>> SRCARCH = x86
>>
>> So I still can't see how you can use that to know if it is a x86_64 or not.
> 
> By the use of CONFIG_X86_32, which is also used elsewhere in that
> samme makefile for something else (so I assume it's wired up in the
> context where it counts, and if not, that's a bug that affects both
> spots and should be fixed)..

I looks like it is a left-over from the time vDSO selftests were in 
Documentation/vDSO and were likely built with kernel config.

CONFIG_X86_32 was brought into tools/testing/selftests/vDSO by commit 
f9b6b0ef6034 ("selftests: move vDSO tests from Documentation/vDSO") and 
was meant to pass -lgcc_s when building vdso_standalone_test_x86 for 
i386, but obviously it doesn't work:

$ make ARCH=i386 V=1
gcc -std=gnu99 -O2 -D_GNU_SOURCE=    vdso_test_gettimeofday.c 
parse_vdso.c  -o 
/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_gettimeofday
gcc -std=gnu99 -O2 -D_GNU_SOURCE=    vdso_test_getcpu.c parse_vdso.c  -o 
/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_getcpu
gcc -std=gnu99 -O2 -D_GNU_SOURCE=    vdso_test_abi.c parse_vdso.c  -o 
/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_abi
gcc -std=gnu99 -O2 -D_GNU_SOURCE=    vdso_test_clock_getres.c  -o 
/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_clock_getres
gcc -std=gnu99 -O2 -D_GNU_SOURCE=  -ldl  vdso_test_correctness.c  -o 
/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_correctness

In another place in selftests (tools/testing/selftests/ipc/), they 
manually add it:

ifeq ($(ARCH),i386)
         ARCH := x86
	CFLAGS := -DCONFIG_X86_32 -D__i386__
endif
ifeq ($(ARCH),x86_64)
	ARCH := x86
	CFLAGS := -DCONFIG_X86_64 -D__x86_64__
endif


So I think this is a confirmation that CONFIG_X86_32 doesn't exist in 
selftests.

Christophe

  reply	other threads:[~2024-09-02 12:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-31 17:11 Christophe Leroy
2024-09-01 13:22 ` Jason A. Donenfeld
2024-09-01 18:00   ` Christophe Leroy
2024-09-01 18:02     ` Jason A. Donenfeld
2024-09-01 18:43       ` Christophe Leroy
2024-09-02  1:20         ` Jason A. Donenfeld
2024-09-02 12:39           ` LEROY Christophe [this message]
2024-09-02 12:43             ` Jason A. Donenfeld
2024-09-02 12:22   ` Christophe Leroy
2024-09-02 12:37     ` Mark Brown
2024-09-02 13:23       ` Christophe Leroy
2024-09-02 13:57         ` Jason A. Donenfeld
2024-09-02 14:18           ` Christophe Leroy
2024-09-02 14:23             ` Christophe Leroy
2024-11-07  8:40   ` Christophe Leroy
2024-09-01 13:27 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74494efd-7cfc-4535-a33d-b86fbae1c322@cs-soprasteria.com \
    --to=christophe.leroy2@cs-soprasteria.com \
    --cc=Jason@zx2c4.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®