From: "H. Peter Anvin" <hpa@zytor.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: xen-devel@lists.xensource.com, Jiri Slaby <jirislaby@gmail.com>,
linux-kernel@vger.kernel.org, chrisw@sous-sol.org,
virtualization@lists.osdl.org, jeremy@xensource.com
Subject: Re: [PATCH 1/1] XEN: enlighten, use uninitialized_var(cx)
Date: Wed, 26 Aug 2009 10:27:15 -0700 [thread overview]
Message-ID: <4A957073.10302@zytor.com> (raw)
In-Reply-To: <20090826060925.GA6194@elte.hu>
On 08/25/2009 11:09 PM, Ingo Molnar wrote:
>>
>> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
>> index e90540a..5ab75e2 100644
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -202,7 +202,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
>>
>> static __init void xen_init_cpuid_mask(void)
>> {
>> - unsigned int ax, bx, cx, dx;
>> + unsigned int ax, bx, uninitialized_var(cx), dx;
>
> Please dont use uninitialized_var(), it's an unreliable facility: if
> this variable ever grows a real used-without-initialization bug in
> the future, the compiler warning is turned off permanently. It's
> rare but might happen. We are better off with initializing it to
> zero.
>
I hadn't seen this thread, but I pushed a patch to x86/urgent to do
exactly that while I was committing the Xen crash patch last night.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
WARNING: multiple messages have this Message-ID (diff)
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Slaby <jirislaby@gmail.com>,
jeremy@xensource.com, chrisw@sous-sol.org,
virtualization@lists.osdl.org, xen-devel@lists.xensource.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] XEN: enlighten, use uninitialized_var(cx)
Date: Wed, 26 Aug 2009 10:27:15 -0700 [thread overview]
Message-ID: <4A957073.10302@zytor.com> (raw)
In-Reply-To: <20090826060925.GA6194@elte.hu>
On 08/25/2009 11:09 PM, Ingo Molnar wrote:
>>
>> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
>> index e90540a..5ab75e2 100644
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -202,7 +202,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
>>
>> static __init void xen_init_cpuid_mask(void)
>> {
>> - unsigned int ax, bx, cx, dx;
>> + unsigned int ax, bx, uninitialized_var(cx), dx;
>
> Please dont use uninitialized_var(), it's an unreliable facility: if
> this variable ever grows a real used-without-initialization bug in
> the future, the compiler warning is turned off permanently. It's
> rare but might happen. We are better off with initializing it to
> zero.
>
I hadn't seen this thread, but I pushed a patch to x86/urgent to do
exactly that while I was committing the Xen crash patch last night.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
next prev parent reply other threads:[~2009-08-26 17:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-25 21:00 [PATCH 1/1] XEN: enlighten, use uninitialized_var(cx) Jiri Slaby
2009-08-25 22:29 ` Jeremy Fitzhardinge
2009-08-25 22:29 ` Jeremy Fitzhardinge
2009-08-26 6:09 ` Ingo Molnar
2009-08-26 17:27 ` H. Peter Anvin [this message]
2009-08-26 17:27 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A957073.10302@zytor.com \
--to=hpa@zytor.com \
--cc=chrisw@sous-sol.org \
--cc=jeremy@xensource.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.