Thread (4 messages) 4 messages, 4 authors, 2016-08-09

Re: cxl: fix NULL dereference in cxl_context_init() on PowerVM guests

From: Michael Ellerman <hidden>
Date: 2016-08-09 11:26:36

On Thu, 2016-28-07 at 05:39:41 UTC, Andrew Donnellan wrote:
Commit f67a6722d650 ("cxl: Workaround PE=0 hardware limitation in Mellanox
CX4") added a "min_pe" field to struct cxl_service_layer_ops, to allow us
to work around a Mellanox CX-4 hardware limitation.

When allocating the PE number in cxl_context_init(), we read from
ctx->afu->adapter->native->sl_ops->min_pe to get the minimum PE number.
Unsurprisingly, in a PowerVM guest ctx->afu->adapter->native is NULL, and
guests don't have a cxl_service_layer_ops struct anywhere.

Move min_pe from struct cxl_service_layer_ops to struct cxl so it's
accessible in both native and PowerVM environments. For the Mellanox CX-4,
set the min_pe value in set_sl_ops().

Fixes: f67a6722d650 ("cxl: Workaround PE=0 hardware limitation in Mellanox CX4")
Reported-by: Frederic Barrat <redacted>
Signed-off-by: Andrew Donnellan <redacted>
Acked-by: Ian Munsie <redacted>
Reviewed-by: Frederic Barrat <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/164793379ad3b7ef5fc5a28260

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help