kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: "Saksena, Abhishek" <abhishek.saksena@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: KVM Irq injection
Date: Tue, 21 Jul 2009 20:16:37 +0300	[thread overview]
Message-ID: <20090721171637.GC1424@redhat.com> (raw)
In-Reply-To: <4158487B9DEE0647BA23911D1C22795767AB1FE8@orsmsx501.amr.corp.intel.com>

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.

      reply	other threads:[~2009-07-21 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 15:57 KVM Irq injection Saksena, Abhishek
2009-07-21 17:16 ` Gleb Natapov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090721171637.GC1424@redhat.com \
    --to=gleb@redhat.com \
    --cc=abhishek.saksena@intel.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).