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.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -417,6 +417,16 @@ struct acrn_pcidev { · 416 unmodified lines | ||
| 417 | 417 | __u32 bar[ACRN_PCI_NUM_BARS]; |
| 418 | 418 | }; |
| 419 | 419 | |
| 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 | + | |
| 420 | 430 | /* The ioctl type, documented in ioctl-number.rst */ |
| 421 | 431 | #define ACRN_IOCTL_TYPE 0xA2 |
| 422 | 432 | |
| @@ -436,6 +446,13 @@ struct acrn_pcidev { · 13 unmodified lines | ||
| 436 | 446 | #define ACRN_IOCTL_SET_VCPU_REGS \ |
| 437 | 447 | _IOW(ACRN_IOCTL_TYPE, 0x16, struct acrn_vcpu_regs) |
| 438 | 448 | |
| 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 | + | |
| 439 | 456 | #define ACRN_IOCTL_NOTIFY_REQUEST_FINISH \ |
| 440 | 457 | _IOW(ACRN_IOCTL_TYPE, 0x31, struct acrn_ioreq_notify) |
| 441 | 458 | #define ACRN_IOCTL_CREATE_IOREQ_CLIENT \ |