提交 f303f117 编写于 作者: G Greg Kurz 提交者: Alexander Graf

spapr: ensure we have at least one XICS server

XICS needs to know the upper value for cpu_index as it is used to compute
the number of servers:

    smp_cpus * kvmppc_smt_threads() / smp_threads

When passing -smp cpus=1,threads=9 on a POWER8 host, we end up with:

    1 * 8 / 9 = 0

... which leads to an assertion in both emulated:

Number of servers needs to be greater 0
Aborted (core dumped)

... and in-kernel XICS:

xics_kvm_realize: Assertion `icp->nr_servers' failed.
Aborted (core dumped)

With this patch, we are sure that nr_servers > 0. Passing the same bogus
-smp option then leads to:

qemu-system-ppc64: Cannot support more than 8 threads on PPC with KVM

... which is a lot more explicit than the XICS errors.
Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 2d103aae
...@@ -1467,7 +1467,8 @@ static void ppc_spapr_init(MachineState *machine) ...@@ -1467,7 +1467,8 @@ static void ppc_spapr_init(MachineState *machine)
/* Set up Interrupt Controller before we create the VCPUs */ /* Set up Interrupt Controller before we create the VCPUs */
spapr->icp = xics_system_init(machine, spapr->icp = xics_system_init(machine,
smp_cpus * kvmppc_smt_threads() / smp_threads, DIV_ROUND_UP(smp_cpus * kvmppc_smt_threads(),
smp_threads),
XICS_IRQS); XICS_IRQS);
/* init CPUs */ /* init CPUs */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册