Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp14714015rwd; Sun, 25 Jun 2023 03:03:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CV9euK0cm4b++SV61SQR3RWa8rRrgyuREfwZrR9jcO4aVlz/rXFppJU4SuPRpbKYlXSQh X-Received: by 2002:a17:903:2301:b0:1b2:665:d251 with SMTP id d1-20020a170903230100b001b20665d251mr2697463plh.47.1687687407381; Sun, 25 Jun 2023 03:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687687407; cv=none; d=google.com; s=arc-20160816; b=tfNa8ObAm0Hbf7umQIkEOD2auZiZlFjeMApqoygMEaDIv+tpIDsGptKoxAFuHAPA/N Vnd3A/Vf8kKaaMOSgFLaa1lr5L8ZFDxmttFGsD0+y+t4cJr7KSE/fA3m8PJWu0zy2KF3 KDiiFdLdl/HCSKRhd8RDusXvBRkpntdy3fhrAFGz2z5vejsv3bMTGSlpqdauIZU1zS4R D9AFM/QK/tJ70ns1zdx2omYxNiFPZ4u1q5pjD3GfdcG2BUgy7PR6qXjKW/7P/m7YXRAw e8lTedVDXkS831FER386+m68qh0cYpnqWoNh4MdHhQZj4fAzqQuCpi+TkVpZEGP/M0nQ C0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pw/aO+zjIDQHPXZ7UrwBB2yvJLJSGY/XUQtK2SgNxyc=; fh=dOptu1ihZdKkZ8ajFex7p+VOwkwvZgrA6cQy2X6s+EM=; b=XjGB+q5rZ4Zki+cE62knWJvqX/uF2kX3eZ7Kmx3Lp5Me7RiBq71C+lGL66Q7CVug+5 KWX54w3Qn4YfiElAWOv/jb3UoJMHzgDG0rXkcSOXYOJ0n3a6ph/+SH1OwPAykcrOZK87 IrI8EB1a+pyrXst9cZpj7xMUlQ7wDBElwCbtJuCZOdaRlMd7nRx/76FV0F87ImZGHVrg IcslLzU5yoGv/C+DxK7cH2fp4eaMXXpkvfv73gHaj4j1T9yrj3bkHxMgN0bWrm8bCsOO CBibD/1SgX/l2vLIwzeJZYYBOOIVKRKIdWyaXQwymkNE11mYvvF1IpM2Q/mW2TQwhM/L YB8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=b91wTEqG; 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 b6-20020a170903228600b001b3bda067dasi2019510plh.493.2023.06.25.03.03.15; Sun, 25 Jun 2023 03:03:27 -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; dkim=pass header.i=@xen0n.name header.s=mail header.b=b91wTEqG; 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 S231945AbjFYJ5F (ORCPT + 99 others); Sun, 25 Jun 2023 05:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231532AbjFYJ5B (ORCPT ); Sun, 25 Jun 2023 05:57:01 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D835D189; Sun, 25 Jun 2023 02:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1687687019; bh=/Ae3yGesaN7INKQfcIHyYeenAVct9PlZ6PKdEfJO/pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b91wTEqGbu5j4mfF648hJJyZjWCNM9Kb0SVrz+kgPalEJ+cfyepf9W9Ww/fCnkDa4 fj4FR96hbNqBSzyhlwsCFrnH/Kh65zNJV5nhb6PRM2UHFPaJN7hHQqJ00pkzDsWjtM HzBanSiVsTKH0px8SfmW50Ml6jZGoWqsZA3gSJR8= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 1AD5A600B5; Sun, 25 Jun 2023 17:56:59 +0800 (CST) From: WANG Xuerui To: Huacai Chen Cc: WANG Rui , Xi Ruoyao , loongarch@lists.linux.dev, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, WANG Xuerui Subject: [PATCH v3 2/8] LoongArch: extable: Also recognize ABI names of registers Date: Sun, 25 Jun 2023 17:56:38 +0800 Message-Id: <20230625095644.3156349-3-kernel@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230625095644.3156349-1-kernel@xen0n.name> References: <20230625095644.3156349-1-kernel@xen0n.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: WANG Rui When the kernel is compiled with LLVM, the register names being handled during exception fixup building are ABI names instead of bare $rNN style. Add mapping for the ABI names for LLVM compatibility. Signed-off-by: WANG Rui Signed-off-by: WANG Xuerui --- arch/loongarch/include/asm/gpr-num.h | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/loongarch/include/asm/gpr-num.h b/arch/loongarch/include/asm/gpr-num.h index e0941af20c7e..996038da806d 100644 --- a/arch/loongarch/include/asm/gpr-num.h +++ b/arch/loongarch/include/asm/gpr-num.h @@ -9,6 +9,22 @@ .equ .L__gpr_num_$r\num, \num .endr + /* ABI names of registers */ + .equ .L__gpr_num_$ra, 1 + .equ .L__gpr_num_$tp, 2 + .equ .L__gpr_num_$sp, 3 + .irp num,0,1,2,3,4,5,6,7 + .equ .L__gpr_num_$a\num, 4 + \num + .endr + .irp num,0,1,2,3,4,5,6,7,8 + .equ .L__gpr_num_$t\num, 12 + \num + .endr + .equ .L__gpr_num_$s9, 22 + .equ .L__gpr_num_$fp, 22 + .irp num,0,1,2,3,4,5,6,7,8 + .equ .L__gpr_num_$s\num, 23 + \num + .endr + #else /* __ASSEMBLY__ */ #define __DEFINE_ASM_GPR_NUMS \ @@ -16,6 +32,20 @@ " .irp num,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31\n" \ " .equ .L__gpr_num_$r\\num, \\num\n" \ " .endr\n" \ +" .equ .L__gpr_num_$ra, 1\n" \ +" .equ .L__gpr_num_$tp, 2\n" \ +" .equ .L__gpr_num_$sp, 3\n" \ +" .irp num,0,1,2,3,4,5,6,7\n" \ +" .equ .L__gpr_num_$a\\num, 4 + \\num\n" \ +" .endr\n" \ +" .irp num,0,1,2,3,4,5,6,7,8\n" \ +" .equ .L__gpr_num_$t\\num, 12 + \\num\n" \ +" .endr\n" \ +" .equ .L__gpr_num_$s9, 22\n" \ +" .equ .L__gpr_num_$fp, 22\n" \ +" .irp num,0,1,2,3,4,5,6,7,8\n" \ +" .equ .L__gpr_num_$s\\num, 23 + \\num\n" \ +" .endr\n" \ #endif /* __ASSEMBLY__ */ -- 2.40.0