* [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
@ 2017-03-30 5:09 Iwona Kotlarska
2017-03-30 9:55 ` Stefan Hajnoczi
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Iwona Kotlarska @ 2017-03-30 5:09 UTC (permalink / raw)
Cc: qemu-devel, marcel, pbonzini, rth, ehabkost, Iwona Kotlarska
Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
---
target/i386/arch_dump.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
index 5a2e4be5d0..fe0aa36932 100644
--- a/target/i386/arch_dump.c
+++ b/target/i386/arch_dump.c
@@ -391,8 +391,7 @@ int cpu_get_dump_info(ArchDumpInfo *info,
#ifdef TARGET_X86_64
X86CPU *first_x86_cpu = X86_CPU(first_cpu);
-
- lma = !!(first_x86_cpu->env.hflags & HF_LMA_MASK);
+ lma = first_cpu && (first_x86_cpu->env.hflags & HF_LMA_MASK);
#endif
if (lma) {
--
2.12.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
2017-03-30 5:09 [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault Iwona Kotlarska
@ 2017-03-30 9:55 ` Stefan Hajnoczi
2017-03-30 10:32 ` Marcel Apfelbaum
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2017-03-30 9:55 UTC (permalink / raw)
To: Iwona Kotlarska
Cc: Eduardo Habkost, qemu-devel, Marcel Apfelbaum, Paolo Bonzini,
Richard Henderson
On Thu, Mar 30, 2017 at 6:09 AM, Iwona Kotlarska <iwona260909@gmail.com> wrote:
> Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
> ---
> target/i386/arch_dump.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
2017-03-30 5:09 [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault Iwona Kotlarska
2017-03-30 9:55 ` Stefan Hajnoczi
@ 2017-03-30 10:32 ` Marcel Apfelbaum
2017-03-30 14:28 ` Eduardo Habkost
2017-03-31 10:01 ` Dr. David Alan Gilbert
3 siblings, 0 replies; 7+ messages in thread
From: Marcel Apfelbaum @ 2017-03-30 10:32 UTC (permalink / raw)
To: Iwona Kotlarska; +Cc: qemu-devel, pbonzini, rth, ehabkost
On 03/30/2017 08:09 AM, Iwona Kotlarska wrote:
> Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
> ---
Hi Iwona,
Next time (this patch is OK) please add here,
after the "---" line a quick info on the version changes, e.g. :
v2 -> v3:
- Addressed Eduardo's comment and didn't split the assignment.
- ...
v1-> v2:
- ....
> target/i386/arch_dump.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
> index 5a2e4be5d0..fe0aa36932 100644
> --- a/target/i386/arch_dump.c
> +++ b/target/i386/arch_dump.c
> @@ -391,8 +391,7 @@ int cpu_get_dump_info(ArchDumpInfo *info,
>
> #ifdef TARGET_X86_64
> X86CPU *first_x86_cpu = X86_CPU(first_cpu);
> -
> - lma = !!(first_x86_cpu->env.hflags & HF_LMA_MASK);
> + lma = first_cpu && (first_x86_cpu->env.hflags & HF_LMA_MASK);
> #endif
>
> if (lma) {
>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Thanks,
Marcel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
2017-03-30 5:09 [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault Iwona Kotlarska
2017-03-30 9:55 ` Stefan Hajnoczi
2017-03-30 10:32 ` Marcel Apfelbaum
@ 2017-03-30 14:28 ` Eduardo Habkost
2017-03-30 14:37 ` Paolo Bonzini
2017-03-31 10:01 ` Dr. David Alan Gilbert
3 siblings, 1 reply; 7+ messages in thread
From: Eduardo Habkost @ 2017-03-30 14:28 UTC (permalink / raw)
To: Iwona Kotlarska; +Cc: qemu-devel, marcel, pbonzini, rth
On Thu, Mar 30, 2017 at 07:09:24AM +0200, Iwona Kotlarska wrote:
> Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Thanks!
Paolo, are you queueing x86 bug fixes for the next -rc?
--
Eduardo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
2017-03-30 14:28 ` Eduardo Habkost
@ 2017-03-30 14:37 ` Paolo Bonzini
2017-03-30 14:38 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2017-03-30 14:37 UTC (permalink / raw)
To: Eduardo Habkost, Iwona Kotlarska
Cc: qemu-devel, marcel, rth, Dr. David Alan Gilbert
On 30/03/2017 16:28, Eduardo Habkost wrote:
> On Thu, Mar 30, 2017 at 07:09:24AM +0200, Iwona Kotlarska wrote:
>> Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
>
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
>
> Thanks!
>
> Paolo, are you queueing x86 bug fixes for the next -rc?
This being HMP, I was leaving it to Dave, but I can queue it too since I
have some memory API stuff to post too.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
2017-03-30 14:37 ` Paolo Bonzini
@ 2017-03-30 14:38 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2017-03-30 14:38 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Eduardo Habkost, Iwona Kotlarska, qemu-devel, marcel, rth
* Paolo Bonzini (pbonzini@redhat.com) wrote:
>
>
> On 30/03/2017 16:28, Eduardo Habkost wrote:
> > On Thu, Mar 30, 2017 at 07:09:24AM +0200, Iwona Kotlarska wrote:
> >> Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
> >
> > Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> >
> > Thanks!
> >
> > Paolo, are you queueing x86 bug fixes for the next -rc?
>
> This being HMP, I was leaving it to Dave, but I can queue it too since I
> have some memory API stuff to post too.
Yeh I'll take this.
Dave
> Paolo
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault
2017-03-30 5:09 [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault Iwona Kotlarska
` (2 preceding siblings ...)
2017-03-30 14:28 ` Eduardo Habkost
@ 2017-03-31 10:01 ` Dr. David Alan Gilbert
3 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2017-03-31 10:01 UTC (permalink / raw)
To: Iwona Kotlarska; +Cc: qemu-devel, marcel, pbonzini, rth, ehabkost
* Iwona Kotlarska (iwona260909@gmail.com) wrote:
> Running QEMU with "qemu-system-x86_64 -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: Iwona Kotlarska <iwona260909@gmail.com>
Queued.
I've fixed up the title to
hmp: fix "dump-quest-memory" segfault
since that's the actual command it fixes.
Dave
> ---
> target/i386/arch_dump.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
> index 5a2e4be5d0..fe0aa36932 100644
> --- a/target/i386/arch_dump.c
> +++ b/target/i386/arch_dump.c
> @@ -391,8 +391,7 @@ int cpu_get_dump_info(ArchDumpInfo *info,
>
> #ifdef TARGET_X86_64
> X86CPU *first_x86_cpu = X86_CPU(first_cpu);
> -
> - lma = !!(first_x86_cpu->env.hflags & HF_LMA_MASK);
> + lma = first_cpu && (first_x86_cpu->env.hflags & HF_LMA_MASK);
> #endif
>
> if (lma) {
> --
> 2.12.0
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-03-31 10:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 5:09 [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault Iwona Kotlarska
2017-03-30 9:55 ` Stefan Hajnoczi
2017-03-30 10:32 ` Marcel Apfelbaum
2017-03-30 14:28 ` Eduardo Habkost
2017-03-30 14:37 ` Paolo Bonzini
2017-03-30 14:38 ` Dr. David Alan Gilbert
2017-03-31 10:01 ` Dr. David Alan Gilbert
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.