kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Expose tsc deadline timer cpuid to guest
Date: Mon, 23 Apr 2012 18:31:25 +0200	[thread overview]
Message-ID: <4F9583DD.10807@siemens.com> (raw)
In-Reply-To: <20120423144818.GA3169@otherpad.lan.raisama.net>

On 2012-04-23 16:48, Eduardo Habkost wrote:
> Trying to summarize the points above:
> 
> Groups (A) and (B) are:
> 
> A) a feature that KVM supports and emulate by itself and can be enabled
>    by userspace blindly, without requiring any additional userspace
>    code to work.
> B) a feature that KVM supports but need support from userspace to work.
> 
> We have to differentiate those two groups somehow, otherwise "-cpu host"
> will always risk being unstable (in case we can't identify group (B) and
> end up enabling a feature that will break) or useless (if group (A) is
> considered always empty).
> 
> (If you think this two-group model is not sufficient, please let me know.)
> 
> Note that I am discussing two things above:
> 
> - Whether GET_SUPPORTED_CPUID should expose only features from group
>   (A), or group (B) too.
>   - One problem here is that today GET_SUPPORTED_CPUIDS have many
>     examples of (B) features inside it. Should we stop doing that?

We have exactly two for the category that I was concerned about: TSC
deadline and X2APIC. The latter is already exposed unconditionally, even
if the kernel does not provide emulation. So, you are right, TSC
deadline is not a new scenario.

>     - TSC-deadline is the first case where we are _not_ doing that. It
>       is the first CPU feature in KVM that can be enabled by userspace
>       (as long as userspace does the proper setup), but it's not
>       included on GET_SUPPORTED_CPUIDs.
>   - Even the current documentation implies that group (B) is included:
> 
>     "This ioctl returns x86 cpuid features which are supported by both
>     the hardware and kvm.  Userspace can use the information returned by
>     this ioctl to construct cpuid information (for KVM_SET_CPUID2) that
>     is consistent with hardware, kernel, and userspace capabilities, and
>                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
>     with user requirements (for example, the user may wish to constrain
>     cpuid to emulate older hardware, or for feature consistency across a
>     cluster)."
> 
>     In the specific case of TSC-deadline, I consider "Qemu knowing that
>     TSC-deadline can be enabled only if in-kernel irqchip is enabled" as
>     an "userpace capability".
> 
> - How to precisely define the groups (A) and (B)?
>   - "requires additional code only if migration is required" qualifies
>     as (B) or (A)?
>   - "requires in-kernel irqchip to be enabled to work" qualifies as (B),
>     doesn't it?

My problem is that features like X2APIC and TSC deadline are exposed by
the kernel without "contributing" to them (if in-kernel irqchip is off).
However, that was how I interpreted this GET_SUPPORTED_CPUID. In fact,
it is used as "kernel or hardware does not _prevent_" already. And in
that sense, it's ok to enable even features that are not in
kernel/hardware hands. We should point out this fact in the documentation.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2012-04-23 16:31 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28 21:55 [PATCH 2/2] Expose tsc deadline timer cpuid to guest Liu, Jinsong
2012-01-04 16:48 ` Jan Kiszka
2012-01-05 20:07   ` Liu, Jinsong
2012-01-05 20:34     ` Jan Kiszka
2012-01-07 18:23       ` Liu, Jinsong
2012-01-08 21:24         ` Jan Kiszka
2012-02-27 16:05           ` Liu, Jinsong
2012-02-27 17:18             ` Jan Kiszka
2012-02-28 10:30               ` Liu, Jinsong
2012-03-06  7:49                 ` [Qemu-devel] " Liu, Jinsong
2012-03-06 10:14                   ` Jan Kiszka
2012-03-09 18:27                     ` Liu, Jinsong
2012-03-09 18:56                       ` [Qemu-devel] " Jan Kiszka
2012-03-09 19:09                         ` Liu, Jinsong
2012-03-09 20:52                           ` Jan Kiszka
2012-03-10  1:07                             ` Andreas Färber
2012-03-11 18:54                             ` Liu, Jinsong
2012-03-12 17:21                             ` Eduardo Habkost
2012-03-25  8:51                               ` Liu, Jinsong
2012-03-09 19:29                       ` Liu, Jinsong
     [not found]                       ` <4F67B4C9.3010502@redhat.com>
     [not found]                         ` <DE8DF0795D48FD4CA783C40EC82923350F7D2F@SHSMSX101.ccr.corp.intel.com>
2012-03-20 13:33                           ` [Qemu-devel] " Eduardo Habkost
2012-03-23  3:49                             ` Liu, Jinsong
2012-03-23 13:46                               ` Eduardo Habkost
2012-03-23 14:17                                 ` Liu, Jinsong
2012-04-19 20:03                                   ` Eduardo Habkost
2012-04-20 10:12                                     ` Jan Kiszka
2012-04-20 15:00                                       ` Eduardo Habkost
2012-04-20 15:19                                         ` [Qemu-devel] " Jan Kiszka
2012-04-20 15:36                                           ` Eduardo Habkost
2012-04-21  7:23                                             ` Jan Kiszka
2012-04-23 14:48                                               ` Eduardo Habkost
2012-04-23 16:31                                                 ` Jan Kiszka [this message]
2012-04-23 20:02                                                   ` Eduardo Habkost
2012-04-24 16:06                                                     ` Jan Kiszka
2012-04-24 17:19                                                       ` [Qemu-devel] " Eduardo Habkost
2012-05-07 18:21                                                         ` Semantics of "-cpu host" (was Re: [Qemu-devel] [PATCH 2/2] Expose tsc deadline timer cpuid to guest) Eduardo Habkost
2012-05-08  0:58                                                           ` Semantics of "-cpu host" (was " Alexander Graf
2012-05-08 20:14                                                             ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Eduardo Habkost
2012-05-08 22:07                                                               ` Alexander Graf
2012-05-09  8:14                                                                 ` Semantics of "-cpu host" (was " Gleb Natapov
2012-05-09  8:42                                                                   ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-09  8:51                                                                     ` Gleb Natapov
2012-05-09  9:05                                                                       ` Alexander Graf
2012-05-09  9:38                                                                         ` Gleb Natapov
2012-05-09  9:54                                                                           ` Alexander Graf
2012-05-09 19:38                                                                           ` Eduardo Habkost
2012-05-09 20:30                                                                             ` Alexander Graf
2012-05-10 12:53                                                                             ` Semantics of "-cpu host" (was " Gleb Natapov
2012-05-10 13:21                                                                               ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-10 13:39                                                                                 ` Gleb Natapov
2012-05-10 14:12                                                                                   ` Eduardo Habkost
2012-05-09  7:16                                                           ` Andre Przywara
2012-06-14 19:02                                                         ` [Qemu-devel] [PATCH 2/2] Expose tsc deadline timer cpuid to guest Liu, Jinsong
2012-06-14 19:12                                                           ` Eduardo Habkost
2012-06-14 19:18                                                             ` Liu, Jinsong

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=4F9583DD.10807@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jinsong.liu@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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).