All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Vijay Kilari <vijay.kilari@gmail.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Julien Grall <julien.grall@linaro.org>
Cc: Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
	manish.jaggi@caviumnetworks.com,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Xen/arm: Virtual ITS command queue handling
Date: Tue, 5 May 2015 15:09:37 +0100	[thread overview]
Message-ID: <5548CF21.2090108@citrix.com> (raw)
In-Reply-To: <CALicx6vrJquEdPY=VAHSEoMW5h2eJMgVA19sM+-_-W6vdX2TXQ@mail.gmail.com>

On 05/05/15 13:14, Vijay Kilari wrote:
> Hi,
> 

Hi Vijay,

>    As discussed, here is the design doc/txt.

I will comment on the proposal 2 as it seems to be the preferred one
assuming you are able to find why it's slow.

> Proposal 2:
> ----------------
> Here when guest writes command to vITS queue and updates CWRITER registers,
> it is trapped in XEN and below steps are followed to process ITS command
> 
> - Dom0 creates a ITS completion device with device id (00:00.1) and reserves
>   n number (256 or so) irqs (LPIs) for this device.
> - One irq/LPI (called completion_irq) of this completion device is
> allocated per domain
> - With this irq/LPI descriptor we can identify the domain/vITS.
> - Info of all the ongoing ITS requests(put in pITS Queue) of this domain is
>   stored in ITS command status array (called its_requests). This is
> managed per vITS.
> 
> 1) Trap of CWRITER write by guest
> 2) Take vITS lock
> 3) Read all the commands written by guest, translate it
>     - If one of the guest command is INT command

Why do you need a specific handling for the guest INT command?

>        a) Append INT command with completion_irq and write this batch as
>           seperate request and goto (3) to process next commands
>     - If more than 'n' commands are sent by guest, start a timer to process
>       remaining commands

Hmmm... How are you sure the time for the timer would be enough?

> 4) Append INT command with completion_irq of current domain
> 5) Release vITS lock
> 6) Take physical ITS (pITS) lock
> 7) Write translated cmds to physical ITS
> 8) Add entry in its_requests

You don't explain what is its_requests.

> 9) Release pITS lock
> 10) return from trap
> 
> One receiving completion interrupt:
> 
> 1) Take the first pending request from its_requests.

I'm assuming that you have some kind of array/list to store the pending
request? I think this would be more difficult to manage than only
supporting one batch per domain at any time.

> 2) Update vITS CREADER of the guest indicating completion of command to guest
> 
> Cons:
>    - Has overhead of processing completion interrupt.
>    - Need to reserve a fake device to generate completion interrupt and
>      reserve one LPI per-domain
> 
> Pros:
>    - VCPU does not poll in Xen for completion of commands.
>    - Handles guest flooding command queue with commands. But needs timer
> 
> Handling Command queue state:
>  - Physical Queue cannot be full as it 64KB there by it can accomodate
> 1K ITS commands.

I don't understand this sentence. Why do you think the physical queue
cannot be full?

>    In case it is full, VCPU has to poll with timeout till physical
> Queue is empty before it post
>    next command
>  - If vITS Queue condition should be managed by guest ITS driver.

Same here.

> Behaviour of Polling and completion interrupt based guest driver:
>  - If completion interrupt (INT) is used by guest driver, then insert
> Xen completion
>    INT command so that CREADER is updated before guest's INT command is injected
>  - If polling mode is used, trap on CREADER checks for completion of command
> 

Regards,

