From patchwork Mon Feb 22 21:26:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 81300 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 o1MLS9wu017525 for ; Mon, 22 Feb 2010 21:28:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673Ab0BVV2F (ORCPT ); Mon, 22 Feb 2010 16:28:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65403 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754603Ab0BVV15 (ORCPT ); Mon, 22 Feb 2010 16:27:57 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1MLRndo004429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Feb 2010 16:27:49 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1MLRmkm019204; Mon, 22 Feb 2010 16:27:49 -0500 Received: from amt.cnet (vpn-11-163.rdu.redhat.com [10.11.11.163]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o1MLRl5B016404; Mon, 22 Feb 2010 16:27:47 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 360A966E0AC; Mon, 22 Feb 2010 18:27:05 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o1MLR18a000785; Mon, 22 Feb 2010 18:27:01 -0300 From: Marcelo Tosatti To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Jan Kiszka , Avi Kivity Subject: [PATCH 2/8] kvm: Fix eflags corruption in kvm mode Date: Mon, 22 Feb 2010 18:26:44 -0300 Message-Id: <14dcc3e2ac52d7a2a1cfe2e54c332d8042485a39.1266874009.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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]); Mon, 22 Feb 2010 21:28:09 +0000 (UTC) diff --git a/cpu-exec.c b/cpu-exec.c index 6a290fd..4029ea2 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -228,11 +228,13 @@ int cpu_exec(CPUState *env1) env = env1; #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;