On Mon, 21 Apr 2014 09:46:59 +0530 Bharata B Rao <bharata....@gmail.com> wrote: > On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz <gk...@linux.vnet.ibm.com> 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. > > 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 ? >
Hi Bharata, I had comments on this patch that I have addressed, I shall send an update shortly (function will be a CPU object method and, most important, we will rely on current_cpu). So I guess you should not use the code above. > Regards, > Bharata. > <http://raobharata.wordpress.com/> Regards. -- Gregory Kurz kurzg...@fr.ibm.com gk...@linux.vnet.ibm.com Software Engineer @ IBM/Meiosys http://www.ibm.com Tel +33 (0)562 165 496 "Anarchy is about taking complete responsibility for yourself." Alan Moore.