From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web12.30045.1598787259522582043 for ; Sun, 30 Aug 2020 04:34:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=oBSMCihX; spf=pass (domain: nuviainc.com, ip: 209.85.128.65, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f65.google.com with SMTP id a65so2910894wme.5 for ; Sun, 30 Aug 2020 04:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=47BPp4nK9BkCrXcLmJpi32XZ6BvCUnYoM0AVFVxjL+c=; b=oBSMCihX95br5VbXm663ospP2OLzhP4p9zagNxEPAaaMUFmoQ5yzT4lmc56fuvvXWz 7zYQ/PzwJF9Xcd9AzGkIq5uob7M+pziN18Goenw6nBL0778KOBMMOXs+xY4cu35mE3xJ uzFdiH2F8uwCfi5sOBClhGxiTG7ZjHRlyf6OkuFAqXYNgpXmeGysKaFougtYPA4hAcxq 2dSewbD7U4oQ9Vh+zvWjp7Lu9zdKRE5N5YP8nIZ8tWUhlQ12AF0aDUTDdkWFOo1N9YGo Qwsvw6z/DlVuwzK25yT17x3ye7QB64bpyW7rY0kkK2zVSfnLpNLNFEJy8greaedb+90Q a3cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=47BPp4nK9BkCrXcLmJpi32XZ6BvCUnYoM0AVFVxjL+c=; b=rgQbWJqTLJ4xmx2v3KOGypFq8qkGZY8SJO4wybdDLQNQuRnG89H7IzJCuxNYlJo0jC ZzL3QDWGDcppBbj6WuV75bZpGVSJcFF/elUkOJBviPsJjRF7QcrpHl+l0xqstMy+Vdmg K7+oNk8vne6frElpWGBFdIcIGYNzFSikWwPHJInAwWGoj5GunIbBn/vp57ULEyqHO7s6 rsg9AK/hBauRRvBT7Uyg6rR4ZiebPRw8926+2HWij9tzdLYI8yQcaU257HIMR8tx7MdK Ql/8oemMxtJ023YMYTIImqBeQ3DdkcMf1pslTOmLnMLrFyfZF/59V7S41DVjjpkQwJWR l7Hw== X-Gm-Message-State: AOAM531wvcYH3Q4RTi1GPzNao0ZMcCD95K+kUTbuZeOM2Nh5Ts8aQOIW /uSfLuKkRYlKkuH/f2Xw9Fphvw== X-Google-Smtp-Source: ABdhPJziqxI7e1KX3ktFR3BPB6BdASS3OHy4ROnODpR1CNXgxBKKj/tnhREDjT5igMs0pIf5Bae4MA== X-Received: by 2002:a1c:28c1:: with SMTP id o184mr7031298wmo.91.1598787257809; Sun, 30 Aug 2020 04:34:17 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id z11sm1492545wru.88.2020.08.30.04.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 04:34:17 -0700 (PDT) Date: Sun, 30 Aug 2020 12:34:14 +0100 From: "Leif Lindholm" To: "Chang, Abner (HPS SW/FW Technologist)" Cc: "devel@edk2.groups.io" , "Chen, Gilbert" , "Schaefer, Daniel" Subject: Re: [PATCH edk2-platforms 1/1] Silicon/SiFive: fix RELEASE builds of U54 PeiCoreInfoHobLib Message-ID: <20200830113414.GA20124@vanye> References: <20200829134118.19610-1-leif@nuviainc.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Aug 30, 2020 at 08:14:36 +0000, Chang, Abner (HPS SW/FW Technologist) wrote: > > -----Original Message----- > > From: Leif Lindholm [mailto:leif@nuviainc.com] > > Sent: Saturday, August 29, 2020 9:41 PM > > To: devel@edk2.groups.io > > Cc: Chang, Abner (HPS SW/FW Technologist) ; > > Chen, Gilbert ; Schaefer, Daniel > > > > Subject: [PATCH edk2-platforms 1/1] Silicon/SiFive: fix RELEASE builds of U54 > > PeiCoreInfoHobLib > > > > In function CreateU54E51CoreProcessorSpecificDataHob(), the > > FirmwareContext variable gets initialized an ASSERT_EFI_ERROR macro, > > meaning the initialization gets folded out for RELEASE builds. Use a > > temporary variable for the ASSERT instead. > > > > Fixes a build error of both u540 and u500 with gcc 8.3. > > > > Cc: Abner Chang > > Cc: Gilbert Chen > > Cc: Daniel Schaefer > > Signed-off-by: Leif Lindholm > > --- > > Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c > > b/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c > > index 6ddae632fd17..edeabf028ff8 100644 > > --- a/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c > > +++ b/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c > > @@ -56,6 +56,7 @@ CreateU54E51CoreProcessorSpecificDataHob ( > > RISC_V_PROCESSOR_SPECIFIC_HOB_DATA ProcessorSpecDataHob; > > EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; > > EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC > > *FirmwareContextHartSpecific; > > + EFI_STATUS Status; > > > > DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__)); > > > > @@ -63,7 +64,8 @@ CreateU54E51CoreProcessorSpecificDataHob ( > > return EFI_INVALID_PARAMETER; > > } > > > > - ASSERT_EFI_ERROR (SbiGetFirmwareContext (&FirmwareContext)); > > + Status = SbiGetFirmwareContext (&FirmwareContext); > > ASSERT_EFI_ERROR > ASSERT_EFI_ERROR() should start at the new line. I see this macro > just attached to the end of Status = SbiGetFirmwareContext > (&FirmwareContext). Is my editor problem? https://edk2.groups.io/g/devel/message/64794 It's your editor. > > + (Status); > Please add error condition check for the Status. Return > EFI_INVALID_PARAMETERS to caller, and also update the function > header for the case of @retval is EFI_INVALID_PARAMETER. Just > realized that we use @return in the function header instead of > @retval. I agree this looks like a better way of handling the failure, but I'll leave that to you. This patch simply stops the current handling from breaking RELEASE builds. Regards, Leif > > Thanks for this. > Abner > > > DEBUG ((DEBUG_INFO, " Firmware Context is at 0x%x.\n", > > FirmwareContext)); > > FirmwareContextHartSpecific = FirmwareContext->HartSpecific[HartId]; > > DEBUG ((DEBUG_INFO, " Firmware Context Hart specific is at 0x%x.\n", > > FirmwareContextHartSpecific)); > > -- > > 2.20.1 >