All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v2 0/2] Introduce SPAPR_NR_IPIS and fix max-cpus
@ 2023-11-22  9:28 Harsh Prateek Bora
  2023-11-22  9:28 ` [PATCH v2 1/2] ppc/spapr: Introduce SPAPR_NR_IPIS to refer IRQ range for CPU IPIs Harsh Prateek Bora
  2023-11-22  9:28 ` [PATCH v2 2/2] ppc/spapr: Initialize max_cpus limit to SPAPR_NR_IPIS Harsh Prateek Bora
  0 siblings, 2 replies; 14+ messages in thread
From: Harsh Prateek Bora @ 2023-11-22  9:28 UTC (permalink / raw)
  To: npiggin, qemu-ppc; +Cc: danielhb413, clg, david, qemu-devel, harshpb

On spapr, the max number of CPU IPIs are 4096 which is accounted during
spapr_irq_init but currently existing macro SPAPR_XIRQ_BASE is being
used to refer to that. Introducing SPAPR_NR_IPIS to refer to the range
of CPU IPIS which is being further used to initialize mc->max_cpus during
spapr_machine_class_init().

Harsh Prateek Bora (2):
  ppc/spapr: Introduce SPAPR_NR_IPIS to refer IRQ range for CPU IPIs.
  ppc/spapr: Initialize max_cpus limit to SPAPR_NR_IPIS.

 hw/ppc/spapr.c             | 9 +++------
 hw/ppc/spapr_irq.c         | 4 ++--
 include/hw/ppc/spapr_irq.h | 1 +
 3 files changed, 6 insertions(+), 8 deletions(-)

-- 
2.39.3



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH v2 1/2] ppc/spapr: Introduce SPAPR_NR_IPIS to refer IRQ range for CPU IPIs.
@ 2023-11-22  9:24 Harsh Prateek Bora
  0 siblings, 0 replies; 14+ messages in thread
From: Harsh Prateek Bora @ 2023-11-22  9:24 UTC (permalink / raw)
  To: npiggin, qemu-ppc; +Cc: danielhb413, clg, david, qemu-devel, harshpb

spapr_irq_init currently uses existing macro SPAPR_XIRQ_BASE to refer to
the range of CPU IPIs during initialization of nr-irqs property.
It is more appropriate to have its own define which can be further
reused as appropriate for correct interpretation.

Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Suggested-by: Cedric Le Goater <clg@kaod.org>
---
 hw/ppc/spapr_irq.c         | 4 ++--
 include/hw/ppc/spapr_irq.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index a0d1e1298e..0c5db6b161 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -329,7 +329,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
         int i;
 
         dev = qdev_new(TYPE_SPAPR_XIVE);
-        qdev_prop_set_uint32(dev, "nr-irqs", smc->nr_xirqs + SPAPR_XIRQ_BASE);
+        qdev_prop_set_uint32(dev, "nr-irqs", smc->nr_xirqs + SPAPR_NR_IPIS);
         /*
          * 8 XIVE END structures per CPU. One for each available
          * priority
@@ -356,7 +356,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
     }
 
     spapr->qirqs = qemu_allocate_irqs(spapr_set_irq, spapr,
-                                      smc->nr_xirqs + SPAPR_XIRQ_BASE);
+                                      smc->nr_xirqs + SPAPR_NR_IPIS);
 
     /*
      * Mostly we don't actually need this until reset, except that not
diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h
index c22a72c9e2..e7a80a8349 100644
--- a/include/hw/ppc/spapr_irq.h
+++ b/include/hw/ppc/spapr_irq.h
@@ -28,6 +28,7 @@
 #define SPAPR_IRQ_MSI        (SPAPR_XIRQ_BASE + 0x0300)
 
 #define SPAPR_NR_XIRQS       0x1000
+#define SPAPR_NR_IPIS        0x1000
 
 struct SpaprMachineState;
 
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-11-23 13:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22  9:28 [PATCH RESEND v2 0/2] Introduce SPAPR_NR_IPIS and fix max-cpus Harsh Prateek Bora
2023-11-22  9:28 ` [PATCH v2 1/2] ppc/spapr: Introduce SPAPR_NR_IPIS to refer IRQ range for CPU IPIs Harsh Prateek Bora
2023-11-22 11:12   ` Philippe Mathieu-Daudé
2023-11-22 11:13   ` Philippe Mathieu-Daudé
2023-11-22 11:16     ` Cédric Le Goater
2023-11-22 11:31   ` Cédric Le Goater
2023-11-23  5:04     ` Harsh Prateek Bora
2023-11-22  9:28 ` [PATCH v2 2/2] ppc/spapr: Initialize max_cpus limit to SPAPR_NR_IPIS Harsh Prateek Bora
2023-11-22 11:16   ` Philippe Mathieu-Daudé
2023-11-23  5:03     ` Harsh Prateek Bora
2023-11-23  8:47       ` Cédric Le Goater
2023-11-23 10:26         ` Philippe Mathieu-Daudé
2023-11-23 13:51           ` Cédric Le Goater
  -- strict thread matches above, loose matches on Subject: below --
2023-11-22  9:24 [PATCH v2 1/2] ppc/spapr: Introduce SPAPR_NR_IPIS to refer IRQ range for CPU IPIs Harsh Prateek Bora

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.