All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH] selftests: vDSO: Do not rely on $ARCH for vdso_test_getrandom && vdso_test_chacha
Date: Mon, 2 Sep 2024 15:57:37 +0200	[thread overview]
Message-ID: <ZtXEUZC_jRBSAG9k@zx2c4.com> (raw)
In-Reply-To: <ffc5600d-362f-4400-8f8b-a1ea77ca51bf@csgroup.eu>

On Mon, Sep 02, 2024 at 03:23:47PM +0200, Christophe Leroy wrote:
> 
> 
> Le 02/09/2024 à 14:37, Mark Brown a écrit :
> > On Mon, Sep 02, 2024 at 02:22:38PM +0200, Christophe Leroy wrote:
> > 
> >> When vdso_test_getcpu doesn't find the vDSO entry point, it prints an error
> >> text and returns KSFT_SKIP
> > 
> >> I thought it would be more correct to have the same behaviour on
> >> vdso_test_getrandom instead of trying to build it only when the underlying
> >> kernel supports it.
> > 
> > The problem is that the test incorporates assembler code so it simply
> > won't build for architectures without explicit porting, the issue isn't
> > if the target kernel supports it but rather that the test won't compile
> > in the first place.
> 
> Yes indeed and that was the purpose of my patch, have a macro in 
> vdso_config.h to tell where the assembler code is:
> 
> diff --git a/tools/testing/selftests/vDSO/vdso_config.h 
> b/tools/testing/selftests/vDSO/vdso_config.h
> index 740ce8c98d2e..693920471160 100644
> --- a/tools/testing/selftests/vDSO/vdso_config.h
> +++ b/tools/testing/selftests/vDSO/vdso_config.h
> @@ -47,6 +47,7 @@
>   #elif defined(__x86_64__)
>   #define VDSO_VERSION		0
>   #define VDSO_NAMES		1
> +#define VDSO_GETRANDOM	 
> "../../../../arch/x86/entry/vdso/vgetrandom-chacha.S"
>   #elif defined(__riscv__) || defined(__riscv)
>   #define VDSO_VERSION		5
>   #define VDSO_NAMES		1
> 
> 
> And then:
> 
> diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha-asm.S 
> b/tools/testing/selftests/vDSO/vdso_test_chacha-asm.S
> new file mode 100644
> index 000000000000..8e704165f6f2
> --- /dev/null
> +++ b/tools/testing/selftests/vDSO/vdso_test_chacha-asm.S
> @@ -0,0 +1,7 @@
> +#include "vdso_config.h"
> +
> +#ifdef VDSO_GETRANDOM
> +
> +#include VDSO_GETRANDOM
> +
> +#endif
> 
> I thought it was a lot easier to handle if through necessary #ifdefs in 
> vdso_config.h that implementing an additional logic in Makefiles.

Yet it still tripped up the test robot, right?

In general I'm not crazy about this approach.

  reply	other threads:[~2024-09-02 13:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-31 17:11 [PATCH] selftests: vDSO: Do not rely on $ARCH for vdso_test_getrandom && vdso_test_chacha 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
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2024-09-01 12:56 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=ZtXEUZC_jRBSAG9k@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=broonie@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.