linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v14 10/20] Revert "arm64: mm: remove unused cpu_set_idmap_tcr_t0sz function"
Date: Fri, 04 Mar 2016 23:51:14 +0000	[thread overview]
Message-ID: <7cda4b8dd98e3b56c4a565228b7ad7f00e9a4ddd.1457135058.git.geoff@infradead.org> (raw)
In-Reply-To: <cover.1457135058.git.geoff@infradead.org>

This reverts commit c51e97d89e526368eb697f87cd4d391b9e19f369.

Add back the cpu_set_idmap_tcr_t0sz function needed by setup_mmu_for_reboot.
---
 arch/arm64/include/asm/mmu_context.h | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
index 2416578..7567030 100644
--- a/arch/arm64/include/asm/mmu_context.h
+++ b/arch/arm64/include/asm/mmu_context.h
@@ -70,23 +70,34 @@ static inline bool __cpu_uses_extended_idmap(void)
 		unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS)));
 }
 
+static inline void __cpu_set_tcr_t0sz(u64 t0sz)
+{
+	unsigned long tcr;
+
+	if (__cpu_uses_extended_idmap())
+		asm volatile (
+		"	mrs	%0, tcr_el1	;"
+		"	bfi	%0, %1, %2, %3	;"
+		"	msr	tcr_el1, %0	;"
+		"	isb"
+		: "=&r" (tcr)
+		: "r"(t0sz), "I"(TCR_T0SZ_OFFSET), "I"(TCR_TxSZ_WIDTH));
+}
+
+/*
+ * Set TCR.T0SZ to the value appropriate for activating the identity map.
+ */
+static inline void cpu_set_idmap_tcr_t0sz(void)
+{
+	__cpu_set_tcr_t0sz(idmap_t0sz);
+}
+
 /*
  * Set TCR.T0SZ to its default value (based on VA_BITS)
  */
 static inline void cpu_set_default_tcr_t0sz(void)
 {
-	unsigned long tcr;
-
-	if (!__cpu_uses_extended_idmap())
-		return;
-
-	asm volatile (
-	"	mrs	%0, tcr_el1	;"
-	"	bfi	%0, %1, %2, %3	;"
-	"	msr	tcr_el1, %0	;"
-	"	isb"
-	: "=&r" (tcr)
-	: "r"(TCR_T0SZ(VA_BITS)), "I"(TCR_T0SZ_OFFSET), "I"(TCR_TxSZ_WIDTH));
+	__cpu_set_tcr_t0sz(TCR_T0SZ(VA_BITS));
 }
 
 /*
-- 
2.5.0

  parent reply	other threads:[~2016-03-04 23:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 23:51 [PATCH v14 00/20] arm64 kexec kernel patches v14 Geoff Levand
2016-03-04 23:51 ` [PATCH v14 02/20] arm64: Cleanup SCTLR flags Geoff Levand
2016-03-04 23:51 ` [PATCH v14 08/20] arm64: Add new asm macro copy_page Geoff Levand
2016-03-04 23:51 ` [PATCH v14 06/20] arm64: kernel: Include _AC definition in page.h Geoff Levand
2016-03-04 23:51 ` Geoff Levand [this message]
2016-03-04 23:51 ` [PATCH v14 03/20] arm64: Convert hcalls to use HVC immediate value Geoff Levand
2016-03-04 23:51 ` [PATCH v14 05/20] arm64: kvm: allows kvm cpu hotplug Geoff Levand
2016-03-04 23:51 ` [PATCH v14 12/20] arm64/kexec: Add core kexec support Geoff Levand
2016-03-11 11:37   ` James Morse
2016-03-04 23:51 ` [PATCH v14 09/20] arm64: Add back cpu_reset routines Geoff Levand
2016-03-04 23:51 ` [PATCH v14 11/20] Revert "arm64: remove dead code" Geoff Levand
2016-03-04 23:51 ` [PATCH v14 04/20] arm64: Add new hcall HVC_CALL_FUNC Geoff Levand
2016-03-04 23:51 ` [PATCH v14 07/20] arm64: Promote KERNEL_START/KERNEL_END definitions to a header file Geoff Levand
2016-03-04 23:51 ` [PATCH v14 01/20] arm64: Fold proc-macros.S into assembler.h Geoff Levand
2016-03-04 23:51 ` [PATCH v14 16/20] arm64: limit memory regions based on DT property, usable-memory Geoff Levand
2016-03-04 23:51 ` [PATCH v14 19/20] arm64: kdump: enable kdump in the arm64 defconfig Geoff Levand
2016-03-04 23:51 ` [PATCH v14 13/20] arm64/kexec: Enable kexec " Geoff Levand
2016-03-04 23:51 ` [PATCH v14 20/20] arm64: kdump: update a kernel doc Geoff Levand
2016-03-04 23:51 ` [PATCH v14 17/20] arm64: kdump: implement machine_crash_shutdown() Geoff Levand
2016-03-04 23:51 ` [PATCH v14 15/20] arm64: kdump: reserve memory for crash dump kernel Geoff Levand
2016-03-04 23:51 ` [PATCH v14 18/20] arm64: kdump: add kdump support Geoff Levand
2016-03-04 23:51 ` [PATCH v14 14/20] arm64/kexec: Add pr_debug output Geoff Levand
2016-03-11 11:39   ` James Morse
2016-03-07 22:25 ` [PATCH v14 00/20] arm64 kexec kernel patches v14 Azriel Samson
2016-03-07 23:35   ` Geoff Levand
2016-03-08  0:23     ` AKASHI Takahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cda4b8dd98e3b56c4a565228b7ad7f00e9a4ddd.1457135058.git.geoff@infradead.org \
    --to=geoff@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).