qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Huang Ying <ying.huang@intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Avi Kivity <avi@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH v3 12/21] kvm: x86: Drop MCE MSRs write back restrictions
Date: Wed, 05 Jan 2011 10:06:22 +0100	[thread overview]
Message-ID: <4D24348E.8050109@web.de> (raw)
In-Reply-To: <1294216431.22308.372.camel@yhuang-dev>

[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]

Am 05.01.2011 09:33, Huang Ying wrote:
> On Wed, 2011-01-05 at 16:07 +0800, Jan Kiszka wrote:
>> Am 05.01.2011 07:42, Huang Ying wrote:
>>> On Tue, 2011-01-04 at 16:32 +0800, Jan Kiszka wrote:
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> There is no need to restrict writing back MCE MSRs to reset or full
>>>> state updates as setting their values has no side effects.
>>>
>>> Sorry for late.
>>
>> Don't worry.
>>
>>>
>>> The MCE MSRs contents is sticky for warm reset except MCG_STATUS, so
>>> their content should be kept.  And the following sequence may set
>>> uncorrected value in MCE registers.
>>>
>>> savevm -> loadvm -> (OS clear MCE registers) -> reset -> (MCE registers
>>> has new (uncorrected) value)
>>
>> Sorry, I can't follow. Unless I miss some subtle detail, the question is
>> not when we transfer the mcg_* CPUState fields to the kernel, but when
>> and how we manipulate them in user space, e.g. on reset. Where are those
>> fields touched incorrectly between get and put msrs so that we cannot
>> write them back?
> 
> If my understanding is correct, MSRs are not saved to user space
> (env->mce_banks) during reset in current code.  So if all MCE MSRs are
> restored to kernel, their user space contents from previous loadvm may
> be put into kernel after reset.

Ah, good point! We need

diff --git a/vl.c b/vl.c
index 1958e01..23d4169 100644
--- a/vl.c
+++ b/vl.c
@@ -1353,6 +1353,7 @@ static void main_loop(void)
         }
         if (qemu_reset_requested()) {
             pause_all_vcpus();
+            cpu_synchronize_all_states();
             qemu_system_reset();
             resume_all_vcpus();
         }

and corresponding (sigh...) qemu-kvm patch. Will post them.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2011-01-05  9:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04  8:32 [Qemu-devel] [PATCH v3 00/21] [uq/master] Prepare for more qemu-kvm merging Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 01/21] kvm: Fix coding style violations Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 02/21] kvm: Drop return value of kvm_cpu_exec Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 03/21] kvm: Stop on all fatal exit reasons Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 04/21] kvm: Improve reporting of fatal errors Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 05/21] x86: Optionally dump code bytes on cpu_dump_state Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 06/21] kvm: x86: Align kvm_arch_put_registers code with comment Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 07/21] kvm: x86: Prepare kvm_get_mp_state for in-kernel irqchip Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 08/21] kvm: x86: Remove redundant mp_state initialization Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 09/21] kvm: x86: Fix xcr0 reset mismerge Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 10/21] kvm: x86: Refactor msr_star/hsave_pa setup and checks Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 11/21] kvm: x86: Reset paravirtual MSRs Jan Kiszka
2011-01-04 11:06   ` [Qemu-devel] " Glauber Costa
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 12/21] kvm: x86: Drop MCE MSRs write back restrictions Jan Kiszka
2011-01-05  6:42   ` [Qemu-devel] " Huang Ying
2011-01-05  8:07     ` Jan Kiszka
2011-01-05  8:33       ` Huang Ying
2011-01-05  9:06         ` Jan Kiszka [this message]
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 13/21] kvm: Eliminate KVMState arguments Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 14/21] kvm: x86: Fix !CONFIG_KVM_PARA build Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 15/21] kvm: x86: Introduce kvmclock device to save/restore its state Jan Kiszka
2011-01-04 11:08   ` [Qemu-devel] " Glauber Costa
2011-01-04 11:34     ` Jan Kiszka
2011-01-04 11:43       ` Glauber Costa
2011-01-04 11:45         ` Jan Kiszka
2011-01-04 11:48           ` Glauber Costa
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 16/21] kvm: Drop smp_cpus argument from init functions Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 17/21] kvm: Consolidate must-have capability checks Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 18/21] kvm: x86: Rework identity map and TSS setup for larger BIOS sizes Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 19/21] kvm: Flush coalesced mmio buffer on IO window exits Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 20/21] kvm: Do not use qemu_fair_mutex Jan Kiszka
2011-01-04  8:32 ` [Qemu-devel] [PATCH v3 21/21] kvm: x86: Implicitly clear nmi_injected/pending on reset Jan Kiszka
2011-01-05 12:18 ` [Qemu-devel] [PATCH 11.5/21] Synchronize VCPU states before reset Jan Kiszka
2011-01-05 12:28 ` [Qemu-devel] [PATCH 22/21] kvm: x86: Only read/write MSR_KVM_ASYNC_PF_EN if supported Jan Kiszka
2011-01-05 16:32 ` [Qemu-devel] Re: [PATCH v3 00/21] [uq/master] Prepare for more qemu-kvm merging 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=4D24348E.8050109@web.de \
    --to=jan.kiszka@web.de \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ying.huang@intel.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).