[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/49] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS.
From: |
Nicholas Piggin |
Subject: |
[PULL 18/49] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS. |
Date: |
Mon, 19 Feb 2024 18:29:07 +1000 |
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
Initialize the machine specific max_cpus limit as per the maximum range
of CPU IPIs available. Keeping between 4096 to 8192 will throw IRQ not
free error due to XIVE/XICS limitation and keeping beyond 8192 will hit
assert in tcg_region_init or spapr_xive_claim_irq.
Logs:
Without patch fix:
[root@host build]# qemu-system-ppc64 -accel tcg -smp 10,maxcpus=4097
qemu-system-ppc64: IRQ 4096 is not free
[root@host build]#
On LPAR:
[root@host build]# qemu-system-ppc64 -accel tcg -smp 10,maxcpus=8193
**
ERROR:../tcg/region.c:774:tcg_region_init: assertion failed:
(region_size >= 2 * page_size)
Bail out! ERROR:../tcg/region.c:774:tcg_region_init: assertion failed:
(region_size >= 2 * page_size)
Aborted (core dumped)
[root@host build]#
On x86:
[root@host build]# qemu-system-ppc64 -accel tcg -smp 10,maxcpus=8193
qemu-system-ppc64: ../hw/intc/spapr_xive.c:596: spapr_xive_claim_irq:
Assertion `lisn < xive->nr_irqs' failed.
Aborted (core dumped)
[root@host build]#
With patch fix:
[root@host build]# qemu-system-ppc64 -accel tcg -smp 10,maxcpus=4097
qemu-system-ppc64: Invalid SMP CPUs 4097. The max CPUs supported by
machine 'pseries-8.2' is 4096
[root@host build]#
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/spapr.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0d72d286d8..0028ce0b67 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4639,13 +4639,10 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
mc->block_default_type = IF_SCSI;
/*
- * Setting max_cpus to INT32_MAX. Both KVM and TCG max_cpus values
- * should be limited by the host capability instead of hardcoded.
- * max_cpus for KVM guests will be checked in kvm_init(), and TCG
- * guests are welcome to have as many CPUs as the host are capable
- * of emulate.
+ * While KVM determines max cpus in kvm_init() using kvm_max_vcpus(),
+ * In TCG the limit is restricted by the range of CPU IPIs available.
*/
- mc->max_cpus = INT32_MAX;
+ mc->max_cpus = SPAPR_IRQ_NR_IPIS;
mc->no_parallel = 1;
mc->default_boot_order = "";
--
2.42.0
- [PULL 10/49] tests/avocado: Use default CPU for pseries machine, (continued)
- [PULL 10/49] tests/avocado: Use default CPU for pseries machine, Nicholas Piggin, 2024/02/19
- [PULL 09/49] tests/avocado: Add FreeBSD distro boot tests for ppc, Nicholas Piggin, 2024/02/19
- [PULL 12/49] target/ppc: Rename registers to match ISA, Nicholas Piggin, 2024/02/19
- [PULL 14/49] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep, Nicholas Piggin, 2024/02/19
- [PULL 13/49] hw/ppc/spapr: Add missing license, Nicholas Piggin, 2024/02/19
- [PULL 11/49] ppc/pnv: Update skiboot to v7.1, Nicholas Piggin, 2024/02/19
- [PULL 15/49] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr, Nicholas Piggin, 2024/02/19
- [PULL 16/49] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu', Nicholas Piggin, 2024/02/19
- [PULL 18/49] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS.,
Nicholas Piggin <=
- [PULL 17/49] ppc/spapr: Introduce SPAPR_IRQ_NR_IPIS to refer IRQ range for CPU IPIs., Nicholas Piggin, 2024/02/19
- [PULL 19/49] ppc/spapr: change pseries machine default to POWER10 CPU, Nicholas Piggin, 2024/02/19
- [PULL 20/49] spapr: Tag pseries-2.1 - 2.11 machines as deprecated, Nicholas Piggin, 2024/02/19
- [PULL 22/49] hw/pci-host/raven.c: Mark raven_io_ops as implementing unaligned accesses, Nicholas Piggin, 2024/02/19
[PULL 23/49] misc/pca9552: Fix inverted input status, Nicholas Piggin, 2024/02/19
[PULL 21/49] ppc/pnv: Change powernv default to powernv10, Nicholas Piggin, 2024/02/19