[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be eit
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian |
Date: |
Mon, 21 Apr 2014 13:18:22 +0200 |
On Mon, 21 Apr 2014 09:56:48 +0200
Alexander Graf <address@hidden> wrote:
>
>
> > Am 21.04.2014 um 06:16 schrieb Bharata B Rao <address@hidden>:
> >
> >> On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz <address@hidden> wrote:
> >>
> >> +
> >> +#if !defined(CONFIG_USER_ONLY)
> >> +bool virtio_is_big_endian(void)
> >> +{
> >> + PowerPCCPU *cp = POWERPC_CPU(first_cpu);
> >> + CPUPPCState *env = &cp->env;
> >> +
> >> + /* NOTE: booke uses the same number for another unrelated spr.
> >> + */
> >> + if (strcmp(env->spr_cb[SPR_LPCR].name, "LPCR")) {
> >> + return TARGET_WORDS_BIGENDIAN;
> >> + } else {
> >> + return !(env->spr[SPR_LPCR] & LPCR_ILE);
> >> + }
> >> +}
> >> +#endif
> >
> > I am adding crash support for little endian ppc64 guests and I realized
> > that the above code needs to be re-used in
> > target-ppc/arch_dump.c:cpu_get_dump_info() to set the endianness.
>
> Wouldn't it make more sense to treat dumps like gdb and set the endianness
> depending on MSR_LE?
>
> Alex
>
It makes sense to behave the same as gdb... and BTW, since the guest may
change endianness, we could possibly have MSB and LSB data in the dump. The
important thing is to have the possibility to adapt endianness to what we are
looking (like set target endian in gdb).
> >
> > Do you think it is worth to have this routine as a generic routine to
> > determine endianness so that subsystems other than virtio can reuse the
> > same ?
> >
> > Regards,
> > Bharata.
--
Gregory Kurz address@hidden
address@hidden
Software Engineer @ IBM/Meiosys http://www.ibm.com
Tel +33 (0)562 165 496
"Anarchy is about taking complete responsibility for yourself."
Alan Moore.
- [Qemu-devel] [PATCH v7 5/8] virtio-blk: use virtio wrappers to access headers, (continued)
- [Qemu-devel] [PATCH v7 5/8] virtio-blk: use virtio wrappers to access headers, Greg Kurz, 2014/04/14
- [Qemu-devel] [PATCH v7 6/8] virtio-scsi: use virtio wrappers to access headers, Greg Kurz, 2014/04/14
- [Qemu-devel] [PATCH v7 7/8] virtio-serial-bus: use virtio wrappers to access headers, Greg Kurz, 2014/04/14
- [Qemu-devel] [PATCH v7 8/8] virtio-9p: use virtio wrappers to access headers, Greg Kurz, 2014/04/14
- [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Greg Kurz, 2014/04/14
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Alexander Graf, 2014/04/14
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Bharata B Rao, 2014/04/21
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian,
Greg Kurz <=
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Bharata B Rao, 2014/04/21
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Dave Anderson, 2014/04/22
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Greg Kurz, 2014/04/22
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Dave Anderson, 2014/04/22
- Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian, Greg Kurz, 2014/04/21