From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 5/7] xen/arm: gic: Check the size of the CPU and vCPU interface retrieved from DT Date: Thu, 1 Oct 2015 13:43:38 +0100 Message-ID: <560D2A7A.20101@citrix.com> References: <1443543701-18389-1-git-send-email-julien.grall@citrix.com> <1443543701-18389-6-git-send-email-julien.grall@citrix.com> <1443701292.11707.30.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 1ZhdEL-0000On-G7 for xen-devel@lists.xenproject.org; Thu, 01 Oct 2015 12:45:01 +0000 In-Reply-To: <1443701292.11707.30.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@citrix.com, Zoltan Kiss List-Id: xen-devel@lists.xenproject.org On 01/10/15 13:08, Ian Campbell wrote: > On Tue, 2015-09-29 at 17:21 +0100, Julien Grall wrote: >> @@ -641,7 +643,30 @@ static int __init gicv2_init(void) >> panic("GICv2: Cannot find the maintenance IRQ"); >> gicv2_info.maintenance_irq = res; >> >> - /* TODO: Add check on distributor, cpu size */ >> + /* TODO: Add check on distributor */ >> + >> + /* >> + * The GICv2 CPU interface should at least be 8KB. Although, most of the DT >> + * doesn't correctly set it and use the GICv1 CPU interface size (i.e 4KB). >> + * Warn and then fixup. >> + */ >> + if ( csize < SZ_8K ) >> + { >> + printk(XENLOG_WARNING "GICv2: WARNING: " >> + "The CPU interface size is wrong: %#"PRIx64 >> + " expected %#x\n", > > You missed fixing a split string constant here. Hmmm right. Although, I think the sentence is small so I don't need to rewrite it. >> + csize, SZ_8K); >> + csize = SZ_8K; >> + } >> + >> + /* >> + * Check if the CPU interface and virtual CPU interface have the >> + * same size. >> + */ >> + if ( csize != vsize ) >> + printk(XENLOG_WARNING "GICv2: WARNING: " >> + "The size of the CPU interface (%#"PRIpaddr") and the vCPU interface (%#"PRIpaddr") don't match\n", > > Apart from the wrapping this is also just quite a long line in its own > right (100+ characters with the prefix on the preceeding line) e.g. for > reading a serial log. > > How about s/the CPU interface/GICC/ and s/the vCPU interface/GICV/ ? > > And maybe s/The size/Sizes/? The two suggestions are fine for me. There is a lot small things to fix in this patch series. Shall I resend it? >> >> + /* >> + * Only allow support of GICv2 compatible when the CPU interface >> + * and virtual CPU interface are 8KB >> + * XXX: Handle other size? >> + */ >> + if ( csize != SZ_8K && vsize != SZ_8K ) >> + { >> + printk(XENLOG_WARNING >> + "GICv3: WARNING: Not enabling support of GICv2 compat mode.\n" > > s/of/for/ > >> + "The size of the CPU interface (%#"PRIpaddr") and the vCPU interface (%#"PRIpaddr") should both be 8KB.\n", > > Similarly here. Or just "GICC ("%#...") and GICV ("%#...") must both be 8KB"? I'm fine with that. Regards, -- Julien Grall