From patchwork Tue Mar 15 11:26:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 86962 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 D4EF7B6EF0 for ; Tue, 15 Mar 2011 22:49:06 +1100 (EST) Received: from localhost ([127.0.0.1]:45120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzSkF-000790-9K for incoming@patchwork.ozlabs.org; Tue, 15 Mar 2011 07:48:59 -0400 Received: from [140.186.70.92] (port=35113 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzSOf-0000xR-5n for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:26:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzSOb-0004Ae-QU for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:26:41 -0400 Received: from david.siemens.de ([192.35.17.14]:18187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzSOb-0004A5-Do for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:26:37 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id p2FBQa0p010899; Tue, 15 Mar 2011 12:26:36 +0100 Received: from mchn199C.mchp.siemens.de ([146.254.215.103]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p2FBQVg3000888; Tue, 15 Mar 2011 12:26:36 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Tue, 15 Mar 2011 12:26:20 +0100 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.14 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH v2 09/20] kvm: Mark VCPU state dirty on creation 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 This avoids that early cpu_synchronize_state calls try to retrieve an uninitialized state from the kernel. That even causes a deadlock if io-thread is enabled. Signed-off-by: Jan Kiszka --- kvm-all.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 25ab545..36553fe 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -211,6 +211,7 @@ int kvm_init_vcpu(CPUState *env) env->kvm_fd = ret; env->kvm_state = s; + env->kvm_vcpu_dirty = 1; mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); if (mmap_size < 0) {