From patchwork Thu Apr 2 14:21:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 457690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CABD214007F for ; Fri, 3 Apr 2015 01:22:20 +1100 (AEDT) Received: from localhost ([::1]:58629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydg0g-0005DE-Vs for incoming@patchwork.ozlabs.org; Thu, 02 Apr 2015 10:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydg06-00048U-KJ for qemu-devel@nongnu.org; Thu, 02 Apr 2015 10:21:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ydg00-0002tL-HH for qemu-devel@nongnu.org; Thu, 02 Apr 2015 10:21:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydg00-0002tD-CH for qemu-devel@nongnu.org; Thu, 02 Apr 2015 10:21:36 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id E13322B7857 for ; Thu, 2 Apr 2015 14:21:35 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-40.ams2.redhat.com [10.36.112.40]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t32ELW7n015458 for ; Thu, 2 Apr 2015 10:21:34 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 2 Apr 2015 16:21:26 +0200 Message-Id: <1427984491-23475-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1427984491-23475-1-git-send-email-pbonzini@redhat.com> References: <1427984491-23475-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/6] target-i386: save 64-bit CR3 in 64-bit SMM state save area X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The x86_64 CR3 register is 64 bits wide, save all of them! Signed-off-by: Paolo Bonzini --- target-i386/smm_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/smm_helper.c b/target-i386/smm_helper.c index 58051d3..c62f468 100644 --- a/target-i386/smm_helper.c +++ b/target-i386/smm_helper.c @@ -101,7 +101,7 @@ void do_smm_enter(X86CPU *cpu) stl_phys(cs->as, sm_state + 0x7f60, env->dr[7]); stl_phys(cs->as, sm_state + 0x7f48, env->cr[4]); - stl_phys(cs->as, sm_state + 0x7f50, env->cr[3]); + stq_phys(cs->as, sm_state + 0x7f50, env->cr[3]); stl_phys(cs->as, sm_state + 0x7f58, env->cr[0]); stl_phys(cs->as, sm_state + 0x7efc, SMM_REVISION_ID); @@ -236,7 +236,7 @@ void helper_rsm(CPUX86State *env) env->dr[7] = ldl_phys(cs->as, sm_state + 0x7f60); cpu_x86_update_cr4(env, ldl_phys(cs->as, sm_state + 0x7f48)); - cpu_x86_update_cr3(env, ldl_phys(cs->as, sm_state + 0x7f50)); + cpu_x86_update_cr3(env, ldq_phys(cs->as, sm_state + 0x7f50)); cpu_x86_update_cr0(env, ldl_phys(cs->as, sm_state + 0x7f58)); for (i = 0; i < 6; i++) {