All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu
Cc: Christoffer Dall <christoffer.dall@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	James Morse <james.morse@arm.com>
Subject: [PATCH 09/18] arm64: cpufeatures: Drop the ARM64_HYP_OFFSET_LOW feature flag
Date: Wed,  6 Dec 2017 14:38:30 +0000	[thread overview]
Message-ID: <20171206143839.29223-10-marc.zyngier@arm.com> (raw)
In-Reply-To: <20171206143839.29223-1-marc.zyngier@arm.com>

Now that we can dynamically compute the kernek/hyp VA mask, there
is need for a feature flag to trigger the alternative patching.
Let's drop the flag and everything that depends on it.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm64/include/asm/cpucaps.h |  2 +-
 arch/arm64/kernel/cpufeature.c   | 19 -------------------
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index 2ff7c5e8efab..f130f35dca3c 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -32,7 +32,7 @@
 #define ARM64_HAS_VIRT_HOST_EXTN		11
 #define ARM64_WORKAROUND_CAVIUM_27456		12
 #define ARM64_HAS_32BIT_EL0			13
-#define ARM64_HYP_OFFSET_LOW			14
+/* #define ARM64_UNALLOCATED_ENTRY			14 */
 #define ARM64_MISMATCHED_CACHE_LINE_SIZE	15
 #define ARM64_HAS_NO_FPSIMD			16
 #define ARM64_WORKAROUND_REPEAT_TLBI		17
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index c5ba0097887f..9eabceaaf5fb 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -824,19 +824,6 @@ static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused
 	return is_kernel_in_hyp_mode();
 }
 
-static bool hyp_offset_low(const struct arm64_cpu_capabilities *entry,
-			   int __unused)
-{
-	phys_addr_t idmap_addr = __pa_symbol(__hyp_idmap_text_start);
-
-	/*
-	 * Activate the lower HYP offset only if:
-	 * - the idmap doesn't clash with it,
-	 * - the kernel is not running at EL2.
-	 */
-	return idmap_addr > GENMASK(VA_BITS - 2, 0) && !is_kernel_in_hyp_mode();
-}
-
 static bool has_no_fpsimd(const struct arm64_cpu_capabilities *entry, int __unused)
 {
 	u64 pfr0 = read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1);
@@ -925,12 +912,6 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
 		.field_pos = ID_AA64PFR0_EL0_SHIFT,
 		.min_field_value = ID_AA64PFR0_EL0_32BIT_64BIT,
 	},
-	{
-		.desc = "Reduced HYP mapping offset",
-		.capability = ARM64_HYP_OFFSET_LOW,
-		.def_scope = SCOPE_SYSTEM,
-		.matches = hyp_offset_low,
-	},
 	{
 		/* FP/SIMD is not implemented */
 		.capability = ARM64_HAS_NO_FPSIMD,
-- 
2.14.2

WARNING: multiple messages have this Message-ID (diff)
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 09/18] arm64: cpufeatures: Drop the ARM64_HYP_OFFSET_LOW feature flag
Date: Wed,  6 Dec 2017 14:38:30 +0000	[thread overview]
Message-ID: <20171206143839.29223-10-marc.zyngier@arm.com> (raw)
In-Reply-To: <20171206143839.29223-1-marc.zyngier@arm.com>

Now that we can dynamically compute the kernek/hyp VA mask, there
is need for a feature flag to trigger the alternative patching.
Let's drop the flag and everything that depends on it.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm64/include/asm/cpucaps.h |  2 +-
 arch/arm64/kernel/cpufeature.c   | 19 -------------------
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index 2ff7c5e8efab..f130f35dca3c 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -32,7 +32,7 @@
 #define ARM64_HAS_VIRT_HOST_EXTN		11
 #define ARM64_WORKAROUND_CAVIUM_27456		12
 #define ARM64_HAS_32BIT_EL0			13
