From patchwork Wed Jan 5 12:18:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 77589 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5245AB711B for ; Wed, 5 Jan 2011 23:19:46 +1100 (EST) Received: from localhost ([127.0.0.1]:41037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaSL9-0000Ik-SD for incoming@patchwork.ozlabs.org; Wed, 05 Jan 2011 07:19:43 -0500 Received: from [140.186.70.92] (port=56312 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaSKd-0000HU-8w for qemu-devel@nongnu.org; Wed, 05 Jan 2011 07:19:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaSKX-0001Ls-OM for qemu-devel@nongnu.org; Wed, 05 Jan 2011 07:19:11 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:40653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaSKX-0001Jq-Ge for qemu-devel@nongnu.org; Wed, 05 Jan 2011 07:19:05 -0500 Received: from smtp07.web.de ( [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 632C9192EF402; Wed, 5 Jan 2011 13:18:55 +0100 (CET) Received: from [88.65.255.1] (helo=mchn199C.mchp.siemens.de) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1PaSKN-0006o3-00; Wed, 05 Jan 2011 13:18:55 +0100 Message-ID: <4D2461AD.3060907@web.de> Date: Wed, 05 Jan 2011 13:18:53 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity , Marcelo Tosatti References: In-Reply-To: X-Enigmail-Version: 1.1.2 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX19/YobIDeLhuhA9VFMeKjrFt0x+J9OpNJkPk/OS O85f3RpRTnPKMRfYxPAP4DVZsP/xrWYAc9hn2sHSbphsqDRDdH QgmuEMIng= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Huang Ying Subject: [Qemu-devel] [PATCH 11.5/21] Synchronize VCPU states before reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka This is required to support keeping VCPU states across a system reset. If we do not read the current state before the reset, cpu_synchronize_all_post_reset may write back incorrect state information. The first user of this will be MCE MSR synchronization which currently works around the missing cpu_synchronize_all_states. Signed-off-by: Jan Kiszka --- This must be applied before "Drop MCE MSRs write back restrictions" (I don't want to resend the whole series for this). vl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 768dbf4..20e5dda 100644 --- a/vl.c +++ b/vl.c @@ -1422,6 +1422,7 @@ static void main_loop(void) } if (qemu_reset_requested()) { pause_all_vcpus(); + cpu_synchronize_all_states(); qemu_system_reset(); resume_all_vcpus(); }