* kvm running on core1 wants guest os on core2 to execute a pre-defined program
@ 2013-02-17 2:46 zhangzhi
2013-02-17 12:06 ` Gleb Natapov
0 siblings, 1 reply; 4+ messages in thread
From: zhangzhi @ 2013-02-17 2:46 UTC (permalink / raw)
To: kvm
I have been studying some stuff about KVM and sincerely hope that someone is
willing to reply to this mail.
As we know, If physical NIC interrupt is received on physical CPU 0 which is in
root mode and the hypervisor determines that this is a network packet targeted
to the emulated NIC for a VM at the same time this VM is running a user program
in guest mode on physical CPU 1.
My question is:
At this time can hypervisor running on CPU 0 *actively* interrupt VM and make it
run the corresponding interrupt handler to handle the incoming network data
packet? CPU 1 which is running a user program is not supposed to vm-exit
considering the performance effect, so I can not use the inter-processor
interrupt(IPI) to cause the CPU1 to leave guest mode and exit to the hypervisor.
If anyone knows, please tell me.
Thanks a lot !
Best regards,
henry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kvm running on core1 wants guest os on core2 to execute a pre-defined program
2013-02-17 2:46 kvm running on core1 wants guest os on core2 to execute a pre-defined program zhangzhi
@ 2013-02-17 12:06 ` Gleb Natapov
0 siblings, 0 replies; 4+ messages in thread
From: Gleb Natapov @ 2013-02-17 12:06 UTC (permalink / raw)
To: zhangzhi; +Cc: kvm
On Sun, Feb 17, 2013 at 02:46:28AM +0000, zhangzhi wrote:
> I have been studying some stuff about KVM and sincerely hope that someone is
> willing to reply to this mail.
> As we know, If physical NIC interrupt is received on physical CPU 0 which is in
> root mode and the hypervisor determines that this is a network packet targeted
> to the emulated NIC for a VM at the same time this VM is running a user program
> in guest mode on physical CPU 1.
> My question is:
> At this time can hypervisor running on CPU 0 *actively* interrupt VM and make it
> run the corresponding interrupt handler to handle the incoming network data
> packet? CPU 1 which is running a user program is not supposed to vm-exit
> considering the performance effect, so I can not use the inter-processor
> interrupt(IPI) to cause the CPU1 to leave guest mode and exit to the hypervisor.
>
With current generation of CPUs you will have to use IPI to make CPU1
vmexit and inject interrupt on the next vmentry. Future CPU will allow to
inject interrupt into a running guest without vmexit. On Intel this is
called "posted interrupts".
--
Gleb.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kvm running on core1 wants guest os on core2 to execute a pre-defined program
@ 2013-02-17 15:08 zhang zhi
2013-02-17 15:25 ` Gleb Natapov
0 siblings, 1 reply; 4+ messages in thread
From: zhang zhi @ 2013-02-17 15:08 UTC (permalink / raw)
To: 'Gleb Natapov'; +Cc: kvm
topic: Re: kvm running on core1 wants guest os on core2 to execute a
pre-defined program
On Sun, Feb 17, 2013 at 02:46:28AM +0000, zhangzhi wrote:
> I have been studying some stuff about KVM and sincerely hope that
> someone is willing to reply to this mail.
> As we know, If physical NIC interrupt is received on physical CPU 0
> which is in root mode and the hypervisor determines that this is a
> network packet targeted to the emulated NIC for a VM at the same time
> this VM is running a user program in guest mode on physical CPU 1.
> My question is:
> At this time can hypervisor running on CPU 0 *actively* interrupt VM
> and make it run the corresponding interrupt handler to handle the
> incoming network data packet? CPU 1 which is running a user program is
> not supposed to vm-exit considering the performance effect, so I can
> not use the inter-processor
> interrupt(IPI) to cause the CPU1 to leave guest mode and exit to the
hypervisor.
>
On Sun, Feb 17, 2013 at 20:06:18PM +0000, Gleb wrote:
>>With current generation of CPUs you will have to use IPI to make CPU1
vmexit and inject interrupt on the next vmentry. Future CPU will allow to
>>inject interrupt into a running guest without vmexit. On Intel this is
called "posted interrupts".
>>
>>
Thank you for your prompt reply. According to what you've said, it seems
impossible to make CPU1 run the corresponding interrupt handler without
vm-exit.
I have an idea like this: CPU0 send a message to i/o apic after configuring
i/o apic and the message is mainly about the interrupt vector of emulated
NIC. After that, the i/o apic will go around hypervisor and send the
corresponding interrupt request directly to target CPU1 , considering that
guest os itself owns the NIC device. Is it possible?
Thanks!
henry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kvm running on core1 wants guest os on core2 to execute a pre-defined program
2013-02-17 15:08 zhang zhi
@ 2013-02-17 15:25 ` Gleb Natapov
0 siblings, 0 replies; 4+ messages in thread
From: Gleb Natapov @ 2013-02-17 15:25 UTC (permalink / raw)
To: zhang zhi; +Cc: kvm
On Sun, Feb 17, 2013 at 11:08:19PM +0800, zhang zhi wrote:
>
> topic: Re: kvm running on core1 wants guest os on core2 to execute a
> pre-defined program
>
> On Sun, Feb 17, 2013 at 02:46:28AM +0000, zhangzhi wrote:
> > I have been studying some stuff about KVM and sincerely hope that
> > someone is willing to reply to this mail.
> > As we know, If physical NIC interrupt is received on physical CPU 0
> > which is in root mode and the hypervisor determines that this is a
> > network packet targeted to the emulated NIC for a VM at the same time
> > this VM is running a user program in guest mode on physical CPU 1.
> > My question is:
> > At this time can hypervisor running on CPU 0 *actively* interrupt VM
> > and make it run the corresponding interrupt handler to handle the
> > incoming network data packet? CPU 1 which is running a user program is
> > not supposed to vm-exit considering the performance effect, so I can
> > not use the inter-processor
> > interrupt(IPI) to cause the CPU1 to leave guest mode and exit to the
> hypervisor.
> >
> On Sun, Feb 17, 2013 at 20:06:18PM +0000, Gleb wrote:
> >>With current generation of CPUs you will have to use IPI to make CPU1
> vmexit and inject interrupt on the next vmentry. Future CPU will allow to
> >>inject interrupt into a running guest without vmexit. On Intel this is
> called "posted interrupts".
> >>
> >>
> Thank you for your prompt reply. According to what you've said, it seems
> impossible to make CPU1 run the corresponding interrupt handler without
> vm-exit.
> I have an idea like this: CPU0 send a message to i/o apic after configuring
> i/o apic and the message is mainly about the interrupt vector of emulated
> NIC. After that, the i/o apic will go around hypervisor and send the
> corresponding interrupt request directly to target CPU1 , considering that
> guest os itself owns the NIC device. Is it possible?
Interrupt delivered by IOAPIC will make CPU to do vmexit. It is possible
to hack around it, but it is not simple. See
http://researcher.ibm.com/files/il-ABELG/eli_asplos12.pdf how it was
done already. Just buy HW that is capable enough to do what you want.
--
Gleb.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-17 15:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-17 2:46 kvm running on core1 wants guest os on core2 to execute a pre-defined program zhangzhi
2013-02-17 12:06 ` Gleb Natapov
-- strict thread matches above, loose matches on Subject: below --
2013-02-17 15:08 zhang zhi
2013-02-17 15:25 ` Gleb Natapov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox