From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vijay Kilari Subject: Re: [RFC PATCH v2 13/22] xen/arm: its: Add virtual ITS command support Date: Wed, 29 Apr 2015 21:56:20 +0530 Message-ID: References: <1426775889-29442-1-git-send-email-vijay.kilari@gmail.com> <1426775889-29442-14-git-send-email-vijay.kilari@gmail.com> <55114EFA.9050304@linaro.org> <55197005.7090408@linaro.org> <1427888815.2115.279.camel@citrix.com> <551BDE4C.9030109@citrix.com> <1427966007.4037.14.camel@citrix.com> <551D2298.2060302@citrix.com> <1427973539.4037.52.camel@citrix.com> <551D4888.1020309@gmail.com> <553F6271.4010308@citrix.com> <553FB23F.7090200@citrix.com> <5540C6D5.9020400@citrix.com> <5540DE16.4090900@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5540DE16.4090900@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Ian Campbell , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Julien Grall , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org Hi Julien, On Wed, Apr 29, 2015 at 7:05 PM, Julien Grall wrote: > On 29/04/15 12:56, Julien Grall wrote: >> As the 2 suggested approach don't seem to fit our usage, we need to find >> another approach. > > I think I have another approach which doesn't require interrupt neither > polling in EL2. I could resolve all the issues around approach 1 only concern is generating dummy/fake device id. > > 1) Trap on CWRITER > a) Read command for the vITS CQ > b) Transform command > c) Inject command > - If ITS CQ full => 2) > - If vITS CQ empty => 2) > - Else => 1) > 2) Return to guest > 3) Trap on CREADR > a) Check completion of the current batch of command > - If complete => 3.b) > - Else => 4) > b) Update CREADR > c) Check if more command and inject it (see process in 1)) > 4) Return to guest > > Some other restrictions to add: > - If there is already a batch of command in process for the domain, > defer the injection of new command > - The number of command sent in a batch should be limited. > > I think thoses restrictions are okay because the ITS is per-domain not > per-VCPU. > > Although, there is a possible problem if the guest is not reading > CREADR. Maybe having a timer would be fine to update CREADR and inject > new commands. How to know that guest is not reading CREADR and using INT mode to check for completion? One way is when INT ITS command is emulated, then we can assume that guest is using INT mode and use timer to update CREADR and inject new commands. However with INT mode, if the guest driver is checking for CREADR value on receiving completion interrupt requested through INT ITS command then CREADR will show up old value. Regards Vijay