28.06.2021 19:50, Jim Mattson пишет:
I don't know how you can inject an interrupt with KVM_SET_REGS, but I suspect that you're doing something wrong. :-) If I wanted to inject an interrupt from userspace, I would use KVM_SET_LAPIC (assuming that the local APIC is active) to set the appropriate bit in IRRV. Before you can deliver an interrupt, you have to check the local APIC anyway, to see whether or not your interrupt would be blocked by PPR.
I do not use any of the emulated HW in KVM. PIC is in user-space, and no apic. This is a very simple hypervisor for running the ring3 code only. So to inject an interrupt, I create a stack frame and set eflags/cs/eip to the needed values, and that's all. Just as people did in a pre-KVM era. :)