Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp802809pxy; Wed, 5 May 2021 14:26:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWpTcLnAULhYS6mTi5ywVvmvwqHuZEgHmqd25GrK41qeGIvdtUUjQ9X01oN+kF2uR3lpBH X-Received: by 2002:a17:906:c04b:: with SMTP id bm11mr740910ejb.263.1620249997546; Wed, 05 May 2021 14:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620249997; cv=none; d=google.com; s=arc-20160816; b=KGASvbQD0dVNgc+79l3mkhUAKR8fdL8Z5NglVA6apTxEyhIkZB1QAvi6758LXl5xMv Dz5Q/5f+o6I7v9QWfpB0mCqOwqlCY/9QJrIjXfbHmxt2tL6UwmUlc0JSL5kSO7YklAO1 DtJif1K/7AKiypCYCfBXVPrMYI0pvpsoVslepItcDmOO5/zlHTyZcNi381lpco74E6w3 aMKeHN3WQV3IQliXR47AmsY3AkKcphvNLuy2WlfULJGepg3FZ0ktWBDg4s6b5di8+Hzx dY7K4uTgWinjM/EnEwtigYkm0ob8GlOTK16/QfRVQWhZlCi8CzjsJjPcGXemOrgcKTHH XGiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bl2T2I4euCheO6kuPRufjI1BLux88KgyyYFnH6PcY50=; b=NtAppHvJ2MxYqhUaSdJm9YeO+hygbSB3BPB6IPOXZH13MuwqIE5rejf8I/+QHwtjEt OFVxiqod0HqpUYDXpgxKyO3xo8fYKkBPMAijGVqEu84JISUDnYa++SWgC9M0qRgJwilf k5S1ozltdH25Iv75JfWwpR0cI+TRMLxQQ/8PulPDDQ+EVhc4ndW/lvjD8eSJbvvnLUJ0 enW3RZF+i6pU0Tl2daU2UKRxKeui/Ww2BxECJLRGye1/2Uj4slWUwvf1/lorFp+fCFuT a2VxE2cGsqjaqAeYjXFXmtMAPOIFva8iKzRSaB93t65eDuyk6FEtohqYW10KnD0HHMAd oNfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RqUGfG4+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si438647edq.278.2021.05.05.14.26.13; Wed, 05 May 2021 14:26:37 -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=@kernel.org header.s=k20201202 header.b=RqUGfG4+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231167AbhEEVIS (ORCPT + 99 others); Wed, 5 May 2021 17:08:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:57712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbhEEVIQ (ORCPT ); Wed, 5 May 2021 17:08:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9AF906103E; Wed, 5 May 2021 21:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620248839; bh=XX1MaOTqwyZbNr2qmHq5rmE0mWNmyfdB4PmUbQZYwUo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RqUGfG4+pss2kUdZkYz06SbJtB1Rg53udv27PIENHNcJsIsyubScIIKfZW1Tkn++W xc97UDxnyPoz7YO0awonulkH074LQxGqj5cNRewqyF1U45u3aSD20rOZGpLidjS9Ob OQu1XFIOfNZX8oWFv39+1i8UtuJugoPZOfSu6Cp0I8mYA1oTZGiaZezylMCLHM8/tr 8Tt+y2TarOj1SZPIcynZJb35lqKlJReKOdgAkmEU2XidP0wwmLK542EqbeYpRsAete n4Y3MS9C9uJ2+k4jcMEW6dmC3F7pspRVU0GX6Jlf+b71N4uYC2LlGR7RS/+sy520MT CSfXbwPg2l31w== Date: Wed, 5 May 2021 14:07:14 -0700 From: Nathan Chancellor To: Jian Cai Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, ndesaulniers@google.com, manojgupta@google.com, llozano@google.com, clang-built-linux@googlegroups.com, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] arm64: vdso: remove commas between macro name and arguments Message-ID: References: <20210416203522.2397801-1-jiancai@google.com> <20210416232341.2421342-1-jiancai@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210416232341.2421342-1-jiancai@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jian, On Fri, Apr 16, 2021 at 04:23:41PM -0700, Jian Cai wrote: > LLVM's integrated assembler does not support using commas separating > the name and arguments in .macro. However, only spaces are used in the > manual page. This replaces commas between macro names and the subsequent > arguments with space in calls to clock_gettime_return to make it > compatible with IAS. > > Link: > https://sourceware.org/binutils/docs/as/Macro.html#Macro > https://github.com/ClangBuiltLinux/linux/issues/1349 > > Signed-off-by: Jian Cai The actual patch itself looks fine to me but there should be some more explanation in the commit message that this patch is for 4.19 only and why it is not applicable upstream. Additionally, I would recommend using the '--subject-prefix=' flag to 'git format-patch' to clarify that as well, something like '--subject-prefix="PATCH 4.19 ONLY"'? My explanation would be something like (take bits and pieces as you feel necessary): ======================================================================== [PATCH 4.19 ONLY] arm64: vdso: remove commas between macro name and arguments LLVM's integrated assembler does not support using a comma to separate a macro name and its arguments when there is only one argument with a default value: arch/arm64/kernel/vdso/gettimeofday.S:230:24: error: too many positional arguments clock_gettime_return, shift=1 ^ arch/arm64/kernel/vdso/gettimeofday.S:253:24: error: too many positional arguments clock_gettime_return, shift=1 ^ arch/arm64/kernel/vdso/gettimeofday.S:274:24: error: too many positional arguments clock_gettime_return, shift=1 ^ This error is not in mainline because commit 28b1a824a4f4 ("arm64: vdso: Substitute gettimeofday() with C implementation") rewrote this assembler file in C as part of a 25 patch series that is unsuitable for stable. Just remove the comma in the clock_gettime_return invocations in 4.19 so that GNU as and LLVM's integrated assembler work the same. ======================================================================== I worded the first sentence the way that I did because correct me if I am wrong but it seems that the integrated assembler has no issues with the use of commas separating the arguments in a .macro definition as that is done everywhere in arch/arm64, just not when there is a single parameter with a default value because essentially what it is evaluating it to is "clock_gettime_return ,shift=1", which according to the GAS manual [1] means that "shift" is actually being set to 0 then there is an other parameter, when it expects only one. [1]: After the definition is complete, you can call the macro either as ‘reserve_str a,b’ (with ‘\p1’ evaluating to a and ‘\p2’ evaluating to b), or as ‘reserve_str ,b’ (with ‘\p1’ evaluating as the default, in this case ‘0’, and ‘\p2’ evaluating to b). Lastly, Will or Catalin should ack this as an explicitly out of mainline patch so that Greg or Sasha can take it. I would put them on the "To:" line in addition to Greg and Sasha. Hopefully this is helpful! Cheers, Nathan > --- > > Changes v1 -> v2: > Keep the comma in the macro definition to be consistent with other > definitions. > > Changes v2 -> v3: > Edit tags. > > arch/arm64/kernel/vdso/gettimeofday.S | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S > index 856fee6d3512..b6faf8b5d1fe 100644 > --- a/arch/arm64/kernel/vdso/gettimeofday.S > +++ b/arch/arm64/kernel/vdso/gettimeofday.S > @@ -227,7 +227,7 @@ realtime: > seqcnt_check fail=realtime > get_ts_realtime res_sec=x10, res_nsec=x11, \ > clock_nsec=x15, xtime_sec=x13, xtime_nsec=x14, nsec_to_sec=x9 > - clock_gettime_return, shift=1 > + clock_gettime_return shift=1 > > ALIGN > monotonic: > @@ -250,7 +250,7 @@ monotonic: > clock_nsec=x15, xtime_sec=x13, xtime_nsec=x14, nsec_to_sec=x9 > > add_ts sec=x10, nsec=x11, ts_sec=x3, ts_nsec=x4, nsec_to_sec=x9 > - clock_gettime_return, shift=1 > + clock_gettime_return shift=1 > > ALIGN > monotonic_raw: > @@ -271,7 +271,7 @@ monotonic_raw: > clock_nsec=x15, nsec_to_sec=x9 > > add_ts sec=x10, nsec=x11, ts_sec=x13, ts_nsec=x14, nsec_to_sec=x9 > - clock_gettime_return, shift=1 > + clock_gettime_return shift=1 > > ALIGN > realtime_coarse: > -- > 2.31.1.368.gbe11c130af-goog >