Linux Input/HID development
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Deepa Dinamani <deepa.kernel@gmail.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	y2038 Mailman List <y2038@lists.linaro.org>
Subject: Re: [PATCH v2 3/4] input: Deprecate real timestamps beyond year 2106
Date: Sat, 29 Oct 2016 00:01:14 +0200	[thread overview]
Message-ID: <1563780.JF7NgVgytb@wuerfel> (raw)
In-Reply-To: <CAKdAkRRXyz=uao_XdDVpG=BDsy+GA=bzkEKJabbs3Cd7ZG1mZA@mail.gmail.com>

On Friday, October 28, 2016 2:56:10 PM CEST Dmitry Torokhov wrote:
> On Fri, Oct 28, 2016 at 2:47 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday, October 28, 2016 2:39:35 PM CEST Deepa Dinamani wrote:
> >> >> >> @@ -55,24 +60,24 @@ struct ff_effect_compat {
> >> >> >>
> >> >> >>  static inline size_t input_event_size(void)
> >> >> >>  {
> >> >> >> -       return (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) ?
> >> >> >> -               sizeof(struct input_event_compat) : sizeof(struct input_event);
> >> >> >> +       return in_compat_syscall() ? sizeof(struct raw_input_event_compat) :
> >> >> >> +                                    sizeof(struct raw_input_event);
> >> >> >>  }
> >> >> >
> >> >> > I think the COMPAT_USE_64BIT_TIME check has to stay here,
> >> >> > it's needed for x32 mode on x86-64.
> >> >>
> >
> > We have to distinguish four cases on x86:
> >
> > - native 32-bit, input_event with 32-bit time_t
> > - compat 32-bit, input_event_compat with 32-bit time_t
> > - native 64-bit, input_event with 64-bit time_t
> > - compat x32, input_event with 64-bit time_t
> >
> > The first three can happen on other architectures too,
> > the last one is x86 specific. There are probably other ways
> > to express the condition above, but I can't think of one
> > that is better than the one we have today.
> 
> Can we detect if given task is compat x32, like we do for compat
> 64/32? Or entire userspace has to be x32?

Yes, this works fine per task, with the definition of COMPAT_USE_64BIT_TIME
that is hardcoded to zero everywhere except on x86 where it is

#define COMPAT_USE_64BIT_TIME \
        (!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT))

This is unrelated to the patch in question, the existing code
is correct as long as we don't change the logic and just
replace input_event with raw_input_event (or __kernel_input_event
or whichever you prefer).

	Arnd

  reply	other threads:[~2016-10-28 22:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  3:27 [PATCH v2 0/4] Make input drivers y2038 safe Deepa Dinamani
2016-10-18  3:27 ` [PATCH v2 1/4] uinput: Add ioctl for using monotonic/ boot times Deepa Dinamani
2016-10-27  1:45   ` Peter Hutterer
2016-10-27 20:39     ` Deepa Dinamani
2016-10-28  4:32       ` Peter Hutterer
2016-10-18  3:27 ` [PATCH v2 2/4] input: evdev: Replace timeval with timespec64 Deepa Dinamani
2016-10-27  1:34   ` Peter Hutterer
2016-10-27 11:14     ` Arnd Bergmann
2016-10-18  3:27 ` [PATCH v2 3/4] input: Deprecate real timestamps beyond year 2106 Deepa Dinamani
2016-10-27  2:24   ` Dmitry Torokhov
2016-10-27 22:25     ` Deepa Dinamani
2016-10-27 23:12       ` Dmitry Torokhov
2016-10-28 12:19         ` Arnd Bergmann
2016-10-30  4:34           ` Deepa Dinamani
2016-10-27  2:56   ` Peter Hutterer
2016-10-27 22:24     ` Deepa Dinamani
2016-10-28  4:46       ` Peter Hutterer
2016-10-28 12:44         ` Arnd Bergmann
2016-10-30  4:19         ` Deepa Dinamani
2016-10-31 10:30           ` Peter Hutterer
2016-10-28 12:43   ` Arnd Bergmann
2016-10-28 15:19     ` Deepa Dinamani
2016-10-28 15:45       ` Arnd Bergmann
2016-10-28 21:39         ` Deepa Dinamani
2016-10-28 21:47           ` Arnd Bergmann
2016-10-28 21:56             ` Dmitry Torokhov
2016-10-28 22:01               ` Arnd Bergmann [this message]
2016-10-18  3:27 ` [PATCH v2 4/4] input: serio: Replace timeval by timespec64 Deepa Dinamani

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=1563780.JF7NgVgytb@wuerfel \
    --to=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=y2038@lists.linaro.org \
    /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