Message ID | 20230802064215.31111-1-minda.chen@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp262264vqx; Wed, 2 Aug 2023 00:04:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBh9xQG1A0Xu0gE8+YRNajCJIPpX2dIO/F0CCovcusvE/BbxtUsXT8wK3SOeC2OHmOl9/S X-Received: by 2002:a05:6a20:4285:b0:123:149b:a34f with SMTP id o5-20020a056a20428500b00123149ba34fmr18707360pzj.1.1690959855123; Wed, 02 Aug 2023 00:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690959855; cv=none; d=google.com; s=arc-20160816; b=sfkFK1y2tLf7tPgodzppCp+zkH6wBcYBQfJr0h7y1kpnSFRw5dLPp7mVbXOMp9RjEi cE6YzB9vFezu2jqv9CC4+7fXwO/ljhMBPA9WW7PloDmcvJIuZ45ySwF/RSNbvSeTEOBd GTewR8VU7cX7qCyfenudb7C8/oPZ6/Oa1H6VnSvdhpP/VIOKqgOPHYeJvkBvIuSG3LnO HEswaesNZAjPcqLGMuD0TW5QqSveb00J58jL7p2WI6R8lV5sxdz1rbKBlChexLbi0JJS EZm4oTNbCdteE2gaT9j2IgZR9w/WPVSv8capPi9pTR4YeIkvnUfMJkkLYcS1CXbhBlns 6YOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=UT/9ffBfwC4j/gfIZvyhsFObZW1cCqrSp8exyshJxSo=; fh=SdSl0NANxOLmmdpDs0YhfcYyoG6UCSYN2Ymd1r7Mw2M=; b=bz4jmClNtIOOhNfVQgxoNq8S75bwMa9JymsspCuQ6V/V7lcDttmrQPz+VkVPf+N2Ph kEn9w7fVJozSqjZkN3RfxXcPLuzhTx2Q64uzd2RRmQyQs24Y5ZZSgDcdrTzIIjSnviG4 vv3+vXljXLi3t7+SI16sV37C26JlEYAFekkJZJOXlrs44Wgd99IBGNcF9JbdCicx4HFO 99VdePJH7C0oQu+XBB7MSsJRIBwTn0fK63zEcntzH9J558EYt20e/w8uL1SlUQ9mbZbE hui1F2Kv3DgvjWCYbfi0h9udxvn5Jv5CwVN8UnP5eii7ChkjdYPrCroL2VLKA5U8457u YpbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x190-20020a6386c7000000b0055ffed90ccasi9998296pgd.459.2023.08.02.00.03.42; Wed, 02 Aug 2023 00:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232305AbjHBGnV (ORCPT <rfc822;cambridge8321@gmail.com> + 99 others); Wed, 2 Aug 2023 02:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjHBGnQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Aug 2023 02:43:16 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A579230DD for <linux-kernel@vger.kernel.org>; Tue, 1 Aug 2023 23:42:48 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 4745B24E248; Wed, 2 Aug 2023 14:42:17 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 2 Aug 2023 14:42:17 +0800 Received: from ubuntu.localdomain (183.27.98.54) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 2 Aug 2023 14:42:16 +0800 From: Minda Chen <minda.chen@starfivetech.com> To: Conor Dooley <conor@kernel.org>, Jisheng Zhang <jszhang@kernel.org>, Samuel Holland <samuel@sholland.org>, Dao Lu <daolu@rivosinc.com>, "Heiko Stuebner" <heiko@sntech.de>, Paul Walmsley <paul.walmsley@sifive.com>, "Palmer Dabbelt" <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu> CC: <linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>, "Minda Chen" <minda.chen@starfivetech.com> Subject: [PATCH v1] riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause Date: Wed, 2 Aug 2023 14:42:15 +0800 Message-ID: <20230802064215.31111-1-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.98.54] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773099920804511050 X-GMAIL-MSGID: 1773099920804511050 |
Series |
[v1] riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause
|
|
Commit Message
Minda Chen
Aug. 2, 2023, 6:42 a.m. UTC
Actually it is a part of Conor's
commit aae538cd03bc ("riscv: fix detection of toolchain
Zihintpause support").
It is looks like a merge issue. Samuel's
commit 0b1d60d6dd9e ("riscv: Fix build with
CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and
revert to __riscv_zihintpause. So this patch can fix it.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
---
arch/riscv/include/asm/vdso/processor.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hey Minda, On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: > Actually it is a part of Conor's > commit aae538cd03bc ("riscv: fix detection of toolchain > Zihintpause support"). > It is looks like a merge issue. Yup, spot on. > Samuel's > commit 0b1d60d6dd9e ("riscv: Fix build with > CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and > revert to __riscv_zihintpause. So this patch can fix it. > > Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Did you actually manage to trigger this, or was this by inspection? clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's what the clang-built-linux CI uses to test the LTS kernels from before LLVM's IAS was supported for RISC-V. Seemingly all that needs to be satisfied there is that zihintpause doesn't appear in -march so this has gone unnoticed. Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks, Conor. > --- > arch/riscv/include/asm/vdso/processor.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/include/asm/vdso/processor.h b/arch/riscv/include/asm/vdso/processor.h > index 14f5d27783b8..96b65a5396df 100644 > --- a/arch/riscv/include/asm/vdso/processor.h > +++ b/arch/riscv/include/asm/vdso/processor.h > @@ -14,7 +14,7 @@ static inline void cpu_relax(void) > __asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy)); > #endif > > -#ifdef __riscv_zihintpause > +#ifdef CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE > /* > * Reduce instruction retirement. > * This assumes the PC changes. > -- > 2.17.1 >
On 2023/8/2 14:54, Conor Dooley wrote: > Hey Minda, > > On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: >> Actually it is a part of Conor's >> commit aae538cd03bc ("riscv: fix detection of toolchain >> Zihintpause support"). >> It is looks like a merge issue. > > Yup, spot on. > >> Samuel's >> commit 0b1d60d6dd9e ("riscv: Fix build with >> CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and >> revert to __riscv_zihintpause. So this patch can fix it. >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > > Did you actually manage to trigger this, or was this by inspection? > clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's > what the clang-built-linux CI uses to test the LTS kernels from before > LLVM's IAS was supported for RISC-V. Seemingly all that needs to be > satisfied there is that zihintpause doesn't appear in -march so this has > gone unnoticed. > > Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > Thanks, > Conor. > Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log of processor.h found this issue. >> --- >> arch/riscv/include/asm/vdso/processor.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/riscv/include/asm/vdso/processor.h b/arch/riscv/include/asm/vdso/processor.h >> index 14f5d27783b8..96b65a5396df 100644 >> --- a/arch/riscv/include/asm/vdso/processor.h >> +++ b/arch/riscv/include/asm/vdso/processor.h >> @@ -14,7 +14,7 @@ static inline void cpu_relax(void) >> __asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy)); >> #endif >> >> -#ifdef __riscv_zihintpause >> +#ifdef CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE >> /* >> * Reduce instruction retirement. >> * This assumes the PC changes. >> -- >> 2.17.1 >>
On Wed, Aug 02, 2023 at 03:32:15PM +0800, Minda Chen wrote: > > > On 2023/8/2 14:54, Conor Dooley wrote: > > Hey Minda, > > > > On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: > >> Actually it is a part of Conor's > >> commit aae538cd03bc ("riscv: fix detection of toolchain > >> Zihintpause support"). > >> It is looks like a merge issue. > > > > Yup, spot on. > > > >> Samuel's > >> commit 0b1d60d6dd9e ("riscv: Fix build with > >> CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and > >> revert to __riscv_zihintpause. So this patch can fix it. > >> > >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > > > > Did you actually manage to trigger this, or was this by inspection? > > clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's > > what the clang-built-linux CI uses to test the LTS kernels from before > > LLVM's IAS was supported for RISC-V. Seemingly all that needs to be > > satisfied there is that zihintpause doesn't appear in -march so this has > > gone unnoticed. > > > > Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") > > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > > > Thanks, > > Conor. > > > Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax > cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log > of processor.h found this issue. That doesn't look like it is fixed in later stable kernels (we are at 6.1.42-rcN right now I think). It sounds we should ask Greg to backport 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") to 6.1. Does that make sense to you?
On 2023/8/2 15:48, Conor Dooley wrote: > On Wed, Aug 02, 2023 at 03:32:15PM +0800, Minda Chen wrote: >> >> >> On 2023/8/2 14:54, Conor Dooley wrote: >> > Hey Minda, >> > >> > On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: >> >> Actually it is a part of Conor's >> >> commit aae538cd03bc ("riscv: fix detection of toolchain >> >> Zihintpause support"). >> >> It is looks like a merge issue. >> > >> > Yup, spot on. >> > >> >> Samuel's >> >> commit 0b1d60d6dd9e ("riscv: Fix build with >> >> CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and >> >> revert to __riscv_zihintpause. So this patch can fix it. >> >> >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >> > >> > Did you actually manage to trigger this, or was this by inspection? >> > clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's >> > what the clang-built-linux CI uses to test the LTS kernels from before >> > LLVM's IAS was supported for RISC-V. Seemingly all that needs to be >> > satisfied there is that zihintpause doesn't appear in -march so this has >> > gone unnoticed. >> > >> > Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") >> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> >> > >> > Thanks, >> > Conor. >> > >> Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax >> cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log >> of processor.h found this issue. > > That doesn't look like it is fixed in later stable kernels (we are at > 6.1.42-rcN right now I think). It sounds we should ask Greg to backport > 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") > to 6.1. Does that make sense to you? Yes. 6.1 is lts kernel. Starfive will use this kernel for a long time. Thanks.
On Wed, Aug 02, 2023 at 04:17:51PM +0800, Minda Chen wrote: > > > On 2023/8/2 15:48, Conor Dooley wrote: > > On Wed, Aug 02, 2023 at 03:32:15PM +0800, Minda Chen wrote: > >> > >> > >> On 2023/8/2 14:54, Conor Dooley wrote: > >> > Hey Minda, > >> > > >> > On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: > >> >> Actually it is a part of Conor's > >> >> commit aae538cd03bc ("riscv: fix detection of toolchain > >> >> Zihintpause support"). > >> >> It is looks like a merge issue. > >> > > >> > Yup, spot on. > >> > > >> >> Samuel's > >> >> commit 0b1d60d6dd9e ("riscv: Fix build with > >> >> CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and > >> >> revert to __riscv_zihintpause. So this patch can fix it. > >> >> > >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > >> > > >> > Did you actually manage to trigger this, or was this by inspection? > >> > clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's > >> > what the clang-built-linux CI uses to test the LTS kernels from before > >> > LLVM's IAS was supported for RISC-V. Seemingly all that needs to be > >> > satisfied there is that zihintpause doesn't appear in -march so this has > >> > gone unnoticed. > >> > > >> > Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") > >> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > >> > > >> > Thanks, > >> > Conor. > >> > > >> Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax > >> cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log > >> of processor.h found this issue. > > > > That doesn't look like it is fixed in later stable kernels (we are at > > 6.1.42-rcN right now I think). It sounds we should ask Greg to backport > > 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") > > to 6.1. Does that make sense to you? > Yes. 6.1 is lts kernel. Starfive will use this kernel for a long time. Thanks. What is preventing you from moving to a newer kernel version? All of your kernel changes are already properly merged into Linus's tree, right? thanks, greg k-h
On Wed, Aug 02, 2023 at 10:33:27AM +0200, Greg KH wrote: > On Wed, Aug 02, 2023 at 04:17:51PM +0800, Minda Chen wrote: > > > > > > On 2023/8/2 15:48, Conor Dooley wrote: > > > On Wed, Aug 02, 2023 at 03:32:15PM +0800, Minda Chen wrote: > > >> > > >> > > >> On 2023/8/2 14:54, Conor Dooley wrote: > > >> > Hey Minda, > > >> > > > >> > On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: > > >> >> Actually it is a part of Conor's > > >> >> commit aae538cd03bc ("riscv: fix detection of toolchain > > >> >> Zihintpause support"). > > >> >> It is looks like a merge issue. > > >> > > > >> > Yup, spot on. > > >> > > > >> >> Samuel's > > >> >> commit 0b1d60d6dd9e ("riscv: Fix build with > > >> >> CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and > > >> >> revert to __riscv_zihintpause. So this patch can fix it. > > >> >> > > >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > > >> > > > >> > Did you actually manage to trigger this, or was this by inspection? > > >> > clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's > > >> > what the clang-built-linux CI uses to test the LTS kernels from before > > >> > LLVM's IAS was supported for RISC-V. Seemingly all that needs to be > > >> > satisfied there is that zihintpause doesn't appear in -march so this has > > >> > gone unnoticed. > > >> > > > >> > Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") > > >> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > >> > > > >> > Thanks, > > >> > Conor. > > >> > > > >> Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax > > >> cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log > > >> of processor.h found this issue. > > > > > > That doesn't look like it is fixed in later stable kernels (we are at > > > 6.1.42-rcN right now I think). It sounds we should ask Greg to backport > > > 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") > > > to 6.1. Does that make sense to you? > > Yes. 6.1 is lts kernel. Starfive will use this kernel for a long time. Thanks. > > What is preventing you from moving to a newer kernel version? All of > your kernel changes are already properly merged into Linus's tree, > right? Regardless of their reasons, "vdso.so call cpu_relax cause application core dump" is something that we should fix in stable kernels, no?
On Wed, Aug 02, 2023 at 09:52:45AM +0100, Conor Dooley wrote: > On Wed, Aug 02, 2023 at 10:33:27AM +0200, Greg KH wrote: > > On Wed, Aug 02, 2023 at 04:17:51PM +0800, Minda Chen wrote: > > > > > > > > > On 2023/8/2 15:48, Conor Dooley wrote: > > > > On Wed, Aug 02, 2023 at 03:32:15PM +0800, Minda Chen wrote: > > > >> > > > >> > > > >> On 2023/8/2 14:54, Conor Dooley wrote: > > > >> > Hey Minda, > > > >> > > > > >> > On Wed, Aug 02, 2023 at 02:42:15PM +0800, Minda Chen wrote: > > > >> >> Actually it is a part of Conor's > > > >> >> commit aae538cd03bc ("riscv: fix detection of toolchain > > > >> >> Zihintpause support"). > > > >> >> It is looks like a merge issue. > > > >> > > > > >> > Yup, spot on. > > > >> > > > > >> >> Samuel's > > > >> >> commit 0b1d60d6dd9e ("riscv: Fix build with > > > >> >> CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and > > > >> >> revert to __riscv_zihintpause. So this patch can fix it. > > > >> >> > > > >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > > > >> > > > > >> > Did you actually manage to trigger this, or was this by inspection? > > > >> > clang-15 + binutils 2.35 was, IIRC, how we spotted this because that's > > > >> > what the clang-built-linux CI uses to test the LTS kernels from before > > > >> > LLVM's IAS was supported for RISC-V. Seemingly all that needs to be > > > >> > satisfied there is that zihintpause doesn't appear in -march so this has > > > >> > gone unnoticed. > > > >> > > > > >> > Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") > > > >> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > > >> > > > > >> > Thanks, > > > >> > Conor. > > > >> > > > > >> Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax > > > >> cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log > > > >> of processor.h found this issue. > > > > > > > > That doesn't look like it is fixed in later stable kernels (we are at > > > > 6.1.42-rcN right now I think). It sounds we should ask Greg to backport > > > > 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") > > > > to 6.1. Does that make sense to you? > > > Yes. 6.1 is lts kernel. Starfive will use this kernel for a long time. Thanks. > > > > What is preventing you from moving to a newer kernel version? All of > > your kernel changes are already properly merged into Linus's tree, > > right? > > Regardless of their reasons, "vdso.so call cpu_relax cause application > core dump" is something that we should fix in stable kernels, no? Yes.
On Wed, Aug 02, 2023 at 11:42:59AM +0200, Greg KH wrote: > On Wed, Aug 02, 2023 at 09:52:45AM +0100, Conor Dooley wrote: > > On Wed, Aug 02, 2023 at 10:33:27AM +0200, Greg KH wrote: > > > On Wed, Aug 02, 2023 at 04:17:51PM +0800, Minda Chen wrote: > > > > On 2023/8/2 15:48, Conor Dooley wrote: > > > > > On Wed, Aug 02, 2023 at 03:32:15PM +0800, Minda Chen wrote: > > > > >> On 2023/8/2 14:54, Conor Dooley wrote: > > > > >> Thanks, Conor. I found this just by inspection. I found a issue that vdso.so call cpu_relax > > > > >> cause application core dump in kernel 6.1.31. I need Samuel'patch to fix this. And I search the log > > > > >> of processor.h found this issue. > > > > > > > > > > That doesn't look like it is fixed in later stable kernels (we are at > > > > > 6.1.42-rcN right now I think). It sounds we should ask Greg to backport > > > > > 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") > > > > > to 6.1. Does that make sense to you? > > > > Yes. 6.1 is lts kernel. Starfive will use this kernel for a long time. Thanks. > > > > > > What is preventing you from moving to a newer kernel version? All of > > > your kernel changes are already properly merged into Linus's tree, > > > right? > > > > Regardless of their reasons, "vdso.so call cpu_relax cause application > > core dump" is something that we should fix in stable kernels, no? > > Yes. It doesn't apply cleanly as a cherry-pick onto linux-6.1, so it'll need to be submitted. Maybe Minda can do that, since they've got an already tested version of the patch. Failing that, I will.
Hello: This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <palmer@rivosinc.com>: On Wed, 2 Aug 2023 14:42:15 +0800 you wrote: > Actually it is a part of Conor's > commit aae538cd03bc ("riscv: fix detection of toolchain > Zihintpause support"). > It is looks like a merge issue. Samuel's > commit 0b1d60d6dd9e ("riscv: Fix build with > CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and > revert to __riscv_zihintpause. So this patch can fix it. > > [...] Here is the summary with links: - [v1] riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause https://git.kernel.org/riscv/c/a09560a7b160 You are awesome, thank you!
diff --git a/arch/riscv/include/asm/vdso/processor.h b/arch/riscv/include/asm/vdso/processor.h index 14f5d27783b8..96b65a5396df 100644 --- a/arch/riscv/include/asm/vdso/processor.h +++ b/arch/riscv/include/asm/vdso/processor.h @@ -14,7 +14,7 @@ static inline void cpu_relax(void) __asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy)); #endif -#ifdef __riscv_zihintpause +#ifdef CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE /* * Reduce instruction retirement. * This assumes the PC changes.