summaryrefslogtreecommitdiff
path: root/target-s390x/helper.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2009-12-05 12:44:26 +0100
committerAurelien Jarno <aurelien@aurel32.net>2009-12-05 17:36:05 +0100
commit10c339a07d42fcccbccd3f8a5e9c94ccb51fe3e4 (patch)
tree5f0a7c337caba4c87117bd6afe2c9682c1ce5ad0 /target-s390x/helper.c
parent6b02494d64a15476e26a6e8468623d01c4c75c58 (diff)
Add support for S390x system emulation
Let's enable the basics for system emulation so we can run virtual machines with KVM! Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-s390x/helper.c')
-rw-r--r--target-s390x/helper.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 4a198ae32f..4c2dc82115 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -27,6 +27,9 @@
#include "gdbstub.h"
#include "qemu-common.h"
+#include <linux/kvm.h>
+#include "kvm.h"
+
CPUS390XState *cpu_s390x_init(const char *cpu_model)
{
CPUS390XState *env;
@@ -60,3 +63,22 @@ void cpu_reset(CPUS390XState *env)
/* FIXME: reset vector? */
tlb_flush(env, 1);
}
+
+#ifndef CONFIG_USER_ONLY
+
+int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
+ int mmu_idx, int is_softmmu)
+{
+ target_ulong phys;
+ int prot;
+
+ /* XXX: implement mmu */
+
+ phys = address;
+ prot = PAGE_READ | PAGE_WRITE;
+
+ return tlb_set_page(env, address & TARGET_PAGE_MASK,
+ phys & TARGET_PAGE_MASK, prot,
+ mmu_idx, is_softmmu);
+}
+#endif /* CONFIG_USER_ONLY */