All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Cc: kernel-team@android.com, Will Deacon <will@kernel.org>
Subject: [PATCH 4/4] KVM: arm64: Force SCTLR_EL2.WXN when running nVHE
Date: Wed, 10 Mar 2021 15:26:56 +0000	[thread overview]
Message-ID: <20210310152656.3821253-5-maz@kernel.org> (raw)
In-Reply-To: <20210310152656.3821253-1-maz@kernel.org>

As the EL2 nVHE object is nicely split into sections and that
we already differenciating permissions for data and code,
we can enable SCTLR_EL2.WXN so that we don't have to worry
about misconfiguration of the page tables.

Flip the WXN bit and get the ball running!

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/include/asm/sysreg.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 9d1aef631646..cc17f7d487ed 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -580,7 +580,8 @@
 #define SCTLR_ELx_M	(BIT(0))
 
 #define SCTLR_EL2_FLAGS	(SCTLR_ELx_M  | SCTLR_ELx_A | SCTLR_ELx_C | \
-			 SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_IESB)
+			 SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_IESB | \
+			 SCTLR_ELx_WXN)
 
 /* SCTLR_EL2 specific flags. */
 #define SCTLR_EL2_RES1	((BIT(4))  | (BIT(5))  | (BIT(11)) | (BIT(16)) | \
-- 
2.29.2

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Cc: James Morse <james.morse@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>,
	qperret@google.com, kernel-team@android.com
Subject: [PATCH 4/4] KVM: arm64: Force SCTLR_EL2.WXN when running nVHE
Date: Wed, 10 Mar 2021 15:26:56 +0000	[thread overview]
Message-ID: <20210310152656.3821253-5-maz@kernel.org> (raw)
In-Reply-To: <20210310152656.3821253-1-maz@kernel.org>

As the EL2 nVHE object is nicely split into sections and that
we already differenciating permissions for data and code,
we can enable SCTLR_EL2.WXN so that we don't have to worry
about misconfiguration of the page tables.

Flip the WXN bit and get the ball running!

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/include/asm/sysreg.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 9d1aef631646..cc17f7d487ed 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -580,7 +580,8 @@
 #define SCTLR_ELx_M	(BIT(0))
 
 #define SCTLR_EL2_FLAGS	(SCTLR_ELx_M  | SCTLR_ELx_A | SCTLR_ELx_C | \
-			 SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_IESB)
+			 SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_IESB | \
+			 SCTLR_ELx_WXN)
 
 /* SCTLR_EL2 specific flags. */
 #define SCTLR_EL2_RES1	((BIT(4))  | (BIT(5))  | (BIT(11)) | (BIT(16)) | \
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Cc: James Morse <james.morse@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>,
	qperret@google.com, kernel-team@android.com
Subject: [PATCH 4/4] KVM: arm64: Force SCTLR_EL2.WXN when running nVHE
Date: Wed, 10 Mar 2021 15:26:56 +0000	[thread overview]
Message-ID: <20210310152656.3821253-5-maz@kernel.org> (raw)
In-Reply-To: <20210310152656.3821253-1-maz@kernel.org>

As the EL2 nVHE object is nicely split into sections and that
we already differenciating permissions for data and code,
we can enable SCTLR_EL2.WXN so that we don't have to worry
about misconfiguration of the page tables.

Flip the WXN bit and get the ball running!

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/include/asm/sysreg.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 9d1aef631646..cc17f7d487ed 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -580,7 +580,8 @@
 #define SCTLR_ELx_M	(BIT(0))
 
 #define SCTLR_EL2_FLAGS	(SCTLR_ELx_M  | SCTLR_ELx_A | SCTLR_ELx_C | \
-			 SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_IESB)
+			 SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_IESB | \
+			 SCTLR_ELx_WXN)
 
 /* SCTLR_EL2 specific flags. */
 #define SCTLR_EL2_RES1	((BIT(4))  | (BIT(5))  | (BIT(11)) | (BIT(16)) | \
-- 
2.29.2


  parent reply	other threads:[~2021-03-10 15:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 15:26 [PATCH 0/4] KVM: arm64: Running the EL2 nVHE code with WXN Marc Zyngier
2021-03-10 15:26 ` Marc Zyngier
2021-03-10 15:26 ` Marc Zyngier
2021-03-10 15:26 ` [PATCH 1/4] arm64: Use INIT_SCTLR_EL1_MMU_OFF to disable the MMU on CPU restart Marc Zyngier
2021-03-10 15:26   ` Marc Zyngier
2021-03-10 15:26   ` Marc Zyngier
2021-03-10 15:26 ` [PATCH 2/4] KVM: arm64: Use INIT_SCTLR_EL2_MMU_OFF to disable the MMU on KVM teardown Marc Zyngier
2021-03-10 15:26   ` Marc Zyngier
2021-03-10 15:26   ` Marc Zyngier
2021-03-10 15:26 ` [PATCH 3/4] KVM: arm64: Rename SCTLR_ELx_FLAGS to SCTLR_EL2_FLAGS Marc Zyngier
2021-03-10 15:26   ` Marc Zyngier
2021-03-10 15:26   ` Marc Zyngier
2021-03-10 15:46   ` Will Deacon
2021-03-10 15:46     ` Will Deacon
2021-03-10 15:46     ` Will Deacon
2021-03-10 16:05     ` Marc Zyngier
2021-03-10 16:05       ` Marc Zyngier
2021-03-10 16:05       ` Marc Zyngier
2021-03-10 16:15       ` Will Deacon
2021-03-10 16:15         ` Will Deacon
2021-03-10 16:15         ` Will Deacon
2021-03-10 17:49         ` Marc Zyngier
2021-03-10 17:49           ` Marc Zyngier
2021-03-10 17:49           ` Marc Zyngier
2021-03-10 18:20           ` Will Deacon
2021-03-10 18:20             ` Will Deacon
2021-03-10 18:20             ` Will Deacon
2021-03-11 11:35             ` Mark Rutland
2021-03-11 11:35               ` Mark Rutland
2021-03-11 11:35               ` Mark Rutland
2021-03-11 12:00               ` Mark Rutland
2021-03-11 12:00                 ` Mark Rutland
2021-03-11 12:00                 ` Mark Rutland
2021-03-10 15:26 ` Marc Zyngier [this message]
2021-03-10 15:26   ` [PATCH 4/4] KVM: arm64: Force SCTLR_EL2.WXN when running nVHE Marc Zyngier
2021-03-10 15:26   ` 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=20210310152656.3821253-5-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=kernel-team@android.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=will@kernel.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 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.