Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77A61C43219 for ; Fri, 3 Dec 2021 14:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381371AbhLCOOx (ORCPT ); Fri, 3 Dec 2021 09:14:53 -0500 Received: from mga14.intel.com ([192.55.52.115]:58062 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbhLCOOw (ORCPT ); Fri, 3 Dec 2021 09:14:52 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10186"; a="237203619" X-IronPort-AV: E=Sophos;i="5.87,284,1631602800"; d="scan'208";a="237203619" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2021 06:11:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,284,1631602800"; d="scan'208";a="513259816" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga007.fm.intel.com with ESMTP; 03 Dec 2021 06:11:18 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 1B3EBBT7008557; Fri, 3 Dec 2021 14:11:11 GMT From: Alexander Lobakin To: Peter Zijlstra Cc: Alexander Lobakin , linux-hardening@vger.kernel.org, x86@kernel.org, Jesse Brandeburg , Kristen Carlson Accardi , Kees Cook , Miklos Szeredi , Ard Biesheuvel , Tony Luck , Bruce Schlobohm , Jessica Yu , kernel test robot , Miroslav Benes , Evgenii Shatokhin , Jonathan Corbet , Masahiro Yamada , Michal Marek , Nick Desaulniers , Herbert Xu , "David S. Miller" , Thomas Gleixner , Will Deacon , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Arnd Bergmann , Josh Poimboeuf , Nathan Chancellor , Masami Hiramatsu , Marios Pomonis , Sami Tolvanen , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, live-patching@vger.kernel.org, llvm@lists.linux.dev, hjl.tools@gmail.com Subject: Re: [PATCH v8 05/14] x86: conditionally place regular ASM functions into separate sections Date: Fri, 3 Dec 2021 15:10:51 +0100 Message-Id: <20211203141051.82467-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: <20211202223214.72888-1-alexandr.lobakin@intel.com> <20211202223214.72888-6-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra Date: Fri, 3 Dec 2021 10:44:10 +0100 > On Thu, Dec 02, 2021 at 11:32:05PM +0100, Alexander Lobakin wrote: > > Use the newly introduces macros to create unique separate sections > > for (almost) every "regular" ASM function (i.e. for those which > > aren't explicitly put into a specific one). > > There should be no leftovers as input .text will be size-asserted > > in the LD script generated for FG-KASLR. > > *groan*... > > Please, can't we do something like: > > #define SYM_PUSH_SECTION(name) \ > .if section == .text \ > .push_section .text.##name \ > .else \ > .push_section .text \ > .endif > > #define SYM_POP_SECTION() \ > .pop_section > > and wrap that inside the existing SYM_FUNC_START*() SYM_FUNC_END() > macros. Ah I see. I asked about this in my previous mail and you replied already (: Cool stuff, I'll use it, it simplifies things a lot. Thanks! Al