From patchwork Fri Apr 15 15:32:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 91406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7A84CB6F1E for ; Sat, 16 Apr 2011 01:37:52 +1000 (EST) Received: from localhost ([::1]:33630 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAl5h-0000LN-Ih for incoming@patchwork.ozlabs.org; Fri, 15 Apr 2011 11:37:49 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAl1B-0001O9-DP for qemu-devel@nongnu.org; Fri, 15 Apr 2011 11:33:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAl13-0003pf-IY for qemu-devel@nongnu.org; Fri, 15 Apr 2011 11:33:09 -0400 Received: from cantor.suse.de ([195.135.220.2]:40833 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAl13-0003p2-8O for qemu-devel@nongnu.org; Fri, 15 Apr 2011 11:33:01 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id E659074609; Fri, 15 Apr 2011 17:32:59 +0200 (CEST) From: Alexander Graf To: QEMU-devel Developers Date: Fri, 15 Apr 2011 17:32:48 +0200 Message-Id: <1302881578-5357-8-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1302881578-5357-1-git-send-email-agraf@suse.de> References: <1302881578-5357-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.2 Cc: peter.maydell@linaro.org, Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH 07/17] s390x: Enable s390x-softmmu target 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 This patch adds some code paths for running s390x guest OSs without the need for KVM. Signed-off-by: Alexander Graf --- v3 -> v4: - declare non-working when EXT is masked - remove obsolete cpu_halted --- cpu-exec.c | 8 ++++++++ target-s390x/exec.h | 11 ++++++++++- target-s390x/helper.c | 4 ++++ 3 files changed, 22 insertions(+), 1 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 5d6c9a8..d57afef 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -346,6 +346,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 @@ -560,6 +562,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..7a87fff 100644 --- a/target-s390x/exec.h +++ b/target-s390x/exec.h @@ -31,7 +31,16 @@ register struct CPUS390XState *env asm(AREG0); static inline int cpu_has_work(CPUState *env) { - return env->interrupt_request & CPU_INTERRUPT_HARD; // guess + return ((env->interrupt_request & CPU_INTERRUPT_HARD) && + (env->psw.mask & PSW_MASK_EXT)); +} + +static inline void regs_to_env(void) +{ +} + +static inline void env_to_regs(void) +{ } static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock* tb) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 4a5297b..629dfd9 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -82,3 +82,7 @@ int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong address, int rw, return 0; } #endif /* CONFIG_USER_ONLY */ + +void do_interrupt (CPUState *env) +{ +}