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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B08A2C433F5 for ; Fri, 11 Feb 2022 13:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LwjrZcn5C8DopFb0tV9ipH7BB+vIoXUzw/YHhBkhMvI=; b=k23JfTXDZxamOj 8W/xWwT3jgx84NJtjj9/vh0v0Sl3k6f3jt2waZVq4daXnsUY38QA817LiE73s5OxAjrRM4ZUnk4M7 A9wpZRkOVR/9IYgXkAPLofjVmXGM1ocLX7aaFOn3tbiSKUhFdXjy3Dafsl6Mlng3qYFNHwE/6di9f fUsSIpPbAOXlCoZinE09ade0rTR5NRyv3nN4bPTO9Sj63e6M51GNTFIXDO04TXVCnVbLCbYqg6Piu cgp4IeS0RSl+eXSYeE3Jseos6dhdVSX3H5SZNd/c+U2HgtcQlRDe5+dyD++fsiLGGIDTAfw9NQI05 BFDfUwiNOLf+ibXU85EQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIVvB-007NBK-Hs; Fri, 11 Feb 2022 13:25:09 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIVv6-007N9b-U8 for linux-arm-kernel@lists.infradead.org; Fri, 11 Feb 2022 13:25:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C42C1042; Fri, 11 Feb 2022 05:25:02 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.87.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11A773F718; Fri, 11 Feb 2022 05:24:58 -0800 (PST) Date: Fri, 11 Feb 2022 13:24:49 +0000 From: Mark Rutland To: Nick Desaulniers Cc: linux-kernel@vger.kernel.org, Nathan Chancellor , acme@redhat.com, ardb@kernel.org, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, jpoimboe@redhat.com, jslaby@suse.cz, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, will@kernel.org, llvm@lists.linux.dev, James Y Knight Subject: Re: [PATCH v2 2/7] linkage: add SYM_{ENTRY,START,END}_AT() Message-ID: References: <20220125113200.3829108-1-mark.rutland@arm.com> <20220125113200.3829108-3-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220211_052505_051693_732C33C5 X-CRM114-Status: GOOD ( 19.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 11, 2022 at 11:32:27AM +0000, Mark Rutland wrote: > On Thu, Feb 10, 2022 at 05:20:10PM -0800, Nick Desaulniers wrote: > > On Thu, Feb 10, 2022 at 6:52 AM Mark Rutland wrote: > For the expression > > > > > .if (qwerty_fiqin_end - qwerty_fiqin_start) > (0x200 - 0x1c) > > > > can you use local labels (`.L` prefix) rather than symbolic > > references? or is there a risk of them not being unique per TU? > > For the problem in this patch I might be able to do something of that shape, > but I'll need to factor the SYM_*() helpers differently so that I can use > labels for the primary definition. FWIW, that refactoring turned out to be easier than I expected, and I actually prefer the new structure. I've ended up dropping this patch, and in the next patch I leave SYM_FUNC_START() unchanged, but calculate the size in SYM_FUNC_END() and propagate that to all the aliases pre-calculated: diff --git a/include/linux/linkage.h b/include/linux/linkage.h index dbf8506decca..027ab1618bf8 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -165,7 +165,18 @@ #ifndef SYM_END #define SYM_END(name, sym_type) \ .type name sym_type ASM_NL \ - .size name, .-name + .set .L__sym_size_##name, .-name ASM_NL \ + .size name, .L__sym_size_##name +#endif + +/* SYM_ALIAS -- use only if you have to */ +#ifndef SYM_ALIAS +#define SYM_ALIAS(alias, name, sym_type, linkage) \ + linkage(alias) ASM_NL \ + .set alias, name \ + .type alias sym_type ASM_NL \ + .set .L__sym_size_##alias, .L__sym_size_##name ASM_NL \ + .size alias, .L__sym_size_##alias #endif I still think that in future we *might* want to be able to use two non-label symbols (in the same section/fragment/etc) to generate an absolute expression, but that's not a blocker for this series, and for the common cases (e.g. checking size) we can probably work around that as above. Thanks for looknig at this! Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel