Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1277292ybl; Fri, 23 Aug 2019 16:46:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQxVWmzNGcjqXoOw8MBfeRpH6c2MfmwX69OYSsBh04ser1/EPEBqdg0IOkgKAfkoM//nDG X-Received: by 2002:a62:c584:: with SMTP id j126mr8127374pfg.21.1566603989463; Fri, 23 Aug 2019 16:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566603989; cv=none; d=google.com; s=arc-20160816; b=LqNML0QzabABrh4ZSEUSaAY2iBaCsoG8Vuzt5pbtZcVhi6QKaiSoYuZ88t0JLjpGXn g0ev0tpw4QIQNOHrPkMK+CURtVbOuMOBvnwDYj0bgO006yVye9MmEoqTv5Zc1IVoeIWN of2sXta4a/9XOSwGVWqYVbU3SJSE1fM7L2TnRGrKuqoPwWQHxs8VI6fCOIDlKD1xojxS 59nZ+o5HGOh+wny9Yrc+m3N4nktHeweItVyBW7Cg8dIa9T1xNI721xnXpPu2fR+x7WTN 7JnZ2xYYonyfy50v0HgdLFVT5Z4gOYoEoXIOOcqvi9XhjSRk9ZSi2Y5FxJdclk/mkMMv c+wg== 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=zt72p+NG9H0RmDMlFtGQe4owUigOTRzFH32YTLo8myw=; b=C2laYL7suA7htP3MO7AGePrVDhidL5UkjRJ9nLneSTk9xtxy+ELeZtkAxXJ/uyKfLO FzdJxvpXyCxjyFZpAlxC0Vmr8KCruzZEqR2AGFuuULCqCqlUML5WkJWvYQ3f2byWta60 bfk9XQm5PVBAvMZalFtPF+/oS7TKDJdQqpcDlRqfKm+NT/1ZsE0W6SvrXxxndaxozCK7 VpKVM6Ka6mZ4Zalsy0rP5gi0jJxaAebEeE3jgPpD1ws/B+8t1CgqPmx7OdqECV/Cit3I wSePS52/IHZ+Da0JcueY3IBUCdHueeA7PTH+iE9zt3udADE9bLivBoFzmRY0slztexmt FmXA== 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 130si3025750pgg.18.2019.08.23.16.46.13; Fri, 23 Aug 2019 16:46:29 -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 S1725934AbfHWXoW (ORCPT + 99 others); Fri, 23 Aug 2019 19:44:22 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:36780 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725873AbfHWXoW (ORCPT ); Fri, 23 Aug 2019 19:44:22 -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 1i1JEB-0002eX-EZ; Sat, 24 Aug 2019 01:44:19 +0200 Date: Sat, 24 Aug 2019 01:44:18 +0200 (CEST) From: Thomas Gleixner To: Sebastian Mayr cc: 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> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 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) which is only true for IA32 and independent of syscalls, exceptions ... Thanks, tglx