Guillaume Thouvenin
2006-Feb-22 08:06 UTC
[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 } 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@lists.xensource.com http://lists.xensource.com/xen-devel
Li, Xin B
2006-Feb-22 12:00 UTC
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@lists.xensource.com >http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Li, Xin B
2006-Feb-22 15:39 UTC
RE: [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@intel.com>>-----Original Message----- >From: xen-devel-bounces@lists.xensource.com >[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Li, Xin B >Sent: 2006年2月22日 20:00 >To: Guillaume Thouvenin; xen-devel@lists.xensource.com >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@lists.xensource.com >>http://lists.xensource.com/xen-devel >> > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel