From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2 5/9] xen/arm: vgic: Optimize the way to store GICD_IPRIORITYR in the rank Date: Tue, 6 Oct 2015 14:49:19 +0100 Message-ID: <1444139359.5302.179.camel@citrix.com> References: <1444049512-15323-1-git-send-email-julien.grall@citrix.com> <1444049512-15323-6-git-send-email-julien.grall@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 1ZjScN-00089C-PE for xen-devel@lists.xenproject.org; Tue, 06 Oct 2015 13:49:23 +0000 In-Reply-To: <1444049512-15323-6-git-send-email-julien.grall@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 , xen-devel@lists.xenproject.org Cc: stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, 2015-10-05 at 13:51 +0100, Julien Grall wrote: > Xen is currently directly storing the value of GICD_IPRIORITYR register > in the rank. This makes emulation of the register access very simple > but makes the code to get the priority for a given vIRQ more complex. > > While the priority of an vIRQ is retrieved every time an vIRQ is injected > to the guest, the access to register occurs less often. > > Each GICD_IPRIORITYR register stores 4 priorities associated for 4 vIRQs > (see 4.3.11 in IHI 0048B). As Xen is using little endian, we can use > an union to access directly a register or a priority for a given IRQ. > > Note that the field "ipriority" has been renamed to "ipriorityr" to > match the name of the register in the GIC spec. > > Finally, the implementation of the callback get_irq_priority is exactly > the same for both vGIC drivers. Consolidate the implementation in the > common vGIC code and drop the callback. > > Signed-off-by: Julien Grall Acked-by: Ian Campbell