[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 20/20] target-ppc: enable virtio endian ambivalen
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH v8 20/20] target-ppc: enable virtio endian ambivalent support |
Date: |
Fri, 13 Jun 2014 13:26:04 +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>
---
target-ppc/cpu.h | 2 ++
target-ppc/translate_init.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 75ed5fa..b076a14 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 4d94015..2468c69 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -8463,6 +8463,16 @@ 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;
+
+ return !msr_le;
+}
+#endif
+
static void ppc_cpu_initfn(Object *obj)
{
CPUState *cs = CPU(obj);
@@ -8550,6 +8560,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 v8 13/20] virtio: allow byte swapping for vring, (continued)
- [Qemu-devel] [PATCH v8 15/20] virtio-balloon: use virtio wrappers to access page frame numbers, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 16/20] virtio-blk: use virtio wrappers to access headers, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 17/20] virtio-scsi: use virtio wrappers to access headers, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 18/20] virtio-serial-bus: use virtio wrappers to access headers, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 19/20] virtio-9p: use virtio wrappers to access headers, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 20/20] target-ppc: enable virtio endian ambivalent support,
Greg Kurz <=
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Alexander Graf, 2014/06/13
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Stefan Hajnoczi, 2014/06/17
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Alexander Graf, 2014/06/17
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Stefan Hajnoczi, 2014/06/18
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Greg Kurz, 2014/06/18
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Michael S. Tsirkin, 2014/06/18
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Alexander Graf, 2014/06/18
- Re: [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Michael S. Tsirkin, 2014/06/18