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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98FBFEE4993 for ; Wed, 23 Aug 2023 07:52:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232621AbjHWHwK (ORCPT ); Wed, 23 Aug 2023 03:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231564AbjHWHwK (ORCPT ); Wed, 23 Aug 2023 03:52:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5DEFCE6; Wed, 23 Aug 2023 00:52:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C21F61920; Wed, 23 Aug 2023 07:52:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09211C433C8; Wed, 23 Aug 2023 07:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692777127; bh=RrVC+nogoaZgt/Y3jUBheREnMWxpQIF1TAB30x8RvjE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dEj3Lzw7hAZZPCtkp0+9x+e7toz8Q2K8csXTxCu+eAk9U9sFpYDr7Hi16kGUZ0pNB ht5J8RxLaEGJPvXxfRukfSwVoO7vRtix56SNNwECn25lHhNgE9vU24qrvCd208dz7T 76uBf2Mebi5yxvxXz7R6dGM55lIQOqIFGYlbEKMjmF88j1htqj6KYHq4Nh23NQ7d/V f2PG+nFdRscJGXFoCaEx3MgWhO08K8n+MQFXhgpH/UmmPd4tyTHLORNWzCGw67gjWU zGqIHsdO3XdCnMqsrXC+Uji5UgNFn34BKtMO4cavSTSZpC54Ef8gSQjhIhha6zEyX0 SwgVZY6Oif3sw== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Randy Dunlap , Stephen Rothwell , Linux Next Mailing List Cc: Linux Kernel Mailing List , linux-riscv Subject: Re: linux-next: Tree for Aug 21 (riscv-64 asm) In-Reply-To: <877cpmxl95.fsf@all.your.base.are.belong.to.us> References: <20230821164605.7bac05f1@canb.auug.org.au> <5ebf04f8-0cf6-d2b4-fb73-f51fff421b3a@infradead.org> <87ttsr33a8.fsf@all.your.base.are.belong.to.us> <0111b49a-8cdf-2c1a-bab3-d1fd647aafa6@infradead.org> <87bkeyxmzx.fsf@all.your.base.are.belong.to.us> <877cpmxl95.fsf@all.your.base.are.belong.to.us> Date: Wed, 23 Aug 2023 09:52:04 +0200 Message-ID: <87r0nu19i3.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org Bj=C3=B6rn T=C3=B6pel writes: > Bj=C3=B6rn T=C3=B6pel writes: > >> Randy Dunlap writes: >> >>> Hi, >>> >>> On 8/22/23 01:11, Bj=C3=B6rn T=C3=B6pel wrote: >>>> Randy Dunlap writes: >>>>=20 >>>>> On 8/20/23 23:46, Stephen Rothwell wrote: >>>>>> Hi all, >>>>>> >>>>>> Changes since 20230818: >>>>>> >>>>> >>>>> ../arch/riscv/kernel/traps.c: In function 'do_irq': >>>>> ../arch/riscv/kernel/traps.c:384:1: error: s0 cannot be used in 'asm'= here >>>>> 384 | } >>>>> | ^ >>>>> ../arch/riscv/kernel/irq.c: In function 'do_softirq_own_stack': >>>>> ../arch/riscv/kernel/irq.c:94:1: error: s0 cannot be used in 'asm' he= re >>>>> 94 | } >>>>> | ^ >>>>> >>>>> >>>>> 2 out of 10 risc-v 64-bit builds failed with these errors. >>>>> >>>>> Is this a toolchain problem or something else? >>>>=20 >>>> Hmm, do you have a link to config/toolchain/log, or similar? >>> >>> The full randconfig file is attached. >>> >>> The toolchain is Arnd's build of gcc 13.1.0 from: >>> https://mirrors.edge.kernel.org/pub/tools/crosstool/ >>> (x86_64 host) >>> >>> Hm, I see that the latest/current there is gcc 13.2.0. >>> I'll upgrade later today. >> >> Thanks Randy! I can reproduce with GCC 12 on my machine. >> >> The config has >> | # CONFIG_FRAME_POINTER is not set >> but for some reason "-fno-omit-frame-pointer" is passed to GCC anyway, >> which is why GCC complains about s0 (FP on RISC-V) in asm. >> >> >> I'll dig a bit more. > > There are multiple issues: > * riscv enables -fno-omit-frame-pointer unconditionally for PERF_EVENTS > * CONFIG_FUNCTION_TRACER w/o dynamic ftrace enables -pg, which pulls in > -fno-omit-frame-pointer on riscv. Maybe something like (too crude?): diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 10e7a7ad175a..cd8075c092c3 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -62,6 +62,7 @@ config RISCV select COMMON_CLK select CPU_PM if CPU_IDLE || HIBERNATION select EDAC_SUPPORT + select FRAME_POINTER if PERF_EVENTS || (FUNCTION_TRACER && !DYNAMIC= _FTRACE) select GENERIC_ARCH_TOPOLOGY select GENERIC_ATOMIC64 if !64BIT select GENERIC_CLOCKEVENTS_BROADCAST if SMP diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 6ec6d52a4180..1329e060c548 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -87,9 +87,6 @@ endif ifeq ($(CONFIG_CMODEL_MEDANY),y) KBUILD_CFLAGS +=3D -mcmodel=3Dmedany endif -ifeq ($(CONFIG_PERF_EVENTS),y) - KBUILD_CFLAGS +=3D -fno-omit-frame-pointer -endif =20 # Avoid generating .eh_frame sections. KBUILD_CFLAGS +=3D -fno-asynchronous-unwind-tables -fno-unwind-tables