Message ID | 20231122092855.4440-2-shijie@os.amperecomputing.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1201250vqb; Wed, 22 Nov 2023 01:32:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IErq4xVSP9WDwwiMHrQGqcY/vQcDL9Q23ZsVM4iB2bpU8KFL1qs8AVwxoJPr8FRluL+05LB X-Received: by 2002:a05:6e02:48b:b0:351:5322:b820 with SMTP id b11-20020a056e02048b00b003515322b820mr1451933ils.11.1700645547233; Wed, 22 Nov 2023 01:32:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700645547; cv=pass; d=google.com; s=arc-20160816; b=Lg6EHc6wQJOQFrl308KgOkyJGilrjxX4QrGxx6CoMPcSJOu/ySZOxr8w1ScLrwG8Sf JTUfOZUEtTLvAmMBYR3TejitFZ6C9VL4oISqzB5yKt75SHX94aeOLEEqDaqnX0JoOJhu O0TTt9uVtLiE3wpmyI5oWBmjQ6eUA4vYhOSMXU03mD1WP2Nzzl37gXp2cXnBHqU+Pp7d pTrm47PXcKp5Cp/Zx/HoYBqU1mCM7Ed4g9gp+PDG3R/U3cm7EY8eUGV8j9/BYplcqa2u 71osMHPMUsHORc/HOVmXVMUCKtdJwegft/KBLfGuMEPTLgJ0GIp6HQ+jw96vR8c0PvNV GRAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x+DWlggQhCfDusBUkGypzmxAR/FoqzJEi9ZprSfUN0I=; fh=IFMWg6fVnSyRGoEnT4djvIpOdIiU2mjS7YkNhQGkXP4=; b=JOS/tVaXUywq+mVN1F3ADSEHvHVToRmXDJYBIRmMPYJVD70MlrhH/dbjkGfJ16d9Xy m3lNHm7aThM0Rg1kcccw90rUt6W8kpIf7PxLb9IlAyQRQvuAaAD7zBi8uIZTjtrkcs22 YdhPwrJfbsMkW6tKglzyVzU251OnLYW2DNCUhjS3nxM8juWK545rKtiAeEL28GiNcPCh yZf3O0kPG5h0ondqV1weJR1iTsxetLoWiUzTaP5Ebs8tH7SdVL0IpHpHCbyabWki6/Ry DX0GYCjvAplduE2MmthdFpC3Bw9dDercL08P8QDmTq3w3o92oUTJ7V0K7dH9avQjkOa4 NbxA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=i36imAqF; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m5-20020a056a00080500b006c4ec5d627csi12264828pfk.299.2023.11.22.01.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 01:32:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=i36imAqF; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 520F880842E5; Wed, 22 Nov 2023 01:30:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235180AbjKVJ3r (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 04:29:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbjKVJ3p (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 04:29:45 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2115.outbound.protection.outlook.com [40.107.212.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8FD69D for <linux-kernel@vger.kernel.org>; Wed, 22 Nov 2023 01:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E8TJsLuph98IcU3hPomrl9oeoPm58jX5q7aty1zWSj5cqt4lhkSGsQO/vFHWVWDXw7Ayluips3y86r+SU9fNb/b8lJTstSI3X+yOkjKQHbSAhJKQMudb/zp7y+MYUrX2CxKwkO8/G3HuD2r4Ec07vld1Jp6WBYHWmEMKwMge1M2iwWv8TyPlOc7Sf4Wvf8cCDKzmNb7yu2LPCxYQ6ekH04nx0uS7JKHxf2uATvSnbm6Qizt2HQ/hURW1hYXyP0QwL5j6aAEn/y7YvUWozxShfQphtMHUvL/2I8GecWJkCDL9nkzvEQhPP8r4LQXgyd/JT1CWIpvDeSs++rBdF6fDlw== 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=x+DWlggQhCfDusBUkGypzmxAR/FoqzJEi9ZprSfUN0I=; b=Le1RtiOAQIbPpiZE+wG6UHEhueHts9mGg6xgGiHsHuJiuEglJ6eCqQy8gSwna7LQrsSF3NhgEwyr8fikwDfphVmpaRPDBjpOTy28ppWITIvTVS5KKLzw+9+fMmQ7YGiYtkemEugo113V0IMDHU9X7cRddcLMIPvndbTi+u30DnkwVd0dk5UDVqzy2ZJ11Qvnp7gAAbyzmR7h1t5miw6wpP83IHC4ScJqN8FVQhni2YKKEcxftqg1VNGQKSxpCzgWXh42313GABvIwKrU2Vg102hUhGg7l5Ht5s1FylC6VbU51Ru/qty8kYJWwj1xTGvm2J/S7eT0B12UCQQGl55roQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x+DWlggQhCfDusBUkGypzmxAR/FoqzJEi9ZprSfUN0I=; b=i36imAqF9Jc6ZepsxaSZxOLPdeOmXwh5ZsHqg+M6ikZTdzi7UQ7SiLzBWfO4DKasOfe7JIqCspmXVUWkU3F9TJVGBVdeGrpMkw32g9FE6i7I2DGeZZ7Pkt/O/SVcyvFv5taCyWJJvA9yXKVI52YooqPwZ6T1Z4GuO3l+U4qzwp8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) by CO1PR01MB6760.prod.exchangelabs.com (2603:10b6:303:f2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 09:29:39 +0000 Received: from PH0PR01MB7975.prod.exchangelabs.com ([fe80::3f45:6905:e017:3b77]) by PH0PR01MB7975.prod.exchangelabs.com ([fe80::3f45:6905:e017:3b77%7]) with mapi id 15.20.7002.027; Wed, 22 Nov 2023 09:29:39 +0000 From: Huang Shijie <shijie@os.amperecomputing.com> To: catalin.marinas@arm.com Cc: will@kernel.org, mark.rutland@arm.com, suzuki.poulose@arm.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, anshuman.khandual@arm.com, robh@kernel.org, oliver.upton@linux.dev, maz@kernel.org, patches@amperecomputing.com, Huang Shijie <shijie@os.amperecomputing.com> Subject: [PATCH 1/4] extable: add __sort_main_extable Date: Wed, 22 Nov 2023 17:28:52 +0800 Message-Id: <20231122092855.4440-2-shijie@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231122092855.4440-1-shijie@os.amperecomputing.com> References: <20231122092855.4440-1-shijie@os.amperecomputing.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: CH0PR03CA0247.namprd03.prod.outlook.com (2603:10b6:610:e5::12) To PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7975:EE_|CO1PR01MB6760:EE_ X-MS-Office365-Filtering-Correlation-Id: 4328448c-3e67-4d2e-65f5-08dbeb3d8ccc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QXVusi7mRcgn1LjazqDbgUtZJpzUm7XH0suVrfiIuxoewpf5UO02ntrPTec4uZYGom57iDIlu7b/KwyBRf+IcD95jGXD+RGM5PLpIkat6O9ZMCfJ47uJT2h9Xul5GTP1sgwQKKqybuRNBCmMIKJkp89l5NE06U79wjVzzeHfufpmCn+lJU0dhKFjhNLbFK3RZvfRID5nZ/f2JPdt8t4OQovv/tAfHP9SXSO0613sGNfGpv25KfmZcvO9oMi0WBkEIqilBRH6MpanDXY3zUZ6NPWXgdD5stHghQD11kjN9Fp0lf5fEtQ8A042P1z8diFS8BgVUtDFgZNMD727ZIWCfuWz006oC+sJCTGjEGElWvVlm9Jq1FgixJTI008DurhPr5Izqpwk42G5e69jB7983csbAgFmA9sZbI9AlTcG3ni6Wz5qgY8wcNb3EhZt1Kdxe8sbhyLNWiS4gxDN90LDZ+cRemctdcZg4JEE29PYney4vAMpYz2K6Aqz2Rt9mN8QHOoe6HRfF57PQsr+LYLz2N4dNyKKwzu/ogYvIMTUJ5zP4YRlTPVPno1am9pEUXhsgOdHxGBcI1mDcrXkrp+XDiw8iCB5xlJKj51OazM93tcaXIk0IGXeeqNSLIzOI3Hr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7975.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(39850400004)(396003)(136003)(366004)(376002)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(41300700001)(2906002)(86362001)(7416002)(5660300002)(38350700005)(6512007)(2616005)(1076003)(26005)(478600001)(83380400001)(6486002)(107886003)(6506007)(52116002)(6666004)(38100700002)(66946007)(316002)(4326008)(8676002)(66556008)(8936002)(6916009)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1RzdCUcNKvGfBTKrBp3ZcMNl4wK3wN/7GIMULMm5NbO5JORCcQ6te1WUy6KIkCEUFYGMpTa3Gup7JWRBvrsgj5bnx1zIdoROZEVxupD7W54y5X721nNp9dCzAn9Ye968Dt8ZyfiLYwO+EfmN7O5NHNuSHB04qlk62fWxVRvbHQLXDo02xbgvEbQPRD0S1PLNZ7DIWKMElrX+GPMofr0N1graSLBkp2VJgU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zabWyeDCP/fZDfYW06gW9QpYAhIgWLnFpx2LIlC2mRL3nNzxeqzu2T18sa0oV/qoBLoOWaJ7yEMu5PiebqS27bxKq++e/zuXdmeHJwrcfEUZEdDAC2JCMTf1cmsFIuWfldJAawt8swsewAZqgwYed8SNVYTbf6U36i15oi66reTUBlkmY3+fXYO5lnNIGYPhVLp9m308tsZ5p96iYoF9rhIHir9xuPDisoLQCTh20JC33n0HBDsh8eV2Q27scazuHSMjdYoPGhPwSs+99+71JHjhM9xvR45XExwDbPjji4CCyCLTbqSUqu/fA+FJMtn5nX3FQHNq8htA89jyRhDaoWr8= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4328448c-3e67-4d2e-65f5-08dbeb3d8ccc X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7975.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 09:29:39.3289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DVqP2sfgyoJ+rHBDZmyM0sHtwgQoqZNVe6RPXNnmlVy5THcXWkK89pnAlVC8y7cWZ8MRxbTMSfaMKMhkmTSrFjsYOaQuXTOVGKYf/GjnCF9gpFg/U28sVygqdaP/TeJ6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6760 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 22 Nov 2023 01:30:14 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783256105448801004 X-GMAIL-MSGID: 1783256105448801004 |
Series | arm64: an optimization for AmpereOne | |
Commit Message
Huang Shijie
Nov. 22, 2023, 9:28 a.m. UTC
The AmpereOne chip(arm64) may change the kernel exception table at
boot time, so it needs to sort the kernel extable table during
the kernel boot.
Introduce __sort_main_extable which is used to sort the kernel
exception table.
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
---
include/linux/extable.h | 2 ++
kernel/extable.c | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/extable.h b/include/linux/extable.h index 4ab9e78f313b..ef70ec3633b0 100644 --- a/include/linux/extable.h +++ b/include/linux/extable.h @@ -15,6 +15,8 @@ search_extable(const struct exception_table_entry *base, void sort_extable(struct exception_table_entry *start, struct exception_table_entry *finish); void sort_main_extable(void); +void __sort_main_extable(void); + void trim_init_extable(struct module *m); /* Given an address, look for it in the exception tables */ diff --git a/kernel/extable.c b/kernel/extable.c index 71f482581cab..0fbe0ccb1c3a 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -32,13 +32,19 @@ extern struct exception_table_entry __stop___ex_table[]; /* Cleared by build time tools if the table is already sorted. */ u32 __initdata __visible main_extable_sort_needed = 1; +void __sort_main_extable(void) +{ + if (&__stop___ex_table > &__start___ex_table) + sort_extable(__start___ex_table, __stop___ex_table); +} + /* Sort the kernel's built-in exception table */ void __init sort_main_extable(void) { if (main_extable_sort_needed && &__stop___ex_table > &__start___ex_table) { pr_notice("Sorting __ex_table...\n"); - sort_extable(__start___ex_table, __stop___ex_table); + __sort_main_extable(); } }