-- 
Julien Grall

  parent reply	other threads:[~2015-05-05 14:09 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 12:14 Xen/arm: Virtual ITS command queue handling Vijay Kilari
2015-05-05 13:51 ` Stefano Stabellini
2015-05-05 13:54   ` Julien Grall
2015-05-05 15:56   ` Vijay Kilari
2015-05-05 14:09 ` Julien Grall [this message]
2015-05-05 16:09   ` Vijay Kilari
2015-05-05 16:27     ` Julien Grall
2015-05-12 15:02 ` Ian Campbell
2015-05-12 17:35   ` Julien Grall
2015-05-13 13:23     ` Ian Campbell
2015-05-13 14:26       ` Julien Grall
2015-05-15 10:59         ` Ian Campbell
2015-05-15 11:26           ` Vijay Kilari
2015-05-15 11:30             ` Ian Campbell
2015-05-15 12:03               ` Julien Grall
2015-05-15 12:47                 ` Vijay Kilari
2015-05-15 12:52                   ` Julien Grall
2015-05-15 12:53                   ` Ian Campbell
2015-05-15 13:14                     ` Vijay Kilari
2015-05-15 13:24                       ` Ian Campbell
2015-05-15 13:44                         ` Julien Grall
2015-05-15 14:04                           ` Vijay Kilari
2015-05-15 15:05                             ` Julien Grall
2015-05-15 15:38                               ` Ian Campbell
2015-05-15 17:31                                 ` Julien Grall
2015-05-16  4:03                                   ` Vijay Kilari
2015-05-16  8:49                                     ` Julien Grall
2015-05-19 11:38                                       ` Vijay Kilari
2015-05-19 11:48                                         ` Ian Campbell
2015-05-19 11:55                                         ` Ian Campbell
2015-05-19 12:10                                           ` Vijay Kilari
2015-05-19 12:19                                             ` Ian Campbell
2015-05-19 12:48                                               ` Vijay Kilari
2015-05-19 13:12                                                 ` Ian Campbell
2015-05-19 14:05                                                 ` Julien Grall
2015-05-19 14:48                                                   ` Ian Campbell
2015-05-19 15:44                                                     ` Julien Grall
2015-05-15 14:05                           ` Ian Campbell
2015-05-15 12:19           ` Julien Grall
2015-05-15 12:58             ` Ian Campbell
2015-05-15 13:24               ` Julien Grall
2015-05-19 12:14                 ` Ian Campbell
2015-05-19 13:27                   ` Julien Grall
2015-05-19 13:36                     ` Ian Campbell
2015-05-19 13:46                       ` Julien Grall
2015-05-19 13:54                       ` Ian Campbell
2015-05-19 14:04                         ` Vijay Kilari
2015-05-19 14:18                           ` Ian Campbell
2015-05-21 12:37                             ` Manish Jaggi
2015-05-26 13:04                               ` Ian Campbell
2015-06-01 22:57                                 ` Manish Jaggi
2015-06-02  8:29                                   ` Ian Campbell
2015-05-19 14:06                         ` Julien Grall
2015-05-13 16:27   ` Vijay Kilari
2015-05-15 11:28     ` Ian Campbell
2015-05-15 12:38       ` Vijay Kilari
2015-05-15 13:06         ` Ian Campbell
2015-05-15 13:17         ` Julien Grall
2015-05-15 11:45   ` Xen on ARM vITS Handling Draft B (Was Re: Xen/arm: Virtual ITS command queue handling) Ian Campbell
2015-05-15 14:55     ` Julien Grall
2015-05-19 12:10       ` Ian Campbell
2015-05-19 13:37         ` Julien Grall
2015-05-19 13:51           ` Ian Campbell
2015-05-22 12:16             ` Vijay Kilari
2015-05-22 12:49               ` Julien Grall
2015-05-22 13:58                 ` Vijay Kilari
2015-05-22 14:35                   ` Julien Grall
2015-05-22 14:54                     ` Vijay Kilari
2015-05-24 10:35               ` Julien Grall
2015-05-25  9:06                 ` Vijay Kilari
2015-05-25  9:32                   ` Julien Grall
2015-05-25 10:40                     ` Vijay Kilari
2015-05-25 12:44                       ` Julien Grall
2015-05-25 13:38                         ` Vijay Kilari
2015-05-25 17:11                           ` Julien Grall
2015-05-27 11:22                 ` Ian Campbell
2015-05-27 11:22               ` Ian Campbell

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=5548CF21.2090108@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=julien.grall@linaro.org \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=vijay.kilari@gmail.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.