[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210322164828.800662-2-maz@kernel.org>
Date: Mon, 22 Mar 2021 16:48:26 +0000
From: Marc Zyngier <maz@...nel.org>
To: Quentin Perret <qperret@...gle.com>
Cc: catalin.marinas@....com, james.morse@....com,
julien.thierry.kdev@...il.com, suzuki.poulose@....com,
android-kvm@...gle.com, seanjc@...gle.com, mate.toth-pal@....com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kernel-team@...roid.com, kvmarm@...ts.cs.columbia.edu,
tabba@...gle.com, ardb@...nel.org, mark.rutland@....com,
dbrazdil@...gle.com
Subject: [PATCH 1/3] KVM: arm64: Constraint KVM's own __flush_dcache_area to protectected mode
As we are about to specialise KVM's version of __flush_dcache_area
via a hack opn the read_ctr macro, make sure that we won't ever
use KVM's copy of __flush_dcache_area(), as things would otherwise
break for late arriving CPUs.
Signed-off-by: Marc Zyngier <maz@...nel.org>
---
arch/arm64/kvm/hyp/nvhe/cache.S | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kvm/hyp/nvhe/cache.S b/arch/arm64/kvm/hyp/nvhe/cache.S
index 36cef6915428..1c177d3ec5c6 100644
--- a/arch/arm64/kvm/hyp/nvhe/cache.S
+++ b/arch/arm64/kvm/hyp/nvhe/cache.S
@@ -6,8 +6,12 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/alternative.h>
+#include <asm/asm-bug.h>
SYM_FUNC_START_PI(__flush_dcache_area)
+alternative_if_not ARM64_KVM_PROTECTED_MODE
+ ASM_BUG()
+alternative_else_nop_endif
dcache_by_line_op civac, sy, x0, x1, x2, x3
ret
SYM_FUNC_END_PI(__flush_dcache_area)
--
2.29.2
Powered by blists - more mailing lists