From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: Xen/arm: Virtual ITS command queue handling Date: Fri, 15 May 2015 14:17:54 +0100 Message-ID: <5555F202.2030807@gmail.com> References: <1431442942.8263.175.camel@citrix.com> <1431689282.8943.90.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari , Ian Campbell Cc: Stefano Stabellini , Prasun Kapoor , manish.jaggi@caviumnetworks.com, Julien Grall , "xen-devel@lists.xen.org" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 15/05/15 13:38, Vijay Kilari wrote: >> Can you give some examples of the heaviest translations please so I can >> get a feel for actually how expensive we are talking here. >> > For example to translate MAPVI device_ID, event_ID, vID, vCID > > 1) Read from vITS command queue Not expensive > 2) Validate device_ID is valid by looking at device list attached > to that domain (vITS) It can be reduced by using a tree rather than a list. > 3) Validate vCID (virtual Collection ID) by checking against > re-distributor address/cpu numbers > of this domain Validating vCID can be O(1) if you use only the cpu numbers (see GITS_TYPER.PTA = 0). > 4) Allocate physical LPI for the vID (virtual LPI) from lpi map of > this device > - Check if virtual LPI is already allocated from this device. > - If not allocate it Not expensive. Only looking in a bitmap. > - Update lpi entries for this device What do you mean by updating the LPI entries for this device? > 5) Allocate memory for physical LPI descriptor (Add radix tree > entry) and populate it > 6) Call route_irq_to_guest() for this LPI This could be done earlier by pre-allocating a chunk of LPIs. If memory usage is a concern, I think we could allocate one IRQ descriptor per chunk of LPIs and manage it ourself. > 7) Format physical ITS command and send to pITS Not expensive. Overall, I don't think command are so expensive if we take time to think how to optimize the emulation. Regards, -- Julien Grall