Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761841AbcJ1WBV (ORCPT ); Fri, 28 Oct 2016 18:01:21 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:49400 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753955AbcJ1WBT (ORCPT ); Fri, 28 Oct 2016 18:01:19 -0400 From: Arnd Bergmann To: Dmitry Torokhov Cc: Deepa Dinamani , "linux-input@vger.kernel.org" , Linux Kernel Mailing List , y2038 Mailman List Subject: Re: [PATCH v2 3/4] input: Deprecate real timestamps beyond year 2106 Date: Sat, 29 Oct 2016 00:01:14 +0200 Message-ID: <1563780.JF7NgVgytb@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <1476761253-13450-1-git-send-email-deepa.kernel@gmail.com> <3544660.FKrMrRAIUC@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:4qZDHQ+h00/ScBZ23V1EUbN0xJltPvKWHHLer7WDP2l6z7CCLtM ImsjyUb8OzlbE+LEHmIxfj1k/3S9hbmpgqOkuD75MpzMOd+LsNIFbetNpd5eccB8w+eVg7s 6q/di5qit2NDuzjydvXZLWkCApXapHoeJJRJOy9nHlS6FnVs0DVbK/c/XPCnWwI6d6ZtuoO vpPHi1OnGOXiUofrONVmQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:C4DbJ29r+KE=:4sjwCDi5pIU9duPuKfQ05i qoW6SdhJTS27s1xSVJPHklYIC6Oj8l9kdx8vdh+Fi9d9PEKAa6Z6vRYQh0/rP+lqxXVWidVr8 055nGfjcMpah3A43ez9MbdoHFiU+SkWOIxh7GllTCn/wsYgRxTERYCrh7K8fh835abZmm3Ewe TGRCTxMtclBC+xmHTygmZ7HljLFf8yw+qe5rI8YPD8+faYkRQau+l3RTPCK5Qo91nDfaxKZJK 9ADGQXb94AdqaKmSPzzXaNmJzjLyEK2HfkSH28MK6cje6WufP4olWM/6kaqWmv7LfyQWOy394 cHGaKtxzWWn5K7jr967TAXtNXm6NlpU4Uu3Jj+tf2pQYg88vAwsvQkmP0hGveH1ECaUa76oTE t8CqgUqhpY0FkqON7yG3G8geIn4kqvZ0WVt+ENktSP+lJ52g+2+ZK2RrL7MbV/GbN6pHLnvsT ndx0f5iGSQTfiYNFMXlZOVl/Kia1XYcVWkiHJ2vk3Ho0nw6ZRsc1kBLxkw7RQ0Mj0UsU7HAMq 7fdD5i/CPTKPNwDA6oZ6jGvQS3XZkFndkZH/1MNzqFsNtl8tDRIvgPYhVRQ76Zkz60qKF8eG2 3GVtP9KAUKMuEUwV6p7xUQhb/N1FljwCG16Ao4Hw1g+rsniSebuBrDRM4sc+Vs/g5qmeblP4V 5F1EW3ctlQnOnwzYt/y82pDvvcA59i1qh7qCbViXnpjOGSw/w6AqS+U1SZFrYAqeo4SpPyhHD xx2nl2jCUqmjo9ah Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1900 Lines: 44 On Friday, October 28, 2016 2:56:10 PM CEST Dmitry Torokhov wrote: > On Fri, Oct 28, 2016 at 2:47 PM, Arnd Bergmann 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