Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp20791lqr; Tue, 4 Jun 2024 19:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrBywDfFQv4AC/UwD9Am8VBUJCozDkibYBpfRLI6pH1HlrUeZwsa8NqSnJ0I7jpCq5BwS7LywWgoQp9vVLP5G6cJ84xstM8yhN54d+LA== X-Google-Smtp-Source: AGHT+IG17VWKD0kc0p3ex//wfru2ofNBtP7dCibQvCk4NuiaizSs+iv9RokyHy+t0oAFcxyN53QJ X-Received: by 2002:a05:6358:7f0f:b0:199:432b:821b with SMTP id e5c5f4694b2df-19c6c7adfbbmr147747555d.17.1717553398663; Tue, 04 Jun 2024 19:09:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717553398; cv=pass; d=google.com; s=arc-20160816; b=QoXKKst+Fw6bbivKRoZdgfEEl5VrxYrYVOfkMr/R7rS6Zh2+mZQD5abNzylqcXs8UL Ct5KenVWxL4bTNhbRMH1gZmIDmbnlPw8Mepr1mQCqnipqwtN0acqnX8BInT2teRXACJw HFa/oy0KU81aJx5rA5qAPV5TxRnXwGb/MKgWwZMbM2+bCJrBV4LkI8a3p9lQzjQxL33s 6SRlUygvwztXC3LGyr+7fiFlQF6FbYYoWPCbY4SXOizucSWw49vkmQZRBR3oIWXOBIyi okYAn+udCOLMsWz6o9is24eU6bD787l+4lIvMeTPZKq0jpja1ltr2RYu+qiNxeLoH7L0 nKMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :references:cc:to:from:date:subject:message-id:dkim-signature; bh=+hLssxSftTAbTK2MPi0VtFqUyURlszSjmWyA2r06aas=; fh=XYTYwqrFpwaOofXhCR8pKD9CCedHfxH9AIeG/QBFxRo=; b=bMX/WFaXeqU2yavRDHAsRL4MQ79qYZCGzwNhFj4CCjWVo/0eKsdxOf9ZLHjouXrFov ePCLXgY7UhxPq5gUDAzDd/Fu7usv3u9v5JRMNNE9YphkrrJ+3VR/1fzNX7FD5CWjDXih BlZF2xoAd7u15z2XjcQ2/Imjcdl+HOMNwIVOvBRPeFgqoSxEOLAqdigQQXAEk0UPfPc8 VfNb+SYXjSbRUY8Dit/xhumK2pYv888BEsVrKkXjkxld9pGS7Omm6FFeOyRmHRRDWOQY o0+dqcKIJuM+xKg3x6GO1WZV5CFkBfiYbBB5El/kV1RUTKOtpJfOsNjOq1iAZj5LKRU4 SE5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=oVrrSsqq; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-201666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e07140si9050922a12.293.2024.06.04.19.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 19:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=oVrrSsqq; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-201666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 BE18BB2153E for ; Wed, 5 Jun 2024 02:06:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AF9B5916B; Wed, 5 Jun 2024 02:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="oVrrSsqq" Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) (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 14DEAF503 for ; Wed, 5 Jun 2024 02:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.112 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717553198; cv=none; b=pVAU4YRd/cfrj/CRzccdPH7ow+Cl5WL/ZDiar7n9y4Qik1eeUe+sJuWaJvN9S4zWdOkgO7XDlP7R0QQCf9XX01kwDVK5BsxjC91dCfC42Efx0UfHFb2f+kfG+SPiS43rUOiGeNHYtle5RQXroqLgfV1wMDn3DnbSTTNO5WX5OHY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717553198; c=relaxed/simple; bh=ReFUp7pweTh2zzhDpxSwTrxIMDTmjvQ8dRKlAIkhyPY=; h=Message-ID:Subject:Date:From:To:Cc:References:In-Reply-To; b=DfGtiFKQ74d7ZLn0nk/f5wEXqf72pU6YhsBYgKs9S6RIpu/sdU3hU2AfjiMsqLEvuFZ2bAYIUNjAXaQ2mkye2256ie0ditVtTKi3c0wBsSIkDcKJ+rQ/BgZ1WO/sLoiDiCTD5pWFKRzRu8hLE5tAe20hYi7bO2Ail71oxR6nrY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=oVrrSsqq; arc=none smtp.client-ip=115.124.30.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1717553192; h=Message-ID:Subject:Date:From:To; bh=+hLssxSftTAbTK2MPi0VtFqUyURlszSjmWyA2r06aas=; b=oVrrSsqqdu8KbJx3rdGORmvX7f9YjcNZiOlZ1I7xsBw9jtaYvEDMfRqBRZ6Nuc4VbRJjoaK08T81yaq0NBHtn4X7KNtYK0w6+F4Y4YY86b5LvCYueq8ZoUZO0fW+llUpMO89N47dxrgEGVaVzpeuGWMPBqoHfCMi75Kv151x624= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033068173054;MF=hengqi@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0W7sYmF-_1717553191; Received: from localhost(mailfrom:hengqi@linux.alibaba.com fp:SMTPD_---0W7sYmF-_1717553191) by smtp.aliyun-inc.com; Wed, 05 Jun 2024 10:06:32 +0800 Message-ID: <1717553058.033336-2-hengqi@linux.alibaba.com> Subject: Re: [PATCH] loongarch: Only select HAVE_OBJTOOL and allow ORC unwinder if the inline assembler supports R_LARCH_{32,64}_PCREL Date: Wed, 5 Jun 2024 10:04:18 +0800 From: Heng Qi To: Xi Ruoyao Cc: Nathan Chancellor , 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 , Tejun Heo , Xi Ruoyao , Huacai Chen , WANG Xuerui , Tiezhu Yang References: <20240604150741.30252-1-xry111@xry111.site> In-Reply-To: <20240604150741.30252-1-xry111@xry111.site> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: On Tue, 4 Jun 2024 23:07:41 +0800, Xi Ruoyao wrote: > GAS <= 2.41 does not support generating R_LARCH_{32,64}_PCREL for > "label - ." and it generates R_LARCH_{ADD,SUB}{32,64} pairs instead. > objtool cannot handle R_LARCH_{ADD,SUB}{32,64} pair in __jump_table > (static key implementation) and etc. so it will produce some warnings. > This is causing the kernel CI systems to complain everywhere. > > For GAS we can check if -mthin-add-sub option is available to know if > R_LARCH_{32,64}_PCREL are supported. > > For Clang, we require Clang >= 18 and Clang >= 17 already supports > R_LARCH_{32,64}_PCREL, so we can always assume Clang is fine for > objtool. > > Note that __jump_table is not generated by the compiler so > -fno-jump-table is completely irrelevant for this issue. > Hi Xi Ruoyao, I want to know does this patch fix the following warning: https://lore.kernel.org/all/202406040645.6z95FW1f-lkp@intel.com/ ? Thanks. > Fixes: cb8a2ef0848c ("LoongArch: Add ORC stack unwinder support") > Closes: https://lore.kernel.org/loongarch/Zl5m1ZlVmGKitAof@yujie-X299/ > Closes: https://lore.kernel.org/loongarch/ZlY1gDDPi_mNrwJ1@slm.duckdns.org/ > Closes: https://lore.kernel.org/loongarch/1717478006.038663-1-hengqi@linux.alibaba.com/ > Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=816029e06768 > Link: https://github.com/llvm/llvm-project/commit/42cb3c6346fc > Signed-off-by: Xi Ruoyao > --- > arch/loongarch/Kconfig | 5 ++++- > arch/loongarch/Kconfig.debug | 1 + > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig > index e38139c576ee..e461a6c59f15 100644 > --- a/arch/loongarch/Kconfig > +++ b/arch/loongarch/Kconfig > @@ -143,7 +143,7 @@ config LOONGARCH > select HAVE_LIVEPATCH > select HAVE_MOD_ARCH_SPECIFIC > select HAVE_NMI > - select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS > + select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && AS_HAS_THIN_ADD_SUB > select HAVE_PCI > select HAVE_PERF_EVENTS > select HAVE_PERF_REGS > @@ -273,6 +273,9 @@ config AS_HAS_LBT_EXTENSION > config AS_HAS_LVZ_EXTENSION > def_bool $(as-instr,hvcl 0) > > +config AS_HAS_THIN_ADD_SUB > + def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) || CC_IS_CLANG > + > menu "Kernel type and options" > > source "kernel/Kconfig.hz" > diff --git a/arch/loongarch/Kconfig.debug b/arch/loongarch/Kconfig.debug > index 98d60630c3d4..8b2ce5b5d43e 100644 > --- a/arch/loongarch/Kconfig.debug > +++ b/arch/loongarch/Kconfig.debug > @@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE > > config UNWINDER_ORC > bool "ORC unwinder" > + depends on HAVE_OBJTOOL > select OBJTOOL > help > This option enables the ORC (Oops Rewind Capability) unwinder for > -- > 2.45.2 >