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!") From patchwork Tue Feb 2 12:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12061467 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 7DA2BC433DB for ; Tue, 2 Feb 2021 12:38:54 +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 3217C64F45 for ; Tue, 2 Feb 2021 12:38:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3217C64F45 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=0fR9rEttdVKPUuGbL9UdrTk2qHbd0ecTivs0w1fSEFo=; b=GVnl11aBZstcEEvEYx3bFFuh0 494Qc4S2gnKYCXzC/XFM6WNiRT60nZZJWmUXz1+AAR2ILaDyggCsOl40xvnKLQnUM7y7woeaeDzO4 tiu+dmw/P6kIItj0/1w140r6rPCWhzJrFyjmpXGzvJJ29Wr+2jaL1h+mUxgba3Ms0FapLZKr3NKi4 6JarlTo22LLc3C+2vvN/6nriv+e2Pm+Kw5P0tmBuIwKwi6xyukT2qKC8BjgGhR63SGQXPeHENSdn6 d/p2snQfEmPS/RfewKOpcyOoWFlrBjSwyi/7689vS5/j7H8TvT1Z+pouDprUIEf23yAuPe2NjVk9l shLM6MYNg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6uwE-0002PL-PK; Tue, 02 Feb 2021 12:37:46 +0000 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6uwB-0002OQ-PM for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 12:37:44 +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=2DUF+V0+XGgg8LtiSQKy4ENL7+eJrCysQUcuCDoy02I=; b=Ojzhfc1u9WnjMz0+S1s1P79/EybZy5fZyz2DNVzYvOAZvPo0KMb0RP/930iuKkO7+iRw4Ath3je0BrVRt6QqnmRvamgIRI0ZAjfqVSwCYCcPp3hKOv4gZNxnYlhVLbGEjvc1fsGCRB601iVlYULKjRXmJCnDQHqAHhuhNnEI4vE= Received: from DB6PR0301CA0099.eurprd03.prod.outlook.com (2603:10a6:6:30::46) by DBBPR08MB4887.eurprd08.prod.outlook.com (2603:10a6:10:d7::11) 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:41 +0000 Received: from DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:30:cafe::bd) by DB6PR0301CA0099.outlook.office365.com (2603:10a6:6:30::46) 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:41 +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 DB5EUR03FT022.mail.protection.outlook.com (10.152.20.171) 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:40 +0000 Received: ("Tessian outbound f362b81824dc:v71"); Tue, 02 Feb 2021 12:37:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fbc7aab0906263e1 X-CR-MTA-TID: 64aa7808 Received: from 4cdeae0ebcb0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D9C7D89B-D126-48EA-B3AC-F34BBCF1717A.1; Tue, 02 Feb 2021 12:37:30 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4cdeae0ebcb0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 02 Feb 2021 12:37:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XVAJXOnzbyRPDi19qCqLjKu6gg3RZYIeXpB6vhtX6uunMGWOeHpekus14yqgouvzBsmfmeMEPEW9d+B0ONgWj8LoYe99MO/MXyNjarTNYikG1hdX8z0oQjOL0EKyuFZcyjd7o9q3Tj4MtSZIzf42yBV5c5x2n9XADEg7PlM6k1hQ3A3/2QkQ4WqgXmyAmRQLqjIH/C2YjAUP4BJSnhrD/4gzZ1e8SxgloPC8fH1ScDNgwbeVu5Q+u5oswhVzjR8es/8rLwLfF5pYNRsqR+2JDeDoMDfl+XuWwI843gOBdE20YFegqFF07spY7Z7Zk1DVnhiU8yWjollNeCgCpM9n6Q== 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=2DUF+V0+XGgg8LtiSQKy4ENL7+eJrCysQUcuCDoy02I=; b=k7rhqbsxZx/5jHVqInstvFaHPVHBQDngjz6r3sLhj94+fLHSi9389nCTB3ht6zykMtThQW2gc+RQ/fMQZkzYYZllPDsgANT1c7/DBQrLKco8dcckpewcQc15htKvBBU9A8glQORiUdDXdtHTw6wDWptEW1QLMM29qABFLu+9VKZuFXRG/dx1kWl36CRAXQohKxA/Ow7wxggXCsjAO6vIhwgo5hXJWX4GLMeobtOPv+wOwJXsrYwd+ggPH9y/8sBS6saJS7OwZJdVk1huqjrKa9kF3f30BmIB965ZORqdOfDMjYAC5TXfk/eBXXT+TzSB1zgg4BVr7dlDDLWlY9zGdQ== 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=2DUF+V0+XGgg8LtiSQKy4ENL7+eJrCysQUcuCDoy02I=; b=Ojzhfc1u9WnjMz0+S1s1P79/EybZy5fZyz2DNVzYvOAZvPo0KMb0RP/930iuKkO7+iRw4Ath3je0BrVRt6QqnmRvamgIRI0ZAjfqVSwCYCcPp3hKOv4gZNxnYlhVLbGEjvc1fsGCRB601iVlYULKjRXmJCnDQHqAHhuhNnEI4vE= Received: from MR2P264CA0061.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:31::25) by AM8PR08MB6386.eurprd08.prod.outlook.com (2603:10a6:20b:362::23) 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:27 +0000 Received: from VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:31:cafe::29) by MR2P264CA0061.outlook.office365.com (2603:10a6:500:31::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.18 via Frontend Transport; Tue, 2 Feb 2021 12:37:27 +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 VE1EUR03FT036.mail.protection.outlook.com (10.152.19.204) 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:27 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Tue, 2 Feb 2021 12:37:11 +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:11 +0000 From: Joey Gouly To: Subject: [PATCH 2/2] arm64: vmlinux.ld.S: add assertion for tramp_pg_dir offset Date: Tue, 2 Feb 2021 12:36:58 +0000 Message-ID: <20210202123658.22308-3-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: 881193aa-bf1b-4b9e-6379-08d8c77754c2 X-MS-TrafficTypeDiagnostic: AM8PR08MB6386:|DBBPR08MB4887: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4303;OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7fuFGLiditYhNiexpz/KZqIToGdEtrheS0wE40XuOlvJr85/GLsRCeJ9jejRqBPO9w/4WeVuQwj47o/t/FIK7zSwXfDgyqm5PsSW8WOsdLSiUxLtU9VKARBBRyAyyWbJzO9EDLWXAF5AqToBnE6PW/1iYHGPDclg9jtXCxUIcs0WIBiyrDuo3AG6Lu9bQMZ0OO2qnqS6FyqAklCfu8vR1Y3xdxW/jU+OyI1G5JirZuELyum2HkEned10nY4C7lKnAhn+Mqa6KeCqv/49Wn+3hZ4AIfvvVYMam+y/CXwUsrQKpuKqkybuusKdfab4mlbLUYGIAFiBhUj9O4dPV9TRJMu2URKiw0FJcc+Av8te0DIdaVUCaGyiFq+BHBuNf7Ctw8PVrUW4FT1qfrOFzcIE06za8ZUXR7M7g2zJRmx+OHBjAhVUJaB5zK5LCFbgIyEHOd/KIBJ3Z0SYJR748xXqiTPNmyIcIZgtAO2DXKIDDI/tJ5eclAMVpHXamXYCr0J//Yr9tATj6+aG+jeOJeN0MdWlqGvhJvIWFqxr28KADv6fdYnRxQhxJATJD+KcZQRqLaIVMEbfFHUEZoBqcIuPrCT4n+TFPv7tcPE4ip1/riEELTHOgW7JhEDP/j8MhEw90ZuRWaEOIAcgC1RGfRMvzbWdA7l2rgeBPcDqko0vhZs= 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)(39860400002)(396003)(136003)(346002)(376002)(36840700001)(46966006)(54906003)(426003)(36756003)(86362001)(336012)(186003)(4326008)(44832011)(316002)(8936002)(2616005)(5660300002)(26005)(7696005)(47076005)(2906002)(83380400001)(6916009)(356005)(82740400003)(82310400003)(8676002)(70586007)(70206006)(478600001)(6666004)(1076003)(36860700001)(81166007); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6386 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 5a949529-4824-4219-9301-08d8c7774cce X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eNvAASWNGIXrpUzAQtFk+Td4EnEywH3D3S7lkI7xieIrSrhbFfNd93jHvPZE2p10nV59e8BsFPjal6cXZBK0TVeYEErVCvYJQ2IySsRBzdJyfQspT6JiRTmRVhMrQ9TRdxWWDGa1+NjGoPm1p/TLXFYfd4qBhUirG1ws3dsMK/439aQA6zjE2m+8bNHzb75n5cICYBln4IncaeI7S08BerKnzdAVCtQQV3NjSjyPixv2H/vJjVpI4qfFQto9OFWZ1OzD3kh8tyf/GWDvxU/iw2r7FFMtBjbfAW7OZy/mREBpIZgUlVAhepCO0T5TEHM7vpyLyFagwJBzgr8g+17zdVjNSWkMNko8I46ALmmFfzLmOUjoRTc+e1wTOmdV1/j2sWIKJmGJL8XCUZlT3tv18lYii/B1roK1NZIUzCK97FIyDf7XNUe+0Ryo/sAmteyp/QSmVmwv21ju9hf0FXHV8dC2+Bps2fuayDZwTjKGhdECH5p4HRbXSNOAZJwC6XtSPjvLMbSkrhSTNn8QyMMGeBbTaqPbTvsv4xImKRr0KspLw2h2Xdu76CzlLaNAh1otuXlSxDlKCNkJ1mnwit4zxi+uRluAwozy0iEdvdPUDeoy3vicVlKMznsiWRc3WBdLyarXhO63peif9+5Fma/mkhxnIEvdzNO2MA0Br5e8x7Q= 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)(396003)(136003)(39860400002)(376002)(36840700001)(46966006)(44832011)(1076003)(478600001)(8676002)(5660300002)(54906003)(4326008)(82310400003)(316002)(81166007)(426003)(6666004)(6916009)(82740400003)(36860700001)(336012)(26005)(86362001)(186003)(36756003)(83380400001)(70206006)(47076005)(70586007)(2616005)(7696005)(8936002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2021 12:37:40.9896 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 881193aa-bf1b-4b9e-6379-08d8c77754c2 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: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4887 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_073743_850641_B55364C5 X-CRM114-Status: GOOD ( 12.71 ) 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 TRAMP_SWAPPER_OFFSET and use that instead of hardcoding the offset between swapper_pg_dir and tramp_pg_dir. Then use TRAMP_SWAPPER_OFFSET to assert that the offset is correct at link time. Signed-off-by: Joey Gouly --- arch/arm64/include/asm/memory.h | 6 ++++++ arch/arm64/kernel/entry.S | 4 ++-- arch/arm64/kernel/vmlinux.lds.S | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 300f728fa288..f9aa9fa8806e 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -165,6 +165,12 @@ */ #define RESERVED_SWAPPER_OFFSET (PAGE_SIZE) +/* + * Open-coded (swapper_pg_dir - tramp_pg_dir) as this cannot be calculated + * until link time. + */ +#define TRAMP_SWAPPER_OFFSET (2 * PAGE_SIZE) + #ifndef __ASSEMBLY__ #include diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index c9bae73f2621..c6aee646eb6b 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -805,7 +805,7 @@ SYM_CODE_END(ret_to_user) // Move from tramp_pg_dir to swapper_pg_dir .macro tramp_map_kernel, tmp mrs \tmp, ttbr1_el1 - add \tmp, \tmp, #(2 * PAGE_SIZE) + add \tmp, \tmp, #TRAMP_SWAPPER_OFFSET bic \tmp, \tmp, #USER_ASID_FLAG msr ttbr1_el1, \tmp #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003 @@ -825,7 +825,7 @@ alternative_else_nop_endif // Move from swapper_pg_dir to tramp_pg_dir .macro tramp_unmap_kernel, tmp mrs \tmp, ttbr1_el1 - sub \tmp, \tmp, #(2 * PAGE_SIZE) + sub \tmp, \tmp, #TRAMP_SWAPPER_OFFSET orr \tmp, \tmp, #USER_ASID_FLAG msr ttbr1_el1, \tmp /* diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index a03a5300bce9..68f76a96c60b 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -319,3 +319,8 @@ ASSERT(_text == KIMAGE_VADDR, "HEAD is misaligned") ASSERT(swapper_pg_dir - reserved_pg_dir == RESERVED_SWAPPER_OFFSET, "RESERVED_SWAPPER_OFFSET is wrong!") + +#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 +ASSERT(swapper_pg_dir - tramp_pg_dir == TRAMP_SWAPPER_OFFSET, + "TRAMP_SWAPPER_OFFSET is wrong!") +#endif