mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
ppc: Skip partially initialized vCPUs in 'info pic'
CPU_FOREACH() can race with vCPU hotplug/unplug on sPAPR machines, ie. we may try to print out info about a vCPU with a NULL presenter pointer. Check that in order to prevent QEMU from crashing. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <157192725327.3146912.12047076483178652551.stgit@bahia.lan> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
This commit is contained in:
parent
35886de140
commit
0a83b47055
2 changed files with 20 additions and 2 deletions
|
@ -44,7 +44,16 @@
|
|||
|
||||
void icp_pic_print_info(ICPState *icp, Monitor *mon)
|
||||
{
|
||||
int cpu_index = icp->cs ? icp->cs->cpu_index : -1;
|
||||
int cpu_index;
|
||||
|
||||
/* Skip partially initialized vCPUs. This can happen on sPAPR when vCPUs
|
||||
* are hot plugged or unplugged.
|
||||
*/
|
||||
if (!icp) {
|
||||
return;
|
||||
}
|
||||
|
||||
cpu_index = icp->cs ? icp->cs->cpu_index : -1;
|
||||
|
||||
if (!icp->output) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue