From: Miroslav Rezanina <mrezanin@redhat.com>
To: Wei Huang <wei@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
qemu-devel@nongnu.org, David Gibson <david@gibson.dropbear.id.au>,
qemu-ppc@nongnu.org,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Thomas Huth <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hmp: fix "dump-quest-memory" segfault (ppc)
Date: Tue, 12 Sep 2017 00:52:57 -0400 (EDT) [thread overview]
Message-ID: <201906370.13293029.1505191977177.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <0c996e65-fc92-6553-7f27-188d42c2235b@redhat.com>
----- Original Message -----
> From: "Thomas Huth" <thuth@redhat.com>
> To: "Laurent Vivier" <lvivier@redhat.com>, qemu-devel@nongnu.org
> Cc: "David Gibson" <david@gibson.dropbear.id.au>, qemu-ppc@nongnu.org, "Dr . David Alan Gilbert"
> <dgilbert@redhat.com>, "Miroslav Rezanina" <mrezanin@redhat.com>
> Sent: Monday, September 11, 2017 4:36:01 PM
> Subject: Re: [PATCH] hmp: fix "dump-quest-memory" segfault (ppc)
>
> On 11.09.2017 13:00, Laurent Vivier wrote:
> > Commit fd5d23babf (hmp: fix "dump-quest-memory" segfault)
> > fixes the problem for i386, do the same for ppc.
> >
> > Running QEMU with
> > qemu-system-ppc64 -M none -nographic -m 256
> > and executing
> > dump-guest-memory /dev/null 0 8192
> > results in segfault
> >
> > Fix by checking if we have CPU.
> >
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> > ---
> > target/ppc/arch_dump.c | 17 +++++++++++------
> > 1 file changed, 11 insertions(+), 6 deletions(-)
> >
> > diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c
> > index 8e9397aa58..dcb7b19950 100644
> > --- a/target/ppc/arch_dump.c
> > +++ b/target/ppc/arch_dump.c
> > @@ -224,17 +224,22 @@ typedef struct NoteFuncDescStruct NoteFuncDesc;
> > int cpu_get_dump_info(ArchDumpInfo *info,
> > const struct GuestPhysBlockList *guest_phys_blocks)
> > {
> > - PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
> > - PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
> > -
> > info->d_machine = PPC_ELF_MACHINE;
> > info->d_class = ELFCLASS;
> >
> > - if ((*pcc->interrupts_big_endian)(cpu)) {
> > - info->d_endian = ELFDATA2MSB;
> > + if (first_cpu) {
> > + PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
> > + PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
> > +
> > + if ((*pcc->interrupts_big_endian)(cpu)) {
> > + info->d_endian = ELFDATA2MSB;
> > + } else {
> > + info->d_endian = ELFDATA2LSB;
> > + }
> > } else {
> > - info->d_endian = ELFDATA2LSB;
> > + info->d_endian = ELFDATA2MSB;
> > }
> > +
> > /* 64KB is the max page size for pseries kernel */
> > if (strncmp(object_get_typename(qdev_get_machine()),
> > "pseries-", 8) == 0) {
> >
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
We need similar fix for aarch64 too.
Mirek
--
Miroslav Rezanina
Software Engineer - Virtualization Team
next prev parent reply other threads:[~2017-09-12 4:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 11:00 [Qemu-devel] [PATCH] hmp: fix "dump-quest-memory" segfault (ppc) Laurent Vivier
2017-09-11 11:06 ` Daniel P. Berrange
2017-09-11 11:20 ` Laurent Vivier
2017-09-11 11:41 ` Cornelia Huck
2017-09-11 11:43 ` Daniel P. Berrange
2017-09-11 12:04 ` Dr. David Alan Gilbert
2017-09-11 12:10 ` Laurent Vivier
2017-09-11 12:13 ` Daniel P. Berrange
2017-09-11 12:15 ` Laurent Vivier
2017-09-11 14:39 ` Thomas Huth
2017-09-11 12:21 ` Cornelia Huck
2017-09-11 13:17 ` Laurent Vivier
2017-09-11 11:14 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-09-11 14:36 ` [Qemu-devel] " Thomas Huth
2017-09-12 4:52 ` Miroslav Rezanina [this message]
2017-09-12 5:19 ` Thomas Huth
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=201906370.13293029.1505191977177.JavaMail.zimbra@redhat.com \
--to=mrezanin@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
--cc=wei@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.