From patchwork Tue Feb 23 14:54:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 81472 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1NEsa0F005963 for ; Tue, 23 Feb 2010 14:54:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752908Ab0BWOye (ORCPT ); Tue, 23 Feb 2010 09:54:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3979 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667Ab0BWOye (ORCPT ); Tue, 23 Feb 2010 09:54:34 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1NEsVnj006743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Feb 2010 09:54:31 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1NEsUVs016544; Tue, 23 Feb 2010 09:54:30 -0500 Received: from localhost.localdomain (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id C6D08250059; Tue, 23 Feb 2010 16:54:29 +0200 (IST) From: Avi Kivity To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH 1/1] kvm: Fix eflags corruption in kvm mode Date: Tue, 23 Feb 2010 16:54:29 +0200 Message-Id: <1266936869-9700-2-git-send-email-avi@redhat.com> In-Reply-To: <1266936869-9700-1-git-send-email-avi@redhat.com> References: <1266936869-9700-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 23 Feb 2010 14:54:37 +0000 (UTC) diff --git a/cpu-exec.c b/cpu-exec.c index af4595b..3246c9e 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -232,11 +232,13 @@ int cpu_exec(CPUState *env1) env_to_regs(); #if defined(TARGET_I386) - /* put eflags in CPU temporary format */ - CC_SRC = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C); - DF = 1 - (2 * ((env->eflags >> 10) & 1)); - CC_OP = CC_OP_EFLAGS; - env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C); + if (!kvm_enabled()) { + /* put eflags in CPU temporary format */ + CC_SRC = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C); + DF = 1 - (2 * ((env->eflags >> 10) & 1)); + CC_OP = CC_OP_EFLAGS; + env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C); + } #elif defined(TARGET_SPARC) #elif defined(TARGET_M68K) env->cc_op = CC_OP_FLAGS;