Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp341299lqr; Wed, 5 Jun 2024 07:41:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBQiTmolOPlxhjLQji/V92G8hKPwh2sfkP7gOCoYwNlzBeD5/SVegjj08DtddjDZKOhcnqGRWjp+vVnzdB7B4qTrfiekmdTxbkCbieuw== X-Google-Smtp-Source: AGHT+IG1TFXoRYgI8HE5k5Ji8pgjMKz7C687lAbUccueC6d9tULKVzm0EWNH2qraerPILYtXP5cD X-Received: by 2002:a17:90b:2384:b0:2c1:9892:8fb with SMTP id 98e67ed59e1d1-2c27db003c0mr2879014a91.5.1717598467423; Wed, 05 Jun 2024 07:41:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717598467; cv=pass; d=google.com; s=arc-20160816; b=eOHErrV6Bn64Ifxg0yNUPlven40AE3MD2CmrDc6p6yVfcR/7DZ4BlGx6AfBZggfoI0 MHk2pbS+deW+78NzUCD0n/vtUyyyONk7XoH2MqtkbD28/KOTF5BzGZpI8c1mkSla/GSK 9qOlioPY3CpmOas4hYHnVLDpc5y9f4o8SVhDfWEujaWijDs14lCLsV6ZFwr1m+XMXwLC WjSCI6JhdbRPW4kNZr2O3c1kINody0tFmZRIzZ+Lc/5vMhtPSLLCrHUHftokTLCRIQ43 mJLqDNFDHbN6dHQhvwwXwOroTYRvyn3cSQmqDitZrzMmVrfJUkZnr60L9yCnR1cs/gXY 4ykg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=I97f7JYMpiUS3u0zi5RpSCT46HFV5nPQVsay0SFQe9o=; fh=4WfND/VRk4g+Gbh6W8C8hEqMzYQzLXJtWBfoYgzLyp4=; b=hrh6QB7cRNgiDmEALL8SCJkzdyajWYBImLvuZa/+f2tEDXPd4HWRk1+5ggjiBxGYcc stXHSc4a+RN2E/QTimrX6Dj0rE8Q5/AlH8FvL/2/WwWYEVpWJ2PCQISfZLhCcNKEtUHV cP+sy3wpwSfkHpOZpSXoxJbUNkdfVY9K2g+XaOXtgg//X103n94sAqGhwcVUqtVypK7Y d6UmO9YP+eKFijA2zxuqDm5WGNY3DgyIZs8dpT3SjN9ZpcAMJHC2yjd/WqFqHofxpoik UTIGJED7CdH4n1TRKXnx+nxvEn8lArKX+rA1v/bLs1E61GiIChXy80jTCM6Q+GFn5xaL fMGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="K/QYeyeS"; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-202694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c28066e8d8si1311721a91.60.2024.06.05.07.41.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 07:41:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="K/QYeyeS"; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-202694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AA5E7B24750 for ; Wed, 5 Jun 2024 13:41:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00B5D19AA77; Wed, 5 Jun 2024 13:18:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="K/QYeyeS" Received: from xry111.site (xry111.site [89.208.246.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA5B719924D for ; Wed, 5 Jun 2024 13:18:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.208.246.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717593500; cv=none; b=mqvaroFVInEoNinLmr3/3TRes5KcocWS/uGNk0LC9fMkJm59aXbjucOEYAaFyV0tqg/LaHdpyM6+Tq3R7Lxf+f4HJaJqzX7jYlnG5HPnRUgP4V/QtCikaoXulnUaxgRpJrGt7OfbHvxvLNnTQjK+cqSXhk6FJNPya3LoDaeXd78= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717593500; c=relaxed/simple; bh=aSGeY//DKOc9pUfHYgBFU7c6uqdrSP0BOyUSG+ubbnc=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=eItNdB7BXDgUCq4kU9fi2ESslBlHzKd6GgPdnpBr8JUHLJaBk03bgW+ywjN9nBvzOo8ps79oFIZrruB/pP44g+lKK4KxxL8icW7cuCrRwaJ6khFSeBbhHtEYprG5f9ILuFOM3k+fNTkuxNwLw8TOpRHvibYMnaxBCNmaHT0lbZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site; spf=pass smtp.mailfrom=xry111.site; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b=K/QYeyeS; arc=none smtp.client-ip=89.208.246.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1717593493; bh=aSGeY//DKOc9pUfHYgBFU7c6uqdrSP0BOyUSG+ubbnc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=K/QYeyeSpUarJlYgGgAyIAl4Fd+JhbABsGC8TCH2Hn4w42JBjAcm37/+UPyjiPAiS FXqo2AgIrAo3JpeegFXyKyanW+LLvUOsnxx66xVFVXJVJCEME/Rclz++AQPGIMeI5U CkSNEPqyletl8w4nPPNuC6JwFEfS5d5LgrHDLEpE= Received: from [192.168.124.13] (unknown [113.140.11.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id E912F6760C; Wed, 5 Jun 2024 09:18:08 -0400 (EDT) Message-ID: <444ec2031ef6ca016cbfa8dfedc51bddc8529ba7.camel@xry111.site> Subject: Re: [PATCH] loongarch: Only select HAVE_OBJTOOL and allow ORC unwinder if the inline assembler supports R_LARCH_{32,64}_PCREL From: Xi Ruoyao To: Nathan Chancellor , Peter Zijlstra Cc: Huacai Chen , WANG Xuerui , Tiezhu Yang , Nick Desaulniers , Bill Wendling , Justin Stitt , Youling Tang , Jinyang He , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, mengqinggang@loongson.cn, cailulu@loongson.cn, wanglei@loongson.cn, luweining@loongson.cn, Yujie Liu , Heng Qi , Tejun Heo Date: Wed, 05 Jun 2024 21:18:06 +0800 In-Reply-To: References: <20240604150741.30252-1-xry111@xry111.site> <20240605054328.GA279426@thelio-3990X> <20240605062548.GF279426@thelio-3990X> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2024-06-05 at 18:57 +0800, Xi Ruoyao wrote: > On Tue, 2024-06-04 at 23:25 -0700, Nathan Chancellor wrote: > > On Wed, Jun 05, 2024 at 01:54:24PM +0800, Xi Ruoyao wrote: > > > On Tue, 2024-06-04 at 22:43 -0700, Nathan Chancellor wrote: > > > > For what it's worth, I have noticed some warnings with clang that I > > > > don't see with GCC but I only filed an issue on our GitHub and neve= r > > > > followed up on the mailing list, so sorry about that. > > > >=20 > > > > https://github.com/ClangBuiltLinux/linux/issues/2024 > > > >=20 > > > > Might be tangential to this patch though but I felt it was worth > > > > mentioning. > > >=20 > > > The warnings in GCC build is definitely the issue handled by this pat= ch. > > > But the warnings in Clang build should be a different issue.=C2=A0 Ca= n you > > > attach the kernel/events/core.o file from the Clang build for analysi= s? > > > I guess we need to disable more optimization... > >=20 > > Sure thing. Let me know if there are any issues with the attachment. >=20 > Thanks!=C2=A0 I've simplified it and now even... >=20 > .global test > .type test,@function > test: >=20 > addi.d $sp,$sp,-448 > st.d $ra,$sp,440 > st.d $fp,$sp,432 > addi.d $fp,$sp,448 >=20 > # do something >=20 > addi.d $sp,$fp,-448 > ld.d $fp,$sp,432 > ld.d $ra,$sp,440 > addi.d $sp,$sp,448 > ret >=20 > .size test,.-test >=20 > is enough to trigger a objtool warning: >=20 > /home/xry111/t1.o: warning: objtool: test+0x20: return with modified stac= k frame >=20 > And to me this warning is bogus? Minimal C reproducer: struct x { _Alignas(64) char buf[128]; }; void f(struct x *p); void g() { struct x x =3D { .buf =3D "1145141919810" }; f(&x); } Then objtool is unhappy to the object file produced with "clang -c -O2" from this translation unit: /home/xry111/t2.o: warning: objtool: g+0x50: return with modified stack fra= me It seems CFI_BP has a very specific semantic in objtool and Clang does not operates $fp in the expected way. I'm not sure about my conclusion though. Maybe Peter can explain it better. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University