public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Handle multiple interrupts injection in one vmexit
@ 2014-05-26  7:51 Arthur Chunqi Li
  2014-05-26 10:44 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Arthur Chunqi Li @ 2014-05-26  7:51 UTC (permalink / raw)
  To: kvm

Hi there,

External interrupts are injected in function vcpu_enter_guest, with
checking KVM_REQ_EVENT. If there are more than one interrupts in one
vmexit (e.g. nmi and external events occur concurrently in one
vmexit), KVM will handle only one interrupt of the highest priority
(e.g. NMI), right? So only NMI is injected in this vmexit, thus when
will the other external events injected? I don't see any extra setting
of KVM_REQ_EVENT to handle the lower priority interrupts injection in
KVM.

Thanks,
Arthur

-- 
Arthur Chunqi Li
Department of Computer Science
School of EECS
Peking University
Beijing, China

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

* Re: Handle multiple interrupts injection in one vmexit
  2014-05-26  7:51 Handle multiple interrupts injection in one vmexit Arthur Chunqi Li
@ 2014-05-26 10:44 ` Jan Kiszka
  2014-05-26 11:09   ` Arthur Chunqi Li
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2014-05-26 10:44 UTC (permalink / raw)
  To: Arthur Chunqi Li, kvm

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

On 2014-05-26 15:51, Arthur Chunqi Li wrote:
> Hi there,
> 
> External interrupts are injected in function vcpu_enter_guest, with
> checking KVM_REQ_EVENT. If there are more than one interrupts in one
> vmexit (e.g. nmi and external events occur concurrently in one
> vmexit), KVM will handle only one interrupt of the highest priority
> (e.g. NMI), right? So only NMI is injected in this vmexit, thus when
> will the other external events injected? I don't see any extra setting
> of KVM_REQ_EVENT to handle the lower priority interrupts injection in
> KVM.

[you should mention that you are talking about x86 here]

If both events are pending, inject_pending_event will try to inject the
NMI. vcpu_enter_guest will then notice that there are still pending
interrupts and request the interrupt window vmexit. If the NMI should be
blocked, an NMI window exit is requested. But on NMI injection, another
KVM_REQ_EVENT is send (see e.g. handle_nmi_window in vmx.c).

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

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

* Re: Handle multiple interrupts injection in one vmexit
  2014-05-26 10:44 ` Jan Kiszka
@ 2014-05-26 11:09   ` Arthur Chunqi Li
  0 siblings, 0 replies; 3+ messages in thread
From: Arthur Chunqi Li @ 2014-05-26 11:09 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm

Thanks Jan.

On Mon, May 26, 2014 at 6:44 PM, Jan Kiszka <jan.kiszka@web.de> wrote:
> On 2014-05-26 15:51, Arthur Chunqi Li wrote:
>> Hi there,
>>
>> External interrupts are injected in function vcpu_enter_guest, with
>> checking KVM_REQ_EVENT. If there are more than one interrupts in one
>> vmexit (e.g. nmi and external events occur concurrently in one
>> vmexit), KVM will handle only one interrupt of the highest priority
>> (e.g. NMI), right? So only NMI is injected in this vmexit, thus when
>> will the other external events injected? I don't see any extra setting
>> of KVM_REQ_EVENT to handle the lower priority interrupts injection in
>> KVM.
>
> [you should mention that you are talking about x86 here]
>
> If both events are pending, inject_pending_event will try to inject the
> NMI. vcpu_enter_guest will then notice that there are still pending
> interrupts and request the interrupt window vmexit. If the NMI should be
> blocked, an NMI window exit is requested. But on NMI injection, another
> KVM_REQ_EVENT is send (see e.g. handle_nmi_window in vmx.c).
>
Yes, I see the Bit 2 (Interrupt-window exiting) and Bit 22 (NMI-window
exiting) on Primary Processor-Based VM-Execution Controls is used to
handle simultaneous (or contiguous) interrupt/NMI injection. See Intel
SDM Chapter 24.6.2 if any other guys need this information.

Arthur
> Jan
>
>



-- 
Arthur Chunqi Li
Department of Computer Science
School of EECS
Peking University
Beijing, China

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

end of thread, other threads:[~2014-05-26 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26  7:51 Handle multiple interrupts injection in one vmexit Arthur Chunqi Li
2014-05-26 10:44 ` Jan Kiszka
2014-05-26 11:09   ` Arthur Chunqi Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox