[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111003163001.GG17108@phenom.oracle.com>
Date: Mon, 3 Oct 2011 12:30:01 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: Ian Campbell <Ian.Campbell@...rix.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
Dan Carpenter <error27@...il.com>
Subject: Re: [Xen-devel] [PATCH 8/9] xen/enlighten: Fix compile warnings.
On Fri, Sep 30, 2011 at 09:10:51AM +0100, Ian Campbell wrote:
> On Thu, 2011-09-29 at 20:52 +0100, Konrad Rzeszutek Wilk wrote:
> > linux/arch/x86/xen/enlighten.c: In function ‘xen_start_kernel’:
> > linux/arch/x86/xen/enlighten.c:226: warning: ‘cx’ may be used uninitialized in this function
> > linux/arch/x86/xen/enlighten.c:240: note: ‘cx’ was declared here
>
> Before 61f4237d5b005767a76f4f3694e68e6f78f392d9 we used to initialise cx
> to zero before calling xen_cpuid.
>
> 947ccf9c3c30307b774af3666ee74fcd9f47f646 didn't put it back for some
> reason.
>
> Regardless I'm not sure how cx can be unused while {a,b,d}x apparently
> are not. All four are passed to xen_cpuid(&ax, &bx, &cx, &dx) and even
> if gcc were being clever and looking into xen_cpuid all four are in the
> output constraints of the real cpuid asm call.
>
> Oh, I see, ax and cx are also in the input side of the asm and ax is
> initialised but cx is not and that is the use not the one later in
> xen_init_cpuid_mask.
>
> I think that even if cpuid leaf ax=1 happens not to use the subleaf
> index in cx we'd be better to initialise cx=0 than use uninitialized_var
<nods> I somehow read the code as 'cx' being set in xen_cpuid, but your
analysis correct. Done!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists