On Tue, Jul 21, 2009 at 08:57:26AM -0700, Saksena, Abhishek wrote: > > > > Hi, > I am building some device models around the KVM and am intersted in injecting IRQs. > > The current LibKVM.h provides following function > > int kvm_inject_irq ( kvm_context_t<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html> kvm, > int vcpu, > unsigned irq > ) > > Simulate an external vectored interrupt. > > This allows you to simulate an external vectored interrupt. > > Parameters: > kvm Pointer to the current kvm_context<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html> > vcpu Which virtual CPU should get dumped > irq Vector number > > Returns: > 0 on success > > My question is if I am say Injecting IRQ on pin 0 on PIC how do I get croosponding vector? I am using KVM's interrupt controllers. > This ioctl should be used if userspace emulates HW that maps IRQ to interrupt vector (PIC/IOAPIC/LAPIC). > > > I also see another function > > > > int kvm_set_irq_level ( kvm_context_t<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html> kvm, int irq, int level ) > > > > Can this be used safely to inject IRQ- I am gusseing irq refers to the pin and Level the value of that pin. How do I tell with this function which CPU I want to inject interrupt? > > And this one should be used if PIC/IOAPIC/LAPIC are emulated by a kernel. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html