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.web12.14043.1614365164122227531 for ; Fri, 26 Feb 2021 10:46:04 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=snsj6O6l; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D09264F2A for ; Fri, 26 Feb 2021 18:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614365163; bh=iDGz07EWeMTiByRccg7BNxN+3blJtmH2BfeSPjQPjoQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=snsj6O6lA3oCv1T9hnUFXSLv+H7L7CRPH6hYCZ2QiFaYNhp5HDgWiQZ5FDLrRA+wh STSixkmXQJ2wbmxrJcEP2rkbFa+bGj0T5+pQMgZFJmcA6XgjUQB2Z6SZwo7+zNLmuj 2jQmp/3yElJEooBOSLVdGPKU/hwbFeCwV+Gysem61DTl+1qnVTYvSOWE2WbnxSR0EU 21EORqi5D5diZbxv/b1bo64Ik5zHR2poIzq4tBAyK8qQcLOUY8oncLshcad0AVBya/ RrgP4vS32Id8d1taP+6GopK+GhRfnfNrC8//2mg26h1lDfqPLn4JJATqX0IYPgHRAc 8+4juGsNz/Grw== Received: by mail-oo1-f41.google.com with SMTP id x23so2410454oop.1 for ; Fri, 26 Feb 2021 10:46:03 -0800 (PST) X-Gm-Message-State: AOAM532qs8UNOgP6w4ccuHh0ylkcCtXU+lweV05MBGzsRQtPRQCqA0dj 2zlqROzMex+llV5sd756+pzCOno+NhJBXXuNHG0= X-Google-Smtp-Source: ABdhPJz5T+URt90x+NJfpp0Pnv2PsFnLYFKpcS3Ko3Dwc9T8HiXLrM9fZtpZyYHcuYv/b4zYbTIHTKJnDN2BzreLcPo= X-Received: by 2002:a4a:94a7:: with SMTP id k36mr3294762ooi.45.1614365162734; Fri, 26 Feb 2021 10:46:02 -0800 (PST) MIME-Version: 1.0 References: <20210225171110.41324-1-sami.mujawar@arm.com> In-Reply-To: From: "Ard Biesheuvel" Date: Fri, 26 Feb 2021 19:45:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v2 1/1] ArmPkg: Fix uninitialised variable in ArmMmuStandaloneMmLib To: Sughosh Ganu , "Liming Gao (Byosoft address)" Cc: devel@edk2.groups.io, Sami Mujawar , Ard Biesheuvel , Leif Lindholm , Matteo.Carlini@arm.com, Ben.Adderson@arm.com, nd Content-Type: text/plain; charset="UTF-8" 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 attributes >> 0e43e02b9bd8 ArmPkg: Allow FF-A calls to get memory region's attributes >> >> However, in the error handling logic for the Get/Set Memory attributes, >> the CLANG compiler reports that a status variable could be used without >> 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)