From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Ian Munsie <imunsie@au1.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>, mikey <mikey@neuling.org>,
linuxppc-dev@lists.ozlabs.org,
Frederic Barrat <frederic.barrat@fr.ibm.com>
Subject: Re: [PATCH] cxl: Ensure PSL interrupt is configured for contexts with no AFU IRQs
Date: Wed, 4 May 2016 16:26:09 +0200 [thread overview]
Message-ID: <572A0681.4080703@linux.vnet.ibm.com> (raw)
In-Reply-To: <1462337578-15883-1-git-send-email-imunsie@au.ibm.com>
Hi Ian,
> diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c
> index c0cdf3c..04f6dff 100644
> --- a/drivers/misc/cxl/guest.c
> +++ b/drivers/misc/cxl/guest.c
> @@ -552,6 +552,17 @@ static int attach_afu_directed(struct cxl_context *ctx, u64 wed, u64 amr)
>
> elem->common.sstp0 = cpu_to_be64(ctx->sstp0);
> elem->common.sstp1 = cpu_to_be64(ctx->sstp1);
> +
> + /*
> + * Ensure we have at least one interrupt allocated to take faults for
> + * kernel contexts that may not have allocated any AFU IRQs at all:
> + */
> + if (ctx->irqs.range[0] == 0) {
> + rc = afu_register_irqs(ctx, 0);
> + if (rc)
> + goto out_free;
> + }
> +
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.
Of course, this is highly theoretical. pHyp only supports cxlflash, so
count is not supposed to be null. Still...
Other than that, the patch looks good to me.
Fred
next prev parent reply other threads:[~2016-05-04 14:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 4:52 [PATCH] cxl: Ensure PSL interrupt is configured for contexts with no AFU IRQs Ian Munsie
2016-05-04 14:26 ` Frederic Barrat [this message]
2016-05-05 0:14 ` Ian Munsie
2016-05-05 5:58 ` Frederic Barrat
2016-05-10 21:48 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=572A0681.4080703@linux.vnet.ibm.com \
--to=fbarrat@linux.vnet.ibm.com \
--cc=frederic.barrat@fr.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).