From patchwork Tue Feb 2 12:36:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12061465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 393FEC433DB for ; Tue, 2 Feb 2021 12:38:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF4C864F45 for ; Tue, 2 Feb 2021 12:38:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF4C864F45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rtW//MpWjFWWcScncMT5bYGsG1ro1pU7UvKnMqJmAIE=; b=ktT7u/C09CkkJ81lMEwyUcaiO /k2mSU3WUr9IE1edTb5i6Wlp4vhoA9yWWkOOWY480JSaSP3ZRvrUrrQ0tvAp1QMF9Iqosy9sRy9qe V+IYWqcgxjIsO8eSe6Qfb6HlnyisXiOYDqzhWh9BGOxhR7Jp/6afb52YuhJXOYq0FO2u5UlYkeRlH CriKv1TFXXI5bnfBnmrhZ98QCUnGXsopr8b/Gq8wDFtX35KXphQr28pXKsM07G6jM0KxLg/tr9zAQ nUKl61LYOlyQRUc3YolME9E7MZpv4FXB/bcH4FqFypg66LimXNUrX+9TozAlls1HsfYqQnU0E9Vdx s4UxPM7zQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6uw7-0002Nt-5m; Tue, 02 Feb 2021 12:37:39 +0000 Received: from mail-eopbgr130071.outbound.protection.outlook.com ([40.107.13.71] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6uw3-0002Mu-SY for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 12:37:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zcz8Hmd/bSGQB3CpolLP2uF40G1o6AbSl6mVujmQnMc=; b=s4YZGEApEbvqL4A+4Xv2fRJJb7hO3lI3nrkbyCcu8IRDyP1IrzUEcOGXLoAtY41LM3f9XaeYFQYvRyq8wsY1/F+RDe0iLvK9fqFSGNNYqe9JRqRjd6NR5oq6lq+mWanuARVOGS6ris0Kp7+xiSyeTvvlXQaNwogh0L4qD3Qj0gM= Received: from DB6PR07CA0079.eurprd07.prod.outlook.com (2603:10a6:6:2b::17) by VI1PR08MB3088.eurprd08.prod.outlook.com (2603:10a6:803:3f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.24; Tue, 2 Feb 2021 12:37:31 +0000 Received: from DB5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2b:cafe::78) by DB6PR07CA0079.outlook.office365.com (2603:10a6:6:2b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.8 via Frontend Transport; Tue, 2 Feb 2021 12:37:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.infradead.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.infradead.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT011.mail.protection.outlook.com (10.152.20.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Tue, 2 Feb 2021 12:37:31 +0000 Received: ("Tessian outbound 587c3d093005:v71"); Tue, 02 Feb 2021 12:37:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ff2a5390e5058a6a X-CR-MTA-TID: 64aa7808 Received: from b148aa3342ca.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 408059D3-3CC7-4760-9911-37FE544670E8.1; Tue, 02 Feb 2021 12:37:16 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b148aa3342ca.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 02 Feb 2021 12:37:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hQrwbIbgihBfcZGUYLr3C2kR1SapIrGj7IwyVq3u3le5HXhQkWrz9FaKFf6v084mSXQtRb/yEAFssvMuWZ3J9/+kF7cBMeRBzp1KTnMBDBNb4lStDgnnQyVwMnypRto53xPiwSUVQGPzVpn20CmbKrWLroj1WZAA8OoHXNYwwDjPQPd0n5rLlqwxzAFbbz7u6QmRdq2r2+Nc9XQ2yw9GVT2Wfjb1t7r3H2kst42BNZ03mOd9Z9riTOqp9GZ/QvK87uhmtRy4TFXZwIhdYRC5gFG7igXNBWyYauOj2mceGEuV2ZmYENbnC9c0GHz0+H7h9e4WKV/9qbLAwTtvzfq98g== 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-SenderADCheck; bh=Zcz8Hmd/bSGQB3CpolLP2uF40G1o6AbSl6mVujmQnMc=; b=iNdTWRsKha58Ucb2eERYp/lPO0FXT6OaIn9SJb3A6dub2eRtCMEgSLbLlbEVzRb0UJoXAxCbbCNYMH2M3wC6sq/n+x4609FqzGbhr0pvsjHSZQbD1t3eDiqj6hlhBqZK/y5vNMvCi8so3kpBgJUE87lG+Q7uwlYAyy4sqE/uwo862zdfPhM+aRgT2KYpSoZnEhnk7BlMNfGNEuHOvxY0porQHH5KJHbZAkWhP1JGkFxpXLY0UhNTQxfUc17SdnKdiOb18jqGbiXp3BCKSeOLTGiCN41LsBHiuFbeuceM20qD/bGe4g8PgfoY1Jrv26NZlDoCul4W6bs3FLzZHdktiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zcz8Hmd/bSGQB3CpolLP2uF40G1o6AbSl6mVujmQnMc=; b=s4YZGEApEbvqL4A+4Xv2fRJJb7hO3lI3nrkbyCcu8IRDyP1IrzUEcOGXLoAtY41LM3f9XaeYFQYvRyq8wsY1/F+RDe0iLvK9fqFSGNNYqe9JRqRjd6NR5oq6lq+mWanuARVOGS6ris0Kp7+xiSyeTvvlXQaNwogh0L4qD3Qj0gM= Received: from DB6PR0801CA0065.eurprd08.prod.outlook.com (2603:10a6:4:2b::33) by VI1PR08MB4222.eurprd08.prod.outlook.com (2603:10a6:803:c0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17; Tue, 2 Feb 2021 12:37:12 +0000 Received: from DB5EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:2b:cafe::6e) by DB6PR0801CA0065.outlook.office365.com (2603:10a6:4:2b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.17 via Frontend Transport; Tue, 2 Feb 2021 12:37:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT034.mail.protection.outlook.com (10.152.20.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3784.11 via Frontend Transport; Tue, 2 Feb 2021 12:37:11 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2044.4; Tue, 2 Feb 2021 12:37:10 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Tue, 2 Feb 2021 12:37:10 +0000 Received: from e124191.cambridge.arm.com (10.11.7.12) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2044.4 via Frontend Transport; Tue, 2 Feb 2021 12:37:10 +0000 From: Joey Gouly To: Subject: [PATCH 1/2] arm64: vmlinux.ld.S: add assertion for reserved_pg_dir offset Date: Tue, 2 Feb 2021 12:36:57 +0000 Message-ID: <20210202123658.22308-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210202123658.22308-1-joey.gouly@arm.com> References: <20210202123658.22308-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ccd0a96-9bf9-42c9-9e40-08d8c7774f34 X-MS-TrafficTypeDiagnostic: VI1PR08MB4222:|VI1PR08MB3088: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1443;OLM:1443; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +itoLjdBvTAz3kfjhOFnRGPf6VYEgZZK+MTQYAiybQWKWzGVrTcUKj4XXOhcqUGdJv1sC41md+roLIlDYfFNObp0k9V3AtAecURiV3aIbfa6qWWPWvI/0jcheBCzId/7jBtb8IuBsJ3lqUcTuk4AtvVwXu6kDI1dzF+YBfr8uHSBmcBzHM+aupGGJv0g8XI7W+O7CV09IBy3qxIahNUlTUmP7lAHYb2XYmZXwqGTRiBJ7y6CmywbYvs4ZY0onhs365LeSfIGFkVZAcBhQ1AxTQe5Mdfs8x6bNLr25H9kyDcE1cmzOzGOYlDdiT7LX5x6ITI3RNYWTvPZJDjjNwmLuOhywcn64limRDyM4Y02JZO50G7bWcVRF92RUOeYEyOP1OQelCZ3VauVP850axYvojox38q0wSyAFAzT15xb+56dqETjHfyKLvnsJYXBnke1Of8VT/8RYMAtYkqRrayWiy8AlCAKLoF70RgAmj/DXP467v2vI6BRBDzTiBVL9by/AbiHO2DX77ZUoOSF+YsRJywPrcIODHyBSpYuQYFMuaceJKYrYwsUr3cc7lzqx2IYz8GwLUwnDrgm0rbMYflMdGCvJI3JKGzoW7G8HMkNOBHZkkeXX6VwST21QcTt64YBsTadhURelep+icMv+zx2QUFsbPy9xSHjdJmR7+qlbpI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(39860400002)(376002)(36840700001)(46966006)(70586007)(5660300002)(478600001)(47076005)(70206006)(316002)(8936002)(356005)(7696005)(6916009)(86362001)(8676002)(336012)(36860700001)(82310400003)(44832011)(426003)(2906002)(54906003)(36756003)(6666004)(2616005)(4326008)(82740400003)(1076003)(26005)(81166007)(83380400001)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4222 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9571d641-4097-4594-6a33-08d8c7774351 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mAn5sau7AX0FAk1Uq0UT5IWjTFtPGXlEOM4lM9R8QtwxBkFMmNrwZ1F0bMTrnSoQhRPq4iZmTJ/2nZIS9k2W6ms/SARkj8GGm/q/8NgoXJPIODmLMMe9xzgQ3FjpK25S/WGVFAeBejGKSn3rZzr+Ehuaxs9GzmKQfC6MO6EwM3Xh4D1kqWJrk6hcAM8rkgZD9GATb41n+3M9CnpWq9xWEz5jn0vPr5QQdC0qwWcbf94bi+gz9kkAN17YVodruhfeUmf165E5gB8dNRrUXk+uH6paq0h2L2T4kSDfiX9WeRUHbhSkcgiGX5nUeAGZARFcY0blyXyASMrcvYwjIuGnCCVRhU21KtbQKawz719ZRLchhApPBil3RumJJSRVEv/gFn6UgiK2cKpsf5cKYxna7JKg0rRWODaxzUaCAGV50SP6wEP4SXt8b2dJcBGpAQxfJyHB89ow3ABmls7bJMbkM0v8/l45W39TAuGuxJaBWj5dYSv6tz2eCOM9XSniZ9VrCZCGJxYfQcS3/h7ybs4jCetNidr1Qgcl5Der+lzl1cnZUOA1dsVTVxGfgJaXHscpscmhbLM7bVuz6dT7l255HiawurHt4idkg6JBTngMsWdFqaXTP03naCo3IprRJEDPkCUlX7XThDqPsBDh+D+SPZWPgpCG2gIadb0G7TvRB04= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(346002)(376002)(39860400002)(136003)(396003)(46966006)(36840700001)(6666004)(44832011)(4326008)(36756003)(336012)(2906002)(54906003)(82740400003)(81166007)(316002)(6916009)(8936002)(1076003)(36860700001)(426003)(2616005)(70586007)(47076005)(83380400001)(5660300002)(26005)(86362001)(186003)(70206006)(8676002)(82310400003)(7696005)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2021 12:37:31.6719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ccd0a96-9bf9-42c9-9e40-08d8c7774f34 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3088 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_073737_037377_3D6772A7 X-CRM114-Status: GOOD ( 15.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , nd@arm.com, Will Deacon , Joey Gouly Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add RESERVED_SWAPPER_OFFSET and use that instead of hardcoding the offset between swapper_pg_dir and reserved_pg_dir. Then use RESERVED_SWAPPER_OFFSET to assert that the offset is correct at link time. Signed-off-by: Joey Gouly --- arch/arm64/include/asm/asm-uaccess.h | 4 ++-- arch/arm64/include/asm/memory.h | 6 ++++++ arch/arm64/include/asm/uaccess.h | 2 +- arch/arm64/kernel/vmlinux.lds.S | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/asm-uaccess.h b/arch/arm64/include/asm/asm-uaccess.h index 9990059be106..ccedf548dac9 100644 --- a/arch/arm64/include/asm/asm-uaccess.h +++ b/arch/arm64/include/asm/asm-uaccess.h @@ -15,10 +15,10 @@ .macro __uaccess_ttbr0_disable, tmp1 mrs \tmp1, ttbr1_el1 // swapper_pg_dir bic \tmp1, \tmp1, #TTBR_ASID_MASK - sub \tmp1, \tmp1, #PAGE_SIZE // reserved_pg_dir just before swapper_pg_dir + sub \tmp1, \tmp1, #RESERVED_SWAPPER_OFFSET // reserved_pg_dir msr ttbr0_el1, \tmp1 // set reserved TTBR0_EL1 isb - add \tmp1, \tmp1, #PAGE_SIZE + add \tmp1, \tmp1, #RESERVED_SWAPPER_OFFSET msr ttbr1_el1, \tmp1 // set reserved ASID isb .endm diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 99d7e1494aaa..300f728fa288 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -159,6 +159,12 @@ #define IOREMAP_MAX_ORDER (PMD_SHIFT) #endif +/* + * Open-coded (swapper_pg_dir - reserved_pg_dir) as this cannot be calculated + * until link time. + */ +#define RESERVED_SWAPPER_OFFSET (PAGE_SIZE) + #ifndef __ASSEMBLY__ #include diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index f0fe0cc6abe0..0deb88467111 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h @@ -87,7 +87,7 @@ static inline void __uaccess_ttbr0_disable(void) ttbr = read_sysreg(ttbr1_el1); ttbr &= ~TTBR_ASID_MASK; /* reserved_pg_dir placed before swapper_pg_dir */ - write_sysreg(ttbr - PAGE_SIZE, ttbr0_el1); + write_sysreg(ttbr - RESERVED_SWAPPER_OFFSET, ttbr0_el1); isb(); /* Set reserved ASID */ write_sysreg(ttbr, ttbr1_el1); diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 4c0b0c89ad59..a03a5300bce9 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -316,3 +316,6 @@ ASSERT((__entry_tramp_text_end - __entry_tramp_text_start) == PAGE_SIZE, * If padding is applied before .head.text, virt<->phys conversions will fail. */ ASSERT(_text == KIMAGE_VADDR, "HEAD is misaligned") + +ASSERT(swapper_pg_dir - reserved_pg_dir == RESERVED_SWAPPER_OFFSET, + "RESERVED_SWAPPER_OFFSET is wrong!")