public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] rseq01: basic test rseq
Date: Thu, 16 Feb 2023 23:17:27 -0500	[thread overview]
Message-ID: <20230217041727.GA30450@localhost> (raw)
In-Reply-To: <Y+4MTlm9O/sN3Ety@yuki>

On Thu, Feb 16, 2023 at 11:58:22AM +0100, Cyril Hrubis wrote:
> Hi!
> > Add basic check for the newly added glibc API in LTP.
> > This test references the glibc test case tst-rseq.c.
> > 
> > Signed-off-by: Wei Gao <wegao@suse.com>
> > ---
> > +#if defined(HAVE_SYS_RSEQ_H) && defined(RSEQ_SIG)
>                                              ^
> 					     Where is this macro
> 					     defined?
RSEQ_SIG is arch specific macro , following are result in my test system:

find / -name "*.h" | xargs grep RSEQ_SIG
/usr/include/x86_64-linux-gnu/bits/rseq.h:#define RSEQ_SIG        0x53053053

dpkg -S /usr/include/x86_64-linux-gnu/bits/rseq.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/rseq.h

> > +#include <stdio.h>
> > +#include <sched.h>
> > +#include "lapi/rseq.h"
> > +
> > +static void run(void)
> > +{
> > +	check_rseq_available();
> > +
> > +	TST_EXP_PASS(!(sched_getcpu() >= 0));
> 
> This does not actually check anything useful.
This case used to test against glibc's implementation, correct me if i am wrong.
Once i saw following commit in glibc, so i think we can use sched_getcpu 
do some sanity check for rseq implementation in glibc. 
1d350aa060 Linux: Use rseq to accelerate sched_getcpu

> 
> Very basic test would register rqseq, then loop over available CPUs, pin
> a process to the CPU and check that rqsed did register the buffers. The
> very basic test would look like:
> 
> https://github.com/torvalds/linux/blob/master/tools/testing/selftests/rseq/basic_test.c
> 

Thanks for your feedback, i have a question on test direction, which one is our target?

1) Check system call ONLY regardless glibc version/implementation then we move linux kernel test(as above link you mentioned) into our test.

2) Check glibc's implemenation for rseq(from 2.35), such as 1.check sched_getcpu, 2.check glibc API 
how to disable rseq feature which support automaticly from glibc start. (e3e589829d nptl: Add glibc.pthread.rseq tunable to control rseq registration). Then our target is move glibc test case to our test.

> > +}
> > +
> > +static struct tst_test test = {
> > +	.test_all = run,
> > +	.needs_root = 1,
> > +};
> > -- 
> > 2.35.3
> > 
> > 
> > -- 
> > Mailing list info: https://lists.linux.it/listinfo/ltp
> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-02-17  4:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 13:46 [LTP] [PATCH v1] rseq01: basic test rseq Wei Gao via ltp
2023-02-14 11:46 ` Cyril Hrubis
2023-02-15  2:34 ` [LTP] [PATCH v2] " Wei Gao via ltp
2023-02-16 10:58   ` Cyril Hrubis
2023-02-17  4:17     ` Wei Gao via ltp [this message]
2023-02-17  9:33       ` Cyril Hrubis
2023-02-21  1:34   ` [LTP] [PATCH v3 0/2] Move linux rseq test into ltp Wei Gao via ltp
2023-02-21  1:34     ` [LTP] [PATCH v3 1/2] rseq: Copy linux rseq test header files to ltp Wei Gao via ltp
2023-03-13 15:48       ` Cyril Hrubis
2023-03-14 13:49         ` Wei Gao via ltp
2023-03-14 16:29           ` Cyril Hrubis
2023-03-14 22:40             ` Wei Gao via ltp
2023-02-21  1:34     ` [LTP] [PATCH v3 2/2] rseq01: basic test rseq Wei Gao via ltp
2023-03-09  2:04       ` [LTP] [PATCH v4] " Wei Gao via ltp
2023-03-09  8:16         ` [LTP] [PATCH v5] " Wei Gao via ltp

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=20230217041727.GA30450@localhost \
    --to=ltp@lists.linux.it \
    --cc=chrubis@suse.cz \
    --cc=wegao@suse.com \
    /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