@@ -7,6 +7,7 @@
#include <linux/kernel.h>
#include <linux/kvm.h>
#include <linux/sizes.h>
+#include <linux/virtio_config.h>
struct kvm_ext kvm_req_ext[] = {
{ DEFINE_KVM_EXT(KVM_CAP_ONE_REG) },
@@ -224,5 +225,14 @@ int kvm__arch_setup_firmware(struct kvm *kvm)
u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
{
- return 0;
+ u64 features = 0;
+
+ /* CoVE VMs mandate VIRTIO_F_ACCESS_PLATFORM feature to force use of
+ * SWIOTLB bounce buffers through DMA API. Without this device probe
+ * will fail for CoVE VMs.
+ */
+ if (kvm->cfg.arch.cove_vm)
+ features |= (1ULL << VIRTIO_F_ACCESS_PLATFORM);
+
+ return features;
}