Add callbacks for archs to provide virtio host flags.
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arm/aarch32/kvm.c | 5 +++++
arm/aarch64/kvm.c | 5 +++++
include/kvm/kvm.h | 2 ++
mips/kvm.c | 5 +++++
powerpc/kvm.c | 5 +++++
riscv/kvm.c | 5 +++++
virtio/core.c | 5 ++++-
x86/kvm.c | 5 +++++
8 files changed, 36 insertions(+), 1 deletion(-)
@@ -12,3 +12,8 @@ u64 kvm__arch_default_ram_address(void)
{
return ARM_MEMORY_AREA;
}
+
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
+{
+ return 0;
+}
@@ -234,3 +234,8 @@ void kvm__arch_enable_mte(struct kvm *kvm)
pr_debug("MTE capability enabled");
}
+
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
+{
+ return 0;
+}
@@ -203,6 +203,8 @@ int kvm__arch_free_firmware(struct kvm *kvm);
bool kvm__arch_cpu_supports_vm(void);
void kvm__arch_read_term(struct kvm *kvm);
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm);
+
#ifdef ARCH_HAS_CFG_RAM_ADDRESS
static inline bool kvm__arch_has_cfg_ram_address(void)
{
@@ -374,3 +374,8 @@ void ioport__map_irq(u8 *irq)
void serial8250__inject_sysrq(struct kvm *kvm, char sysrq)
{
}
+
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
+{
+ return 0;
+}
@@ -529,3 +529,8 @@ int kvm__arch_free_firmware(struct kvm *kvm)
{
return 0;
}
+
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
+{
+ return 0;
+}
@@ -182,3 +182,8 @@ int kvm__arch_setup_firmware(struct kvm *kvm)
{
return 0;
}
+
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
+{
+ return 0;
+}
@@ -285,7 +285,10 @@ void virtio_notify_status(struct kvm *kvm, struct virtio_device *vdev,
u64 virtio_dev_get_host_features(struct virtio_device *vdev, struct kvm *kvm, void *dev)
{
- return vdev->ops->get_host_features(kvm, dev);
+ u64 features = kvm__arch_get_virtio_host_features(kvm);
+
+ features |= vdev->ops->get_host_features(kvm, dev);
+ return features;
}
bool virtio_access_config(struct kvm *kvm, struct virtio_device *vdev,
@@ -387,3 +387,8 @@ void kvm__arch_read_term(struct kvm *kvm)
serial8250__update_consoles(kvm);
virtio_console__inject_interrupt(kvm);
}
+
+u64 kvm__arch_get_virtio_host_features(struct kvm *kvm)
+{
+ return 0;
+}