On 5/7/2014 3:20 AM, Greg Kurz wrote: > On Mon, 05 May 2014 13:04:35 +0200 > Alexander Graf <ag...@suse.de> wrote: >> On 05/05/2014 10:05 AM, Greg Kurz wrote: >>> From: Bharata B Rao <bhar...@linux.vnet.ibm.com> >>> >>> Fix ppc64 arch specific dump code to work correctly for little endian >>> guests. >>> >>> We introduce a NoteFuncArg type to avoid adding extra arguments to all note >>> functions. >>> >>> Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> [snip]
>>> -static void ppc64_write_elf64_vmxregset(Note *note, PowerPCCPU *cpu) >>> +static void ppc64_write_elf64_vmxregset(NoteFuncArg *arg, PowerPCCPU *cpu) >>> { >>> int i; >>> struct PPC64ElfVmxregset *vmxregset; >>> + Note *note = &arg->note; >>> + DumpState *s = arg->state; >>> >>> - note->hdr.n_type = cpu_to_be32(NT_PPC_VMX); >>> + note->hdr.n_type = cpu_to_dump32(s, NT_PPC_VMX); >>> vmxregset = ¬e->contents.vmxregset; >>> memset(vmxregset, 0, sizeof(*vmxregset)); >>> >>> for (i = 0; i < 32; i++) { >>> - vmxregset->avr[i].u64[0] = cpu_to_be64(cpu->env.avr[i].u64[0]); >>> - vmxregset->avr[i].u64[1] = cpu_to_be64(cpu->env.avr[i].u64[1]); >>> + vmxregset->avr[i].u64[0] = cpu_to_dump64(s, >>> cpu->env.avr[i].u64[0]); >>> + vmxregset->avr[i].u64[1] = cpu_to_dump64(s, >>> cpu->env.avr[i].u64[1]); >> >> Is this correct? Tom, could you please ack if it is? >> >> >> Alex >> >> > > Tom, > > Can you comment plz ? > > Thanks. > Is the avr element in the dump supposed to represent a 128-bit value? Or maybe I should ask a more fundamental question: should a dump of a BE guest be identical regardless of whether it is a BE host or LE host. Ditto for an LE guest. It feels like there is an endianness issue here but I have not yet been able to put my finger on it.