From: Julien Grall <julien.grall@linaro.org>
To: Vijay Kilari <vijay.kilari@gmail.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>,
Tim Deegan <tim@xen.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
manish.jaggi@caviumnetworks.com
Subject: Re: [RFC PATCH v2 06/22] xen/arm: its: Port ITS driver to xen
Date: Mon, 23 Mar 2015 13:27:06 +0000 [thread overview]
Message-ID: <551014AA.8000101@linaro.org> (raw)
In-Reply-To: <CALicx6uzkNyzY+OJb0wj-J4=69AxZTZ_oZzHgw0O78p63_rRQA@mail.gmail.com>
On 23/03/15 12:24, Vijay Kilari wrote:
>>> /*
>>> * ITS command descriptors - parameters to be encoded in a command
>>> @@ -228,10 +243,10 @@ static struct its_collection
>>> *its_build_mapd_cmd(struct its_cmd_block *cmd,
>>> struct its_cmd_desc
>>> *desc)
>>> {
>>> unsigned long itt_addr;
>>> - u8 size = ilog2(desc->its_mapd_cmd.dev->nr_ites);
>>> + u8 size = max(fls(desc->its_mapd_cmd.dev->nr_ites) - 1, 1);
>>
>>
>> ilog2 on an uint32_t is defined as fls(val) - 1. Where does the max come
>> from?
>>
>> IHMO, I would define ilog2 in Xen, that would be easier.
>
> Anyway this code is not used later. So I don't bother much about this
Again, what's the purpose of fixing compilation bug in code which will
be remove a patch later?
If you want to fix build errors, you have to fix them correctly. Not
trying to add wrong code in order to make the compiler happy...
>>
>>>
>>> - itt_addr = virt_to_phys(desc->its_mapd_cmd.dev->itt);
>>> - itt_addr = ALIGN(itt_addr, ITS_ITT_ALIGN);
>>> + itt_addr = __pa(desc->its_mapd_cmd.dev->itt);
>>> + itt_addr = ROUNDUP(itt_addr, ITS_ITT_ALIGN);
>>
>>
>> This file use the Linux coding style. Please use hard tab.
>>
>>>
>>> its_encode_cmd(cmd, GITS_CMD_MAPD);
>>> its_encode_devid(cmd, desc->its_mapd_cmd.dev->device_id);
>>> @@ -348,7 +363,7 @@ static struct its_cmd_block *its_allocate_entry(struct
>>> its_node *its)
>>> while (its_queue_full(its)) {
>>> count--;
>>> if (!count) {
>>> - pr_err_ratelimited("ITS queue not draining\n");
>>> + its_err("ITS queue not draining\n");
>>
>>
>> its_err and pr_err_ratelimited are not the same things. The former is not
>> ratelimited.
>>
>> AFAICT this function will be accessible in someway from the guest. It would
>> be possible to DOS Xen when sending a command.
>
> Any equivalent ratelimited function in Xen?
All GUEST_* and INFO/DEBUG are ratelimited. It might be worth to
introduce ratelimited concept for ERROR.
>>
>>> return NULL;
>>> }
>>> cpu_relax();
>>> @@ -380,7 +395,7 @@ static void its_flush_cmd(struct its_node *its, struct
>>> its_cmd_block *cmd)
>>> * the ITS.
>>> */
>>> if (its->flags & ITS_FLAGS_CMDQ_NEEDS_FLUSHING)
>>> - __flush_dcache_area(cmd, sizeof(*cmd));
>>> + clean_and_invalidate_dcache_va_range(cmd, sizeof(*cmd));
>>> else
>>> dsb(ishst);
>>> }
>>> @@ -402,7 +417,7 @@ static void its_wait_for_range_completion(struct
>>> its_node *its,
>>>
>>> count--;
>>> if (!count) {
>>> - pr_err_ratelimited("ITS queue timeout\n");
>>> + its_err("ITS queue timeout\n");
>>
>>
>> Ditto
>>
>> [..]
>>
>>> -static void its_send_inv(struct its_device *dev, u32 event_id)
>>> +/* TODO: Remove static for the sake of compilation */
>>> +void its_send_inv(struct its_device *dev, u32 event_id)
>>
>>
>> Rather than changing the prototype. Would it be possible to #if 0 the
>> function? It would be easier to keep track change.
>
> Does not matter much. Anyway I can try as you wish
Depend if you care about the reviewers time or not...
>
>>
>>> -static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t
>>> *hwirq)
>>> +/* TODO: Remove static for the sake of compilation */
>>> +int its_alloc_device_irq(struct its_device *dev, int *hwirq)
>>> {
>>> int idx;
>>>
>>> @@ -1139,6 +1169,8 @@ static int its_alloc_device_irq(struct its_device
>>> *dev, irq_hw_number_t *hwirq)
>>> return 0;
>>> }
>>>
>>> +/* pci and msi handling no more required here */
>>
>>
>> Hmmm why?
>
> This code is not required. we don't have msi_domain_ops
I have the feeling that counting the number of MSI for a device will be
useful later.
>
>>
>>
>> Already said on V1: of_device_id and dt_device_match are compatible. If you
>> change the name it will work too...
>>
>>> + while ((np = dt_find_matching_node(np, its_device_ids)))
>>> + {
>>> + if (!dt_find_property(np, "msi-controller", NULL))
>>> + continue;
>>
>>
>> In your cover letter, you said you support multiple ITS node but this piece
>> of code show that it's not the case...
>
> If I remember correctly, this is later updated
Unfortunately not... anyway the for loop is valid. So please drop your
while here.
>>
>>> + }
>>>
>>> - for (np = of_find_matching_node(node, its_device_id); np;
>>> - np = of_find_matching_node(np, its_device_id)) {
>>> - its_probe(np, parent_domain);
>>
>>
>> The for loop was perfect, why did you drop it?
>>
>>> + if (np) {
>>> + its_probe(np);
>>> }
>>>
>>> if (list_empty(&its_nodes)) {
>>> - pr_warn("ITS: No ITS available, not enabling LPIs\n");
>>> + its_warn("ITS: No ITS available, not enabling LPIs\n");
>>> return -ENXIO;
>>> }
>>>
>>> diff --git a/xen/include/asm-arm/gic_v3_defs.h
>>> b/xen/include/asm-arm/gic_v3_defs.h
>>> index 4e64b56..f8bac52 100644
>>> --- a/xen/include/asm-arm/gic_v3_defs.h
>>> +++ b/xen/include/asm-arm/gic_v3_defs.h
>>> @@ -59,11 +59,12 @@
>>> #define GICR_WAKER_ProcessorSleep (1U << 1)
>>> #define GICR_WAKER_ChildrenAsleep (1U << 2)
>>>
>>> -#define GICD_PIDR2_ARCH_REV_MASK (0xf0)
>>> +#define GIC_PIDR2_ARCH_REV_MASK (0xf0)
>>> +#define GICD_PIDR2_ARCH_REV_MASK GIC_PIDR2_ARCH_REV_MASK
>>
>>
>> Why do you define GIC_PIDR2_ARCH_REV_MASK? It's not consistent with the
>> other part of the code.
>
> Linux code uses GIC_PIDR2_ARCH_REV_MASK
You modify so heavily the Linux code (pr_* -> its_*) that modifying
again a single line (yes only one) wouldn't hurt...
>>
>>> #define GICD_PIDR2_ARCH_REV_SHIFT (0x4)
>>> #define GICD_PIDR2_ARCH_GICV3 (0x3)
>>>
>>> -#define GICR_PIDR2_ARCH_REV_MASK GICD_PIDR2_ARCH_REV_MASK
>>> +#define GICR_PIDR2_ARCH_REV_MASK GIC_PIDR2_ARCH_REV_MASK
>>
>>
>> Why this change? GICD_PIDR2_ARCH_REV_MASK still exists...
>
> gic-v3.c still uses this.
You define GICD_PIDR2_ARCH_REV_MASK with GIC_PIDR2_ARCH_REV_MASK.
So the pre-processor will replace by the correct value.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-03-23 13:27 UTC|newest]
Thread overview: 109+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 14:37 [RFC PATCH v2 00/22] xen/arm: Add ITS support vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 01/22] add linked list apis vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 02/22] Use linked list accessors for page_list helper function vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 03/22] xen/arm: Add bitmap_find_next_zero_area " vijay.kilari
2015-03-20 13:35 ` Julien Grall
2015-03-19 14:37 ` [RFC PATCH v2 04/22] xen/arm: its: Import GICv3 ITS driver from linux vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 05/22] xen/arm: gicv3: Refactor redistributor information vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 06/22] xen/arm: its: Port ITS driver to xen vijay.kilari
2015-03-20 15:06 ` Julien Grall
2015-03-23 12:24 ` Vijay Kilari
2015-03-23 13:27 ` Julien Grall [this message]
2015-04-01 11:34 ` Ian Campbell
2015-04-02 8:25 ` Vijay Kilari
2015-04-02 9:25 ` Ian Campbell
2015-04-02 10:05 ` Vijay Kilari
2015-04-02 13:57 ` Julien Grall
2015-03-19 14:37 ` [RFC PATCH v2 07/22] xen/arm: its: Move ITS command encode helper functions vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 08/22] xen/arm: its: Remove unused code in ITS driver vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 09/22] xen/arm: its: Add helper functions to decode ITS Command vijay.kilari
2015-04-01 11:40 ` Ian Campbell
2015-05-11 14:14 ` Vijay Kilari
2015-05-11 14:25 ` Julien Grall
2015-05-11 14:25 ` Julien Grall
2015-05-11 14:36 ` Vijay Kilari
2015-05-11 22:06 ` Julien Grall
2015-03-19 14:37 ` [RFC PATCH v2 10/22] xen/arm: Add helper function to get domain page vijay.kilari
2015-03-20 16:39 ` Julien Grall
2015-03-19 14:37 ` [RFC PATCH v2 11/22] xen/arm: its: Move its_device structure to header file vijay.kilari
2015-03-19 14:37 ` [RFC PATCH v2 12/22] xen/arm: its: Update irq descriptor for LPIs support vijay.kilari
2015-03-20 16:44 ` Julien Grall
2015-03-30 14:32 ` Vijay Kilari
2015-03-30 15:29 ` Julien Grall
2015-03-19 14:38 ` [RFC PATCH v2 13/22] xen/arm: its: Add virtual ITS command support vijay.kilari
2015-03-21 0:28 ` Julien Grall
2015-03-23 15:52 ` Julien Grall
2015-03-24 11:48 ` Julien Grall
2015-03-30 15:02 ` Vijay Kilari
2015-03-30 15:47 ` Julien Grall
2015-04-01 11:46 ` Ian Campbell
2015-04-01 12:02 ` Julien Grall
2015-04-02 9:13 ` Ian Campbell
2015-04-02 11:06 ` Julien Grall
2015-04-02 11:18 ` Ian Campbell
2015-04-02 13:47 ` Julien Grall
2015-04-28 9:28 ` Vijay Kilari
2015-04-28 9:56 ` Stefano Stabellini
2015-04-28 10:35 ` Julien Grall
2015-04-28 11:36 ` Vijay Kilari
2015-04-28 16:15 ` Julien Grall
2015-04-29 1:44 ` Vijay Kilari
2015-04-29 11:56 ` Julien Grall
2015-04-29 12:12 ` Manish Jaggi
2015-04-29 12:21 ` Julien Grall
2015-04-29 12:33 ` Manish Jaggi
2015-04-29 13:01 ` Julien Grall
2015-04-29 13:08 ` Manish Jaggi
2015-04-29 13:16 ` Julien Grall
2015-04-29 13:35 ` Julien Grall
2015-04-29 16:26 ` Vijay Kilari
2015-04-29 16:30 ` Vijay Kilari
2015-04-29 18:04 ` Julien Grall
2015-04-30 10:02 ` Stefano Stabellini
2015-04-30 10:09 ` Julien Grall
2015-04-30 10:15 ` Stefano Stabellini
2015-04-30 10:20 ` Julien Grall
2015-04-30 10:50 ` Stefano Stabellini
2015-04-30 13:19 ` Vijay Kilari
2015-04-30 13:47 ` Stefano Stabellini
2015-04-30 14:29 ` Julien Grall
2015-05-04 12:58 ` Vijay Kilari
2015-05-04 13:04 ` Julien Grall
2015-05-04 13:27 ` Vijay Kilari
2015-05-04 13:44 ` Julien Grall
2015-05-04 13:54 ` Julien Grall
2015-05-04 15:19 ` Vijay Kilari
2015-05-04 17:00 ` Julien Grall
2015-05-05 10:28 ` Stefano Stabellini
2015-05-05 11:06 ` Vijay Kilari
2015-05-05 11:47 ` Julien Grall
2015-05-05 12:00 ` Vijay Kilari
2015-05-05 12:08 ` Julien Grall
2015-05-05 11:08 ` Julien Grall
2015-05-05 11:45 ` Vijay Kilari
2015-05-05 11:54 ` Stefano Stabellini
2015-05-05 10:39 ` Stefano Stabellini
2015-05-05 11:10 ` Julien Grall
2015-05-05 11:57 ` Stefano Stabellini
2015-05-05 12:03 ` Julien Grall
2015-03-19 14:38 ` [RFC PATCH v2 14/22] xen/arm: its: Add emulation of ITS control registers vijay.kilari
2015-03-24 17:12 ` Julien Grall
2015-03-19 14:38 ` [RFC PATCH v2 15/22] xen/arm: its: Add support to emulate GICR register for LPIs vijay.kilari
2015-03-27 15:46 ` Julien Grall
2015-03-19 14:38 ` [RFC PATCH v2 16/22] xen/arm: its: implement hw_irq_controller " vijay.kilari
2015-03-27 17:02 ` Julien Grall
2015-03-19 14:38 ` [RFC PATCH v2 17/22] xen/arm: its: Map ITS translation space vijay.kilari
2015-03-27 17:07 ` Julien Grall
2015-03-19 14:38 ` [RFC PATCH v2 18/22] xen/arm: its: Dynamic allocation of LPI descriptors vijay.kilari
2015-03-19 14:38 ` [RFC PATCH v2 19/22] xen/arm: its: Support ITS interrupt handling vijay.kilari
2015-03-19 14:38 ` [RFC PATCH v2 20/22] xen/arm: its: Generate ITS node for Dom0 vijay.kilari
2015-03-19 14:38 ` [RFC PATCH v2 21/22] xen/arm: its: Initialize virtual and physical ITS driver vijay.kilari
2015-03-19 14:38 ` [RFC PATCH v2 22/22] xen/arm: its: Generate ITS dt node for DomU vijay.kilari
2015-03-20 13:37 ` [RFC PATCH v2 00/22] xen/arm: Add ITS support Julien Grall
2015-03-20 16:23 ` Julien Grall
2015-03-23 12:37 ` Vijay Kilari
2015-03-23 13:11 ` Julien Grall
2015-03-23 15:18 ` Vijay Kilari
2015-03-23 15:30 ` Julien Grall
2015-03-23 16:09 ` Vijay Kilari
2015-03-23 16:18 ` Julien Grall
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=551014AA.8000101@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=manish.jaggi@caviumnetworks.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=vijay.kilari@gmail.com \
--cc=vijaya.kumar@caviumnetworks.com \
--cc=xen-devel@lists.xen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.