From patchwork Sat Jun 9 16:19:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 163949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 299BAB6FD1 for ; Sun, 10 Jun 2012 03:45:14 +1000 (EST) Received: from localhost ([::1]:57493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdOP2-0005U5-Da for incoming@patchwork.ozlabs.org; Sat, 09 Jun 2012 12:20:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdOOR-00047l-A8 for qemu-devel@nongnu.org; Sat, 09 Jun 2012 12:20:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SdOOP-0003UT-6T for qemu-devel@nongnu.org; Sat, 09 Jun 2012 12:20:02 -0400 Received: from mail-ee0-f45.google.com ([74.125.83.45]:35454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdOOO-0003KN-Kx for qemu-devel@nongnu.org; Sat, 09 Jun 2012 12:20:01 -0400 Received: by mail-ee0-f45.google.com with SMTP id d41so1793682eek.4 for ; Sat, 09 Jun 2012 09:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=3591DSF+wrDGad7JkUpaShMIjPqbqB1O7ZaT8MKSWlA=; b=IkMUPBqec4LjaP7wCQIBjMZXy7iV7MarcDACs+6xd+MTYRAlCmlUoqMOfH4mCqj2Cp PP2DW+g+r4ZsVlCPW58ZgFAeE6KMEw1CZ/+cV6d/s5BNI8y+0FkBgWGWUMIvRLNNb3Y8 3QJFCEUO1qaQMyA0Is+usvQLlyGWK82KWY0ZoAP0pZByp5QXDETqEWqNOLoKZBSrGf7x pLud/75o+mD0wlTJvgU+dUb2lUcWIOaNn/o9gtQDL2b3liGvR72v9M4vzwmK+BFbDutL u4wxt4hU+8x4Gd8kS7YrrTnmf0tF4K9CjkJGySa3ND0eyxXEj9F7NjueQuumaWdnVC1k 2Lag== Received: by 10.14.98.204 with SMTP id v52mr4649186eef.198.1339258799610; Sat, 09 Jun 2012 09:19:59 -0700 (PDT) Received: from localhost.localdomain (blueswirl.broker.freenet6.net. [2001:5c0:1400:b::d5a3]) by mx.google.com with ESMTPS id h53sm33625570eea.1.2012.06.09.09.19.58 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jun 2012 09:19:58 -0700 (PDT) From: Blue Swirl To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2012 16:19:15 +0000 Message-Id: <3cd11496df095d67f372bbe7f37124d13593e24a.1339258553.git.blauwirbel@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.45 Subject: [Qemu-devel] [PATCH 19/25] x86: avoid AREG0 for SMM helpers 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 Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl --- target-i386/Makefile.objs | 1 - target-i386/helper.h | 2 +- target-i386/smm_helper.c | 14 ++++---------- target-i386/translate.c | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/target-i386/Makefile.objs b/target-i386/Makefile.objs index 629b775..d9e57c0 100644 --- a/target-i386/Makefile.objs +++ b/target-i386/Makefile.objs @@ -7,4 +7,3 @@ obj-$(CONFIG_LINUX_USER) += ioport-user.o obj-$(CONFIG_BSD_USER) += ioport-user.o $(obj)/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS) -$(obj)/smm_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS) diff --git a/target-i386/helper.h b/target-i386/helper.h index 601b8dd..ec7edca 100644 --- a/target-i386/helper.h +++ b/target-i386/helper.h @@ -71,7 +71,7 @@ DEF_HELPER_1(set_inhibit_irq, void, env) DEF_HELPER_1(reset_inhibit_irq, void, env) DEF_HELPER_2(boundw, void, tl, int) DEF_HELPER_2(boundl, void, tl, int) -DEF_HELPER_0(rsm, void) +DEF_HELPER_1(rsm, void, env) DEF_HELPER_1(into, void, int) DEF_HELPER_1(cmpxchg8b, void, tl) #ifdef TARGET_X86_64 diff --git a/target-i386/smm_helper.c b/target-i386/smm_helper.c index bc1bfa2..8b04eb2 100644 --- a/target-i386/smm_helper.c +++ b/target-i386/smm_helper.c @@ -18,18 +18,17 @@ */ #include "cpu.h" -#include "dyngen-exec.h" #include "helper.h" /* SMM support */ #if defined(CONFIG_USER_ONLY) -void do_smm_enter(CPUX86State *env1) +void do_smm_enter(CPUX86State *env) { } -void helper_rsm(void) +void helper_rsm(CPUX86State *env) { } @@ -41,15 +40,11 @@ void helper_rsm(void) #define SMM_REVISION_ID 0x00020000 #endif -void do_smm_enter(CPUX86State *env1) +void do_smm_enter(CPUX86State *env) { target_ulong sm_state; SegmentCache *dt; int i, offset; - CPUX86State *saved_env; - - saved_env = env; - env = env1; qemu_log_mask(CPU_LOG_INT, "SMM: enter\n"); log_cpu_state_mask(CPU_LOG_INT, env, X86_DUMP_CCOP); @@ -180,10 +175,9 @@ void do_smm_enter(CPUX86State *env1) cpu_x86_update_cr4(env, 0); env->dr[7] = 0x00000400; CC_OP = CC_OP_EFLAGS; - env = saved_env; } -void helper_rsm(void) +void helper_rsm(CPUX86State *env) { target_ulong sm_state; int i, offset; diff --git a/target-i386/translate.c b/target-i386/translate.c index 126a531..2ea52ca 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -7700,7 +7700,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) goto illegal_op; gen_update_cc_op(s); gen_jmp_im(s->pc - s->cs_base); - gen_helper_rsm(); + gen_helper_rsm(cpu_env); gen_eob(s); break; case 0x1b8: /* SSE4.2 popcnt */