diff mbox series

[RFC,kvmtool,01/31] arm64: Disable MTE when CFI flash is emulated

Message ID 20230127113932.166089-2-suzuki.poulose@arm.com (mailing list archive)
State New, archived
Headers show
Series [RFC,kvmtool,01/31] arm64: Disable MTE when CFI flash is emulated | expand

Commit Message

Suzuki K Poulose Jan. 27, 2023, 11:39 a.m. UTC
CFI Flash file image cannot be mapped into the memory of the
guest if MTE is enabled. Thus disable MTE if flash emulation
is requested.

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arm/aarch64/kvm.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
index 54200c9e..5a53badb 100644
--- a/arm/aarch64/kvm.c
+++ b/arm/aarch64/kvm.c
@@ -145,6 +145,12 @@  void kvm__arch_enable_mte(struct kvm *kvm)
 		return;
 	}
 
+	if (kvm->cfg.flash_filename) {
+		kvm->cfg.arch.mte_disabled = true;
+		pr_info("MTE is incompatible with CFI flash support, disabling");
+		return;
+	}
+
 	if (kvm->cfg.arch.mte_disabled) {
 		pr_debug("MTE disabled by user");
 		return;