From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 7/9] xen/arm: vgic: Optimize the way to store the target vCPU in the rank Date: Tue, 6 Oct 2015 15:18:40 +0100 Message-ID: <5613D840.80504@citrix.com> References: <1444049512-15323-1-git-send-email-julien.grall@citrix.com> <1444049512-15323-8-git-send-email-julien.grall@citrix.com> <1444139960.5302.185.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZjT65-0003ID-PJ for xen-devel@lists.xenproject.org; Tue, 06 Oct 2015 14:20:05 +0000 In-Reply-To: <1444139960.5302.185.camel@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: Ian Campbell , xen-devel@lists.xenproject.org Cc: stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 06/10/15 14:59, Ian Campbell wrote: > On Mon, 2015-10-05 at 13:51 +0100, Julien Grall wrote: >> Xen is currently directly storing the value of GICD_ITARGETSR register >> (for GICv2) and GICD_IROUTER (for GICv3) in the rank. This makes the >> emulation of the registers access very simple but makes the code to get >> the target vCPU for a given vIRQ more complex. >> >> While the target vCPU of an vIRQ is retrieved every time an vIRQ is >> injected to the guest, the access to the register occurs less often. >> >> So the data structure should be optimized for the most common case >> rather than the inverse. >> >> This patch introduces the usage of an array to store the target vCPU for >> every interrupt in the rank. This will make the code to get the target >> very quick. The emulation code will now have to generate the >> GICD_ITARGETSR >> and GICD_IROUTER register for read access and split it to store in a >> convenient way. >> >> With the new way to store the target vCPU, the structure vgic_irq_rank >> is shrinked down from 320 bytes to 92 bytes. This is saving about 228 > > "shrunk" > >> bytes of memory allocated separately per vCPU. >> >> Note that with these changes, any read to those registers will list only >> the target vCPU used by Xen. This is fine because the GIC spec doesn't >> require to return exactly the value written and it can be seen as if we >> decide to implement the register read-only. > > I'd prefer if instead of "this is fine..." this said something like "We > think this is likely to be OK because...(stuff)...". Will do. I will resend the whole series fixing the different error you mentioned within the series and add your various acked. Regards, -- Julien Grall