[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/14] pnv/xive: Only support crowd size of 0, 2, 4 and 16
From: |
Michael Kowal |
Subject: |
[PATCH v2 11/14] pnv/xive: Only support crowd size of 0, 2, 4 and 16 |
Date: |
Mon, 9 Dec 2024 18:05:23 -0600 |
From: Glenn Miles <milesg@linux.vnet.ibm.com>
XIVE crowd sizes are encoded into a 2-bit field as follows:
0: 0b00
2: 0b01
4: 0b10
16: 0b11
A crowd size of 8 is not supported.
Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Michael Kowal <kowal@linux.ibm.com>
---
hw/intc/xive.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 2a7ce72606..df77098dd7 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -1687,7 +1687,26 @@ static uint8_t xive_get_group_level(bool crowd, bool
ignore,
uint8_t level = 0;
if (crowd) {
- level = ((ctz32(~nvp_blk) + 1) & 0b11) << 4;
+ /* crowd level is bit position of first 0 from the right in nvp_blk */
+ level = ctz32(~nvp_blk) + 1;
+
+ /*
+ * Supported crowd sizes are 2^1, 2^2, and 2^4. 2^3 is not supported.
+ * HW will encode level 4 as the value 3. See xive2_pgofnext().
+ */
+ switch (level) {
+ case 1:
+ case 2:
+ break;
+ case 4:
+ level = 3;
+ break;
+ default:
+ g_assert_not_reached();
+ }
+
+ /* Crowd level bits reside in upper 2 bits of the 6 bit group level */
+ level <<= 4;
}
if (ignore) {
level |= (ctz32(~nvp_index) + 1) & 0b1111;
--
2.43.0
- [PATCH v2 06/14] ppc/xive2: Process group backlog when updating the CPPR, (continued)
- [PATCH v2 06/14] ppc/xive2: Process group backlog when updating the CPPR, Michael Kowal, 2024/12/09
- [PATCH v2 02/14] ppc/xive: Rename ipb_to_pipr() to xive_ipb_to_pipr(), Michael Kowal, 2024/12/09
- [PATCH v2 04/14] ppc/xive2: Add undelivered group interrupt to backlog, Michael Kowal, 2024/12/09
- [PATCH v2 07/14] ppc/xive2: Process group backlog when updating the CPPR, Michael Kowal, 2024/12/09
- [PATCH v2 08/14] Add support for MMIO operations on the NVPG/NVC BAR, Michael Kowal, 2024/12/09
- [PATCH v2 01/14] ppc/xive2: Update NVP save/restore for group attributes, Michael Kowal, 2024/12/09
- [PATCH v2 10/14] ppc/xive2: Support crowd-matching when looking for target, Michael Kowal, 2024/12/09
- [PATCH v2 05/14] ppc/xive2: Add undelivered group interrupt to backlog, Michael Kowal, 2024/12/09
- [PATCH v2 05/14] ppc/xive2: Process group backlog when pushing an OS context, Michael Kowal, 2024/12/09
- [PATCH v2 04/14] ppc/xive2: Support group-matching when looking for target, Michael Kowal, 2024/12/09
- [PATCH v2 11/14] pnv/xive: Only support crowd size of 0, 2, 4 and 16,
Michael Kowal <=
- [PATCH v2 13/14] pnv/xive: Fix problem with treating NVGC as a NVP, Michael Kowal, 2024/12/09
- [PATCH v2 11/14] ppc/xive2: Check crowd backlog when scanning group backlog, Michael Kowal, 2024/12/09
- [PATCH v2 08/14] qtest/xive: Add group-interrupt test, Michael Kowal, 2024/12/09
- [PATCH v2 09/14] ppc/xive2: Add support for MMIO operations on the NVPG/NVC BAR, Michael Kowal, 2024/12/09
- [PATCH v2 09/14] ppc/xive2: Support crowd-matching when looking for target, Michael Kowal, 2024/12/09
- [PATCH v2 12/14] pnv/xive: Support ESB Escalation, Michael Kowal, 2024/12/09
- [PATCH v2 14/14] qtest/xive: Add test of pool interrupts, Michael Kowal, 2024/12/09
- [PATCH v2 10/14] ppc/xive2: Check crowd backlog when scanning group backlog, Michael Kowal, 2024/12/09