Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp805728ybn; Wed, 2 Oct 2019 06:31:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8CqpceDtSYU8yNQjUR4yQBHIakN9t567UByMuW6XeG0d+SGaj1/zY27u29VGqm3+icZld X-Received: by 2002:a17:906:1e57:: with SMTP id i23mr3053559ejj.204.1570023101920; Wed, 02 Oct 2019 06:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570023101; cv=none; d=google.com; s=arc-20160816; b=oMS92EsjMbSJjYr4mNBSFKgk+Y63iTi+MCXh9fVbpK7Q/OkhLDM6M53dQbMsMgsRgw EmjmGMYfDZOS6Y6L/Bkak1sgBM0A+ad4GW7WLs/TyBDWBlCai7z9aPriONVymbFm54Iu gjLuBY+mCuey70herDsKyHURU6zHOMLJPBnaVzDhOFBR4gWw4iBniQfWS5P+9zsRWxxM R+kHZ+FjgNNFM2PwszGcT9X5xwi3tPRZEGwhZPVswcGsxyBu8abB+hRUSVPcRVVlpLW6 duxCH2vSaKR5jQYpSkcKJpd+rMGSn0MAev3+C8YxtMM0dIzhvOHbS7WVV58IDT1PekY5 isfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=jdK03n3+2me9Sk19EdnaoVUhfmldNzf5bSdl3P4k3vY=; b=J4MJmty7FQZ/BbsfWgjsxDntJCcjsaP8YNax0IdpKKqjIi0MxiBiwVPCRlEJw8MyIH EHZqqBl1A86iABlI/2lMFxuKLRzFozcqFHOr1Hwau4pelVoHThqG/r1gL/x/YlkDCPCr j3P3V7sJBBl/YvwNENripfOHqdbG4lk96dPQyw0jbWqPfrQlQC/thshukl+vQu3k0trN SpKI49o+etcZl8BCUxDO8JsOAKv/Yfm+YJ5aWT7xelgZ23dGScYTJCFh+33pugJx/YIw VvKDVG8G5L3nlsUouFs02L+XiwJZgjf5cVoDI/htoqPcnjX/P+hMYr8Nvkec09BSpj+E eoiw== 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 x20si10769094ejb.393.2019.10.02.06.30.44; Wed, 02 Oct 2019 06:31:41 -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 S1726492AbfJBM4D (ORCPT + 99 others); Wed, 2 Oct 2019 08:56:03 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:39816 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbfJBM4D (ORCPT ); Wed, 2 Oct 2019 08:56:03 -0400 Received: by mail-oi1-f196.google.com with SMTP id w144so17509772oia.6; Wed, 02 Oct 2019 05:56:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jdK03n3+2me9Sk19EdnaoVUhfmldNzf5bSdl3P4k3vY=; b=MOly8uCnmzYYz+9aKY5gmsgwWRFU2ZTLX0qM4JSEQvxvnj4GRT0naw9sq3bKVOqUCm mpNf0bq+vhMzeFrQtSwGUhLt/I7WErgFqGTRZ5UNGh7HOTLkcyHsmX8W4yoM1a91V1Lx BNaBl8RVepiVIoXQmMLS2llTuRdCxAydWfhFUCkhypleXikhdJS/dtsxRAjHeyumg2Ni yqEBx66NtFDiYqhQH3DpvPm+HdZqeqbSe5AAQ3VOIcQ7dNCYsBtO0gBUK3H9RdeWKuGv 4zIfuihwHr4M77rBsGK09BuzByc24IU186nIOKPYS2uWJzZL+NWtHTdYSOwhsZPp3Qwe 08vA== X-Gm-Message-State: APjAAAWrj+dZ6N6OBsCT09H7E0ut2ICIO9hvj9yI1wRiPqHVQN6Helay 4a92RrVBqgD7PHiw1RV8s5edFxgNtz2PSzWOJFQ= X-Received: by 2002:aca:3908:: with SMTP id g8mr2794516oia.54.1570020961944; Wed, 02 Oct 2019 05:56:01 -0700 (PDT) MIME-Version: 1.0 References: <20190930112636.vx2qxo4hdysvxibl@willie-the-truck> <20190930121803.n34i63scet2ec7ll@willie-the-truck> <20191001092823.z4zhlbwvtwnlotwc@willie-the-truck> <20191001170142.x66orounxuln7zs3@willie-the-truck> <20191001175512.GK25745@shell.armlinux.org.uk> <20191001181438.GL25745@shell.armlinux.org.uk> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 2 Oct 2019 14:55:50 +0200 Message-ID: Subject: Re: [PATCH] compiler: enable CONFIG_OPTIMIZE_INLINING forcibly To: Nick Desaulniers Cc: Russell King - ARM Linux admin , Will Deacon , Masahiro Yamada , Linus Torvalds , Nicolas Saenz Julienne , Andrew Morton , Ingo Molnar , Borislav Petkov , Miguel Ojeda , linux-arch , LKML , Catalin Marinas , Stefan Wahren , Kees Cook , Arnd Bergmann , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nick, On Wed, Oct 2, 2019 at 6:33 AM Nick Desaulniers wrote: > On Tue, Oct 1, 2019 at 11:14 AM Russell King - ARM Linux admin > wrote: > > On Tue, Oct 01, 2019 at 11:00:11AM -0700, Nick Desaulniers wrote: > > > On Tue, Oct 1, 2019 at 10:55 AM Russell King - ARM Linux admin > > > wrote: > > > > On Tue, Oct 01, 2019 at 10:44:43AM -0700, Nick Desaulniers wrote: > > > > > I apologize; I don't mean to be difficult. I would just like to avoid > > > > > surprises when code written with the assumption that it will be > > > > > inlined is not. It sounds like we found one issue in arm32 and one in > > > > > arm64 related to outlining. If we fix those two cases, I think we're > > > > > close to proceeding with Masahiro's cleanup, which I view as a good > > > > > thing for the health of the Linux kernel codebase. > > > > > > > > Except, using the C preprocessor for this turns the arm32 code into > > > > yuck: > > > > > > > > 1. We'd need to turn get_domain() and set_domain() into multi-line > > > > preprocessor macro definitions, using the GCC ({ }) extension > > > > so that get_domain() can return a value. > > > > > > > > 2. uaccess_save_and_enable() and uaccess_restore() also need to > > > > become preprocessor macro definitions too. > > > > > > > > So, we end up with multiple levels of nested preprocessor macros. > > > > When something goes wrong, the compiler warning/error message is > > > > going to be utterly _horrid_. > > > > > > That's why I preferred V1 of Masahiro's patch, that fixed the inline > > > asm not to make use of caller saved registers before calling a > > > function that might not be inlined. > > > > ... which I objected to based on the fact that this uaccess stuff is > > supposed to add protection against the kernel being fooled into > > accessing userspace when it shouldn't. The whole intention there is > > that [sg]et_domain(), and uaccess_*() are _always_ inlined as close > > as possible to the call site of the accessor touching userspace. > > Then use the C preprocessor to force the inlining. I'm sorry it's not > as pretty as static inline functions. Which makes us lose the baby^H^H^H^Htype checking performed on function parameters, requiring to add more ugly checks. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds