Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp14104013rwd; Sat, 24 Jun 2023 12:07:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OeM1JA6sZuEANQRkQUDtkcOJ2MMdzhVC2/P7rL25lZwCDmwJOwGGlwxDxEXQndFzbGbdi X-Received: by 2002:a05:6a20:160a:b0:11f:6391:3ae6 with SMTP id l10-20020a056a20160a00b0011f63913ae6mr30696648pzj.28.1687633657101; Sat, 24 Jun 2023 12:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687633657; cv=none; d=google.com; s=arc-20160816; b=Bq6TJqyNs3fywjEGqmKNYAnX40slfuh/HaqbIjB7gowuFAQBRdbNA8vbkj/FH7Yuoj h54uK0TuSkwRpHgVtd7v1R1uJWmiri9GcDwFnGj07/qPEMJ75Qen2MbKbiH3MfEnW92d n0wMELSdXKwL3YrJFSnXHOpzGKFMIUbKGDm8Fn082x/Q6jnNq9ONoP2rJQSubtT0AqIn R0YemIwg/JepB30ib1O1GilgrGjYIpLomdGbssL833fFZnAGlUHNDfpsBqJIC0ARIHW0 l9oaFQz/ppcqQ5U5hpQ0r879W+6UmkTmloiTAiHzZF4eHWmey41Re1U+W+3QrE0n8kS5 argw== 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=wNR11smEctOGofmGHPLewkqo6ikORTS/3iFGJM8LKjp7i1yjclThbFLPJinSRslNfJ 0lXAHsCVWkBR7N3DrbzR078tMz98j4zKZm3Y5zmJpdF0pQ0bZ8ZZLt8e7jNIgVMFuhPL fBAYlH6H3ngUVIGScCIXw4cDCH8u/eh2YK8TK40QPXIaO1w04p/o4xbBJRFcAbBiojFQ NOi2GqIEbsn+LD9BcE05/qoLhnZeX684W3In3xtHhsUCr7lvQscR74w9kiDlPwem8h/F rtj/itpv80oSbu3JMjKRn1+du7kY0CQvXvNNLMKP06Js2h4LqqbynJdslGPp1FLyudRa uSBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=W0FowH2h; 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 76-20020a63004f000000b005348885119asi2060055pga.523.2023.06.24.12.07.25; Sat, 24 Jun 2023 12:07:37 -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=W0FowH2h; 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 S233228AbjFXSl1 (ORCPT + 99 others); Sat, 24 Jun 2023 14:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233209AbjFXSlT (ORCPT ); Sat, 24 Jun 2023 14:41:19 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05736E6E; Sat, 24 Jun 2023 11:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1687632077; bh=/Ae3yGesaN7INKQfcIHyYeenAVct9PlZ6PKdEfJO/pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W0FowH2hBnntaEvJepg6vWOVJdazENduLKVu8dJOy/eSMAZNaUP9/lQSUv5221dNg Jod9FOdXsSeZj652qWQ8vbDTfjfX4sJG8wOS8QOqvr4sKcqG0kJRvddbfT3uuLYh08 mX21padNCBhsaAnIyXaBsQtlkk9E1ZDKflSQUZ5M= 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 824DE6015C; Sun, 25 Jun 2023 02:41:17 +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 v2 2/9] LoongArch: extable: Also recognize ABI names of registers Date: Sun, 25 Jun 2023 02:40:48 +0800 Message-Id: <20230624184055.3000636-3-kernel@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230624184055.3000636-1-kernel@xen0n.name> References: <20230624184055.3000636-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,URIBL_BLOCKED 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