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

RE: [Xen-devel] phys_basetab might be used uninitialized in domain.c

To: "Li, Xin B" <xin.b.li@xxxxxxxxx>, "Guillaume Thouvenin" <guillaume.thouvenin@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] phys_basetab might be used uninitialized in domain.c
From: "Li, Xin B" <xin.b.li@xxxxxxxxx>
Date: Wed, 22 Feb 2006 23:39:25 +0800
Delivery-date: Wed, 22 Feb 2006 15:53:35 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcY3no7QQIIbHgh1Rki0uXQb36lYJAAANHsQAAl+DxA=
Thread-topic: [Xen-devel] phys_basetab might be used uninitialized in domain.c
Fix gcc warning and clean a piece of code in arch_set_info_guest to avoid AP of 
HVM domain going to a wrong code path.

Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>


>-----Original Message-----
>From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx 
>[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Li, Xin B
>Sent: 2006年2月22日 20:00
>To: Guillaume Thouvenin; xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: RE: [Xen-devel] phys_basetab might be used 
>uninitialized in domain.c
>
>>Hello,
>>
>> In xen-unstable [changeset 8920], gcc warns me that phys_basetab
>>variable might be used uninitialized in arch/x86/domain.c
>>
>> So is it ok to write:
>>
>>    414     if ( shadow_mode_refcounts(d) )
>>    415     {
>>    416         if ( 
>>!get_page(mfn_to_page(phys_basetab>>PAGE_SHIFT), d) )
>>    417         {
>>    418             destroy_gdt(v);
>>    419             return -EINVAL;
>>    420         }
>
>phys_basetab should be initialized to INVALID_MFN, and check if it is
>valid before use.
>Also, this code causes AP of SMP VMX guest can't boot, I will send a
>fix.
>thanks
>-Xin
>
>>
>> in arch_set_info_guest() knowing that phys_basetab can be 
>>unset at this
>>point.
>>
>>Hope this help,
>>Guillaume
>>
>>_______________________________________________
>>Xen-devel mailing list
>>Xen-devel@xxxxxxxxxxxxxxxxxxx
>>http://lists.xensource.com/xen-devel
>>
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-devel
>

Attachment: domain.patch
Description: domain.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>