From: Ian Munsie <imunsie@au1.ibm.com>
To: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Cc: Michael Neuling <michael.neuling@au1.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v3 08/18] cxl: IRQ allocation for guests
Date: Wed, 10 Feb 2016 18:23:57 +1100 [thread overview]
Message-ID: <1455088421-sup-7567@delenn.ozlabs.ibm.com> (raw)
In-Reply-To: <1454765345-7417-9-git-send-email-fbarrat@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
> + /*
> + * Look for the interrupt number.
> + * On bare-metal, we know the range 0 only contains the PSL
> + * interrupt so, we could start counting at range 1 and initialize
> + * afu_irq at 1.
> + * In a guest, range 0 also contains AFU interrupts, so it must
> + * be counted for, but we initialize afu_irq at 0 to take into
> + * account the PSL interrupt.
> + *
> + * For code-readability, it just seems easier to go over all
> + * the ranges.
> + */
Thanks for adding that explanation :)
> + if (cpu_has_feature(CPU_FTR_HVMODE))
> + alloc_count = count;
> + else
> + alloc_count = count + 1;
Almost a shame you can't reuse the afu_irq_range_start function you
defined for this, but doing so would probably make the code less
readable, so fine to leave this as is.
> /* We've allocated all memory now, so let's do the irq allocations */
> irq_name = list_first_entry(&ctx->irq_names, struct cxl_irq_name, list);
> - for (r = 1; r < CXL_IRQ_RANGES; r++) {
> + for (r = afu_irq_range_start(); r < CXL_IRQ_RANGES; r++) {
> hwirq = ctx->irqs.offset[r];
> for (i = 0; i < ctx->irqs.range[r]; hwirq++, i++) {
> - cxl_map_irq(ctx->afu->adapter, hwirq,
> - cxl_irq_afu, ctx, irq_name->name);
> + if (r == 0 && i == 0)
> + /* PSL interrupt, only for guest */
That comment is perhaps not as clear as it could be - the interrupt is
used on either, but it's only allocated per context on PowerVM guests.
Cheers,
-Ian
next prev parent reply other threads:[~2016-02-10 7:24 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-06 13:28 [PATCH v3 00/18] cxl: Add support for powerVM guest Frederic Barrat
2016-02-06 13:28 ` [PATCH v3 01/18] cxl: Move common code away from bare-metal-specific files Frederic Barrat
2016-02-10 6:26 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 02/18] cxl: Move bare-metal specific code to specialized files Frederic Barrat
2016-02-10 6:28 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 03/18] cxl: Define process problem state area at attach time only Frederic Barrat
2016-02-10 6:32 ` Ian Munsie
2016-02-11 14:40 ` Frederic Barrat
2016-02-06 13:28 ` [PATCH v3 04/18] cxl: Introduce implementation-specific API Frederic Barrat
2016-02-10 7:07 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 05/18] cxl: Rename some bare-metal specific functions Frederic Barrat
2016-02-10 7:10 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 06/18] cxl: Isolate a few bare-metal-specific calls Frederic Barrat
2016-02-10 7:12 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 07/18] cxl: Update cxl_irq() prototype Frederic Barrat
2016-02-10 7:13 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 08/18] cxl: IRQ allocation for guests Frederic Barrat
2016-02-10 7:23 ` Ian Munsie [this message]
2016-02-06 13:28 ` [PATCH v3 09/18] cxl: New possible return value from hcall Frederic Barrat
2016-02-10 7:24 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 10/18] cxl: New hcalls to support CAPI adapters Frederic Barrat
2016-02-10 8:31 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 11/18] cxl: Separate bare-metal fields in adapter and AFU data structures Frederic Barrat
2016-02-10 9:04 ` Ian Munsie
2016-02-06 13:28 ` [PATCH v3 12/18] cxl: Add guest-specific code Frederic Barrat
2016-02-10 9:35 ` Ian Munsie
2016-02-06 13:29 ` [PATCH v3 13/18] cxl: sysfs support for guests Frederic Barrat
2016-02-08 3:02 ` Stewart Smith
2016-02-09 15:21 ` Frederic Barrat
2016-02-10 6:22 ` Ian Munsie
2016-02-10 9:38 ` Ian Munsie
2016-02-06 13:29 ` [PATCH v3 14/18] cxl: Support to flash a new image on the adapter from a guest Frederic Barrat
2016-02-10 11:20 ` Ian Munsie
2016-02-15 20:53 ` christophe lombard
2016-02-15 23:19 ` Ian Munsie
2016-02-16 10:47 ` christophe lombard
2016-02-06 13:29 ` [PATCH v3 15/18] cxl: Parse device tree and create CAPI device(s) at boot Frederic Barrat
2016-02-10 11:21 ` Ian Munsie
2016-02-06 13:29 ` [PATCH v3 16/18] cxl: Support the cxl kernel API from a guest Frederic Barrat
2016-02-10 11:26 ` Ian Munsie
2016-02-06 13:29 ` [PATCH v3 17/18] cxl: Adapter failure handling Frederic Barrat
2016-02-10 11:28 ` Ian Munsie
2016-02-06 13:29 ` [PATCH v3 18/18] cxl: Add tracepoints around the CAPI hcall Frederic Barrat
2016-02-10 11:29 ` Ian Munsie
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=1455088421-sup-7567@delenn.ozlabs.ibm.com \
--to=imunsie@au1.ibm.com \
--cc=fbarrat@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael.neuling@au1.ibm.com \
/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).