Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp748761ybz; Wed, 15 Apr 2020 18:06:40 -0700 (PDT) X-Google-Smtp-Source: APiQypJQdwVD9XVIyWYQm76WOfBRqrbcP7KQBcHDYSxpR87qRofyknCPP1Yb9o0ygCTaoLFL/wKx X-Received: by 2002:a17:906:2f15:: with SMTP id v21mr7224754eji.329.1586999200579; Wed, 15 Apr 2020 18:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999200; cv=none; d=google.com; s=arc-20160816; b=ekpNO+Cxn56n1K5MX4GJb0KD/EptfXunXB74OWS9Mhiu7xbAN43qseD+gwu/4ceKJe L+X8WgHkF/lDef15DBsS9MiMqqJrwsfqDjCuUBBMGQwd3EKMp49fGwDwyKx0GC2k6Bxk NWpMhGssxgaDSzGLDeFuVXu9zR7ksL134tqsv1tFaeUYXSrYwkILPO9WidHxQMTnLlpi 4GweXFcBalfXvRbgiOHWw7yXCePXfXDiqF26my0fBsLjjvjAk6q+5YvVQ9JKk7HJac8V hRjM3o8wQT6c3trLPNjOoev6tkK3rCpWkWn0b4cj5nFANi6XhK4WuGSdvQBpxZbevU1F sKYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=18e6r5y/jgXADhhgiX3R6vif1YdVTFwaHH058p3heBc=; b=ouinGm2vMfFM8OjAonw+j20UxmoZiHXwvAD9LsYbOB7AmZjI1m0jmxxtXQx6ySZwy3 v8nWJqTyz1qcfUUv5lJPTSQd9aYi07zq5hFe8kllAZlAs5dFnCWpp40h+LjmViKf5f5b nfhr9BzOnNrNvUmpHDmBfL5XFZZtpg+oYDJD4MWAMbi4WbcJ8y9ZBD+aNRCvtUxvhdpL 1lMazlRj/CXRGMLBwdSKXB1GnkKnIt6YRWDijmiW2KG8zDvMdCuunz2MLIlXH49CAYlH GEhYHppMB1yQOFy/dsBCj8q8T717DHVEg2lTC/J+JfkQsxv5KZl0pPoMHZS/WUg1Cpb5 px+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=kzCXjBTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si4996759edv.491.2020.04.15.18.06.15; Wed, 15 Apr 2020 18:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=kzCXjBTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2634962AbgDOUGk (ORCPT + 99 others); Wed, 15 Apr 2020 16:06:40 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:49818 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406385AbgDOUGf (ORCPT ); Wed, 15 Apr 2020 16:06:35 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id A3EE95C07A7; Wed, 15 Apr 2020 22:06:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1586981187; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=18e6r5y/jgXADhhgiX3R6vif1YdVTFwaHH058p3heBc=; b=kzCXjBTXYRcKiwbTlcwjtNog8tdHIMY90JOBql07rNRqIMwQCIZoGNCieVInoqLmPhYZwm 4k8P+IzP+CWSyghxueLPF6FHo9o0Wq/NYnUnX48Qv68wgwdblpR+IsAkpJeT0Xz2uQE46I lghJiyJ2GG3Sm5jm1slWnNgNuLwtqOg= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Wed, 15 Apr 2020 22:06:27 +0200 From: Stefan Agner To: Nick Desaulniers Cc: Jian Cai , Manoj Gupta , Russell King , Enrico Weigelt , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , Linux ARM , LKML , clang-built-linux Subject: Re: [PATCH] ARM: replace the sole use of a symbol with its definition In-Reply-To: References: <20200407190558.196865-1-caij2003@gmail.com> User-Agent: Roundcube Webmail/1.4.1 Message-ID: X-Sender: stefan@agner.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-04-13 20:29, Nick Desaulniers wrote: > On Tue, Apr 7, 2020 at 12:09 PM Jian Cai wrote: >> >> ALT_UP_B macro sets symbol up_b_offset via .equ to an expression >> involving another symbol. The macro gets expanded twice when >> arch/arm/kernel/sleep.S is assembled, creating a scenario where >> up_b_offset is set to another expression involving symbols while its >> current value is based on symbols. LLVM integrated assembler does not >> allow such cases, and based on the documentation of binutils, "Values >> that are based on expressions involving other symbols are allowed, but >> some targets may restrict this to only being done once per assembly", so >> it may be better to avoid such cases as it is not clearly stated which >> targets should support or disallow them. The fix in this case is simple, >> as up_b_offset has only one use, so we can replace the use with the >> definition and get rid of up_b_offset. >> >> Signed-off-by: Jian Cai Thanks for tackling this! > > Probably didn't need the extra parens, but it's fine (unless another > reviewer would like a v2). Maybe Stefan has some thoughts? Since this is a processor macro I actually prefer to have parentheses here. All use sites of ALT_UP_B pass just a label, but still, just to be on the safe side. I was wondering why equ has been used in first place. I don't see an advantage other than having a symbol which can be checked. But given that this code is stable and don't really need debugging at this point, I am fine replacing this to make it work for clang. > Reviewed-by: Nick Desaulniers > > Please add Link tags if these correspond to issues in our link > tracker, they help us track when and where patches land. > Link: https://github.com/ClangBuiltLinux/linux/issues/920 Agreed, please add the link. You can add this when submitting. With that: Reviewed-by: Stefan Agner -- Stefan > >> --- >> arch/arm/include/asm/assembler.h | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h >> index 99929122dad7..adee13126c62 100644 >> --- a/arch/arm/include/asm/assembler.h >> +++ b/arch/arm/include/asm/assembler.h >> @@ -269,10 +269,9 @@ >> .endif ;\ >> .popsection >> #define ALT_UP_B(label) \ >> - .equ up_b_offset, label - 9998b ;\ >> .pushsection ".alt.smp.init", "a" ;\ >> .long 9998b ;\ >> - W(b) . + up_b_offset ;\ >> + W(b) . + (label - 9998b) ;\ >> .popsection >> #else >> #define ALT_SMP(instr...) >> -- >> 2.26.0.292.g33ef6b2f38-goog >>