public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 04/19] qemu-kvm: x86: Drop MSR reset
Date: Thu, 05 May 2011 11:16:27 +0300	[thread overview]
Message-ID: <4DC25CDB.9060805@redhat.com> (raw)
In-Reply-To: <4DC25BC5.9090801@siemens.com>

On 05/05/2011 11:11 AM, Jan Kiszka wrote:
> On 2011-05-05 10:08, Avi Kivity wrote:
> >  On 05/04/2011 10:43 PM, Jan Kiszka wrote:
> >>  From: Jan Kiszka<jan.kiszka@siemens.com>
> >>
> >>  Paravirtual MSRs are properly cleared on reset now, and blindly clearing
> >>  the rest is questionable anyway (better address those one by one,
> >>  re-initializing their backing CPU state fields).
> >>
> >
> >  This can introduce a regression when new paravirtual MSRs are added.
>
> You mean MSRs already included or future ones?

Future ones.

> >   So
> >  we either need to port this, or query the reset state from the kernel
> >  immediately after creating the vcpu and saving it.
>
> Can't completely follow what you mean.
>
> My general point remains: Every MSR requires individual care, not blind
> overwriting like qemu-kvm does. So the person contributing a new MSR,
> real or pv, has to tackle this aspect, and we need to review the code in
> this regard.

It's a trick to avoid needing individual care.

1. Call KVM_CREATE_VCPU.  This causes all MSRs to be initialized to 
their power-on reset values.
2. Issue KVM_GET_MSR_LIST, and then KVM_GET_MSRS to read all MSRs.  
Stash them all in safe places - the ones known to qemu but also the 
unknown ones.  Qemu may use its own values for the MSRs it knows about 
(for example if different cpu models have different power-on values)
3. On reset, issue KVM_SET_MSRS with the MSR values obtained in step 2.

The result is forward and backwards compatibility without lockstepping 
qemu and kvm.

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


  reply	other threads:[~2011-05-05  8:16 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 19:43 [PATCH 00/19] qemu-kvm: Cleanup and switch to upstream - Part I Jan Kiszka
2011-05-04 19:43 ` [PATCH 01/19] qemu-kvm: Switch to upstream mp_state functions Jan Kiszka
2011-05-04 19:43 ` [PATCH 02/19] qemu-kvm: x86: Use upstream kvmclock device Jan Kiszka
2011-05-04 19:43 ` [PATCH 03/19] Revert "introduce VMSTATE_U64" Jan Kiszka
2011-05-04 19:43 ` [PATCH 04/19] qemu-kvm: x86: Drop MSR reset Jan Kiszka
2011-05-05  8:08   ` Avi Kivity
2011-05-05  8:11     ` Jan Kiszka
2011-05-05  8:16       ` Avi Kivity [this message]
2011-05-05  8:27         ` Jan Kiszka
2011-05-05  8:33           ` Avi Kivity
2011-05-05  8:44             ` Jan Kiszka
2011-05-05  8:53               ` Avi Kivity
2011-05-05  9:32                 ` Jan Kiszka
2011-05-05 10:22                   ` Avi Kivity
2011-05-05 10:36                     ` Jan Kiszka
2011-05-05 11:57                       ` Avi Kivity
2011-05-05 11:22                   ` Gleb Natapov
2011-05-05 11:58                     ` Avi Kivity
2011-05-05 12:23                       ` Gleb Natapov
2011-05-05 12:42                         ` Jan Kiszka
2011-05-05 13:33                     ` Marcelo Tosatti
2011-05-05 18:08                       ` Gleb Natapov
2011-05-04 19:43 ` [PATCH 05/19] qemu-kvm: Use upstream VCPU reset services Jan Kiszka
2011-05-04 19:43 ` [PATCH 06/19] qemu-kvm: Use upstream vcpu initialization Jan Kiszka
2011-05-04 19:43 ` [PATCH 07/19] qemu-kvm: Start using qemu-thread services Jan Kiszka
2011-05-04 19:43 ` [PATCH 08/19] qemu-kvm: Use upstream kvm_arch_get/put_registers Jan Kiszka
2011-05-04 19:43 ` [PATCH 09/19] qemu-kvm: Use upstream state synchronization services Jan Kiszka
2011-05-04 19:43 ` [PATCH 10/19] qemu-kvm: Drop remaining libkvm fragments Jan Kiszka
2011-05-04 19:43 ` [PATCH 11/19] qemu-kvm: Drop some more unused code Jan Kiszka
2011-05-04 19:43 ` [PATCH 12/19] qemu-kvm: Drop some obsolete/unused fields from kvm_context Jan Kiszka
2011-05-04 19:43 ` [PATCH 13/19] qemu-kvm: Refactor in-kernel irqchip and pit control Jan Kiszka
2011-05-04 19:43 ` [PATCH 14/19] qemu-kvm: Fold kvm_create into kvm_create_context Jan Kiszka
2011-05-04 19:43 ` [PATCH 15/19] qemu-kvm: Fold kvm_arch_qemu_create_context into kvm_arch_create Jan Kiszka
2011-05-04 19:43 ` [PATCH 16/19] qemu-kvm: Push PIT reinjection control into x86 code Jan Kiszka
2011-05-04 19:43 ` [PATCH 17/19] qemu-kvm: Replace kvm_show_regs/code with cpu_dump_state Jan Kiszka
2011-05-04 19:43 ` [PATCH 18/19] qemu-kvm: Fold kvm_init_coalesced_mmio into kvm_create_context Jan Kiszka
2011-05-04 19:43 ` [PATCH 19/19] qemu-kvm: x86: Use kvm_arch_init Jan Kiszka
2011-05-05  8:22 ` [PATCH 00/19] qemu-kvm: Cleanup and switch to upstream - Part I Avi Kivity
2011-05-05  8:29   ` Jan Kiszka
2011-05-06 13:51 ` Marcelo Tosatti

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=4DC25CDB.9060805@redhat.com \
    --to=avi@redhat.com \
    --cc=jan.kiszka@siemens.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