Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1272156lqs; Sat, 15 Jun 2024 01:45:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmE1k16NEdOQtVRxj2upVcw1nsPwQ7MVNWOoikrEFzdqYG3GH5VAvGBEqwNiCh4fTqRjwiuDnJhnvCt2SKHIFqULGYq25314tmE5gGaw== X-Google-Smtp-Source: AGHT+IFo3EUxllu1+mcHASLW8gCJyKoTXvAFNm/xYGDU4OG80zVTZxw7l//QGkyfqRBAuj3Mi3v2 X-Received: by 2002:a50:9e8c:0:b0:57c:5aff:112a with SMTP id 4fb4d7f45d1cf-57cbd8b9c05mr2985709a12.32.1718441149393; Sat, 15 Jun 2024 01:45:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718441149; cv=pass; d=google.com; s=arc-20160816; b=P+dxAVypDJe0upL7VPkpXIpwd45FUfgzaYbCHXrihz1VwG5CD32UvhBVs2MD9TxR6y 9nRteSFe8eHlhD8pUnjpwOjA+Sy/rtTz1Y9Rz3xFRjlA/YSeDFxuc+nOS3ev5kuhjayH IBM08bacf1bqotF3JbMG5tbnCdB/dPSNWOHh6B6vHQ8L9OeH/W4q/gl/q8qKK0R0RYJS m2VsJJ4n/U6fgS/bLm9c3fy6ghkZe9wMwMFXgwhQy4bVDkFpbriFe1bsfQ0G5bKKRMFK TMrZIcjBFZh6ayF/0Dpm+0h2VI4+NPU2PCMXT5NLVYBN6kg2AIybHrbignSmlPZikO5D lCyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=fMvkB/ar7Xfnx08mHvvCThFJ66QUTpDw+00v+ROK750=; fh=5rKDBQMqpbqSUJrb61ZXZb3kOvuq3rpxV6vYCO3rpeA=; b=aYmkH2voTqoTWhcsb0U9BM8WXJrT91ZjSV2RXWGRm5xHdzfh/MtZAfG0VQUgfSCWW9 o32oBSfH7mQX/NIDcOkpPivu0V2laD+CZjeLllrbFs2xleeu+djmP5JGXoFpg7jbbrxQ 9oQO4T6aRn1HlYXduSvJa23SU8wGgAJwtAZXbxy4uIJDHi2Arcz3qqZBCliThmmkFVGN wsWA4rSB+BoxaHMjZ8NOhXZx9q+Meq228fXY6IwSk4ZBMrZMK4epIYKWWYVXcsNEftzx dUCWNuyPx0RVPC8Kq8r73XO1O+ABwEW2pnLqeJHSkL1sjqd5mkGRay/L+utxaU889gwF spow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hXF6tCKj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215793-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb74776ccsi2637412a12.631.2024.06.15.01.45.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 01:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215793-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hXF6tCKj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215793-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1B5981F228FF for ; Sat, 15 Jun 2024 08:45:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 399961BDE6; Sat, 15 Jun 2024 08:45:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hXF6tCKj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 625DC18C08 for ; Sat, 15 Jun 2024 08:45:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718441141; cv=none; b=Zn1qdD8cGWVPelUDDuObkOyhYX7gxO3r7qFM0vnBczlg+iT4yT+Qyp3LSvqyWTqhCNgNRQcQL85CjLiqEaqmH3JJH7dxw9I5Rcx9KluQVyTZuyFqzWBdgynbt+WkCFtr5Q9wixIwNypqZOxgEbpC26rfOKcp7t02oA7tDFhtHJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718441141; c=relaxed/simple; bh=GdLmPax7aWiaByiSGY+x7MgyDxVdt9d2Knc1iA0FO3w=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=itzB8reQJfVr9GfHSZ+RjheTrG+KB/7a2SAHM+tPRB6NYtMWeoddIsZHhPHUcCYVZlof72Sdf86YI285YI0mZj3GXN72prew+3X3Qp56pn/CMDMEK70XYIOcsYO1lP8tKLAvlM23LFGVUDzZEg0p+S0qV+YAUsj6xfmzQ3t1ejQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hXF6tCKj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0722AC4AF4D for ; Sat, 15 Jun 2024 08:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718441141; bh=GdLmPax7aWiaByiSGY+x7MgyDxVdt9d2Knc1iA0FO3w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hXF6tCKjymD4Un5DImf0JQnw657JedpiHmR7OS/HByUX2eODkZOKZjZNu0b9yRhtF bHoXafNNzNonBRGr1/mHLNErZFDmKFjAkukcRCPiN6QZY8HrnySSiYsM3ePRG4Kszx uziqTEadEPp0EmeqPYxwrA4Z6TlGVFB9IIBbZbnw+1cAQM5ypNsi9R0JS8+l8Kl5k1 enD2Nhpc5SGBU39+xl+2lggKHaMjN4Ow4OpH7ucE/V6+cY4UtEyKfEpmeKZy3813Fq elQjWAdn+l7kDkDAPFcY1RBcdZd/NzMeIZV+vVIbaRjuaLdJKWE2Kxn+/yD11Z8syx 4kHvUzxdYUV1w== Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2ebec2f11b7so27444471fa.2 for ; Sat, 15 Jun 2024 01:45:40 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXsbkGaupyut6s6sQt866iB4CRht4IH61wnmbb50RP88xe6VSP/kdhjB+bcf6it5DJfqqnLfrAmww1T+PGFYs30TS7+2ruu2+V4ncRX X-Gm-Message-State: AOJu0Yxk+DowOK1M5rMoL56egdCeDhxGD8jPgV4YwObsBc4Nz9gVnGo5 vkUmaEbeTEg0HWPJul8EYI4LKCzdI+hhM/1w1SfBRxybPicI9YHlXuw367ubWRRzcSOFdCczP4q XPKPxGe6stjhjkR2RQdI+dy6NF7A= X-Received: by 2002:a2e:9cc8:0:b0:2eb:fd86:f141 with SMTP id 38308e7fff4ca-2ec0e5b87f8mr29134151fa.6.1718441139247; Sat, 15 Jun 2024 01:45:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240604150741.30252-1-xry111@xry111.site> <20240605054328.GA279426@thelio-3990X> <20240605062548.GF279426@thelio-3990X> <444ec2031ef6ca016cbfa8dfedc51bddc8529ba7.camel@xry111.site> <82b7e6ea-c2cb-6364-ebe9-bff928028408@loongson.cn> <1c132209a612e2e8953f0b458fc01853120db9a9.camel@xry111.site> <2bf11cd2-8449-acda-f5ad-659c38cb018e@loongson.cn> <96a2e8a80c06772b64fcbdba42e1dae2d68a53a7.camel@xry111.site> <2bd6ae20-ec56-c1a2-c5dd-e8c978a376d3@loongson.cn> <329dac82e09dfc75e77ae93ebbeacdec1dc9ff7f.camel@xry111.site> In-Reply-To: <329dac82e09dfc75e77ae93ebbeacdec1dc9ff7f.camel@xry111.site> From: Huacai Chen Date: Sat, 15 Jun 2024 16:45:26 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] loongarch: Only select HAVE_OBJTOOL and allow ORC unwinder if the inline assembler supports R_LARCH_{32,64}_PCREL To: Xi Ruoyao Cc: Jinyang He , Nathan Chancellor , Peter Zijlstra , WANG Xuerui , Tiezhu Yang , Nick Desaulniers , Bill Wendling , Justin Stitt , Youling Tang , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Ruoyao and Jinyang, On Fri, Jun 7, 2024 at 4:29=E2=80=AFPM Xi Ruoyao wrote= : > > On Fri, 2024-06-07 at 15:14 +0800, Jinyang He wrote: > > > Note: on RISC-V and LoongArch, the stack slot for the previous f= rame > > > pointer is stored at fp[-2] instead of fp[0]. See [Consider > > > standardising which stack slot fp points > > > to](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/= 18) > > > for the RISC-V discussion. > > > > In most cases the $fp is saved at cfa-16. But for va args, something > > becomes different at LoongArch (I do not know the case of riscv), the > > $fp isn't saved at cfa-16. (e.g. printk?) > > Oops indeed. Even with a very simple case: > > int sum(int a, int b) { > return a + b; > } > > with -fno-omit-frame-pointer we get: > > sum: > addi.d $r3,$r3,-16 > st.d $r22,$r3,8 > addi.d $r22,$r3,16 > ld.d $r22,$r3,8 > add.w $r4,$r4,$r5 > addi.d $r3,$r3,16 > jr $r1 > > So for leaf functions (where we don't save $ra) $fp is saved at cfa-8. > > > I feel that the update_cfi_state should be arch specific. I believe > > that some logic can be reused, but each arch may have its own logic. > > I agree it now. What is the conclusion about the clang part now? And for the original -mno-thin-add-sub problem, do you have some way to fix it in the root? I think we needn't rush, there are some weeks before 6.10 released. Huacai > > -- > Xi Ruoyao > School of Aerospace Science and Technology, Xidian University >