qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH v3 6/9] target-arm: support QMP dump-guest-memory


From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v3 6/9] target-arm: support QMP dump-guest-memory
Date: Fri, 18 Dec 2015 11:59:39 +0000

On 15 December 2015 at 22:51, Andrew Jones <address@hidden> wrote:
> Add the support needed for creating prstatus elf notes. This
> allows us to use QMP dump-guest-memory.
>
> Signed-off-by: Andrew Jones <address@hidden>

> +int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
> +                             int cpuid, void *opaque)
> +{
> +    struct aarch64_note note;
> +    CPUARMState *env = &ARM_CPU(cs)->env;
> +    DumpState *s = opaque;
> +    uint64_t pstate, sp;
> +    int ret, i;
> +
> +    aarch64_note_init(&note, s, "CORE", 5, NT_PRSTATUS, 
> sizeof(note.prstatus));
> +
> +    note.prstatus.pr_pid = cpu_to_dump32(s, cpuid);
> +
> +    if (!is_a64(env)) {
> +        aarch64_sync_32_to_64(env);
> +        pstate = cpsr_read(env);
> +        sp = aarch64_compat_sp(env);

I don't understand why we need to do this. If this is an
AArch64 dump then we should just treat it as an AArch64
dump, and presumably the consumer of the dump knows enough
to know what the "hypervisor view" of a CPU that's currently
in 32-bit mode is. It has to anyway to be able to figure
out where all the other registers are, so why can't it
also figure out what mode the CPU is currently in and thus
where r13 is in the xregs array?

> +    } else {
> +        pstate = pstate_read(env);
> +        sp = env->xregs[31];
> +    }

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]