All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V3 00/17] Syscalls: Add support for time64 variants
Date: Tue, 19 May 2020 12:27:55 +0200	[thread overview]
Message-ID: <CAK8P3a0_o+pme5Ejy9L4_xfmnMO1a0j52rkp_mXDet_fPmXLYg@mail.gmail.com> (raw)
In-Reply-To: <20200519094201.llskyyq2jbx7onai@vireshk-i7>

On Tue, May 19, 2020 at 11:42 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 18-05-20, 11:21, Arnd Bergmann wrote:
> > For msgctl/semctl/shmctl, the existing syscalls were extended in a
> > compatible way, using an extended 'high' field for each 32-bit
> > seconds value. I later learned that on some architectures, the
> > 'compat' version of that failed to zero-initialize those fields, so I
> > guess all we need is a test that ensures this was fixed correctly,
> > by initializing the '*_high' to something nonzero before calling
> > the syscall, and checking that it gets zero-filled by the syscall.
>
> Okay, I see the new structure (struct semid64_ds) getting added to the
> kernel. But I am not sure how to call the 'compat' version, can you
> please help ?
>
> Do I just need to call like this ?
>
>         struct semid64_ds buf_ds = {
>                 .sem_otime_high = 1,
>                 .sem_ctime_high = 1
>         };
>         union semun arg;
>
>         arg.buf = &buf_ds;
>         semctl(semid, 0, IPC_STAT, arg);
>
> ?

Yes, and then check that the two fields now contain zeroes.

This needs to be compile-time guarded in some form to avoid
running it on 64-bit machines (which don't have the fields), or
to run into compile-time failures with old kernel headers that
don't expose the fields. Note that the struct definitions are
architecture-specific, so unfortunately you can't just provide
a copy of that definition in ltp unless you add all eight versions
that the kernel defines.
Perhaps ltp already has a way to probe whether the headers
have the latest struct definition.

    Arnd

      reply	other threads:[~2020-05-19 10:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  8:14 [LTP] [PATCH V3 00/17] Syscalls: Add support for time64 variants Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 01/17] syscalls/timer_gettime: Add support for time64 tests Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 02/17] syscalls/timer_settime: " Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 03/17] syscalls/timerfd: " Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 04/17] syscalls/sched_rr_get_interval: " Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 05/17] syscalls/futex: Merge futex_wait_bitset tests Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 06/17] syscalls/futex: Add support for time64 tests Viresh Kumar
2020-05-18  8:14 ` [LTP] [PATCH V3 07/17] syscalls/io_pgetevents: " Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 08/17] syscalls/sigwaitinfo: Migrate to new test framework Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 09/17] syscalls/rt_sigtimedwait: Add support for time64 tests Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 10/17] syscalls/mq_timed{send|receive}: " Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 11/17] syscalls/recvmmsg: " Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 12/17] syscalls/ppoll: " Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 13/17] syscalls/select6: " Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 14/17] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-05-18 10:27   ` [LTP] [PATCH V4 13/17] syscalls/select6: Add support for time64 tests Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 15/17] syscalls/semtimedop: Add support for semtimedop and its time64 version Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 16/17] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-05-18  8:15 ` [LTP] [PATCH V3 17/17] syscalls/utimensat: Add support for time64 tests Viresh Kumar
2020-05-18  9:02 ` [LTP] [PATCH V3 00/17] Syscalls: Add support for time64 variants Arnd Bergmann
2020-05-18  9:12   ` Viresh Kumar
2020-05-18  9:21     ` Arnd Bergmann
2020-05-19  8:54       ` Viresh Kumar
2020-05-19  9:14         ` Arnd Bergmann
2020-05-19  9:42       ` Viresh Kumar
2020-05-19 10:27         ` Arnd Bergmann [this message]

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=CAK8P3a0_o+pme5Ejy9L4_xfmnMO1a0j52rkp_mXDet_fPmXLYg@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=ltp@lists.linux.it \
    /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.