From: Peter Maydell <peter.maydell@linaro.org>
To: Andrew Jones <drjones@redhat.com>
Cc: "Markus Armbruster" <armbru@redhat.com>,
"Alexander Graf" <agraf@suse.de>,
"QEMU Developers" <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"Andreas Färber" <afaerber@suse.de>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 6/9] target-arm: support QMP dump-guest-memory
Date: Fri, 18 Dec 2015 11:59:39 +0000 [thread overview]
Message-ID: <CAFEAcA9ENDZfeNFJgJOdv+O+iPXW6Sod-1vBYAj-ViysSiXReQ@mail.gmail.com> (raw)
In-Reply-To: <1450219878-5293-7-git-send-email-drjones@redhat.com>
On 15 December 2015 at 22:51, Andrew Jones <drjones@redhat.com> wrote:
> Add the support needed for creating prstatus elf notes. This
> allows us to use QMP dump-guest-memory.
>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> +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(¬e, 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
next prev parent reply other threads:[~2015-12-18 12:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 22:51 [Qemu-devel] [PATCH v3 0/9] target-arm: enable qmp-dump-guest-memory Andrew Jones
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 1/9] qapi-schema: dump-guest-memory: Improve text Andrew Jones
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 2/9] dump: qemunotes aren't commonly needed Andrew Jones
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 3/9] dump: allow target to set the page size Andrew Jones
2015-12-18 12:10 ` Peter Maydell
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 4/9] dump: allow target to set the physical base Andrew Jones
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 5/9] target-arm: introduce aarch64_compat_sp Andrew Jones
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 6/9] target-arm: support QMP dump-guest-memory Andrew Jones
2015-12-18 11:59 ` Peter Maydell [this message]
2015-12-18 16:05 ` Andrew Jones
2015-12-18 16:31 ` Peter Maydell
2015-12-18 18:05 ` Andrew Jones
2015-12-18 18:46 ` Peter Maydell
2015-12-18 19:57 ` Andrew Jones
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 7/9] target-arm: dump-guest-memory: add prfpreg notes for aarch64 Andrew Jones
2015-12-18 12:06 ` Peter Maydell
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 8/9] elf: add arm note types Andrew Jones
2015-12-18 12:05 ` Peter Maydell
2015-12-15 22:51 ` [Qemu-devel] [PATCH v3 9/9] target-arm: dump-guest-memory: add vfp notes for arm Andrew Jones
2015-12-18 12:05 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA9ENDZfeNFJgJOdv+O+iPXW6Sod-1vBYAj-ViysSiXReQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=drjones@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).