[PATCH V5 2/4] powerpc/mm: Add support for handling > 512TB address in SLB miss

Paul Mackerras paulus at ozlabs.org
Wed Mar 21 15:11:11 AEDT 2018


On Sun, Mar 18, 2018 at 04:35:56PM +0530, Aneesh Kumar K.V wrote:

[snip]
> +static inline int get_ea_context(mm_context_t *ctx, unsigned long ea)
> +{
> +	int index = ea >> MAX_EA_BITS_PER_CONTEXT;
> +
> +	if (likely(index < ARRAY_SIZE(ctx->extended_id)))
> +		return ctx->extended_id[index];
> +	/* should never happen */
> +	BUG();

Are you absolutely sure that we can never get here with an address
greater than 4PB no matter what userspace does?

I would much prefer that we just return 0 here.  I can't see that the
kernel is in a position where it really cannot continue execution at
this point, so BUG is not appropriate.

Paul.


More information about the Linuxppc-dev mailing list