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 B4DDFC77B7A for ; Thu, 1 Jun 2023 14:25:09 +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:References:In-Reply-To: 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: List-Owner; bh=Iw+DDHdqR3/202Zrzt2wiUihxMzyaAny8aCwaOrWZnU=; b=QQoZymqnv1RqQe TV5yPWDtz3l2WNQ/AgBt2bDpjrm+022sNsUYA9qmeoLt0W/LPr0xzM2MtE76XTZqXEsPXQ2K2EOs3 qId5zBLYYTLd+dtU6Lv345AzeJngJjAZfFZpFWLfrFCAIn4KiJwSQ+6tYR2ric35sSPw+YuIC/8li eInC1fN21l/vazcgz9NU/LQ5e1TPLhcTXtzhLDHQsrydO0GhTQHVs5BBvPkkHES/xHK2W7r1+579g znX+7hs6Cgxj35jN/Hl9wJKxcdvOFxifZHPSSpCq/9QVq4BS+vL229ttHPWSMon/hhnMavQ/zcnmL YiK05zWzroGhwB6tbWXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4jEO-003qHj-2P; Thu, 01 Jun 2023 14:24:48 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4jEK-003qDP-06 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 14:24:45 +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 964D261343; Thu, 1 Jun 2023 14:24:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EFE8C4339B; Thu, 1 Jun 2023 14:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685629483; bh=QeXrTcs9euVEdtvTgs4gwN1J0VX7j4VyVft9OrkGH+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ipY81Qh/MhaEBFUfv5iL4gfxYWUMfEsiTAwv9qMV+ZfT2jk2k+pv8sYnPy2HaUGAi 87BcZKJshNiovfB6N1Y9pGzSNuBIjgJQdPP2NDV8ODYuJR2G+OwJgMf4HxAb7pMvht oMHjKhEXUMt10haCB6PJpPBc7ZqZ/W0w04GrJwKH9h3pOKFz48wsFrBVRBrPXt0qrA TYN1uRhKs/1WEtW5CSKoP5pHgfQbEYcRyghT6uiF4vM0nPREaYEXgVr1otTrU/Hueq h1wnMlGvgWd5FV3KapKWkxagKzulQ5cXL7+XhH6u65enU1wMZgUoVse6TziycIy/r1 zNhJ+t7sjqgaQ== Received: from 90.4.23.109.rev.sfr.net ([109.23.4.90] helo=localhost.localdomain) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q4jEH-0024XU-4c; Thu, 01 Jun 2023 15:24:41 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Vladimir Murzin Subject: [PATCH 4/5] KVM: arm64: Remove CnP usage Date: Thu, 1 Jun 2023 15:24:28 +0100 Message-Id: <20230601142429.12835-5-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230601142429.12835-1-maz@kernel.org> References: <20230601142429.12835-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 109.23.4.90 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, ardb@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, vladimir.murzin@arm.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-20230601_072444_161396_7B04B62E X-CRM114-Status: GOOD ( 14.40 ) 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 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 --- 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