All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Vladimir Murzin <vladimir.murzin@arm.com>
Subject: [PATCH 4/5] KVM: arm64: Remove CnP usage
Date: Thu,  1 Jun 2023 15:24:28 +0100	[thread overview]
Message-ID: <20230601142429.12835-5-maz@kernel.org> (raw)
In-Reply-To: <20230601142429.12835-1-maz@kernel.org>

KVM has two main uses of CnP: at stage-2 so that CnP could be honored
for adventurous guests, and at EL2 stage-1, for reasons that I can't
really explain.

Get rid of the whole thing.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/include/asm/kvm_mmu.h   | 3 +--
 arch/arm64/kvm/hyp/nvhe/hyp-init.S | 6 ------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 27e63c111f78..d81ec81709b5 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -281,12 +281,11 @@ static __always_inline u64 kvm_get_vttbr(struct kvm_s2_mmu *mmu)
 {
 	struct kvm_vmid *vmid = &mmu->vmid;
 	u64 vmid_field, baddr;
-	u64 cnp = system_supports_cnp() ? VTTBR_CNP_BIT : 0;
 
 	baddr = mmu->pgd_phys;
 	vmid_field = atomic64_read(&vmid->id) << VTTBR_VMID_SHIFT;
 	vmid_field &= VTTBR_VMID_MASK(kvm_arm_vmid_bits);
-	return kvm_phys_to_vttbr(baddr) | vmid_field | cnp;
+	return kvm_phys_to_vttbr(baddr) | vmid_field;
 }
 
 /*
diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S b/arch/arm64/kvm/hyp/nvhe/hyp-init.S
index a6d67c2bb5ae..ffb915a17360 100644
--- a/arch/arm64/kvm/hyp/nvhe/hyp-init.S
+++ b/arch/arm64/kvm/hyp/nvhe/hyp-init.S
@@ -103,9 +103,6 @@ SYM_CODE_START_LOCAL(___kvm_hyp_init)
 
 	ldr	x1, [x0, #NVHE_INIT_PGD_PA]
 	phys_to_ttbr x2, x1
-alternative_if ARM64_HAS_CNP
-	orr	x2, x2, #TTBR_CNP_BIT
-alternative_else_nop_endif
 	msr	ttbr0_el2, x2
 
 	/*
@@ -255,9 +252,6 @@ SYM_FUNC_START(__pkvm_init_switch_pgd)
 	/* Install the new pgtables */
 	ldr	x3, [x0, #NVHE_INIT_PGD_PA]
 	phys_to_ttbr x4, x3
-alternative_if ARM64_HAS_CNP
-	orr	x4, x4, #TTBR_CNP_BIT
-alternative_else_nop_endif
 	msr	ttbr0_el2, x4
 
 	/* Set the new stack pointer */
-- 
2.39.2


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

  parent reply	other threads:[~2023-06-01 14:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 14:24 [PATCH 0/5] arm64: Get rid of CnP Marc Zyngier
2023-06-01 14:24 ` [PATCH 1/5] arm64: Remove CnP detection Marc Zyngier
2023-06-01 14:24 ` [PATCH 2/5] arm64: Drop NVIDIA Carmel CnP workaround Marc Zyngier
2023-06-01 14:24 ` [PATCH 3/5] arm64: Drop support for CnP Marc Zyngier
2023-06-01 14:24 ` Marc Zyngier [this message]
2023-06-01 14:24 ` [PATCH 5/5] arm64: Remove CONFIG_ARM64_CNP Marc Zyngier
2023-06-01 14:31 ` [PATCH 0/5] arm64: Get rid of CnP Marc Zyngier
2023-06-01 14:31   ` Marc Zyngier
2023-06-02  8:41 ` Vladimir Murzin

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=20230601142429.12835-5-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=vladimir.murzin@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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.