[PATCH] cxl: Ensure PSL interrupt is configured for contexts with no AFU IRQs

Ian Munsie imunsie at au1.ibm.com
Thu May 5 10:14:34 AEST 2016

Excerpts from Frederic Barrat's message of 2016-05-05 00:26:09 +1000:
> I believe there's a potential problem there for powerVM guest.
> In afu_allocate_irqs(), the allocation of the bitmap for the AFU 
> interrupts should return NULL (since count = 0). Therefore we'll skip 
> the allocation for the irq names. Yet we need one for the PSL interrupt. 
> I'm not too sure of what the effect of calling cxl_map_irq with a NULL 
> name is (later, in afu_register_hwirqs), but it's likely not very good.
> That is admittedly a latent pb introduced by the powerVM patch, only 
> revealed here.

Actually I believe it should be fine - kcalloc should return
ZERO_SIZE_POINTER, not NULL and the names should still be allocated.
I'm pretty sure we already rely on this for AFUs that don't use any
interrupts per context, otherwise they would fail with -ENOMEM.

> Of course, this is highly theoretical. pHyp only supports cxlflash, so 
> count is not supposed to be null. Still...

Yeah, I was somewhat tempted not to bother coping with this situation in
PowerVM given we don't have any users that need it, but it seemed like a
better idea to make the API's behaviour consistent regardless of the
underlying platform.

> Other than that, the patch looks good to me.

Thanks for the review :)


More information about the Linuxppc-dev mailing list