Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1305586ybl; Fri, 23 Aug 2019 17:23:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpdM/uxO38yM+JmaQfsfMDQ9X4YZDOTSRaE16dExKX0Qh0uvOyXiqSZ0GOfh8NOFjq2vpx X-Received: by 2002:a17:902:b605:: with SMTP id b5mr7724755pls.103.1566606199642; Fri, 23 Aug 2019 17:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566606199; cv=none; d=google.com; s=arc-20160816; b=Azrts/ouAV/LNZJgqzMDkXa0tTw9kFUMkBTqQcQO6L4IK2VwjIQDYvjdBoBnJ2lQ0P DF6AZJmNbvOTgpzhqkX4Xavb1vZWz/oZ1FtSAZmnsMrr0wRe3LZvLJ9UKSDhWHeGcnaD Cm7b4tlH8dtTJdndKlnSjDGYunPMo+0G7HEibdjub2iDi9kzlq1hGLYYhPHrjrMT20oR SbboS7BjWAavCn3Gl73gGfqKTFz452QYD7jH/N/zMEq6zlPqlCjmWH9mA/0YWc4rgdCJ PoqWJvUiEYQZapFef8rbk1VJgSBMDcFftmtE+DBviPvJ3lgIS3FnSYmlX76wZCT7UuuO S2Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=1M9I24Wfx/raZ2z0bq2eq1lR/pwdzN7rhiS753xn3xo=; b=bHDvSQEedJmy7Qrsvv8CuGr5IyPeC+GwOzFeCy66+hVJTCVKOiA9xYyhQmgdnBgA2c vBVtftEY50gBVP1LKWxQY6Kuv8RhrKrMpRgbvz6g6hMb/hZM/3+V1t9lWB0B8v80dYbH DC6FjVHp6tOg7S8wJrebnlb4cNS/tIu1mqbjFEdKejR3guhBmmg2P5su5F+IlpA33Qdh yLwiBnMEYxI+aBh3QiYBRw1Eu6RzfGMYrzpsOcSeHFEiCjP/N59qsw18VXAxldTg0M1J 3MCAc138gGnQKQB9Sl1/Vo6+m8jQRwTgdznHfNL9N02f2AQiNWvH0JvwUr2Uyyo9xdvs y2yQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si3961995pfp.64.2019.08.23.17.23.04; Fri, 23 Aug 2019 17:23:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbfHXAUu (ORCPT + 99 others); Fri, 23 Aug 2019 20:20:50 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:37023 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbfHXAUt (ORCPT ); Fri, 23 Aug 2019 20:20:49 -0400 Received: from p5de0b6c5.dip0.t-ipconnect.de ([93.224.182.197] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i1JnN-00032f-Vz; Sat, 24 Aug 2019 02:20:42 +0200 Date: Sat, 24 Aug 2019 02:20:40 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: Sebastian Mayr , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, LKML , Masami Hiramatsu , Andy Lutomirski , Peter Zijlstra , Dmitry Safonov , Oleg Nesterov , Srikar Dronamraju Subject: Re: [PATCH] uprobes/x86: fix detection of 32-bit user mode In-Reply-To: Message-ID: References: <20190728152617.7308-1-me@sam.st> <32D5D6B1-B29E-426E-90B6-48565A3B8F3B@amacapital.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1804277223-1566606041=:1939" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1804277223-1566606041=:1939 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 23 Aug 2019, Andy Lutomirski wrote: > > On Aug 23, 2019, at 5:03 PM, Thomas Gleixner wrote: > > > >> On Sat, 24 Aug 2019, Thomas Gleixner wrote: > >> On Fri, 23 Aug 2019, Andy Lutomirski wrote: > >>>> On Aug 23, 2019, at 4:44 PM, Thomas Gleixner wrote: > >>>> > >>>>>> On Sat, 24 Aug 2019, Thomas Gleixner wrote: > >>>>>> On Sun, 28 Jul 2019, Sebastian Mayr wrote: > >>>>>> > >>>>>> -static inline int sizeof_long(void) > >>>>>> +static inline int sizeof_long(struct pt_regs *regs) > >>>>>> { > >>>>>> - return in_ia32_syscall() ? 4 : 8; > >>>>> > >>>>> This wants a comment. > >>>>> > >>>>>> + return user_64bit_mode(regs) ? 8 : 4; > >>>> > >>>> The more simpler one liner is to check > >>>> > >>>> test_thread_flag(TIF_IA32) > >>> > >>> I still want to finish killing TIF_IA32 some day. Let’s please not add new users. > >> > >> Well, yes and no. This needs to be backported .... > > > > And TBH the magic in user_64bit_mode() is not pretty either. > > > It’s only magic on Xen. I should probably stick a > cpu_feature_enabled(X86_FEATURE_XENPV) in there instead. For backporting sake I really prefer the TIF version. One usage site more is not the end of the world. We can add the user_64bit_mode() variant from Sebastian on top as a cleanup right away so mainline is clean. Thanks, tglx --8323329-1804277223-1566606041=:1939--