From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web09.2676.1614424274494262123 for ; Sat, 27 Feb 2021 03:11:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fUS434XT; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id BE48064ECE for ; Sat, 27 Feb 2021 11:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614424273; bh=flFFZXamug2p3sLrEn3rxKKEkvGHL8EKwndP6XuIef8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fUS434XTgUDYP1Wd1QbhTC6LyJHBDe+qI+ra+lYRknxL3yBsp2aUzN+i50lvbmunR gJAB+/J9AGpyEDRAWUXUZpxH3i4l+ceeJBEfmFDfXpLs+5jWx2Jk2AHyrx0E0gBH0p wL9qUJ2lX3AmWzAQOye+zG000fpSo0vXUNwnjDWhqHycBvUnLQWxsDsAiu8x1rwdz0 3EoWHN2kLsd5sct9na8/ldPTYk08v5bWmmrZA7LaVPHI3J/MdOAnlncZaoYCmctTtM +H/ErGNixeFZAOZAJxE7eiKDhQ6Iv9LAC3m71rNHTwMWXxfvkxJQq91xfU/D8IPtvb qbvayzyesuUGw== Received: by mail-ot1-f50.google.com with SMTP id k13so11656460otn.13 for ; Sat, 27 Feb 2021 03:11:13 -0800 (PST) X-Gm-Message-State: AOAM533iwpiel6Kty5lynY8Krw3lvnLYkcNgtGu20YST13Vvoj28BQyT 2YnVdVjjts/QvqYgUJo1XzHhruXf9OPANJx+Abg= X-Google-Smtp-Source: ABdhPJwpc0EtSdwch3Bm41ZDN4QowxIK/I8ZHJ/OIyMOAWt0ZbNPKrzc1XQbvgRSIFA7AoaG0m0ARfVw8W0nnBLIYgA= X-Received: by 2002:a9d:42c:: with SMTP id 41mr5677321otc.108.1614424273091; Sat, 27 Feb 2021 03:11:13 -0800 (PST) MIME-Version: 1.0 References: <20210225171110.41324-1-sami.mujawar@arm.com> <003901d70cec$8b673150$a23593f0$@byosoft.com.cn> In-Reply-To: <003901d70cec$8b673150$a23593f0$@byosoft.com.cn> From: "Ard Biesheuvel" Date: Sat, 27 Feb 2021 12:11:01 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v2 1/1] ArmPkg: Fix uninitialised variable in ArmMmuStandaloneMmLib To: devel@edk2.groups.io, "Liming Gao (Byosoft address)" Cc: Sughosh Ganu , Sami Mujawar , Ard Biesheuvel , Leif Lindholm , Matteo.Carlini@arm.com, Ben.Adderson@arm.com, nd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 27 Feb 2021 at 10:40, gaoliming wrote: > > Ard: > This patch fixes the compiler build error. It is a bug fix. I am OK to= merge it for this stable tag. > OK, thanks, Merged as #1467 > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Ard Biesheuvel > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B42=E6=9C=8827=E6=97= =A5 2:46 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: Sughosh Ganu ; L= iming Gao (Byosoft > > address) > > =E6=8A=84=E9=80=81: devel@edk2.groups.io; Sami Mujawar ; Ard > > Biesheuvel ; Leif Lindholm ; > > Matteo.Carlini@arm.com; Ben.Adderson@arm.com; nd > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH v2 1/1] ArmPkg: Fix uninit= ialised variable in > > ArmMmuStandaloneMmLib > > > > On Fri, 26 Feb 2021 at 11:58, Sughosh Ganu > > wrote: > > > > > > > > > On Thu, 25 Feb 2021 at 22:41, Sami Mujawar > > wrote: > > >> > > >> The following patches added support for StandaloneMM using FF-A: > > >> 9da5ee116a28 ArmPkg: Allow FF-A calls to set memory region's attrib= utes > > >> 0e43e02b9bd8 ArmPkg: Allow FF-A calls to get memory region's attrib= utes > > >> > > >> However, in the error handling logic for the Get/Set Memory attribu= tes, > > >> the CLANG compiler reports that a status variable could be used wit= hout > > >> initialisation. This issue is a false positive and is not seen with= GCC. > > >> > > >> The Get/Set Memory attributes operation is atomic and therefore an > > >> FFA_INTERRUPT or FFA_SUCCESS response is not expected in response > > >> to FFA_MSG_SEND_DIRECT_REQ. So the remaining cases that could occur > > >> are: > > >> - the target sends FFA_MSG_SEND_DIRECT_RESP with a success or > > >> failure code. > > >> or > > >> - FFA_MSG_SEND_DIRECT_REQ transmission failure. > > >> > > >> Therefore, > > >> - reorder the error handling conditions such that it prevents the > > >> uninitialised variable issue being flagged by CLANG. > > >> - move the repetitive code to a static helper function and add > > >> documentation at the appropriate places. > > >> - fix error handling in functions that invoke GetMemoryPermissions= (). > > >> > > >> Signed-off-by: Sami Mujawar > > >> --- > > >> The changes can be seen at: > > >> > > https://github.com/samimujawar/edk2/tree/1657_stmm_ffa_fix_unused_var > > _v2 > > > > > > > > > Tested the changes on the StandaloneMm image on the Qemu platform. > > > > > > Tested-by: Sughosh Ganu > > > Reviewed-by: Sughosh Ganu > > > > > > > Thanks. Sami, can you confirm that this patch fixes the CI failure I > > reported to you in private? If so, I intend to merge this during the > > freeze (assuming Liming is ok with that) > > > > >=20 > >