[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/14] pnv/xive: Only support crowd size of 0, 2, 4 and 16
From: |
Nicholas Piggin |
Subject: |
Re: [PATCH 11/14] pnv/xive: Only support crowd size of 0, 2, 4 and 16 |
Date: |
Tue, 19 Nov 2024 12:31:59 +1000 |
On Wed Oct 16, 2024 at 7:13 AM AEST, Michael Kowal wrote:
> 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.
Squash this into patch 9 as a fix? xive2_pgofnext() is introduced in
patch 10, but that's not enough to worry about changing the comment.
Thanks,
Nick
>
> 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 d5fbd9bbd8..565f0243bd 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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 11/14] pnv/xive: Only support crowd size of 0, 2, 4 and 16,
Nicholas Piggin <=