WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 1/1] XEN: enlighten, use uninitialized_var(cx)

To: Ingo Molnar <mingo@xxxxxxx>
Subject: [Xen-devel] Re: [PATCH 1/1] XEN: enlighten, use uninitialized_var(cx)
From: "H. Peter Anvin" <hpa@xxxxxxxxx>
Date: Wed, 26 Aug 2009 10:27:15 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jiri Slaby <jirislaby@xxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, chrisw@xxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxx, jeremy@xxxxxxxxxxxxx
Delivery-date: Wed, 26 Aug 2009 10:28:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090826060925.GA6194@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1251234044-6943-1-git-send-email-jirislaby@xxxxxxxxx> <20090826060925.GA6194@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2
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.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>