Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4187490ybl; Mon, 26 Aug 2019 06:51:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDCV5rXnwlxLI/rjsnA+f2tr5V8CWLJNwPwhy1ouybDcgj3n6bxtUUw3YJoT39Y/aNI5ZK X-Received: by 2002:a17:90a:a105:: with SMTP id s5mr19792224pjp.51.1566827487673; Mon, 26 Aug 2019 06:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566827487; cv=none; d=google.com; s=arc-20160816; b=XsfPg8hgFNvPKrqoSfcntm2TyESZFzSfEHVtYkFVYgWAyXCFBcx+5IPbstAzafeM6z QrmZaGVJmzAiKF7Qendv/PppruSPBjUW8wAaVDoGGd9IHTB19/PhJLBCgleiTm9dA3eK lSuFKLFBng0R1BBRueyt0tz8VRgUiu7VaPcz+iTL/5jM13JSELs/0+L7Xc3oheqlt4nH F+fr1yullh6OCrV1AsW9fjRmTN7GLzdZChXhJSxrIBPBXTPk6X7D/VDhLeD4GhSw9Ltb 5ZJXRDBexAx7FsBFzqoBka1RxWVEvhLJcHck0g89bTB9hl6JpuLBNYaNyMb55rh/Z5Hm FBsw== 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=i0UpvTk8zqcgTmTGnX8VQ+umWZtla0SYYbzcGCz4oyE=; b=X5kgmPbVklPmhKcwgZEMBoN54E2efU/ediQpoIK3iaVZ+SOvj6TPlzdUN6bjKKgAIl fw9+sSbE7gN+UpUpouQcjrqz/z/Ha6Xn+yctOx4VxYZ9o4JS5PUmDt+MEe4bdCgfPKlC xwozm61kfIv5e6BnwzxuCBlDb0EMP4uH7ZTloZ7u+CJnSAHluqBL846hY8SsmBE/6F50 r1YDz/qecuIuz3/1R9coL1DDXCoL2WaYtsKb8a5Pc3waJOo3TbRCX89qx+lkQxlDh9fk fahS7vBUfLbl3zHTgy+oL+ZDaE1f7R4gJ/F6YE3BKp2k0+VE/uwAe/RVOiI4eseBZ37A RJIg== 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 u2si8877049pgm.242.2019.08.26.06.51.11; Mon, 26 Aug 2019 06:51:27 -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 S1732070AbfHZNso (ORCPT + 99 others); Mon, 26 Aug 2019 09:48:44 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:40178 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728550AbfHZNsn (ORCPT ); Mon, 26 Aug 2019 09:48:43 -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 1i2FML-0004bC-7H; Mon, 26 Aug 2019 15:48:37 +0200 Date: Mon, 26 Aug 2019 15:48:35 +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-25970487-1566827317=: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-25970487-1566827317=: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 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. Bah, scratch it. I take the proper one right away. --8323329-25970487-1566827317=:1939--