summary refs log tree commit diff stats
path: root/include/hw/ppc/xive.h
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2025-03-11 11:51:21 +1000
committerNicholas Piggin <npiggin@gmail.com>2025-03-11 22:43:31 +1000
commit9d2b6058c5b0601779a65e7db4176073940a713d (patch)
treebec0f2299dcc170ca540e87c39ee741917147fde /include/hw/ppc/xive.h
parenta45580ad03f034c84689c6bee5f875432dbd73ba (diff)
downloadfocaccia-qemu-9d2b6058c5b0601779a65e7db4176073940a713d.tar.gz
focaccia-qemu-9d2b6058c5b0601779a65e7db4176073940a713d.zip
ppc/xive2: Add grouping level to notification
The NSR has a (so far unused) grouping level field. When a interrupt
is presented, that field tells the hypervisor or OS if the interrupt
is for an individual VP or for a VP-group/crowd. This patch reworks
the presentation API to allow to set/unset the level when
raising/accepting an interrupt.

It also renames xive_tctx_ipb_update() to xive_tctx_pipr_update() as
the IPB is only used for VP-specific target, whereas the PIPR always
needs to be updated.

Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'include/hw/ppc/xive.h')
-rw-r--r--include/hw/ppc/xive.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 75276b9ba6..805b1d7b80 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -508,6 +508,11 @@ static inline uint8_t xive_priority_to_ipb(uint8_t priority)
         0 : 1 << (XIVE_PRIORITY_MAX - priority);
 }
 
+static inline uint8_t xive_priority_to_pipr(uint8_t priority)
+{
+    return priority > XIVE_PRIORITY_MAX ? 0xFF : priority;
+}
+
 /*
  * Convert an Interrupt Pending Buffer (IPB) register to a Pending
  * Interrupt Priority Register (PIPR), which contains the priority of
@@ -540,8 +545,10 @@ void xive_tctx_pic_print_info(XiveTCTX *tctx, GString *buf);
 Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp);
 void xive_tctx_reset(XiveTCTX *tctx);
 void xive_tctx_destroy(XiveTCTX *tctx);
-void xive_tctx_ipb_update(XiveTCTX *tctx, uint8_t ring, uint8_t ipb);
+void xive_tctx_pipr_update(XiveTCTX *tctx, uint8_t ring, uint8_t priority,
+                           uint8_t group_level);
 void xive_tctx_reset_signal(XiveTCTX *tctx, uint8_t ring);
+void xive_tctx_notify(XiveTCTX *tctx, uint8_t ring, uint8_t group_level);
 
 /*
  * KVM XIVE device helpers