[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 13/27] target/s390x: proper cpu->be convertion in
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v1 13/27] target/s390x: proper cpu->be convertion in s390_store_status() |
Date: |
Mon, 18 Sep 2017 17:59:58 +0200 |
Necessary so TCG can also use it.
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/helper.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 09468f85fa..e44d54b932 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -267,17 +267,24 @@ int s390_store_status(S390CPU *cpu, hwaddr addr, bool
store_arch)
cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id, 1);
}
for (i = 0; i < 16; ++i) {
- *((uint64_t *)mem + i) = get_freg(&cpu->env, i)->ll;
+ *((uint64_t *)mem + i) = cpu_to_be64(get_freg(&cpu->env, i)->ll);
+ }
+ for (i = 0; i < 16; ++i) {
+ *((uint64_t *)(mem + 128) + i) = cpu_to_be64(cpu->env.regs[i]);
+ }
+ *((uint64_t *)(mem + 256)) = cpu_to_be64(get_psw_mask(&cpu->env));
+ *((uint64_t *)(mem + 264)) = cpu_to_be64(cpu->env.psw.addr);
+ *((uint32_t *)(mem + 280)) = cpu_to_be32(cpu->env.psa);
+ *((uint32_t *)(mem + 284)) = cpu_to_be32(cpu->env.fpc);
+ *((uint32_t *)(mem + 292)) = cpu_to_be32(cpu->env.todpr);
+ *((uint64_t *)(mem + 296)) = cpu_to_be64(cpu->env.cputm);
+ *((uint64_t *)(mem + 304)) = cpu_to_be64(ckc);
+ for (i = 0; i < 16; ++i) {
+ *((uint32_t *)(mem + 320) + i) = cpu_to_be32(cpu->env.aregs[i]);
+ }
+ for (i = 0; i < 16; ++i) {
+ *((uint64_t *)(mem + 384) + i) = cpu_to_be64(cpu->env.cregs[i]);
}
- memcpy(mem + 128, &cpu->env.regs, 128);
- memcpy(mem + 256, &cpu->env.psw, 16);
- memcpy(mem + 280, &cpu->env.psa, 4);
- memcpy(mem + 284, &cpu->env.fpc, 4);
- memcpy(mem + 292, &cpu->env.todpr, 4);
- memcpy(mem + 296, &cpu->env.cputm, 8);
- memcpy(mem + 304, &ckc, 8);
- memcpy(mem + 320, &cpu->env.aregs, 64);
- memcpy(mem + 384, &cpu->env.cregs, 128);
cpu_physical_memory_unmap(mem, len, 1, len);
--
2.13.5
- Re: [Qemu-devel] [PATCH v1 09/27] target/s390x: factor out handling of WAIT PSW into handle_wait(), (continued)
- [Qemu-devel] [PATCH v1 10/27] s390x/kvm: pass ipb directly into handle_sigp(), David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 11/27] s390x/kvm: generalize SIGP stop and restart interrupt injection, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 12/27] s390x/kvm: factor out storing of CPU status, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 15/27] s390x/kvm: drop two debug prints, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 13/27] target/s390x: proper cpu->be convertion in s390_store_status(),
David Hildenbrand <=
- [Qemu-devel] [PATCH v1 14/27] s390x/kvm: factor out storing of adtl CPU status, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 17/27] s390x/kvm: factor out actual handling of STOP interrupts, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 19/27] s390x/tcg: implement SIGP SENSE, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 21/27] s390x/tcg: implement SIGP EMERGENCY SIGNAL, David Hildenbrand, 2017/09/18
- [Qemu-devel] [PATCH v1 16/27] s390x/kvm: factor out SIGP code into sigp.c, David Hildenbrand, 2017/09/18