]> git.proxmox.com Git - mirror_qemu.git/commit
spapr: register dummy ICPs later
authorGreg Kurz <groug@kaod.org>
Tue, 27 Feb 2018 15:22:58 +0000 (16:22 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 6 Mar 2018 02:16:29 +0000 (13:16 +1100)
commit72fdd4de8e5fdc1a6078e000835fb54592a3fe97
tree6804d344e7b4e6a0f1da3aedb78d5b1f5e72413e
parent4b387f9ee16358ab17ce74ff7266071bd2ae25ff
spapr: register dummy ICPs later

Some older machine types create more ICPs than needed. We hence
need to register up to xics_max_server_number() dummy ICPs to
accomodate the migration of these machine types.

Recent VSMT rework changed xics_max_server_number() to return

    DIV_ROUND_UP(max_cpus * spapr->vsmt, smp_threads)

instead of

    DIV_ROUND_UP(max_cpus * kvmppc_smt_threads(), smp_threads);

The change is okay but it requires spapr->vsmt to be set, which
isn't the case with the current code. This causes the formula to
return zero and we don't create dummy ICPs. This breaks migration
of older guests as reported here:

    https://bugzilla.redhat.com/show_bug.cgi?id=1549087

The dummy ICP workaround doesn't really have a dependency on XICS
itself. But it does depend on proper VCPU id numbering and it must
be applied before creating vCPUs (ie, creating real ICPs). So this
patch moves the workaround to spapr_init_cpus(), which already
assumes VSMT to be set.

Fixes: 72194664c8a1 ("spapr: use spapr->vsmt to compute VCPU ids")
Reported-by: Lukas Doktor <ldoktor@redhat.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c