From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v9 08/10] xen/arm: take the rank lock before accessing ipriority Date: Mon, 28 Jul 2014 17:22:40 +0100 Message-ID: <53D678D0.5000903@linaro.org> References: <1406223192-26267-8-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406223192-26267-8-git-send-email-stefano.stabellini@eu.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: Stefano Stabellini , xen-devel@lists.xensource.com Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Vijay Kilari List-Id: xen-devel@lists.xenproject.org Hi Stefano, On 07/24/2014 06:33 PM, Stefano Stabellini wrote: > Currently we read ipriority from vgic_vcpu_inject_irq without taking the > rank lock. Fix that by taking the rank lock and reading ipriority at the > beginning of the function. > > As vgic_vcpu_inject_irq is called from the irq.c upon receiving an > interrupt, we need to change the implementation of vgic_lock/unlock_rank > to spin_lock_irqsave to make it safe in irq context. > > Signed-off-by: Stefano Stabellini Which series between GICv3 and this one will go first? I suspect this one, so Vijay will have to rebase his VGICv3 patch on yours. [..] > @@ -367,6 +368,10 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq) > unsigned long flags; > bool_t running; > > + vgic_lock_rank(v, rank, flags); > + priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8, irq, DABT_WORD)], 0, irq & 0x3); This line is longer than 80 characters. I would split it, but I'm not sure if it will be readable. Anyway: Acked-by: Julien Grall Regards, -- Julien Grall