kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KVM Irq injection
@ 2009-07-21 15:57 Saksena, Abhishek
  2009-07-21 17:16 ` Gleb Natapov
  0 siblings, 1 reply; 2+ messages in thread
From: Saksena, Abhishek @ 2009-07-21 15:57 UTC (permalink / raw)
  To: kvm@vger.kernel.org




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.



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?



-Abhishek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: KVM Irq injection
  2009-07-21 15:57 KVM Irq injection Saksena, Abhishek
@ 2009-07-21 17:16 ` Gleb Natapov
  0 siblings, 0 replies; 2+ messages in thread
From: Gleb Natapov @ 2009-07-21 17:16 UTC (permalink / raw)
  To: Saksena, Abhishek; +Cc: kvm@vger.kernel.org

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-21 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 15:57 KVM Irq injection Saksena, Abhishek
2009-07-21 17:16 ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).