qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: agraf@suse.de, afaerber@suse.de
Cc: David Gibson <david@gibson.dropbear.id.au>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Greg Kurz <gkurz@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 01/22] spapr: ensure we have at least one XICS server
Date: Wed, 24 Jun 2015 16:30:15 +1000	[thread overview]
Message-ID: <1435127436-28560-2-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1435127436-28560-1-git-send-email-david@gibson.dropbear.id.au>

From: Greg Kurz <gkurz@linux.vnet.ibm.com>

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: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index f174e5a..10ca866 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1467,7 +1467,8 @@ static void ppc_spapr_init(MachineState *machine)
 
     /* Set up Interrupt Controller before we create the VCPUs */
     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);
 
     /* init CPUs */
-- 
2.4.3

  reply	other threads:[~2015-06-24  6:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24  6:30 [Qemu-devel] [PATCH 00/22] sPAPR updates 2015-06-24 David Gibson
2015-06-24  6:30 ` David Gibson [this message]
2015-06-24  6:30 ` [Qemu-devel] [PATCH 02/22] pseries: Update SLOF firmware image to qemu-slof-20150429 David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 03/22] spapr: Merge sPAPREnvironment into sPAPRMachineState David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 04/22] spapr: Remove obsolete ram_limit field from sPAPRMachineState David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 05/22] spapr: Remove obsolete entry_point " David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 06/22] spapr: Add sPAPRMachineClass David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 07/22] spapr_pci: encode missing 64-bit memory address space David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 08/22] spapr_pci: encode class code including Prog IF register David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 09/22] spapr_pci: set device node unit address as hex David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 10/22] spapr_iommu: drop erroneous check in h_put_tce_indirect() David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 11/22] spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlags David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 12/22] Revert "hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)" David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 13/22] spapr: Consider max_cpus during xics initialization David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 14/22] spapr: Support ibm, lrdr-capacity device tree property David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 15/22] cpus: Add a macro to walk CPUs in reverse David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 16/22] spapr: Reorganize CPU dt generation code David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 17/22] spapr: Consolidate cpu init code into a routine David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 18/22] ppc: Update cpu_model in MachineState David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 19/22] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 20/22] spapr_pci: enumerate and add PCI device tree David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 21/22] spapr_pci: populate ibm,loc-code David Gibson
2015-06-24  6:30 ` [Qemu-devel] [PATCH 22/22] spapr_pci: drop redundant args in spapr_[populate, create]_pci_child_dt David Gibson
2015-06-24  6:50 ` [Qemu-devel] [PATCH 00/22] sPAPR updates 2015-06-24 David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435127436-28560-2-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).