From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: KVM guest interrupts, traps, and, exceptions
Date: Sat, 27 Mar 2010 18:42:59 +0200 [thread overview]
Message-ID: <4BAE3593.90901@cs.helsinki.fi> (raw)
In-Reply-To: <12C1532A-4977-44BC-BF6D-9696C006EC1A@suse.de>
Hi Alexander,
Alexander Graf wrote:
>> I'm continuing my journey through the KVM API documentation and I'm now scratching my head on how interrupts, traps, and exceptions are supported by the API. I see KVM_CREATE_IRQCHIP and KVM_IRQ_LINE but I'm unable to work out how the host is notified of such events. For example, if the guest does
>>
>> int $0x10
>
> IRQs here mean hardware interrupts. They usually are pushed from host -> guest. So all you need is a way to tell the guest "you got an interrupt". Your userspace is the one giving interrupts, so there's no need to an exit.
>
> The "int $0x10" instruction describes a software interrupt. These are handled 100% in guest space.
>
>> is there some KVM_EXIT "exit reason" like we have for IO? Is there some other mechanism for that? As I haven't yet set up anything related to IRQs I can see the host just deadlock on user interrupts.
>
> I don't think I quite understand? If there's anything running inside guest context the host shouldn't be affected at all. Host interrupts always intercept guest execution.
OK, so Avi asked me not to look at KVM code or qemu code if I don't
understand something in Documentation/kvm/api.txt and instead, complain
about it. That might also partly explain why I am so confused.
I'm not talking in host -> guest interrupts but interrupts happening in
the _guest_. Now if I understand your explanation correctly, host is not
involved in interrupt processing but instead I just need to set up IDTs
properly in the guest? That makes sense and explains why guest
interrupts are not mentioned in the KVM API documentation at all. ;-)
Pekka
next prev parent reply other threads:[~2010-03-27 16:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-27 15:43 KVM guest interrupts, traps, and, exceptions Pekka Enberg
2010-03-27 16:15 ` Alexander Graf
2010-03-27 16:42 ` Pekka Enberg [this message]
2010-03-27 16:45 ` Alexander Graf
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=4BAE3593.90901@cs.helsinki.fi \
--to=penberg@cs.helsinki.fi \
--cc=agraf@suse.de \
--cc=avi@redhat.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