-#define ARM64_HYP_OFFSET_LOW			14
+/* #define ARM64_UNALLOCATED_ENTRY			14 */
 #define ARM64_MISMATCHED_CACHE_LINE_SIZE	15
 #define ARM64_HAS_NO_FPSIMD			16
 #define ARM64_WORKAROUND_REPEAT_TLBI		17
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index c5ba0097887f..9eabceaaf5fb 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -824,19 +824,6 @@ static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused
 	return is_kernel_in_hyp_mode();
 }
 
-static bool hyp_offset_low(const struct arm64_cpu_capabilities *entry,
-			   int __unused)
-{
-	phys_addr_t idmap_addr = __pa_symbol(__hyp_idmap_text_start);
-
-	/*
-	 * Activate the lower HYP offset only if:
-	 * - the idmap doesn't clash with it,
-	 * - the kernel is not running at EL2.
-	 */
-	return idmap_addr > GENMASK(VA_BITS - 2, 0) && !is_kernel_in_hyp_mode();
-}
-
 static bool has_no_fpsimd(const struct arm64_cpu_capabilities *entry, int __unused)
 {
 	u64 pfr0 = read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1);
@@ -925,12 +912,6 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
 		.field_pos = ID_AA64PFR0_EL0_SHIFT,
 		.min_field_value = ID_AA64PFR0_EL0_32BIT_64BIT,
 	},
-	{
-		.desc = "Reduced HYP mapping offset",
-		.capability = ARM64_HYP_OFFSET_LOW,
-		.def_scope = SCOPE_SYSTEM,
-		.matches = hyp_offset_low,
-	},
 	{
 		/* FP/SIMD is not implemented */
 		.capability = ARM64_HAS_NO_FPSIMD,
-- 
2.14.2

  parent reply	other threads:[~2017-12-06 14:39 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 14:38 [PATCH 00/18] KVM/arm64: Randomise EL2 mappings Marc Zyngier
2017-12-06 14:38 ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 01/18] arm64: asm-offsets: Avoid clashing DMA definitions Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 02/18] arm64: asm-offsets: Remove unused definitions Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 03/18] arm64: asm-offsets: Remove potential circular dependency Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 04/18] arm64: alternatives: Enforce alignment of struct alt_instr Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:48   ` Konrad Rzeszutek Wilk
2017-12-06 14:48     ` Konrad Rzeszutek Wilk
2017-12-06 14:57     ` Marc Zyngier
2017-12-06 14:57       ` Marc Zyngier
2017-12-06 15:18       ` Konrad Rzeszutek Wilk
2017-12-06 15:18         ` Konrad Rzeszutek Wilk
2017-12-06 15:39         ` Marc Zyngier
2017-12-06 15:39           ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 05/18] arm64: alternatives: Add dynamic patching feature Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 06/18] arm64: insn: Add N immediate encoding Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 07/18] arm64: insn: Add encoder for bitwise operations using litterals Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 08/18] arm64: KVM: Dynamically patch the kernel/hyp VA mask Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` Marc Zyngier [this message]
2017-12-06 14:38   ` [PATCH 09/18] arm64: cpufeatures: Drop the ARM64_HYP_OFFSET_LOW feature flag Marc Zyngier
2017-12-06 14:38 ` [PATCH 10/18] arm64; insn: Add encoder for the EXTR instruction Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 11/18] arm64: insn: Allow ADD/SUB (immediate) with LSL #12 Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 12/18] arm64: KVM: Introduce EL2 VA randomisation Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 13/18] arm64: Update the KVM memory map documentation Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 14/18] KVM: arm/arm64: Do not use kern_hyp_va() with kvm_vgic_global_state Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 15/18] KVM: arm/arm64: Demote HYP VA range display to being a debug feature Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 16/18] KVM: arm/arm64: Move ioremap calls to create_hyp_io_mappings Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 17/18] KVM: arm/arm64: Keep GICv2 HYP VAs in kvm_vgic_global_state Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier
2017-12-06 14:38 ` [PATCH 18/18] KVM: arm/arm64: Move HYP IO VAs to the "idmap" range Marc Zyngier
2017-12-06 14:38   ` Marc Zyngier

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=20171206143839.29223-10-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.