From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4C3BC43334 for ; Thu, 21 Jul 2022 12:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jNuJ6o3+1KZ2CuaCB0gdUEyk9HPqf457ygu2n8bDb9Q=; b=HVbQtF7GrrZAdK t+nUn7fHfyBrvvj3eKjFX4NvtXR6pMx0N8TRk7hokV2roUgHP7K3uetS1sP1evAV/AMuqsOlV/MNa DZANwurEU4hC1NNwwdjwm9P3/yn9/oY1VCmEDC6pIX0CsWM1yxDEj7cWc8O7/m/sA2xYsLcUD7DdQ zimpz16Z9qLQ3Brksdko85k4Ow1GbIbxjBPaRiCffy4KI/wqO+hv5r0dDzpVlfrAcOZgSPshzdVMt QIy4vvyFG7kmgnnz7jZg7EKfPfiGFJctdSaxSJEwON4YKRVWrxh7jxP2fDbimWi7LI9bL6+2P+Vjz S9BXHU+V3+Jj3Ah5WaeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEVW9-006O07-9I; Thu, 21 Jul 2022 12:43:01 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEVW5-006Nxe-Vi for linux-arm-kernel@lists.infradead.org; Thu, 21 Jul 2022 12:42:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A0F6D61B5A; Thu, 21 Jul 2022 12:42:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0602AC3411E; Thu, 21 Jul 2022 12:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658407375; bh=CSAnv6iCQsqMo/ndaQudPCAuFpZVzmp/Th29xuvoT18=; h=From:To:Cc:Subject:Date:From; b=CF2FSEn5B0ZX9PxIAGQ2Xs8fQ+Aaal7/nTCzqM8Wfghd5+QTLSoq4cKiP30ALPGeE B9Lvw6tKI4wdF1vijW7rTm1tWX5+OS6N68YWUb+tSWL8MQor8q2myNADOwJk+aymDV ZYh0fPWIUfJCfqlNXS35PUdanwAeRX3TD8oKCgzhrdEIVw5mOvanTPEV+BlZPolh5j NQ5PjeGjaU/7cF4bwFeEV/IwA8uYTcn8GA5SbxAfbIA+910oHA3MHqIW3SlkJVMWZq cYfjQMKi2psAmqVra34fc86ln6stHzl8GMkzApLDSycQLGyCstUVj7M5W+N5OXBX2t QMws8Qthyhvwg== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oEVW0-0094WZ-My; Thu, 21 Jul 2022 13:42:52 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Catalin Marinas , Mark Rutland , pcc@google.com, Ard Biesheuvel , kernel-team@android.com Subject: [PATCH] arm64: Use mov_q to load KPTI_NG_PTE_FLAGS/SWAPPER_R*_MMUFLAGS Date: Thu, 21 Jul 2022 13:42:44 +0100 Message-Id: <20220721124244.903567-1-maz@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, pcc@google.com, ardb@kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220721_054258_131523_3A39FF29 X-CRM114-Status: GOOD ( 14.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org With f7b4c3b82e7d ("arm64: set UXN on swapper page tables"), the kernel fails to build: arch/arm64/kernel/head.S: Assembler messages: arch/arm64/kernel/head.S:334: Error: immediate cannot be moved by a single instruction arch/arm64/kernel/head.S:343: Error: immediate cannot be moved by a single instruction arch/arm64/kernel/head.S:354: Error: immediate cannot be moved by a single instruction arch/arm64/kernel/head.S:379: Error: immediate cannot be moved by a single instruction as the constants that inherit SWAPPER_P*_FLAGS cannot be loaded using a single 'mov' instruction. Move over to mov_q to fix this. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/head.S | 8 ++++---- arch/arm64/mm/proc.S | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index cefe6a73ee54..aa7c58689f68 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -331,7 +331,7 @@ SYM_FUNC_START_LOCAL(create_idmap) adrp x0, init_idmap_pg_dir adrp x3, _text adrp x6, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE - mov x7, SWAPPER_RX_MMUFLAGS + mov_q x7, SWAPPER_RX_MMUFLAGS map_memory x0, x1, x3, x6, x7, x3, IDMAP_PGD_ORDER, x10, x11, x12, x13, x14, EXTRA_SHIFT @@ -340,7 +340,7 @@ SYM_FUNC_START_LOCAL(create_idmap) adrp x2, init_pg_dir adrp x3, init_pg_end bic x4, x2, #SWAPPER_BLOCK_SIZE - 1 - mov x5, SWAPPER_RW_MMUFLAGS + mov_q x5, SWAPPER_RW_MMUFLAGS mov x6, #SWAPPER_BLOCK_SHIFT bl remap_region @@ -351,7 +351,7 @@ SYM_FUNC_START_LOCAL(create_idmap) bfi x22, x21, #0, #SWAPPER_BLOCK_SHIFT // remapped FDT address add x3, x2, #MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE bic x4, x21, #SWAPPER_BLOCK_SIZE - 1 - mov x5, SWAPPER_RW_MMUFLAGS + mov_q x5, SWAPPER_RW_MMUFLAGS mov x6, #SWAPPER_BLOCK_SHIFT bl remap_region @@ -376,7 +376,7 @@ SYM_FUNC_START_LOCAL(create_kernel_mapping) adrp x3, _text // runtime __pa(_text) sub x6, x6, x3 // _end - _text add x6, x6, x5 // runtime __va(_end) - mov x7, SWAPPER_RW_MMUFLAGS + mov_q x7, SWAPPER_RW_MMUFLAGS map_memory x0, x1, x5, x6, x7, x3, (VA_BITS - PGDIR_SHIFT), x10, x11, x12, x13, x14 diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 7837a69524c5..e5578a6e80c0 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -293,7 +293,7 @@ SYM_FUNC_START(idmap_kpti_install_ng_mappings) isb mov temp_pte, x5 - mov pte_flags, #KPTI_NG_PTE_FLAGS + mov_q pte_flags, KPTI_NG_PTE_FLAGS /* Everybody is enjoying the idmap, so we can rewrite swapper. */ /* PGD */ -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel