Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1290825ybl; Fri, 23 Aug 2019 17:04:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzI+j2soXMJAGn80VwE865vlGAY/IBvUPp69tcaSd0ozDMZ3bCeHz3oTo2GnnSIzA0kNQij X-Received: by 2002:a17:902:8484:: with SMTP id c4mr7531041plo.223.1566605071321; Fri, 23 Aug 2019 17:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566605071; cv=none; d=google.com; s=arc-20160816; b=0YV2H05hoEQ8fj8w7bLx3UxK9Q55QozlV43wSN8VaQkuCZNnMc8OzPYDuxEnbUOODi YIXotNelC7xcNLFGVzhLREoa8i/8UO9haN4aXLuI4w0W/8JNek/4H7zQRwiaVc4RG1qN 5fnApCRQkSLht2qWmlLVxNxFL9lG9wxcOaMFFwgVNZo73q2ES5KhgmWL/np8GjKCoXe2 ytsD1IU3j1YVtEE/IJX1v8BPws8K2JDxzQxbdNs+cTJ6cPNENUJyIlmoQYhK+4PQF0dj hcJIOyKZkoSMtqNg+bJcbZnRCWaheJ0kc+pW7gzJVRi/QyttQsuXuFPHxdePJRkvKnW+ rUzg== 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=3fu1gJl9YfZD2T/Av08TF2FfYu1rtda/PFKaxdgwjbE=; b=IGq6O6HCcy7mhT/veLghP6+kEaonpnZkd7c5HDynFUkT34LaRwpTCSnHh6yM/NjkNo Wfhy8I9VhaE5As2XPrtm8i9bsxsD3RMo8hd7FGJIVJZToxCode1cbclZ3VQ0WNGhRbfj 4R+zr8O90KY0ylT0YLqX6fr0WyBNBUkvjwycYFSm0ooRUArwDfl5VmdGuhKAXteWoJNt v+3XQ/cFkXFQ+05+pADQl6+3So0t5cDrQphA44NzFSocIUc2Qvl2aqnBdn6Kx2O7/CZJ Lzeo9MX1jgmbe5iQeNVcLbQw/424qNxeDAXlaNC3eY9+rtMWzfaxOdNajZEesEUKVSe9 dSVQ== 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 16si3087704pgw.559.2019.08.23.17.04.15; Fri, 23 Aug 2019 17:04:31 -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 S1726279AbfHXADO (ORCPT + 99 others); Fri, 23 Aug 2019 20:03:14 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:36876 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbfHXADN (ORCPT ); Fri, 23 Aug 2019 20:03:13 -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 1i1JWP-0002oe-PF; Sat, 24 Aug 2019 02:03:09 +0200 Date: Sat, 24 Aug 2019 02:03:08 +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-296781555-1566604989=: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-296781555-1566604989=:1939 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT 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. Thanks, tglx --8323329-296781555-1566604989=:1939--