[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: please Clang in arch_set_info_guest()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 9 Jun 2021 16:45:33 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZC5QUXtQ/wDtkBplkxLxp2aU0VAZlci8WoSyD5pw8uo=; b=c8m+RvOajKmQ3iBrZahA+zJIXE7+svok3D7kKqWhb3xRPlbft0fR0XvyxrHFa7862hOLAgyKliZJXcQeaz/SF2W+mOzxewI+CS1sEmk0qY4rEgde3mJeFrlwWHoaajAuN1KR4Fd04LXLAZX/x6Vr+v0IHQ0T4oIKmCvdMFtseKrgIllzsQk36gE1jVauj+AZx7/osSyQN8F16zd/jm7R3pkytf66InQGDh7dvdQgneIYFjTofi6mUh+kpHr4JSneZd2E0wgVYwglew5JzjXKIAXUEUjFB8wtcPIxk8EnYfQwMNvnGSudCcUAeVFea9c7v6KoiWqcK1ACfvwXm/gV3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YDAMUrzHekTsOcT0g3zDN752elSMy++1zJ8ZEsvuxGsqoRFq18DA4asWGkL5OLdwOtT71j/KJ0B+x7OxOXZHCyODCgQFCuRNFAjGmnkisLRELaKum4zeRIFsOIXlTqRgweBVJ8Vnf8+bS1/rOPhSnjPlCFFRpnFNZKg/D1hXu1unrbzvgxB8bQbTOnGJExrq5MqIeITUKpvPLoqtJcUIsSc0TdsSNupG0vCm3p9/KKaocMhZgDhtMOeAcoVx7la4Z92h1nkxT2cBwCQIPPgTRHIgv+8fZ6t/64Vb8k/kC/z6+vtQjk5pRL9sUKD7P99JBGs58GI3W/Q6RpKjZi5IyA==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 09 Jun 2021 15:45:52 +0000
  • Ironport-hdrordr: A9a23:97T5U6PcmuDiIsBcTyX155DYdb4zR+YMi2TDiHoedfUFSKOlfp 6V8MjztSWVtN4QMEtQ/uxoS5PwP080kqQFnrX5XI3SIDUO3VHIEGgM1/qY/9SNIVyGygcZ79 YcT0EcMqyDMbEZt7eD3ODQKb9Jq7PrgcPY55ar854ud3ANV0gJ1XYLNu/xKDwSeOApP+tcKH PR3Ls8m9L2Ek5nHvhTS0N1EdTrlpnurtbLcBQGDxko5E2nii6p0qfzF1y90g0FWz1C7L8++S yd+jaJppmLgrWe8FvxxmXT55NZlJ/IzcZCPtWFjowwJi/3ggilSYx9U/mpvSwzosuo9FE2+e O84isIDoBW0Tf8b2u1qRzi103LyzA18ULvzleenD/KvdH5bChSMbsFuatpNj/ir2YwttB116 xGm0iDsYBMMB/GlCPho/DVShBRkFauq3ZKq59Qs5Vma/pYVFZtl/1YwKsMe61wRR4SqbpXU9 WGNfusoMq/KjihHijkVgAF+q3YYpwxdi32D3Tq9PbliAS/MRhCvgMlLfck7wE9HaQGOtN5Dt T/Q9NVfY51P4YrhIJGdas8qJiMeyPwqSylChPYHb2xLtB3B5uKke+s3IkI
  • Ironport-sdr: po6olZMhaetWr2bPU34eipGkfyr0+QjVc+p6mOzHWdh1EO85ICQI5ehw4Wlho5M4WvnTegj8wI f81DhVmqrMhByh29rTlhuKIf8TUsBONol5tjhlLCRIYAVzEoQtZdXyRzUOxAp9fMHhHUjNLYUt Bpazg/18ar5vhtW1Jsx36j0cMkllYZ8J1MTfXn7TBVWjeNgPg1YQQKbnC3QfjZcGTMruebL3m5 AtphcXizao5jSZ/LUEuax7dvN7vV9DY3nfe3WMjO7S6JBahBk/au1d64GcZguYkJ7saYfoPqPF 5Ms=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09/06/2021 14:14, Jan Beulich wrote:
> Clang 10 reports
>
> domain.c:1328:10: error: variable 'cr3_mfn' is used uninitialized whenever 
> 'if' condition is false [-Werror,-Wsometimes-uninitialized]
>     if ( !compat )
>          ^~~~~~~
> domain.c:1334:34: note: uninitialized use occurs here
>     cr3_page = get_page_from_mfn(cr3_mfn, d);
>                                  ^~~~~~~
> domain.c:1328:5: note: remove the 'if' if its condition is always true
>     if ( !compat )
>     ^~~~~~~~~~~~~~
> domain.c:1042:18: note: initialize the variable 'cr3_mfn' to silence this 
> warning
>     mfn_t cr3_mfn;
>                  ^
>                   = 0
> domain.c:1189:14: error: variable 'fail' is used uninitialized whenever 'if' 
> condition is false [-Werror,-Wsometimes-uninitialized]
>         if ( !compat )
>              ^~~~~~~
> domain.c:1211:9: note: uninitialized use occurs here
>         fail |= v->arch.pv.gdt_ents != c(gdt_ents);
>         ^~~~
> domain.c:1189:9: note: remove the 'if' if its condition is always true
>         if ( !compat )
>         ^~~~~~~~~~~~~~
> domain.c:1187:18: note: initialize the variable 'fail' to silence this warning
>         bool fail;
>                  ^
>                   = false
>
> despite this being a build with -O2 in effect, and despite "compat"
> being constant "false" when CONFIG_COMPAT (and hence CONFIG_PV32) is not
> defined, as it gets set at the top of the function from the result of
> is_pv_32bit_domain().
>
> Re-arrange the two "offending" if()s such that when COMPAT=n the
> respective variables will be seen as unconditionally initialized. The
> original aim was to have the !compat cases first, though.
>
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> I wonder how many more there are to come.

https://gitlab.com/xen-project/patchew/xen/-/pipelines/317744453

Everything seems ok now.  The failure is a known arm32 randconfig issue
which still hasn't been fixed, and is unrelated to this.

Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.