From: Ian Campbell Subject: Re: [PATCH v3] xen/arm: introduce PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI Date: Wed, 9 Jul 2014 15:40:13 +0100 Message-ID: <1404916813.11945.29.camel@hastur.hellion.org.uk> References: <1404484784-30659-1-git-send-email-stefano.stabellini@eu.citrix.com> <1404909672.16789.23.camel@kazak.uk.xensource.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: Anup Patel Cc: xen-devel@lists.xensource.com, Pranavkumar Sawargaonkar , Julien Grall , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Wed, 2014-07-09 at 19:54 +0530, Anup Patel wrote: > On Wed, Jul 9, 2014 at 7:49 PM, Stefano Stabellini > wrote: > > On Wed, 9 Jul 2014, Pranavkumar Sawargaonkar wrote: > >> Hi Stefano/ Ian, > >> > >> On Wed, Jul 9, 2014 at 6:11 PM, Ian Campbell wrote: > >> > On Fri, 2014-07-04 at 15:39 +0100, Stefano Stabellini wrote: > >> >> GICH_LR_HW doesn't work as expected on X-Gene: request maintenance > >> >> interrupts and perform EOIs in the hypervisor for hardware interrupts as > >> >> a workaround. Trigger this behaviour with a per platform option. > >> >> > >> >> This patch assumes that GICC_DIR can be written on any pcpu for a given > >> >> SGI, not matter where GICC_IAR has been read before. > >> > > >> > Did you really mean SGI here? Those are per-cpu, I suspect you meant > >> > SPI? > >> > > >> > Ack to the actual patch though. > >> > > >> > Ian. > >> > > >> > >> We have found clean fix for this issue in u-boot. > >> > >> The issue is that X-Gene does not implement security extensions > >> but the GIC-400 present in X-Gene has security extensions. To take > >> care of this situation, APM HW designers have provided two sets > >> of GIC register addresses: one for accessing GIC secured registers, > >> and another for accessing GIC non-secured registers. Currently, we > >> are only accessing GIC secured register for Linux, Xen, and KVM. > >> This works fine in most cases but does not work for GICH_LRn.HW > >> bit because we can only auto-deactivate non-secured interrupts using > >> GICH_LRn.HW bit. > >> > >> To fix this issue, we have updated u-boot to initialize GIC secured > >> register to make all interrupts as non-secured and we will need to > >> access GIC non-secured registers from Linux, Xen, KVM, and > >> everywhere else. > >> > >> For now, you can go ahead with this patch but once we have updated > >> u-boot released by APM then we will need to disable the quirk for > >> X-Gene Mustang. We would be also having a patch for Linux to fix > >> the GIC addresses in X-Gene Storm DTS file. > > > > It's great that you managed to fix the problem! > > > > How can we detect whether the Mustang board we are running on has an > > up-to-date uboot? Would it be possible for u-boot to add a flag > > somewhere to tell that the GICH_LRn.HW is safe to use? Then we could > > check that flag and only enable PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI if > > the flag is missing. > > I think we should check GIC Dist address passed in DTS by > u-boot to Xen. If GIC Dist address is secured address then > enable the quirk otherwise disable the qurik. Isn't IGROUPR readable from NS? In which case we should be able to spot the difference, I think? Stefano, you might want to arrange in your patch to cache the value of the quirk in the gicv2 struct -- otherwise all the calls to platform_has_quirk are going to add up. Ian.