Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp606488rwo; Wed, 2 Aug 2023 00:50:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSlFbrg2LHqytMrMgBjLZHWUBRmUyXPpOUfxdm0/LV4i500Uo89m5+7L2Ex9obUrzhDf4g X-Received: by 2002:a17:906:cc4f:b0:99b:4b4f:c9de with SMTP id mm15-20020a170906cc4f00b0099b4b4fc9demr4301524ejb.36.1690962601541; Wed, 02 Aug 2023 00:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690962601; cv=none; d=google.com; s=arc-20160816; b=VnY6hZ6M9l/XUlpezu+1KJhyCmnCC3mPkmgVbwiZUhIkfOh792ycAY/I6mR723zs6k WZEQmfq/wZDH0bdOBslJs8XRC9TlGpf0URaWIdq7plVRnsaD3ZWG3awL8KJDZJoGmMjF 8as37F5DprmMiH2I0574f+3Q84ERe8MWb8pYnc7j9p9mrF6YGsTFh0E/dhC59uh3iSnu TzSrQ78oV2n4/I0mbDjJjTKefHf1ONM1eP2UULZpCJBmkxtiJylBQF4pqCKWcAAti5xJ C1LdZ9kRCKgauxJKPkfEk4Oaut5dUVmuikAyhgGaoF91D5MYe8iBOCoKydThCXk4huie +dew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=zknxZFG0jmGRLV2g3TMgRt8pIkmbju2CZegsTWnIYhw=; fh=IYYk8GmeDxIHTLAJtzZN68C56Wmx7jFi0qvkwPoo1ts=; b=ipYRYndfadOVi2XkQfoHQrI+PXVQ4RnxgIh3nxANq/UBkAjb27BeGAt8kpp6i8wFCb vlmenEY2wTrmWPImZQ+WAy0qLsAOKJuxREGQz7r3wby3QfETxEgD6RIEPM5M0de8EJcy bk7gUhTsO+fNjHbkcmelYzXlPS1BSN29dOLcJZ7wsccr7gq1+SJffjgLs49nHlvvA81N /JJXKkQuzvWQ6101MddG0tU6YfD8NO+HDONq+Gn31wPDnKVDkNF5GRCtP5ngjRHedAJN 25tlrCZ5h5XFD6VE0a6UZXcIDbmzpRr9raRk3SCALOwCj5YtI4W29Kg/JhgrsnSNh7w3 /pgw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gq15-20020a170906e24f00b0099315476769si9528870ejb.26.2023.08.02.00.49.37; Wed, 02 Aug 2023 00:50:01 -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 S232439AbjHBHcW (ORCPT + 99 others); Wed, 2 Aug 2023 03:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbjHBHcU (ORCPT ); Wed, 2 Aug 2023 03:32:20 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1131EA for ; Wed, 2 Aug 2023 00:32:18 -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 0021224E03C; Wed, 2 Aug 2023 15:32:16 +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 15:32:17 +0800 Received: from [192.168.125.127] (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 15:32:15 +0800 Message-ID: Date: Wed, 2 Aug 2023 15:32:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1] riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause Content-Language: en-US To: Conor Dooley CC: Conor Dooley , Jisheng Zhang , Samuel Holland , Dao Lu , "Heiko Stuebner" , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , , , Mason Huo References: <20230802064215.31111-1-minda.chen@starfivetech.com> <20230802-sharpness-spoon-f9b8804fb66f@wendy> From: Minda Chen In-Reply-To: <20230802-sharpness-spoon-f9b8804fb66f@wendy> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.98.54] X-ClientProxiedBy: EXCAS061.cuchost.com (172.16.6.21) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SCC_BODY_URI_ONLY,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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 > > 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 >>