From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Alexey Zaytsev <alexey.zaytsev@gmail.com>,
kvm <kvm@vger.kernel.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 2/2] Expose tsc deadline timer cpuid to guest
Date: Mon, 27 Feb 2012 18:18:36 +0100 [thread overview]
Message-ID: <4F4BBAEC.2040603@siemens.com> (raw)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923350B5F29@SHSMSX101.ccr.corp.intel.com>
On 2012-02-27 17:05, Liu, Jinsong wrote:
> Jan Kiszka wrote:
>> On 2012-01-07 19:23, Liu, Jinsong wrote:
>>> Jan Kiszka wrote:
>>>> On 2012-01-05 18:07, Liu, Jinsong wrote:
>>>>>> Sorry, it remains bogus to expose the tsc deadline timer feature
>>>>>> on machines < pc-1.1. That's just like we introduced kvmclock
>>>>>> only to pc-0.14 onward. The reason is that guest OSes so far
>>>>>> running on qemu-1.0 or older without deadline timer support must
>>>>>> not find that feature when being migrated to a host with qemu-1.1
>>>>>> in pc-1.0 compat mode. Yes, the user can explicitly disable it,
>>>>>> but that is not the idea of legacy machine models. They should
>>>>>> provide the very same environment that older qemu versions
>>>>>> offered.
>>>>>>
>>>>>
>>>>> Not quite clear about this point.
>>>>> Per my understanding, if a kvm guest running on an older qemu
>>>>> without tsc deadline timer support,
>>>>> then after migrate, the guest would still cannot find tsc deadline
>>>>> feature, no matter older or newer host/qemu/pc-xx it migrate to.
>>>>
>>>> What should prevent this? The feature flags are not part of the
>>>> vmstate. They are part of the vm configuration which is not migrated
>>>> but defined by starting qemu on the target host.
>>>>
>>>
>>> Thanks! understand this point ("They are part of the vm
>>> configuration which is not migrated but defined by starting qemu on
>>> the target host").
>>>
>>> But kvmclock example still cannot satisfy the purpose "guest running
>>> on old qemu/pc-0.13 without kvmclock support must not find kvmclock
>>> feature when being migrated to a host with new qemu/pc-0.13 compat
>>> mode". After migration, guest can possibily find kvmclock
>>> feature CPUID.0x40000001.KVM_FEATURE_CLOCKSOURCE: pc_init1(...,
>>> kvmclock_enabled) { pc_cpus_init(cpu_model); // the point to
>>> decide and expose cpuid features to guest
>>>
>>> if (kvmclock_enabled) { // the difference point between
>>> pc-0.13 vs. pc-0.14, related nothing to cpuid features.
>>> kvmclock_create(); } }
>>
>> Right, not a perfect example: the cpuid feature is not influenced by
>> this mechanism, only the fact if a kvmclock device (for save/restore)
>> should be created. I guess we ignored this back then, only focusing on
>> the more obvious issue of the addition device.
>>
>>>
>>> Seems currently there is no good way to satisfy "guest running on
>>> old qemu/pc-xx without feature A support must not find feature A
>>> when being migrated to a host with new qemu/pc-xx compat mode", i.e.
>>> considering
>>> * if running with '-cpu host' then migrate;
>>> * each time we add a new cpuid feature it need add one or more new
>>> machine model? is it necessary to bind pc-xx with cpuid feature?
>>> * logically cpuid features should better be controlled by cpu model,
>>> not by machine model.
>>
>> The compatibility machines define the possible cpu models. If I select
>
> How does machine define possible cpu models?
> cpu model defined by qemu option '-cpu ...', while machine model defined by '-machine ...'
>
>> pc-0.14, e.g. -cpu kvm64 should not give me features that 0.14 was not
>> exposing.
>>
>
> in such case, it's '-cpu kvm64' who take effect to decide what cpuid features would exposed to guest, not '-machine pc-0.14'.
>
> IMO, what our patch need to do is to expose a cpuid feature to guest (CPUID.01H:ECX.TSC_Deadline[bit 24]), it decided by cpu model, not machine model:
> pc_init1(..., cpu_model, ...)
> {
> pc_cpus_init(cpu_model); // this is the whole logic exposing cpuid features to guest
> ...
> }
>
> Do I misunderstanding something?
My point is that
qemu-version-A [-cpu whatever]
should provide the same VM as
qemu-version-B -machine pc-A [-cpu whatever]
specifically if you leave out the cpu specification.
So the compat machine could establish a feature mask (e.g. append some
"-tsc_deadline" in this case). But, indeed, we need a new channel for this.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
Avi Kivity <avi@redhat.com>, kvm <kvm@vger.kernel.org>,
Alexey Zaytsev <alexey.zaytsev@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Expose tsc deadline timer cpuid to guest
Date: Mon, 27 Feb 2012 18:18:36 +0100 [thread overview]
Message-ID: <4F4BBAEC.2040603@siemens.com> (raw)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923350B5F29@SHSMSX101.ccr.corp.intel.com>
On 2012-02-27 17:05, Liu, Jinsong wrote:
> Jan Kiszka wrote:
>> On 2012-01-07 19:23, Liu, Jinsong wrote:
>>> Jan Kiszka wrote:
>>>> On 2012-01-05 18:07, Liu, Jinsong wrote:
>>>>>> Sorry, it remains bogus to expose the tsc deadline timer feature
>>>>>> on machines < pc-1.1. That's just like we introduced kvmclock
>>>>>> only to pc-0.14 onward. The reason is that guest OSes so far
>>>>>> running on qemu-1.0 or older without deadline timer support must
>>>>>> not find that feature when being migrated to a host with qemu-1.1
>>>>>> in pc-1.0 compat mode. Yes, the user can explicitly disable it,
>>>>>> but that is not the idea of legacy machine models. They should
>>>>>> provide the very same environment that older qemu versions
>>>>>> offered.
>>>>>>
>>>>>
>>>>> Not quite clear about this point.
>>>>> Per my understanding, if a kvm guest running on an older qemu
>>>>> without tsc deadline timer support,
>>>>> then after migrate, the guest would still cannot find tsc deadline
>>>>> feature, no matter older or newer host/qemu/pc-xx it migrate to.
>>>>
>>>> What should prevent this? The feature flags are not part of the
>>>> vmstate. They are part of the vm configuration which is not migrated
>>>> but defined by starting qemu on the target host.
>>>>
>>>
>>> Thanks! understand this point ("They are part of the vm
>>> configuration which is not migrated but defined by starting qemu on
>>> the target host").
>>>
>>> But kvmclock example still cannot satisfy the purpose "guest running
>>> on old qemu/pc-0.13 without kvmclock support must not find kvmclock
>>> feature when being migrated to a host with new qemu/pc-0.13 compat
>>> mode". After migration, guest can possibily find kvmclock
>>> feature CPUID.0x40000001.KVM_FEATURE_CLOCKSOURCE: pc_init1(...,
>>> kvmclock_enabled) { pc_cpus_init(cpu_model); // the point to
>>> decide and expose cpuid features to guest
>>>
>>> if (kvmclock_enabled) { // the difference point between
>>> pc-0.13 vs. pc-0.14, related nothing to cpuid features.
>>> kvmclock_create(); } }
>>
>> Right, not a perfect example: the cpuid feature is not influenced by
>> this mechanism, only the fact if a kvmclock device (for save/restore)
>> should be created. I guess we ignored this back then, only focusing on
>> the more obvious issue of the addition device.
>>
>>>
>>> Seems currently there is no good way to satisfy "guest running on
>>> old qemu/pc-xx without feature A support must not find feature A
>>> when being migrated to a host with new qemu/pc-xx compat mode", i.e.
>>> considering
>>> * if running with '-cpu host' then migrate;
>>> * each time we add a new cpuid feature it need add one or more new
>>> machine model? is it necessary to bind pc-xx with cpuid feature?
>>> * logically cpuid features should better be controlled by cpu model,
>>> not by machine model.
>>
>> The compatibility machines define the possible cpu models. If I select
>
> How does machine define possible cpu models?
> cpu model defined by qemu option '-cpu ...', while machine model defined by '-machine ...'
>
>> pc-0.14, e.g. -cpu kvm64 should not give me features that 0.14 was not
>> exposing.
>>
>
> in such case, it's '-cpu kvm64' who take effect to decide what cpuid features would exposed to guest, not '-machine pc-0.14'.
>
> IMO, what our patch need to do is to expose a cpuid feature to guest (CPUID.01H:ECX.TSC_Deadline[bit 24]), it decided by cpu model, not machine model:
> pc_init1(..., cpu_model, ...)
> {
> pc_cpus_init(cpu_model); // this is the whole logic exposing cpuid features to guest
> ...
> }
>
> Do I misunderstanding something?
My point is that
qemu-version-A [-cpu whatever]
should provide the same VM as
qemu-version-B -machine pc-A [-cpu whatever]
specifically if you leave out the cpu specification.
So the compat machine could establish a feature mask (e.g. append some
"-tsc_deadline" in this case). But, indeed, we need a new channel for this.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-02-27 17:18 UTC|newest]
Thread overview: 100+ 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
2011-12-28 21:55 ` [Qemu-devel] " Liu, Jinsong
2012-01-04 16:48 ` Jan Kiszka
2012-01-04 16:48 ` [Qemu-devel] " Jan Kiszka
2012-01-05 20:07 ` Liu, Jinsong
2012-01-05 20:07 ` [Qemu-devel] " Liu, Jinsong
2012-01-05 20:34 ` Jan Kiszka
2012-01-05 20:34 ` [Qemu-devel] " Jan Kiszka
2012-01-07 18:23 ` Liu, Jinsong
2012-01-07 18:23 ` [Qemu-devel] " Liu, Jinsong
2012-01-08 21:24 ` Jan Kiszka
2012-01-08 21:24 ` [Qemu-devel] " Jan Kiszka
2012-02-27 16:05 ` Liu, Jinsong
2012-02-27 16:05 ` [Qemu-devel] " Liu, Jinsong
2012-02-27 17:18 ` Jan Kiszka [this message]
2012-02-27 17:18 ` Jan Kiszka
2012-02-28 10:30 ` Liu, Jinsong
2012-02-28 10:30 ` [Qemu-devel] " Liu, Jinsong
2012-03-06 7:49 ` Liu, Jinsong
2012-03-06 7:49 ` Liu, Jinsong
2012-03-06 10:14 ` Jan Kiszka
2012-03-06 10:14 ` Jan Kiszka
2012-03-09 18:27 ` Liu, Jinsong
2012-03-09 18:27 ` [Qemu-devel] " Liu, Jinsong
2012-03-09 18:56 ` Jan Kiszka
2012-03-09 18:56 ` Jan Kiszka
2012-03-09 19:09 ` Liu, Jinsong
2012-03-09 19:09 ` Liu, Jinsong
2012-03-09 20:52 ` Jan Kiszka
2012-03-09 20:52 ` Jan Kiszka
2012-03-10 1:07 ` Andreas Färber
2012-03-10 1:07 ` Andreas Färber
2012-03-11 18:54 ` Liu, Jinsong
2012-03-11 18:54 ` Liu, Jinsong
2012-03-12 17:21 ` Eduardo Habkost
2012-03-25 8:51 ` Liu, Jinsong
2012-03-25 8:51 ` [Qemu-devel] " Liu, Jinsong
2012-03-09 19:29 ` Liu, Jinsong
2012-03-09 19:29 ` [Qemu-devel] " Liu, Jinsong
2012-03-19 22:35 ` Rik van Riel
2012-03-20 12:53 ` Liu, Jinsong
2012-03-20 13:33 ` Eduardo Habkost
2012-03-20 13:33 ` Eduardo Habkost
2012-03-23 3:49 ` Liu, Jinsong
2012-03-23 3:49 ` Liu, Jinsong
2012-03-23 13:46 ` Eduardo Habkost
2012-03-23 13:46 ` Eduardo Habkost
2012-03-23 14:17 ` Liu, Jinsong
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
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-07 18:21 ` [Qemu-devel] Semantics of "-cpu host" (was " Eduardo Habkost
2012-05-08 0:58 ` Alexander Graf
2012-05-08 0:58 ` [Qemu-devel] " Alexander Graf
2012-05-08 20:14 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Eduardo Habkost
2012-05-08 20:14 ` [Qemu-devel] Semantics of "-cpu host" (was " Eduardo Habkost
2012-05-08 22:07 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-08 22:07 ` [Qemu-devel] Semantics of "-cpu host" (was " Alexander Graf
2012-05-09 8:14 ` Gleb Natapov
2012-05-09 8:14 ` [Qemu-devel] " Gleb Natapov
2012-05-09 8:42 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-09 8:42 ` [Qemu-devel] Semantics of "-cpu host" (was " Alexander Graf
2012-05-09 8:51 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Gleb Natapov
2012-05-09 8:51 ` [Qemu-devel] Semantics of "-cpu host" (was " Gleb Natapov
2012-05-09 9:05 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-09 9:05 ` [Qemu-devel] Semantics of "-cpu host" (was " Alexander Graf
2012-05-09 9:38 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Gleb Natapov
2012-05-09 9:38 ` [Qemu-devel] Semantics of "-cpu host" (was " Gleb Natapov
2012-05-09 9:54 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-09 9:54 ` [Qemu-devel] Semantics of "-cpu host" (was " Alexander Graf
2012-05-09 19:38 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Eduardo Habkost
2012-05-09 19:38 ` [Qemu-devel] Semantics of "-cpu host" (was " Eduardo Habkost
2012-05-09 20:30 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-09 20:30 ` [Qemu-devel] Semantics of "-cpu host" (was " Alexander Graf
2012-05-10 12:53 ` Gleb Natapov
2012-05-10 12:53 ` [Qemu-devel] " Gleb Natapov
2012-05-10 13:21 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Alexander Graf
2012-05-10 13:21 ` [Qemu-devel] Semantics of "-cpu host" (was " Alexander Graf
2012-05-10 13:39 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Gleb Natapov
2012-05-10 13:39 ` [Qemu-devel] Semantics of "-cpu host" (was " Gleb Natapov
2012-05-10 14:12 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Eduardo Habkost
2012-05-10 14:12 ` [Qemu-devel] Semantics of "-cpu host" (was " Eduardo Habkost
2012-05-09 7:16 ` Semantics of "-cpu host" (was Re: [Qemu-devel] " Andre Przywara
2012-05-09 7:16 ` [Qemu-devel] Semantics of "-cpu host" (was " 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:02 ` Liu, Jinsong
2012-06-14 19:12 ` Eduardo Habkost
2012-06-14 19:12 ` Eduardo Habkost
2012-06-14 19:18 ` Liu, Jinsong
2012-06-14 19:18 ` [Qemu-devel] " 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=4F4BBAEC.2040603@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=alexey.zaytsev@gmail.com \
--cc=avi@redhat.com \
--cc=jinsong.liu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.