Re: [PATCH 1/2] x86: kvm: avoid -Wsometimes-uninitized warning

2019-07-12 Thread Arnd Bergmann
On Fri, Jul 12, 2019 at 3:14 PM Paolo Bonzini wrote: > > On 12/07/19 15:02, Arnd Bergmann wrote: > > I think what happens here is that clang does not treat the return > > code of track the return code of is_64_bit_mode() as a constant > > expression, and therefore assumes that the if() condition

Re: [PATCH 1/2] x86: kvm: avoid -Wsometimes-uninitized warning

2019-07-12 Thread Paolo Bonzini
On 12/07/19 15:02, Arnd Bergmann wrote: > I think what happens here is that clang does not treat the return > code of track the return code of is_64_bit_mode() as a constant > expression, and therefore assumes that the if() condition > may or may not be true, for the purpose of determining whether

Re: [PATCH 1/2] x86: kvm: avoid -Wsometimes-uninitized warning

2019-07-12 Thread Arnd Bergmann
On Fri, Jul 12, 2019 at 2:03 PM Roman Kagan wrote: > > On Fri, Jul 12, 2019 at 11:12:29AM +0200, Arnd Bergmann wrote: > > clang points out that running a 64-bit guest on a 32-bit host > > would lead to uninitialized variables: > > > > arch/x86/kvm/hyperv.c:1610:6: error: variable 'ingpa' is used

Re: [PATCH 1/2] x86: kvm: avoid -Wsometimes-uninitized warning

2019-07-12 Thread Roman Kagan
On Fri, Jul 12, 2019 at 11:12:29AM +0200, Arnd Bergmann wrote: > clang points out that running a 64-bit guest on a 32-bit host > would lead to uninitialized variables: > > arch/x86/kvm/hyperv.c:1610:6: error: variable 'ingpa' is used uninitialized > whenever 'if' condition is false

[PATCH 1/2] x86: kvm: avoid -Wsometimes-uninitized warning

2019-07-12 Thread Arnd Bergmann
clang points out that running a 64-bit guest on a 32-bit host would lead to uninitialized variables: arch/x86/kvm/hyperv.c:1610:6: error: variable 'ingpa' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!longmode) { ^