Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp51268rdb; Fri, 15 Dec 2023 22:58:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9YGLBugHATLhm4yVqjCU8DKFjHWjabZrI3isTrmXL/3luqWVCRaucqUMIZisCqHBXnJRm X-Received: by 2002:a05:600c:4a13:b0:40c:3bb2:ca60 with SMTP id c19-20020a05600c4a1300b0040c3bb2ca60mr6102700wmp.40.1702709904293; Fri, 15 Dec 2023 22:58:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702709904; cv=pass; d=google.com; s=arc-20160816; b=LIQ23LZpH9Rb/ZD7djGyVDMTiOjJDryvsJOeDMggmQwYhzvuo0tkkfYm/+zGKy7saJ thGLw39LOk9l6zMKXKsePvBw9U12FKOZvFUYJMs0sXk88hOnvzm5RcIMFk9X3T768aH5 MtmYcRTs/FOmOSagyhKZrl2ChSZLEwB2x2fjezfy1oNE19upuUCxXAZ4YREJzUvAixP0 E7tenSgbdCYI8PpwSLBvpte/dsyi/V3xZ10WEbDk8OniZFXHEjBBy3iNKAE+t/4LDCtq JQ7Q2SqltzrxKc5Nc4E4rIs21xz9is68p/REWh5XiWfCogZ393QJANT/iV0c0jmoNDRB l4HA== 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 :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=abAJ5kPmTCKSkPlTNRUH9LBbaGMSWSbCDFVeXVjm3gQ=; fh=twuUp+Q4oW8+wgH+5RBYUcv4h+AE9EgWk7KYmPJnD4M=; b=reDjVMzLRh2Cxp2romnD2RCraYR81SU8NuGkbTMueSOcmYlbQNzd60zuA3VjFj+BQG I/gphSSwR6gv5YRg9tzNJl/bmizWwJ8xlJtchPKCWNgM5Cuzy24xoihYomN+YBhEbie3 PKCR8yDZl9Y7F8FL/waLxAWZaNTnY7KXpml+WW8tMiVVjM67K1XI8t998OHi5AD+mt7/ 0980afa+azajypy9HY1vjxi3iuykSdW2bHNhbWojUZ1KgQVjb71bN5LYppXg+P1TFyOz D3ytOwIzQ1cfkyHfguUescJWoh77RYbOsjE0t/BmypNhrNnZvz9o0gVyN+LcEBj4eFgy M1fQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=HWt07bWH; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-2118-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2118-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o14-20020a1709061b0e00b009fd56cb6959si8043143ejg.175.2023.12.15.22.58.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 22:58:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2118-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=HWt07bWH; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-2118-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2118-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8F1DC1F25837 for ; Sat, 16 Dec 2023 06:58:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 536B0134C0; Sat, 16 Dec 2023 06:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="HWt07bWH" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2070.outbound.protection.outlook.com [40.92.23.70]) (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 5ECD412B79 for ; Sat, 16 Dec 2023 06:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQp5M2q6073ImiQ+aAsMk/0Qdgp65eI8YmC9QWqWCOHoCyE+CVIQq2eIRlkBUL753LeFdc7Hv43h6kKKbPHvnIxETiY18cXBq9yFXP9q4391X2yfnb6rfXoACZ1G8Rio/xGJQ4StIlaXYdFspBpXmuhLHgGHEooFr0X8rPDmpD2emk6l5H7qgKKpKQZXuWXNyl4eu5AeIFqKThfsIRNRimDu+f/nPvt/8B1dZjtwEzIfc+GEbDJfbVwPYAAKWTwggeVJ3X/1+fTCX+ivwOx1TlNqTb02NCLUZyG+ed/P1OCJY0HVzFHm/iXOHdXVLwmsAb572Ma726DwCAbDGNDpKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=abAJ5kPmTCKSkPlTNRUH9LBbaGMSWSbCDFVeXVjm3gQ=; b=cGH768K7qRgO0mxQYi99HHNzexfJaJM2yp+YZU2LXiUHkFpvikobKyu/hGE3HgznwXAIXZNSd1PcYXg4OETDbmYC9QeLLbet5zSFw0kETpmoeOd9YgW9ErSjn5XjAOUGRKzobk4Lb942rOaOh/zf6aTrTyRP85vXK0c8RBqqo7zCwok/rh+7pj9BEg3QuDjPobUd0BkGUeaTCjODQ90rVzFgkcX2awNkMk2MVIFEwgZW9f/BJei8PP4TxJUWGOmuNZ7IJGpxwZ7sLbbmjtBxXGlAcJPS+wc+MK8QN0ZMJ1z6QLMsBfCSnRWLXBLYf6wNugV0zffCz4stRDAHwhbdkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=abAJ5kPmTCKSkPlTNRUH9LBbaGMSWSbCDFVeXVjm3gQ=; b=HWt07bWHF+Qyz6S4jrdfk8d6E8OjK7BW9I9e/b1WIw2oaMefcb+brMnhRNP55H0OMqVz7HeVDdOdI/3gonRyB+RXHytYxMQLYispLNW6CnQGfbXHKBf6WdLq8nXBvHMr9gLzZ5LRxSvR9iCK+zaxPjx1+aDONItjYVSZH4Y/TsUO0/ukwAmd6dvWdlgLKkomg3hn6XalqCgeL1PJ4Bu2L+tX5alutaczQ6IV5um1v6yhC2f4wBS5o7pIPSrJHlkJx4lEIxOCgHzs6YJVcBcDwuVVFunAeVLzbqGd4uNIdPJX35zc1uY2wEnaKv8H/fYsOWlHQ/JYVxhg0rwcMAllGw== Received: from MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1e1::10) by CH3PR84MB3446.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1cd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.32; Sat, 16 Dec 2023 06:58:10 +0000 Received: from MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM ([fe80::6761:2623:329a:27d6]) by MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM ([fe80::6761:2623:329a:27d6%4]) with mapi id 15.20.7091.030; Sat, 16 Dec 2023 06:58:10 +0000 From: Youling Tang To: Andrew Morton , Huacai Chen Cc: linux-kernel@vger.kernel.org, Youling Tang Subject: [PATCH] scripts/decodecode: Add support for LoongArch Date: Sat, 16 Dec 2023 14:51:28 +0800 Message-ID: X-Mailer: git-send-email 2.40.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [+HyFnpBF9Ct8ndhMDd3urKf1zhJaSGLxEUg2xNBT3jQ=] X-ClientProxiedBy: SI1PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:1f6::7) To MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1e1::10) X-Microsoft-Original-Message-ID: <20231216065128.24664-1-youling.tang@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR84MB3145:EE_|CH3PR84MB3446:EE_ X-MS-Office365-Filtering-Correlation-Id: 64e095ec-338e-43bc-2adb-08dbfe045cde X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bartCEEs3gtx0GZRT+6jt1pUAIHjhoHWKmfRvzSMZigfJY0WV4d+iudKCsWMIsWa8xslBqR5wQO+xtxrtbzQxaPLoa5cArLiNsft3JtOv2j9FIRTeKr2E3rezuZzSSWzA/KY/y17VAnkobZdl/w40pkyZ6rfmenQs/mwuQu8Da4Rf2K8LbTTPF7RQL87IA3cflu72zNZz3NJddF9RnZ1giuMLpWaptrWHgMqHQTUrVTIKI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UOKL2Alb9LbLHHjBkjA2jC30MIiB3bVp2H5lvY3Npgek/W0r6s7L9CK2pk6G?= =?us-ascii?Q?gMvYmdXcoecKtuO7d/Q8x8BezqOnuVTf44CBXADCY7BjCZkn/EppjcfUxNJf?= =?us-ascii?Q?FYWHpgF1Y4PIYrc3DpCmnJ5ZPLhY/3byjc072qNMW5CaHUqE4d584U3I/S9C?= =?us-ascii?Q?k2oM0jjGRF/TqBq+y6ZCUP9u0JMvuSBkiuslYGxSAxefYsX1CrDXOGho484x?= =?us-ascii?Q?+F2e0s3LhuiUV5VdoalpN813CDotsDbHnKaclKEjL2nJeaJe8j+416P21bEf?= =?us-ascii?Q?At8z+1RIt0KkJg4UoHbQJBrR55+IXJmJoYULXzS8OA9oaOwvdQqPyQBdyZQz?= =?us-ascii?Q?bkr5WrxMUgrKJpgp4zSP+HPc7Zut8YEF+cNXi05WJsZnmgrNsFdhnFoR4xKx?= =?us-ascii?Q?nSA8qLb/5svzi6201Yfsqf4rvnMoXoWONsW5oT9J01E0udBzsVpVg0cNAMvl?= =?us-ascii?Q?9cr49Zb4MKTfAn7IOfnJMyrxAR/TBcYCe1L9YXMSCkpdLwUT4yI2zOeZYN9Z?= =?us-ascii?Q?+qEA2dPtiqM7sX4hPoc3xmwGTKx73dvZtUcmX4oXyczFFxuW8B58SIMqlAtK?= =?us-ascii?Q?8oCpp4ZopoirEiIj3CX7oNmHl7Nx3vZ5gDor7/JS0wJOrJenlfpToyuF9WQx?= =?us-ascii?Q?zifCEnAd+gglSHMSELXx75I0bsx3HmoX/M0jeGX1IKo+G1b7D3la3OrvgiE?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64e095ec-338e-43bc-2adb-08dbfe045cde X-MS-Exchange-CrossTenant-AuthSource: MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2023 06:58:09.8761 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR84MB3446 From: Youling Tang An example how to invoke decodecode for loongarch64: $ echo 'Code: 380839f6 380831f9 28412bae <24000ca6> 004081ad 0014cb50 004083e8 02bff34c 58008e91' | \ ARCH=loongarch CROSS_COMPILE=loongarch64-linux-gnu- \ ./scripts/decodecode Code: 380839f6 380831f9 28412bae <24000ca6> 004081ad 0014cb50 004083e8 02bff34c 58008e91 All code ======== 0: 380839f6 ldx.w $fp, $t3, $t2 4: 380831f9 ldx.w $s2, $t3, $t0 8: 28412bae ld.h $t2, $s6, 74(0x4a) c:* 24000ca6 ldptr.w $a2, $a1, 12(0xc) <-- trapping instruction 10: 004081ad slli.w $t1, $t1, 0x0 14: 0014cb50 and $t4, $s3, $t6 18: 004083e8 slli.w $a4, $s8, 0x0 1c: 02bff34c addi.w $t0, $s3, -4(0xffc) 20: 58008e91 beq $t8, $t5, 140(0x8c) # 0xac Code starting with the faulting instruction =========================================== 0: 24000ca6 ldptr.w $a2, $a1, 12(0xc) 4: 004081ad slli.w $t1, $t1, 0x0 8: 0014cb50 and $t4, $s3, $t6 c: 004083e8 slli.w $a4, $s8, 0x0 10: 02bff34c addi.w $t0, $s3, -4(0xffc) 14: 58008e91 beq $t8, $t5, 140(0x8c) # 0xa0 Signed-off-by: Youling Tang --- scripts/decodecode | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/decodecode b/scripts/decodecode index 8fe71c292381..6364218b2178 100755 --- a/scripts/decodecode +++ b/scripts/decodecode @@ -67,6 +67,7 @@ if [ -z "$ARCH" ]; then case `uname -m` in aarch64*) ARCH=arm64 ;; arm*) ARCH=arm ;; + loongarch*) ARCH=loongarch ;; esac fi @@ -98,6 +99,10 @@ disas() { ${CROSS_COMPILE}strip $t.o fi + if [ "$ARCH" = "loongarch" ]; then + ${CROSS_COMPILE}strip $t.o + fi + if [ $pc_sub -ne 0 ]; then if [ $PC ]; then adj_vma=$(( $PC - $pc_sub )) -- 2.40.0