From: Alexander Graf <agraf@suse.de>
To: QEMU-devel Developers <qemu-devel@nongnu.org>
Cc: peter.maydell@linaro.org, Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 07/17] s390x: Enable s390x-softmmu target
Date: Fri, 15 Apr 2011 17:32:48 +0200 [thread overview]
Message-ID: <1302881578-5357-8-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1302881578-5357-1-git-send-email-agraf@suse.de>
This patch adds some code paths for running s390x guest OSs without the
need for KVM.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
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)
+{
+}
--
1.6.0.2
next prev parent reply other threads:[~2011-04-15 15:33 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-15 15:32 [Qemu-devel] [PATCH 00/17] s390x emulation support v4 Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 01/17] tcg: extend max tcg opcodes on 32bit Alexander Graf
2011-04-18 18:42 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 02/17] s390x: s390x-linux-user support Alexander Graf
2011-04-18 11:38 ` Riku Voipio
2011-04-18 12:06 ` Alexander Graf
2011-04-18 12:19 ` Riku Voipio
2011-04-18 13:21 ` Jan-Simon Möller
2011-04-18 13:31 ` Alexander Graf
2011-04-18 13:36 ` Aurelien Jarno
2011-04-18 13:42 ` Alexander Graf
2011-04-18 13:54 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 03/17] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-04-18 16:32 ` Riku Voipio
2011-04-18 21:11 ` Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 04/17] linux-user: add s390x to llseek list Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 05/17] kvm: add kvm stub for arch specific stuff Alexander Graf
2011-04-18 18:34 ` Aurelien Jarno
2011-05-03 14:17 ` Alexander Graf
2011-05-03 14:57 ` Jan Kiszka
2011-05-04 5:19 ` Alexander Graf
2011-05-04 8:31 ` Jan Kiszka
2011-05-04 8:40 ` Alexander Graf
2011-05-04 8:43 ` Jan Kiszka
2011-05-04 8:53 ` Alexander Graf
2011-05-03 15:05 ` Peter Maydell
2011-04-15 15:32 ` [Qemu-devel] [PATCH 06/17] s390x: Prepare cpu.h for emulation Alexander Graf
2011-04-18 18:55 ` Aurelien Jarno
2011-04-15 15:32 ` Alexander Graf [this message]
2011-04-18 18:56 ` [Qemu-devel] [PATCH 07/17] s390x: Enable s390x-softmmu target Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 08/17] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-04-18 19:01 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 09/17] s390x: virtio machine storage keys Alexander Graf
2011-04-18 19:02 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 10/17] s390x: keep hint on virtio managing size Alexander Graf
2011-04-18 19:06 ` Aurelien Jarno
2011-04-18 21:03 ` Alexander Graf
2011-04-20 10:21 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulation Alexander Graf
2011-04-20 10:38 ` Aurelien Jarno
2011-05-04 4:57 ` Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 12/17] s390x: Implement opcode helpers Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 13/17] s390x: Adjust internal kvm code Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 14/17] s390x: translate engine for s390x CPU Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 15/17] s390x: Adjust GDB stub Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 16/17] s390x: remove compatibility cc field Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 17/17] s390x: build s390x by default Alexander Graf
2011-04-27 14:35 ` [Qemu-devel] [PATCH 00/17] s390x emulation support v4 Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302881578-5357-8-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).