kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Alexey Zaytsev <alexey.zaytsev@gmail.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	jinsong.liu@intel.com, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid
Date: Mon, 26 Dec 2011 13:14:17 +0200	[thread overview]
Message-ID: <4EF85709.8000801@redhat.com> (raw)
In-Reply-To: <4EF76DC8.1020509@web.de>

On 12/25/2011 08:39 PM, Jan Kiszka wrote:
> On 2011-12-25 14:03, Avi Kivity wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> > 
> > Unlike all of the other cpuid bits, the TSC deadline timer bit is set
> > unconditionally, regardless of what userspace wants.
> > 
> > This is broken in several ways:
> >  - if userspace doesn't use KVM_CREATE_IRQCHIP, and doesn't emulate the TSC
> >    deadline timer feature, a guest that uses the feature will break
> >  - live migration to older host kernels that don't support the TSC deadline
> >    timer will cause the feature to be pulled from under the guest's feet;
> >    breaking it
> >  - guests that are broken wrt the feature will fail.
> > 
> > Fix by not enabling the feature automatically; instead report it to userspace.
> > Because the feature depends on KVM_CREATE_IRQCHIP, which we cannot guarantee
> > will be called, we expose it via a KVM_CAP_TSC_DEADLINE_TIMER and not
> > KVM_GET_SUPPORTED_CPUID.
> > 
> > Fixes the Illumos guest kernel, which uses the TSC deadline timer feature.
> > 
> > [avi: add the KVM_CAP + documentation]
> > 
> > Reported-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
> > Signed-off-by: Avi Kivity <avi@redhat.com>
> > ---
> > 
> > As we're running out of time and everyone's checking their socks instead of
> > inboxes I've added the missing parts myself.  Jan, if you accidentally see
> > this, please review and add your signoff.
>
> I'm sorry for not holding my promise, was distracted the past days.
> Patch looks good to me, just some minor phrasing corrections below.

Not a problem at all, I can guess you had much better things to do.

>
> Signed-off-by; Jan Kiszka <jan.kiszka@siemens.com>
>
> > 
> >  Documentation/virtual/kvm/api.txt |    9 +++++++++
> >  arch/x86/kvm/cpuid.c              |   16 ++++++----------
> >  arch/x86/kvm/x86.c                |    3 +++
> >  include/linux/kvm.h               |    1 +
> >  4 files changed, 19 insertions(+), 10 deletions(-)
> > 
> > diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> > index 5b03eee..da1f8fd 100644
> > --- a/Documentation/virtual/kvm/api.txt
> > +++ b/Documentation/virtual/kvm/api.txt
> > @@ -1100,6 +1100,15 @@ emulate them efficiently. The fields in each entry are defined as follows:
> >     eax, ebx, ecx, edx: the values returned by the cpuid instruction for
> >           this function/index combination
> >  
> > +The TSC deadline timer feature (CPUID leaf 1, ecx[24]) is always returned
> > +as false, since the feature depends on KVM_CREATE_IRQCHIP for local APIC
> > +support.  Instead it is reported via
> > +
> > +  ioctl(KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER)
> > +
> > +if that returns true you use KVM_CREATE_IRQCHIP, or if emulate the
>                       ^^^                               ^^^
>                       and                               you
>

Thanks, added your signoff and adjusted this.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2011-12-26 11:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-25 13:03 [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid Avi Kivity
2011-12-25 18:39 ` Jan Kiszka
2011-12-26 11:14   ` Avi Kivity [this message]
2011-12-25 19:00 ` Sasha Levin
2011-12-25 19:47   ` Sasha Levin
2011-12-26  8:51     ` Liu, Jinsong
2011-12-26  0:44   ` Jan Kiszka
2011-12-26  8:42 ` Liu, Jinsong
2011-12-26 10:35   ` Avi Kivity
2011-12-26 10:43     ` Alexey Zaytsev
2011-12-26 10:45       ` Avi Kivity
2011-12-26 11:25         ` Alexey Zaytsev
2011-12-26 11:28           ` Avi Kivity

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=4EF85709.8000801@redhat.com \
    --to=avi@redhat.com \
    --cc=alexey.zaytsev@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=jinsong.liu@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).