Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942567AbcJ1Vrp (ORCPT ); Fri, 28 Oct 2016 17:47:45 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:63244 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756113AbcJ1Vrn (ORCPT ); Fri, 28 Oct 2016 17:47:43 -0400 From: Arnd Bergmann To: Deepa Dinamani Cc: Dmitry Torokhov , 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: Fri, 28 Oct 2016 23:47:39 +0200 Message-ID: <3544660.FKrMrRAIUC@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> <1960434.J8MW3Y2VCi@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:QWaVegHUG2GjiBjiCzvBKKmJgWhdH5e+NvRc5R0RMJ/fQqtPz5y cYvWAYn7kwjj32Honu1vwokpSJIntRWsXJU1iS9cXsfZZqM4r2mWzPZD/5Z7OwCcrTINxEw a7Mq4GurIUmURYa5zZpUqFyEKvDEddjDG9ps4wdouXI9Jksr8ZJnA07iQRiqw7S5MnfVNWD zABcUcjbPksMSBrG4r5Yw== X-UI-Out-Filterresults: notjunk:1;V01:K0:7R+2oLt+YMw=:kG8gfjdWxh9pGm2ptLCPPb 6bUWaa7YgcT+P7LchKdg2gsDqPCNNwiBzYjShjLmDTsDfM8UhkULRzov/nNk97X7OnwSL0/ou vl7qUEab91DQ31IuVWJEMZfWd8Qv5cAs9KAxV+MEZMcJGOoF8vTlN+jhQN3dBWLr0k0nUnrqp RytmG3JJeDH0jRY1Uy54FJkC3ILxTSXxvNLHm6xhgIsdcgNHiY5JGVAsh0TDWheUyn6HoZ8sD EwwmflkDioQE3gGDPFxvrZr98Kj3819tseFBNE1FqnuJ3cF6ZSN22DEEZoyCIAcdG9gzytDvd 1GcImItF6vfYSkaG7WbA+sK5Lccu4aR5Wcb307XYxFTNxouEjIZhexQ22jx2ouN42LIPGjaWb SZCyvILg5xyfg4gwYQ5ZYXO5HtqmuVRhSmOaz6j9DmoUxHVJmS/swAu5mj8824bZUD7BJTUAK OP9j7hOPEaDlP+2LpKkjGkWaWYd3gvj7mIXl/0S1kJojpU28HN9Jg2EKH8YhgClrbhin2MMoT h/nLEVVLRiq/8Zjtw1bIhXqBiv2OIgsn7F7vpAXASY9oScmQiNeYI1Z86Hg6pnPQocP28Unsg UmOivvIzFzgNn1XdGPmrCoIRtT0k3he7yod69ExJ0LZ8/QDYnDXe3Dw+44BD54WidDri39Pek c9EW5t2vnGTGFd3EPx9aUZHWY48DHJZieDFg71SlsFRKJ8PJ0iPH7VEtR9CZS2Rna/GmXYTfw TgtdO9cDN6hWNxj3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2145 Lines: 55 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. > >> > >> There is no time_t anymore in the raw_input_event structure. > >> The struct uses __kernel_ulong_t type. > >> This should take care of x32 support. > > > > I don't think it does. > > > >> From this cover letter: > >> https://www.spinics.net/lists/linux-arch/msg16356.html > >> > >> I see that that the __kernel types were introduced to address the ABI > >> issues for x32. > > > > This is a variation of the problem we are trying to solve for > > the other architectures in your patch set: > > > > On x32, the kernel uses produces a structure with the 64-bit > > layout, using __u64 tv_sec, to match the current user space > > that has 64-bit __kernel_ulong_t and 64-bit time_t, but > > in_compat_syscall() also returns 'true' here, as this is > > mostly a 32-bit ABI (time_t being one of the exceptions). > > Yes, I missed this. > > in_compat_syscall() is true for x32, this would mean we end up here > even if it is a x32 syscall. > But, wouldn't it be better to use in_x32_syscall() here since there is > no timeval any more? 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. Arnd