Re: KVM PMU virtualization

Ingo Molnar
2010-02-26T14:37:42Z

* Avi Kivity <avi@redhat.com> wrote:

> >> Certainly guests that we don't port won't be able to use this. I doubt
> >> we'll be able to make Windows work with this - the only performance tool I'm
> >> familiar with on Windows is Intel's VTune, and that's proprietary.
> >
> > Dont you see the extreme irony of your wish to limit Linux kernel design
> > decisions and features based on ... Windows and other proprietary
> > software?
>
> Not at all. Virtualization is a hardware compatibility game. To see what
> happens if you don't play it, see Xen. Eventually they to implemented
> hardware support even though the pv approach is so wonderful.

That's not quite equivalent though.

KVM used to be the clean, integrate-code-with-Linux virtualization approach,
designed specifically for CPUs that can be virtualized properly. (VMX support
first, then SVM, etc.)

KVM virtualized ages-old concepts with relatively straightforward hardware
ABIs: x86 execution, IRQ abstractions, device abstractions, etc.

Now you are in essence turning that all around:

- the PMU is by no means properly virtualized nor really virtualizable by
direct access. There's no virtual PMU that ticks independently of the host
PMU.

- the PMU hardware itself is not a well standardized piece of hardware. It's
very vendor dependent and very limiting.

So to some degree you are playing the role of Xen in this specific affair. You
are pushing for something that shouldnt be done in that form. You want to
interfere with the host PMU by going via the fast & easy short-term hack to
just let the guest OS have the PMU, without any regard to how this impacts
long-term feasible solutions.

I.e. you are a bit like the guy who would have told Linus in 1994:

" Dude, why dont you use the Windows APIs? It's far more compatible and
that's the only way you could run any serious apps. Besides, it requires
no upgrade. Admittedly it's a bit messy and 16-bit but hey, that's our
installed base after all. "

Ingo