@@ -22,6 +22,7 @@
#include "cpu.h"
#include "internals.h"
#include "hw/arm/arm.h"
+#include "hw/pci/pci.h"
#include "exec/memattrs.h"
#include "hw/boards.h"
#include "qemu/log.h"
@@ -31,6 +32,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
};
static bool cap_has_mp_state;
+bool kvm_arm_msi_use_devid;
int kvm_arm_vcpu_init(CPUState *cs)
{
@@ -619,6 +621,10 @@ int kvm_arm_vgic_probe(void)
int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
uint64_t address, uint32_t data, PCIDevice *dev)
{
+ if (kvm_arm_msi_use_devid) {
+ route->flags |= KVM_MSI_VALID_DEVID;
+ route->u.msi.devid = pci_requester_id(dev);
+ }
return 0;
}
@@ -120,6 +120,9 @@ bool write_kvmstate_to_list(ARMCPU *cpu);
void kvm_arm_reset_vcpu(ARMCPU *cpu);
#ifdef CONFIG_KVM
+
+extern bool kvm_arm_msi_use_devid;
+
/**
* kvm_arm_create_scratch_host_vcpu:
* @cpus_to_try: array of QEMU_KVM_ARM_TARGET_* values (terminated with