From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F6E3C433E3 for ; Sat, 18 Jul 2020 14:16:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 801D12070E for ; Sat, 18 Jul 2020 14:16:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZA0vBN+S"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Uz16ViUP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbgGROQb (ORCPT ); Sat, 18 Jul 2020 10:16:31 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47236 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbgGROQ3 (ORCPT ); Sat, 18 Jul 2020 10:16:29 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595081787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=InESnWhhE1Lyrbm8RqL/G1i0QjcPEbAb4abQNdrt+bc=; b=ZA0vBN+SrOoNlxKj9fPmZs53XNpqeydqQ30JHCM1TiQIrq4FEa2B+ezj+nlrK2hW4pxtWS DSwRQNtcOFWyUKw77m14YurY6WpoOQJnbiS35d7QbVmhGxve7Kqb2Y1DgPKGLXEpYDYOS4 oqoAziR7w2ayMO1EsUzU5G5BACkC3MkKzIC1mbbLKje8l038DFG8bJDFYWeHCPbvHLwrwD wz0iSwrRqslMZ9r2cLvPT98eVAHvW1hONwSwROSMngHDku7tUSDjwHh60DIs6K9UIkN2Xg T2JjpCXJmtonP5VWeUuROYj2AW4xVfxekliuTV2I2RTvtNy6yeEMXKfqzz9sxQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595081787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=InESnWhhE1Lyrbm8RqL/G1i0QjcPEbAb4abQNdrt+bc=; b=Uz16ViUPG75XGv0PA6hTKa6ol+KLikD/0YIRqc3DiZjEqyUo0xmOSZzbt8Vl5Wuc4l8wWf vCyqhYdw8l3qFNAw== To: Andy Lutomirski Cc: Kees Cook , LKML , X86 ML , linux-arch , Will Deacon , Arnd Bergmann , Mark Rutland , Keno Fischer , Paolo Bonzini , kvm list , Gabriel Krisman Bertazi Subject: Re: [patch V3 01/13] entry: Provide generic syscall entry functionality In-Reply-To: References: <20200716182208.180916541@linutronix.de> <20200716185424.011950288@linutronix.de> <202007161336.B993ED938@keescook> <87d04vt98w.fsf@nanos.tec.linutronix.de> <202007171045.FB4A586F1D@keescook> <87mu3yq6sf.fsf@nanos.tec.linutronix.de> Date: Sat, 18 Jul 2020 16:16:26 +0200 Message-ID: <875zakq56t.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: > On Fri, Jul 17, 2020 at 12:29 PM Thomas Gleixner wrote: >> The alternative is to play nasty games with TIF_IA32, TIF_ADDR32 and >> TIF_X32 to free up bits for 32bit and make the flags field 64 bit on 64 >> bit kernels, but I prefer to do the above seperation. > > I'm all for cleaning it up, but I don't think any nasty games would be > needed regardless. IMO at least the following flags are nonsense and > don't belong in TIF_anything at all: > > TIF_IA32, TIF_X32: can probably be deleted. Someone would just need > to finish the work. > TIF_ADDR32: also probably removable, but I'm less confident. > TIF_FORCED_TF: This is purely a ptrace artifact and could easily go > somewhere else entirely. > > So getting those five bits back would be straightforward. > > FWIW, TIF_USER_RETURN_NOTIFY is a bit of an odd duck: it's an > entry/exit word *and* a context switch word. The latter is because > it's logically a per-cpu flag, not a per-task flag, and the context > switch code moves it around so it's always set on the running task. Gah, I missed the context switch thing of that. That stuff is hideous. Thanks, tglx