History

virt: acrn: Introduce interrupt injection interfaces

ACRN userspace need to inject virtual interrupts into a User VM in devices emulation. HSM needs provide interfaces to do so. Introduce following interrupt injection interfaces: ioctl ACRN_IOCTL_SET_IRQLINE: Pass data from userspace to the hypervisor, and inform the hypervisor to inject a virtual IOAPIC GSI interrupt to a User VM. ioctl ACRN_IOCTL_INJECT_MSI: Pass data struct acrn_msi_entry from userspace to the hypervisor, and inform the hypervisor to inject a virtual MSI to a User VM. ioctl ACRN_IOCTL_VM_INTR_MONITOR: Set a 4-Kbyte aligned shared page for statistics information of interrupts of a User VM.

Shuo Liu committed 5 years ago

Commit c7cf8d21 parent ce011e15 files · +138 −0Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/acrn.h+17−0
@@ -417,6 +417,16 @@ struct acrn_pcidev { · 416 unmodified lines
417417 __u32 bar[ACRN_PCI_NUM_BARS];
418418 };
419419
420+/**
421+ * struct acrn_msi_entry - Info for injecting a MSI interrupt to a VM
422+ * @msi_addr: MSI addr[19:12] with dest vCPU ID
423+ * @msi_data: MSI data[7:0] with vector
424+ */
425+struct acrn_msi_entry {
426+ __u64 msi_addr;
427+ __u64 msi_data;
428+};
429+
420430 /* The ioctl type, documented in ioctl-number.rst */
421431 #define ACRN_IOCTL_TYPE 0xA2
422432
@@ -436,6 +446,13 @@ struct acrn_pcidev { · 13 unmodified lines
436446 #define ACRN_IOCTL_SET_VCPU_REGS \
437447 _IOW(ACRN_IOCTL_TYPE, 0x16, struct acrn_vcpu_regs)
438448
449+#define ACRN_IOCTL_INJECT_MSI \
450+ _IOW(ACRN_IOCTL_TYPE, 0x23, struct acrn_msi_entry)
451+#define ACRN_IOCTL_VM_INTR_MONITOR \
452+ _IOW(ACRN_IOCTL_TYPE, 0x24, unsigned long)
453+#define ACRN_IOCTL_SET_IRQLINE \
454+ _IOW(ACRN_IOCTL_TYPE, 0x25, __u64)
455+
439456 #define ACRN_IOCTL_NOTIFY_REQUEST_FINISH \
440457 _IOW(ACRN_IOCTL_TYPE, 0x31, struct acrn_ioreq_notify)
441458 #define ACRN_IOCTL_CREATE_IOREQ_CLIENT \