From patchwork Thu Mar 24 15:58:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 88225 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 3D9E0B6F89 for ; Fri, 25 Mar 2011 03:07:09 +1100 (EST) Received: from localhost ([127.0.0.1]:54619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2n3y-00048x-BG for incoming@patchwork.ozlabs.org; Thu, 24 Mar 2011 12:07:06 -0400 Received: from [140.186.70.92] (port=56390 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2mw9-0001Jv-IN for qemu-devel@nongnu.org; Thu, 24 Mar 2011 11:59:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2mw6-0005JX-5m for qemu-devel@nongnu.org; Thu, 24 Mar 2011 11:59:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:32872 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2mw5-0005IK-TD for qemu-devel@nongnu.org; Thu, 24 Mar 2011 11:58:58 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 5B3FE8891E; Thu, 24 Mar 2011 16:58:55 +0100 (CET) From: Alexander Graf To: QEMU-devel Developers Date: Thu, 24 Mar 2011 16:58:44 +0100 Message-Id: <1300982333-12802-9-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1300982333-12802-1-git-send-email-agraf@suse.de> References: <1300982333-12802-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH 08/17] s390x: Enable s390x-softmmu target 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 patch adds some code paths for running s390x guest OSs without the need for KVM. Signed-off-by: Alexander Graf --- cpu-exec.c | 8 ++++++++ target-s390x/exec.h | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 34eaedc..b113f8b 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -316,6 +316,8 @@ int cpu_exec(CPUState *env1) do_interrupt(env); #elif defined(TARGET_M68K) do_interrupt(0); +#elif defined(TARGET_S390X) + do_interrupt(env); #endif env->exception_index = -1; #endif @@ -524,6 +526,12 @@ int cpu_exec(CPUState *env1) do_interrupt(1); next_tb = 0; } +#elif defined(TARGET_S390X) && !defined(CONFIG_USER_ONLY) + if ((interrupt_request & CPU_INTERRUPT_HARD) && + (env->psw.mask & PSW_MASK_EXT)) { + do_interrupt(env); + next_tb = 0; + } #endif /* Don't use the cached interupt_request value, do_interrupt may have updated the EXITTB flag. */ diff --git a/target-s390x/exec.h b/target-s390x/exec.h index f7893f3..6fe64a6 100644 --- a/target-s390x/exec.h +++ b/target-s390x/exec.h @@ -34,6 +34,26 @@ static inline int cpu_has_work(CPUState *env) return env->interrupt_request & CPU_INTERRUPT_HARD; // guess } +static inline void regs_to_env(void) +{ +} + +static inline void env_to_regs(void) +{ +} + +static inline int cpu_halted(CPUState *env) +{ + if (!env->halted) { + return 0; + } + if (cpu_has_work(env)) { + env->halted = 0; + return 0; + } + return EXCP_HALTED; +} + static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock* tb) { env->psw.addr = tb->pc;