mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>
Cc: Richard Henderson <richard.henderson@linaro.org>,
	 Shuah Khan <shuah@kernel.org>, Matt Turner <mattst88@gmail.com>,
	linux-kernel@vger.kernel.org,  linux-kselftest@vger.kernel.org,
	linux-alpha@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Subject: Re: [PATCH] tools/nolibc: add support for Alpha
Date: Tue, 15 Jul 2025 16:42:10 +0200	[thread overview]
Message-ID: <c39ae47e-8a07-44e3-8d71-d44fa804877d@t-8ch.de> (raw)
In-Reply-To: <20250715062809.GA28609@1wt.eu>

On 2025-07-15 08:28:09+0200, Willy Tarreau wrote:
> Hi,
> 
> On Mon, Jul 14, 2025 at 07:21:38AM +0200, Thomas Weißschuh wrote:
> > Hi Richard,
> > 
> > On 2025-07-13 16:21:58-0600, Richard Henderson wrote:
> > > On 7/13/25 14:08, Thomas Weißschuh wrote:
> > > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c
> > > > @@ -709,6 +709,10 @@ int run_startup(int min, int max)
> > > >   	/* checking NULL for argv/argv0, environ and _auxv is not enough, let's compare with sbrk(0) or &end */
> > > >   	extern char end;
> > > >   	char *brk = sbrk(0) != (void *)-1 ? sbrk(0) : &end;
> > > > +#if defined(__alpha__)
> > > > +	/* the ordering above does not work on an alpha kernel */
> > > > +	brk = NULL;
> > > > +#endif
> > > 
> > > The syscall api is different for brk on alpha.
> > > A change to sys_brk or brk in include/nolibc/sys.h is required.
> > 
> > You are referring to osf_brk, right?
> > I think that should work as-is with the current wrappers.
> 
> I finally managed to reinstall my DS10 to build and test this and FWIW
> the test passes:

Thanks for getting real hardware involved!

> 
>   $ ./nolibc-test 
>   Running test 'startup'
>   0 argc = 1                                                        [OK]
>   1 argv_addr = <0x11fc7b428>                                       [OK]
>   2 argv_environ = <0x11fc7b428>                                    [OK]
>   3 argv_total = 1                                                  [OK]
>   4 argv0_addr = <0x11fc7b665>                                      [OK]
>   5 argv0_str = <./nolibc-test>                                     [OK]
>   6 argv0_len = 13                                                  [OK]
>   7 environ_addr = <0x11fc7b438>                                    [OK]
>   8 environ_envp = <0x11fc7b438>                                    [OK]
>   9 environ_auxv = <0x11fc7b438>                                    [OK]
>   10 environ_total = 175                                            [OK]
>   11 environ_HOME = <0x11fc7b6f4>                                   [OK]
>   12 auxv_addr = <0x11fc7b4e8>                                      [OK]
>   13 auxv_AT_UID = 509                                              [OK]
>   14 constructor = 3                                                [OK]
>   15 linkage_errno = <0x1200200f8>                                  [OK]
>   16 linkage_constr = 3                                             [OK]
>   Errors during this test: 0
>   
>   Running test 'syscall'
>   0 access = 0                                                      [OK]
>   1 access_bad = -1 EPERM                                           [OK]
>   2 clock_getres = 0                                                [OK]
>   3 clock_gettime = 0                                               [OK]
>   4 clock_settime = -1 EINVAL                                       [OK]
>   5 getpid = 9201                                                   [OK]
>   6 getppid = 419                                                   [OK]
>   7 gettid = 9201                                                   [OK]
>   8 getpgid_self = 9201                                             [OK]
>   9 getpgid_bad = -1 ESRCH                                          [OK]
>   10 kill_0 = 0                                                     [OK]
>   11 kill_CONT = 0                                                  [OK]
>   12 kill_BADPID = -1 ESRCH                                         [OK]
>   13 sbrk_0 = <0x120024000>                                         [OK]
>   14 sbrk = 0                                                       [OK]
>   15 brk = 0                                                        [OK]
>   (...)
>   Total number of errors: 0
>   Exiting with status 0
> 
> The result is exactly the same if I comment that line that resets brk,
> as brk was apparently already NULL:
> 
>   13 sbrk_0 = <0x120024000>                                         [OK]
>   14 sbrk = 0                                                       [OK]
>   15 brk = 0                                                        [OK]

brk shouldn't be NULL I think. It looks instead like it's 0x120024000.
And it looks weird because the raw numbers look similar to my machine.

>   1 argv_addr = <0x11fc7b428>                                       [OK]

>   13 sbrk_0 = <0x120024000>                                         [OK]

argv is not greater than brk.

Could you double-check your test modification? How does it behave in QEMU for you?
Also could you provide your kernel config?

> > On alpha, mm->brk and mm->arg_start are ordered differently from other
> > architectures. Personally I think the nolibc tests are a bit bogus here.
> 
> I seem to remember that these are among the older minimal consistency
> tests and that it could be time to revisit this :-/

I do like them in general to be fair.

  reply	other threads:[~2025-07-15 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-13 20:08 Thomas Weißschuh
2025-07-13 20:11 ` John Paul Adrian Glaubitz
2025-07-13 22:21 ` Richard Henderson
2025-07-14  5:21   ` Thomas Weißschuh
2025-07-15  6:28     ` Willy Tarreau
2025-07-15 14:42       ` Thomas Weißschuh [this message]
2025-07-16  6:50         ` Willy Tarreau

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=c39ae47e-8a07-44e3-8d71-d44fa804877d@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=arnd@arndb.de \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.org \
    --cc=shuah@kernel.org \
    --cc=w@1wt.eu \
    /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®