[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv2 5/6] target-arm: add dump-guest-memory support
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCHv2 5/6] target-arm: add dump-guest-memory support |
Date: |
Sun, 24 Mar 2013 18:34:34 +0000 |
On 24 March 2013 17:27, Rabin Vincent <address@hidden> wrote:
> Enable support for the dump-guest-memory monitor command for ARM.
Hi. I'm afraid I'm not really familiar with the dump-guest-memory
command/implementation so I have some possibly dumb comments below:
> --- /dev/null
> +++ b/target-arm/arch_dump.c
> @@ -0,0 +1,61 @@
> +#include "cpu.h"
> +#include "sysemu/dump.h"
> +#include "elf.h"
> +
> +typedef struct {
> + char pad1[24];
> + uint32_t pid;
> + char pad2[44];
> + uint32_t regs[18];
> + char pad3[4];
> +} arm_elf_prstatus;
Can you point me at the spec this struct corresponds to?
> +
> +int cpu_write_elf64_note(write_core_dump_function f, CPUArchState *env,
> + int cpuid, void *opaque)
> +{
> + return -1;
> +}
Is there any documentation of the API we're implementing here?
(why does it require us to provide 64 bit functions that are
never used?)
> +
> +int cpu_write_elf32_note(write_core_dump_function f, CPUArchState *env,
> + int cpuid, void *opaque)
> +{
> + arm_elf_prstatus prstatus = {.pid = cpuid};
> +
> + memcpy(&(prstatus.regs), env->regs, sizeof(env->regs));
> + prstatus.regs[16] = cpsr_read(env);
> +
> + return dump_write_elf_note(ELFCLASS32, "CORE", NT_PRSTATUS,
> + &prstatus, sizeof(prstatus),
> + f, opaque);
> +}
> +
> +int cpu_write_elf64_qemunote(write_core_dump_function f, CPUArchState *env,
> + void *opaque)
> +{
> + return -1;
> +}
> +
> +int cpu_write_elf32_qemunote(write_core_dump_function f, CPUArchState *env,
> + void *opaque)
> +{
> + return 0;
> +}
Why is it OK to implement this as a no-op? What could we
be doing here that we don't do? What are the effects?
> +
> +int cpu_get_dump_info(ArchDumpInfo *info)
> +{
> + info->d_machine = EM_ARM;
> +#ifdef TARGET_WORDS_BIGENDIAN
> + info->d_endian = ELFDATA2MSB;
> +#else
> + info->d_endian = ELFDATA2LSB;
> +#endif
> + info->d_class = ELFCLASS32;
Most of this looks like it would be suitable for a default
implementation that said "endian based on TARGET_WORDS_BIGENDIAN,
machine is ELF_MACHINE, class based on TARGET_LONG_BITS".
> +
> + return 0;
> +}
> +
> +ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
> +{
> + return nr_cpus * dump_get_note_size(ELFCLASS32, "CORE",
> + sizeof(arm_elf_prstatus));
> +}
> --
> 1.7.10.4
>
thanks
-- PMM
- [Qemu-devel] [PATCHv2 0/6] ARM dump-guest-memory support, Rabin Vincent, 2013/03/24
- [Qemu-devel] [PATCHv2 1/6] dump: create writable files, Rabin Vincent, 2013/03/24
- [Qemu-devel] [PATCHv2 2/6] dump: extract out note helper, Rabin Vincent, 2013/03/24
- [Qemu-devel] [PATCHv2 3/6] dump: extract out get note size function, Rabin Vincent, 2013/03/24
- [Qemu-devel] [PATCHv2 4/6] dump: fix up memory mapping dependencies / stub, Rabin Vincent, 2013/03/24
- [Qemu-devel] [PATCHv2 5/6] target-arm: add dump-guest-memory support, Rabin Vincent, 2013/03/24
- Re: [Qemu-devel] [PATCHv2 5/6] target-arm: add dump-guest-memory support,
Peter Maydell <=
- [Qemu-devel] [PATCHv2 6/6] dump: fix memory region handling, Rabin Vincent, 2013/03/24
Re: [Qemu-devel] [PATCHv2 0/6] ARM dump-guest-memory support, Andreas Färber, 2013/03/25