[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 21/22] target-ppc: enable virtio endian ambivalen
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH v9 21/22] target-ppc: enable virtio endian ambivalent support |
Date: |
Tue, 24 Jun 2014 19:51:19 +0200 |
User-agent: |
StGit/0.17-dirty |
The device endianness is the cpu endianness at device reset time.
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
---
Changes since v8:
- added missing register sync
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 74407ee..9206556 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 85581c9..73279b9 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9584,6 +9584,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);
@@ -9672,6 +9684,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";
}
- [Qemu-devel] [PATCH v9 11/22] cpu: introduce CPUClass::virtio_is_big_endian(), (continued)
- [Qemu-devel] [PATCH v9 11/22] cpu: introduce CPUClass::virtio_is_big_endian(), Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 12/22] virtio: add endian-ambivalent support to VirtIODevice, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 13/22] virtio: memory accessors for endian-ambivalent targets, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 14/22] virtio: allow byte swapping for vring, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 15/22] virtio-net: use virtio wrappers to access headers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 16/22] virtio-balloon: use virtio wrappers to access page frame numbers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 17/22] virtio-blk: use virtio wrappers to access headers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 18/22] virtio-scsi: use virtio wrappers to access headers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 19/22] virtio-serial-bus: use virtio wrappers to access headers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 20/22] virtio-9p: use virtio wrappers to access headers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 21/22] target-ppc: enable virtio endian ambivalent support,
Greg Kurz <=
- [Qemu-devel] [PATCH v9 22/22] vhost-net: disable when cross-endian, Greg Kurz, 2014/06/24
- Re: [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets, Michael S. Tsirkin, 2014/06/29