From: Julien Grall <julien.grall@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Julien Grall <julien.grall@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
Vijay Kilari <vijay.kilari@gmail.com>,
Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>,
Julien Grall <julien.grall@linaro.org>, 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 13/22] xen/arm: its: Add virtual ITS command support
Date: Tue, 5 May 2015 12:08:07 +0100 [thread overview]
Message-ID: <5548A497.4050109@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1505051112310.2640@kaball.uk.xensource.com>
On 05/05/15 11:28, Stefano Stabellini wrote:
> On Mon, 4 May 2015, Julien Grall wrote:
>> Hi Vijay,
>>
>> On 04/05/2015 16:19, Vijay Kilari wrote:
>>>>>>> How did you implement the interrupt mode? Could it be improve?
>>>>>>
>>>>>>
>>>>>> 1) In physical ITS driver its_device is created with devID
>>>>>> 00:00.1
>>>>>> with
>>>>>> 256 MSI-x are reserved and is named as completion_dev, which is
>>>>>> global.
>>>>>
>>>>>
>>>>> That's a lot of MSI-x reserved... Can't you use only one per domain?
>>>>
>>>>
>>>> Hmmm... I meant for all the domain, not "per domain".
>>>
>>> Complexity with one irq for all domains is that if completion interrupt
>>> comes it is difficult to find out for which vITS/Domain ITS command
>>> it came for.
>>
>> While reserving a single devID sounds feasible on all the future platform.
>> Allocating 256 MSI-x sounds more difficult, you assume that any board will
>> have at least 256 MSI-x free.
>>
>> Although, this is not scalable. How do you plan to handle more than 256
>> domains? By increasing the number of reserved MSI-x?
>>
>> I don't ask you to implement the later now... but if increasing the number of
>> domain supported means rewriting all the completion code and maybe the vITS
>> then you should ask yourself if it's really worth to take this current
>> approach.
>
> As far as I understand there are max 2048 MSI-X per devid and max 8
> functions per device (we can continue to 00:00.2, etc). That gives us
> 16384 max domains with a PCI device assigned to them. We wouldn't use
> any of these MSIs for domains without devices assigned to them. Overall
> I think is OK as a limit, as long as we can handle the allocation
> efficiently (we cannot really allocate 16384 data structures at boot
> time).
You assume that there is enough of LPIs unused. This may not be true on
every platform.
> Actually even 256 domains with devices assigned to them would be enough
> for now, if we don't consume these MSIs with regular domains without PCI
> passthrough.
It would need some plumbing in the toolstack to use vITS only when PCI
passthrough is used for the guest.
>
>>>>>> I am adding one INT per command. This can be improved to add one
>>>>>> INT
>>>>>> cmd for all
>>>>>> the pending commands. Existing Linux driver sends 2 commands at a
>>>>>> time.
>>>>>
>>>>>
>>>>> You should not assume that other OS will send 2 commands at the same
>>>>> time... It could be more or less.
>>>>>
>>>>> Although, having a INT per command is rather slow. One INT command per
>>>>> batch would improve the boot time.
>>>
>>> We cannot limit on number of commands sent at a time. we have to send
>>> all the
>>> pending commands in vITS queue at a time when trapped on CWRITER, Otherwise
>>> we have to check for pending interrupts on completion interrupt and
>>> translate
>>> and send pending commands in interrupt context. Which complicates and adds
>>> more
>>> delays.
>>
>> If we don't limit the number of commands sent, we would allow a domain to
>> flood the command queue. Therefore, other domains wouldn't be able to send
>> command and will likely timeout and crash. This is one possible security issue
>> among many others.
>>
>> Nobody like security issue, it impacts both end-user and the project. Please
>> have this security concern in mind before performance. Performance is usually
>> more easier to address later.
>>
>> As the vITS is only used for interrupt managing (mapping, unmapping), it's not
>> used in hot path such as receiving interrupt. So we don't care if it's "slow"
>> from the guest point of view as long as we emulate the behavior correctly
>> without impacting the other domain.
>
> I think that rate limiting the guest vITS commands could be done in
> second stage. I wouldn't worry about it for now, not because is not
> important, but because we need to get the basic mechanics right first.
> Rome wasn't built in a day.
Even though Rome wasn't built in a day, the design has been well though
before...
The command queue is the big part of the vITS and tight with the
physical ITS driver. If we don't think about rate limiting in the
design, we may need to rework heavily the ITS.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-05-05 11:08 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
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 [this message]
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=5548A497.4050109@citrix.com \
--to=julien.grall@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=ian.campbell@citrix.com \
--cc=julien.grall@linaro.org \
--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.