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

Re: [PATCH 03/10] tools/libxg: Fix uninitialised variable in meminit()

  • To: Julien Grall <julien@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 12 Feb 2021 19:35:28 +0000
  • 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=JLB/N6vyzFsgB8EuuJagPk41G9hnHiknEi9TCRPI1GA=; b=FSQLgRPWSBl0diNYK7dyaCMFlBY5LyRLbBABcyDFVbRJQ1HP72SpTgvWL7AsI6t3wxHP+ORtjVkHhk8AldTqjns3cL3emmKKloss2oTHaD9o0Z4pnww8/P0uoaw3FXC43edMRDuaUits22naziZpX5NfAE42Bct5tomwJzH//IeeBLTX8YoYMBGDvaYK248smJ4HRijs5fJkkmgjBWOil/pke0BJTt3eifYnFGzJQxCaXY8XZ+tL+hf9014mIGp3Lm2FQBgR0iyBcElZ3QqaVDLlOXiF4MrmQc7+IQ3jiuWIafN2ZPfwMOtZHm7KQmiPyXMm7oLudWavOA65FcpwAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KYYVIoizhj5lhw8fojnVOx1bAIbE02ffPYtbY05UTi7HGrFlm8RnUpE5o2Cn9EFI0YUDVIdndviPdfwp9mJxtriQNbrRSpcXoYpJhoqZbKyX6x1KuyKEbZ5KnBg48jsodv1dDPWgnSo1Mgkog8c1aVWyXBnIBiIXnj/GjNjhlU1OZPBBDS40puNsxNjoDip8tf98Ji1H9n6OqQt2DwFUpWhaP1w56UU02tCmb81/pHChDf5sl4GvksIVOg3FnKLjxqiFyQj9eIdzx5/cmEH5MxVr9ggm2hSx1G8Jxc1UeSvtXOUVGxalYXLCwX6NbbfvEWQLO4UnRfOcxcfo7HuWDg==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 12 Feb 2021 19:36:27 +0000
  • Ironport-sdr: A8QwpC+iga+gRWHwRpliqUFyDXuq907TblMdGliqZGio+xmdnNqVvU495jcbYxm3u2gm1d1xDp pb65gXsKZTjJp0J9rJBIRhIEuBqBKo8G9skbag90FNNefHbCOCR6oXZ59RVezxVQp3mS/995p8 EWuHuNEo8j1nwb/BGUiNatBMrAYhYPHRBEJEYKiQtQy2H9FDWypQerD7NrfCiAuRUe5PflS6lX A40Zsy/NDXl8X0RlXfg/8Hchd+Z4X50vLGm14np11gVnrxgELunmD2lHRPR9BJEOz1y0TF916V /3Y=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/02/2021 15:55, Julien Grall wrote:
> Hi Andrew,
> On 12/02/2021 15:39, Andrew Cooper wrote:
>> Various version of gcc, when compiling with -Og, complain:
>>    xg_dom_arm.c: In function 'meminit':
>>    xg_dom_arm.c:420:19: error: 'p2m_size' may be used uninitialized
>> in this function [-Werror=maybe-uninitialized]
>>      420 |     dom->p2m_size = p2m_size;
>>          |     ~~~~~~~~~~~~~~^~~~~~~~~~
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> This was reported nearly 3 years ago (see [1]) and it is pretty sad
> this was never merged :(.

:( We've got far too many patches which fall through the cracks like this.

>> ---
>> CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
>> CC: Wei Liu <wl@xxxxxxx>
>> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>> CC: Julien Grall <julien@xxxxxxx>
>> Julien/Stefano: I can't work out how this variable is supposed to
>> work, and
>> the fact that it isn't a straight accumulation across the RAM banks
>> looks
>> suspect.
> It looks buggy, but the P2M is never used on Arm. In fact, you sent a
> patch a year ago to drop it (see [2]). It would be nice to revive it.

That series was committed more than a year ago - ee21f10d70^..97e34ad22d
- and tbh, I'd forgotten about it.

In light of that, I think I'll just delete the p2m_size references
here.  It's easy to prove correctness via inspection, and removes a
dubious construct entirely.




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