lkml.org 
[lkml]   [2017]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC hack dont apply] intel_idle: support running within a VM
On Sat, 30 Sep 2017 01:21:43 +0200
"Rafael J. Wysocki" <rafael@kernel.org> wrote:

> On Sat, Sep 30, 2017 at 12:01 AM, Michael S. Tsirkin <mst@redhat.com>
> wrote:
> > intel idle driver does not DTRT when running within a VM:
> > when going into a deep power state, the right thing to
> > do is to exit to hypervisor rather than to keep polling
> > within guest using mwait.
> >
> > Currently the solution is just to exit to hypervisor each time we go
> > idle - this is why kvm does not expose the mwait leaf to guests even
> > when it allows guests to do mwait.
> >
> > But that's not ideal - it seems better to use the idle driver to
> > guess when will the next interrupt arrive.
>
> The idle driver alone is not sufficient for that, though.
>
I second that. Why try to solve this problem at vendor specific driver
level? perhaps just a pv idle driver that decide whether to vmexit
based on something like local per vCPU timer expiration? I guess we
can't predict other wake events such as interrupts.
e.g.
if (get_next_timer_interrupt() > kvm_halt_target_residency)
vmexit
else
poll

Jacob

\
 
 \ /
  Last update: 2017-10-02 19:10    [W:0.062 / U:2.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site