[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230127113932.166089-29-suzuki.poulose@arm.com>
Date: Fri, 27 Jan 2023 11:39:29 +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
Subject: [RFC kvmtool 28/31] arm64: realm: Enforce virtio F_ACCESS_PLATFORM flag
For realms, force the F_ACCESS_PLATFORM flag to ensure DMA-APIs
are triggered for virtio in Linux
Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
---
arm/aarch64/kvm.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
index a4664237..1f3a0def 100644
--- a/arm/aarch64/kvm.c
+++ b/arm/aarch64/kvm.c
@@ -5,6 +5,7 @@
#include <linux/byteorder.h>
#include <linux/cpumask.h>
#include <linux/sizes.h>
+#include <linux/virtio_config.h>
#include <kvm/util.h>
@@ -237,5 +238,10 @@ void kvm__arch_enable_mte(struct kvm *kvm)
u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
{
- return 0;
+ u64 features = 0;
+
+ /* Enforce F_ACCESS_PLATFORM for Realms */
+ if (kvm->cfg.arch.is_realm)
+ features |= (1ULL << VIRTIO_F_ACCESS_PLATFORM);
+ return features;
}
--
2.34.1
Powered by blists - more mailing lists