Re: KVM build warnings

Borislav Petkov
2011-05-30T12:46:00Z

On Mon, May 30, 2011 at 07:14:26PM +0900, Takuya Yoshikawa wrote:
> On Mon, 30 May 2011 11:46:04 +0200
> Borislav Petkov <bp@alien8.de> wrote:
>
> > I get the following
> >
> > In file included from arch/x86/kvm/mmu.c:2856:
> > arch/x86/kvm/paging_tmpl.h: In function ‘paging32_walk_addr_generic’:
> > arch/x86/kvm/paging_tmpl.h:124: warning: ‘ptep_user’ may be used uninitialized in this function
> > In file included from arch/x86/kvm/mmu.c:2852:
> > arch/x86/kvm/paging_tmpl.h: In function ‘paging64_walk_addr_generic’:
> > arch/x86/kvm/paging_tmpl.h:124: warning: ‘ptep_user’ may be used uninitialized in this function
> >
> > when building -rc1. It looks like it is caused by
> > 6e2ca7d1802bf8ed9908435e34daa116662e7790 and sticking uninitialized_var() around
> > the ptep_user declaration looks like the easiest solution. But the code should
> > still be audited by someone who's familiar with it whether shutting up the
> > compiler doesn't cause an actual bug.
>
> Sorry, it is my commit.
>
> I think the logic guarantees that ptep_user won't be used until it is
> assigned some value.
>
> It seems to be safe, IIUC.

Ok, thanks for confirming. I'll send a fix soon if no one beats me to
it.

--
Regards/Gruss,
Boris.