[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v3 2/4] ppc64-dump: Support dump for little endian
From: |
Tom Musta |
Subject: |
Re: [Qemu-ppc] [PATCH v3 2/4] ppc64-dump: Support dump for little endian ppc64 |
Date: |
Wed, 07 May 2014 14:02:14 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 5/7/2014 3:20 AM, Greg Kurz wrote:
> On Mon, 05 May 2014 13:04:35 +0200
> Alexander Graf <address@hidden> wrote:
>> On 05/05/2014 10:05 AM, Greg Kurz wrote:
>>> From: Bharata B Rao <address@hidden>
>>>
>>> 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 <address@hidden>
[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.
[Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Greg Kurz, 2014/05/05
- Re: [Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Peter Maydell, 2014/05/06
- Re: [Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Greg Kurz, 2014/05/07
- Re: [Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Peter Maydell, 2014/05/07
- Re: [Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Alexander Graf, 2014/05/07
- Re: [Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Peter Maydell, 2014/05/07
- Re: [Qemu-ppc] [PATCH v3 3/4] target-ppc: ppc can be either endian, Alexander Graf, 2014/05/07