[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 35/37] target-ppc: enable virtio endian ambivalent su
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 35/37] target-ppc: enable virtio endian ambivalent support |
Date: |
Sun, 29 Jun 2014 20:00:10 +0300 |
From: Greg Kurz <address@hidden>
The device endianness is the cpu endianness at device reset time.
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
target-ppc/cpu.h | 2 ++
target-ppc/translate_init.c | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 08ae527..b64c652 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -29,6 +29,8 @@
#define TARGET_LONG_BITS 64
#define TARGET_PAGE_BITS 12
+#define TARGET_IS_BIENDIAN 1
+
/* Note that the official physical address space bits is 62-M where M
is implementation dependent. I've not looked up M for the set of
cpus we emulate at the system level. */
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index a3bb336..2ab2810 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9597,6 +9597,18 @@ static void ppc_cpu_reset(CPUState *s)
tlb_flush(s, 1);
}
+#ifndef CONFIG_USER_ONLY
+static bool ppc_cpu_is_big_endian(CPUState *cs)
+{
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ CPUPPCState *env = &cpu->env;
+
+ cpu_synchronize_state(cs);
+
+ return !msr_le;
+}
+#endif
+
static void ppc_cpu_initfn(Object *obj)
{
CPUState *cs = CPU(obj);
@@ -9692,6 +9704,9 @@ static void ppc_cpu_class_init(ObjectClass *oc, void
*data)
#else
cc->gdb_core_xml_file = "power-core.xml";
#endif
+#ifndef CONFIG_USER_ONLY
+ cc->virtio_is_big_endian = ppc_cpu_is_big_endian;
+#endif
dc->fw_name = "PowerPC,UNKNOWN";
}
--
MST
- [Qemu-devel] [PULL 25/37] cpu: introduce CPUClass::virtio_is_big_endian(), (continued)
- [Qemu-devel] [PULL 25/37] cpu: introduce CPUClass::virtio_is_big_endian(), Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 26/37] virtio: add endian-ambivalent support to VirtIODevice, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 27/37] virtio: memory accessors for endian-ambivalent targets, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 28/37] virtio: allow byte swapping for vring, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 29/37] virtio-net: use virtio wrappers to access headers, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 30/37] virtio-balloon: use virtio wrappers to access page frame numbers, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 31/37] virtio-blk: use virtio wrappers to access headers, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 32/37] virtio-scsi: use virtio wrappers to access headers, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 33/37] virtio-serial-bus: use virtio wrappers to access headers, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 34/37] virtio-9p: use virtio wrappers to access headers, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 35/37] target-ppc: enable virtio endian ambivalent support,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 36/37] vhost-net: disable when cross-endian, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 37/37] tests: add human format test for string output visitor, Michael S. Tsirkin, 2014/06/29
- Re: [Qemu-devel] [PULL 00/37] pc,vhost,virtio fixes, enhancements, Peter Maydell, 2014/06/29