[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230127113932.166089-31-suzuki.poulose@arm.com>
Date: Fri, 27 Jan 2023 11:39:31 +0000
From: Suzuki K Poulose <suzuki.poulose@....com>
To: kvm@...r.kernel.org, kvmarm@...ts.linux.dev
Cc: suzuki.poulose@....com,
Alexandru Elisei <alexandru.elisei@....com>,
Andrew Jones <andrew.jones@...ux.dev>,
Christoffer Dall <christoffer.dall@....com>,
Fuad Tabba <tabba@...gle.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Joey Gouly <Joey.Gouly@....com>, Marc Zyngier <maz@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Oliver Upton <oliver.upton@...ux.dev>,
Paolo Bonzini <pbonzini@...hat.com>,
Quentin Perret <qperret@...gle.com>,
Steven Price <steven.price@....com>,
Thomas Huth <thuth@...hat.com>, Will Deacon <will@...nel.org>,
Zenghui Yu <yuzenghui@...wei.com>, linux-coco@...ts.linux.dev,
kvmarm@...ts.cs.columbia.edu, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Joey Gouly <joey.gouly@....com>
Subject: [RFC kvmtool 30/31] arm64: realm: inject an abort on an unhandled MMIO access
From: Joey Gouly <joey.gouly@....com>
For Realms, inject a synchronous external abort, instead of ignoring unknown
MMIO accesses.
Signed-off-by: Joey Gouly <joey.gouly@....com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
---
arm/kvm-cpu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arm/kvm-cpu.c b/arm/kvm-cpu.c
index 90a15ae9..c96d75eb 100644
--- a/arm/kvm-cpu.c
+++ b/arm/kvm-cpu.c
@@ -155,4 +155,13 @@ void kvm_cpu__show_page_tables(struct kvm_cpu *vcpu)
void kvm_cpu__arch_unhandled_mmio(struct kvm_cpu *vcpu)
{
+ struct kvm_vcpu_events events = { };
+
+ if (!vcpu->kvm->cfg.arch.is_realm)
+ return;
+
+ events.exception.ext_dabt_pending = 1;
+
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_VCPU_EVENTS, &events) < 0)
+ die_perror("KVM_SET_VCPU_EVENTS failed");
}
--
2.34.1
Powered by blists - more mailing lists