hmp: fix "info cpu" segfault
PATCH v3 1/1 hmp: fix "info cpu" segfault
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.
--- target/i386/arch_dump.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/arch_dump.c +1 -2
@@ -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) {
Signature · 1 line
2.12.0
Quoted 8 lines · Iwona Kotlarska
Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory
/dev/null0 8192" results in segfault.
Fix by checking if we have CPU.Signed-off-by Iwona Kotlarska <[email protected]>--- target/i386/arch_dump.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 6 lines · Iwona Kotlarska
Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory
/dev/null0 8192" results in segfault.
Fix by checking if we have CPU.Signed-off-by Iwona Kotlarska <[email protected]>---
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:
- ....
Quoted 9 lines
target/i386/arch_dump.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)target/i386/arch_dump.c +0
-0
target/i386/arch_dump.c int cpu_get_dump_info(ArchDumpInfo *info, · line 397
Quoted 9 lines
target/i386/arch_dump.c +1
-2@@ -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) {
Thanks,
Marcel
Quoted 5 lines · Iwona Kotlarska
Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory
/dev/null0 8192" results in segfault.
Fix by checking if we have CPU.Signed-off-by Iwona Kotlarska <[email protected]>
Thanks!
Paolo, are you queueing x86 bug fixes for the next -rc?
Signature · 1 line
Eduardo
Quoted 5 lines · Eduardo Habkost
Quoted 4 lines · Iwona Kotlarska
Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory
/dev/null0 8192" results in segfault.
Fix by checking if we have CPU.
Quoted 7 lines
Quoted 1 line
Signed-off-by Iwona Kotlarska <[email protected]>Reviewed-by Eduardo Habkost <[email protected]>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
Quoted 10 lines · * Paolo Bonzini ([email protected]) wrote:
Quoted 7 lines · Eduardo Habkost
Quoted 5 lines · Iwona Kotlarska
Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory
/dev/null0 8192" results in segfault.
Fix by checking if we have CPU.Signed-off-by Iwona Kotlarska <[email protected]>
Quoted 8 lines
Quoted 5 lines
Reviewed-by Eduardo Habkost <[email protected]>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
Quoted 1 line
Paolo
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 5 lines · * Iwona Kotlarska ([email protected]) wrote:
Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory
/dev/null0 8192" results in segfault.
Fix by checking if we have CPU.Signed-off-by Iwona Kotlarska <[email protected]>
Queued.
I've fixed up the title to
hmp: fix "dump-quest-memory" segfault
since that's the actual command it fixes.
Dave
Quoted 22 lines
--- target/i386/arch_dump.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)target/i386/arch_dump.c +1
-2@@ -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) {Signature · 1 line
2.12.0
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK