提交 bcec36ea 编写于 作者: A Alexander Graf 提交者: Aurelien Jarno

s390x: Prepare cpu.h for emulation

We need to add some more logic to the CPU description to leverage emulation
of an s390x CPU. This patch adds all the required helpers, fields in CPUState
and constant definitions required for user and system emulation.
Signed-off-by: NAlexander Graf <agraf@suse.de>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 7b59220e
...@@ -82,7 +82,7 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr) ...@@ -82,7 +82,7 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr)
return ipi_states[cpu_addr]; return ipi_states[cpu_addr];
} }
int s390_virtio_hypercall(CPUState *env) int s390_virtio_hypercall(CPUState *env, uint64_t mem_, uint64_t hypercall)
{ {
int r = 0, i; int r = 0, i;
target_ulong mem = env->regs[2]; target_ulong mem = env->regs[2];
......
此差异已折叠。
...@@ -182,8 +182,8 @@ int kvm_arch_process_async_events(CPUState *env) ...@@ -182,8 +182,8 @@ int kvm_arch_process_async_events(CPUState *env)
return 0; return 0;
} }
static void kvm_s390_interrupt_internal(CPUState *env, int type, uint32_t parm, void kvm_s390_interrupt_internal(CPUState *env, int type, uint32_t parm,
uint64_t parm64, int vm) uint64_t parm64, int vm)
{ {
struct kvm_s390_interrupt kvmint; struct kvm_s390_interrupt kvmint;
int r; int r;
...@@ -218,7 +218,7 @@ void kvm_s390_virtio_irq(CPUState *env, int config_change, uint64_t token) ...@@ -218,7 +218,7 @@ void kvm_s390_virtio_irq(CPUState *env, int config_change, uint64_t token)
token, 1); token, 1);
} }
static void kvm_s390_interrupt(CPUState *env, int type, uint32_t code) void kvm_s390_interrupt(CPUState *env, int type, uint32_t code)
{ {
kvm_s390_interrupt_internal(env, type, code, 0, 0); kvm_s390_interrupt_internal(env, type, code, 0, 0);
} }
...@@ -237,7 +237,8 @@ static void setcc(CPUState *env, uint64_t cc) ...@@ -237,7 +237,8 @@ static void setcc(CPUState *env, uint64_t cc)
env->psw.mask |= (cc & 3) << 44; env->psw.mask |= (cc & 3) << 44;
} }
static int sclp_service_call(CPUState *env, struct kvm_run *run, uint16_t ipbh0) static int kvm_sclp_service_call(CPUState *env, struct kvm_run *run,
uint16_t ipbh0)
{ {
uint32_t sccb; uint32_t sccb;
uint64_t code; uint64_t code;
...@@ -287,7 +288,7 @@ static int handle_priv(CPUState *env, struct kvm_run *run, uint8_t ipa1) ...@@ -287,7 +288,7 @@ static int handle_priv(CPUState *env, struct kvm_run *run, uint8_t ipa1)
dprintf("KVM: PRIV: %d\n", ipa1); dprintf("KVM: PRIV: %d\n", ipa1);
switch (ipa1) { switch (ipa1) {
case PRIV_SCLP_CALL: case PRIV_SCLP_CALL:
r = sclp_service_call(env, run, ipbh0); r = kvm_sclp_service_call(env, run, ipbh0);
break; break;
default: default:
dprintf("KVM: unknown PRIV: 0x%x\n", ipa1); dprintf("KVM: unknown PRIV: 0x%x\n", ipa1);
...@@ -300,12 +301,10 @@ static int handle_priv(CPUState *env, struct kvm_run *run, uint8_t ipa1) ...@@ -300,12 +301,10 @@ static int handle_priv(CPUState *env, struct kvm_run *run, uint8_t ipa1)
static int handle_hypercall(CPUState *env, struct kvm_run *run) static int handle_hypercall(CPUState *env, struct kvm_run *run)
{ {
int r;
cpu_synchronize_state(env); cpu_synchronize_state(env);
r = s390_virtio_hypercall(env); env->regs[2] = s390_virtio_hypercall(env, env->regs[2], env->regs[1]);
return r; return 0;
} }
static int handle_diag(CPUState *env, struct kvm_run *run, int ipb_code) static int handle_diag(CPUState *env, struct kvm_run *run, int ipb_code)
......
...@@ -36,7 +36,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf, ...@@ -36,7 +36,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
} }
} }
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].i); cpu_fprintf(f, "F%02d=%016" PRIx64, i, *(uint64_t *)&env->fregs[i]);
if ((i % 4) == 3) { if ((i % 4) == 3) {
cpu_fprintf(f, "\n"); cpu_fprintf(f, "\n");
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册