From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.3444.1599811179754541879 for ; Fri, 11 Sep 2020 00:59:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=mNU1Iy+N; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=05237a886b=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08B7xbRJ013326; Fri, 11 Sep 2020 07:59:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=X6Jxz2LBHQNpJ6d0+PFl/9sg573PWSatdQ72aE5ZtBM=; b=mNU1Iy+Nfhp2ND5uuQVd72m/bWHhPV1Cot3F+DOveO/nhDztLQy+7F/S8/ggI/pWKMId ZxVc1RvWwv67QmXT7MJ9hu6z4AA/izO0KOFOFXKUM8Qr9FxsXx5Lc4Rx7WEGWGFmZR/I hfxz2uFAizNEVraI4UQC+ZrcZp0fXjN+zL9s7EbjGWo4IL4jfRZPTgD8xbs7kG8c0Vjx NeIig7kom5iqc+31vOr2M2FUlkGonj5jkXGH+YU6m/4RVSqhZqWjQdyJH3DZhVhG/O6r Aqeop2FkiZPdsGVT/nKWp3YVOp5N2DwDwmyhmAuV5nmXXEaXsmJdyY71xEBVZvgcUbN+ dA== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 33f0uf8j2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Sep 2020 07:59:38 +0000 Received: from G9W8455.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.216.161.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id 3DDBD7C; Fri, 11 Sep 2020 07:59:20 +0000 (UTC) Received: from G9W8453.americas.hpqcorp.net (2002:10d8:a0d3::10d8:a0d3) by G9W8455.americas.hpqcorp.net (2002:10d8:a15e::10d8:a15e) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 11 Sep 2020 07:59:20 +0000 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (15.241.52.13) by G9W8453.americas.hpqcorp.net (16.216.160.211) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 11 Sep 2020 07:59:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DS2FDRf1Ctkl+rFX8rV0tUQTnrCCc/SKRjJj6qt6Sm3yOgSVyxavm3mE9MtwHNj95TE3pbYdaFlnaA2var35iO2Z2BPmMPWIDBfdiyqcxcdC/1VNtRGOEP1wBFNJxKv0bv7tMpSi8F0J8g7TAtwRQALGugxrQ9D5AHL+s7XuB6r2nwWaEUEz7h1jZJQIvUZzgvAA/d/1tygp2HLEqIY751eweSar3O6DwFGivCSOoUQN9lDjJn4fh4n1SiKJtlDdSu4Kn+0fPqXmna3jnoefpQAmRdN4hqlvoNHxIIV7h2VcqnDcRXT0ruPQrlQ7YMxP3q6r68xdlYCqgEMWllbNzA== 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=X6Jxz2LBHQNpJ6d0+PFl/9sg573PWSatdQ72aE5ZtBM=; b=bR2IDfAEurEf0fI8yTASq/u2x7mbJshjACnImcF2vUYEUQJI8C/M2/ELWZzmpCfdISmegdoxNMytGQsre4LIKIjDwSoOgWQXjCU39MdVjJDPsTYZW1riFrnJy5R/CL9y0TGtU3mwb1XYID1D6U/NOcGj2I8CZeBhf0MTyTwY6kfQlJ5cJP41sqCcwYssIWKZaOI626n+8paJffvuXUQIH0L+Cx7t17qSkCRemyXgQQ06xdu/gWCiZ/vH24s1MdbTN4N/xvB1ocUvn+HOZrAe6bKdtRUfFIJFBP+ko2BIM0XsKmcQN6BPnvKIb3KwkHkc0zlHG1il2YyaLUV6zMmLNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB1242.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7610::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Fri, 11 Sep 2020 07:59:19 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::11b0:1862:f48c:d2a9]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::11b0:1862:f48c:d2a9%9]) with mapi id 15.20.3370.016; Fri, 11 Sep 2020 07:59:18 +0000 Subject: Re: [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: Error handling for locating firmware context To: Abner Chang , CC: Leif Lindholm References: <20200908054844.25755-1-abner.chang@hpe.com> From: "Daniel Schaefer" Message-ID: <556055a0-5056-7949-903f-0f17999fa855@hpe.com> Date: Fri, 11 Sep 2020 15:59:00 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 In-Reply-To: <20200908054844.25755-1-abner.chang@hpe.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.10.6.166] (15.211.146.34) by SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.5 via Frontend Transport; Fri, 11 Sep 2020 07:59:17 +0000 X-Originating-IP: [15.211.146.34] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6156aabd-9e53-4be5-c347-08d8562895eb X-MS-TrafficTypeDiagnostic: DF4PR8401MB1242: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LsLZ8IufYoT9fGfbgCXc1SS8FjzDKhCQoigmXmMkqPmvTx1usPO10UBC2ctd50dfugbC6M1ZDHL27DzMB/0ehvulU8+LImsDpvkCQxksCJ9eaYA4PD576Vhsq5ylLz401D+1MOv0144gO64eItV9esZ+vpoj1nS7qtRW82j+F1qIXJckJRrzR8KpEnU0r63yBk4nLySvBzFtxG2e4o6QWh/Csp0JsPXBC7zX/rOpl+wKxn77cKe6EabYvfV6InGHaZ8WGS8+HhF0fHRSahlvTYMfFtYGA/n8zCoMqxkZyaq3Pj+BkhtHVVrfqjp3sh+je3LlcBGsrrKjN3dcAn8RJmD+IFYxM0wZb61Ap9vFfmCqYaJUfE0BAOYuTXimpRiX X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(136003)(366004)(39860400002)(316002)(8936002)(16576012)(44832011)(186003)(4326008)(16526019)(36756003)(6486002)(86362001)(26005)(31686004)(2616005)(53546011)(8676002)(478600001)(52116002)(83380400001)(66476007)(956004)(2906002)(5660300002)(31696002)(6666004)(66556008)(66946007)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: eQr5ynnA51+VYQ7uGCqnWayBtZiazudsjpc6yb2ZN74913HkOr146CQmjQKvNkOYfIp/30Gk4pPORgyNv6TyFQM1pKBVRQvqxVReGs7K21zMFVqvwY1ZxPIiRVJQxOwBCX1RHNA4INtdkPAAtaBnOSFwRqBDz29pY208vBEz3QYpPRV4k6k6FGgZwzaZCHfux/78YdUCDoTrcVXKvJqwlVpO77iuy4qdibgQHrYrg1Tnk8x0FQStwiCyIou29VL+nU1I7YVlLMl6o8d6eCYNCJd34nHdVehqWuU89v5LUlRs9MZ5pSgMmXHsdQNajarWfF3NMkMRD9hKSyk25BOaEwPWsBWJ/J+4fYhIqd8TaylQ7zdNaXhLpVnBnWIrsW1Pkdjjt9WqfcY0+Q8imA7lR39PxpUURjHFbsV65sOnlfMJVR1m49duTbx70BNkoQqhiSPAPisRnayQPM8R/zLpUlUgLsCaCTTuZMRLIORVaTiZiYN7jFw+AHsRpnF0FXDLunIo5K8K1z1fn+/wq+xK5uKYpTzyP5+zxjBIpmM7pXASxLlbBTjjLi+pOgJKyhKUjXzgedP8N+/hBHoIkix6Xny8+zjBKTLxgv6BdKD39be8S145Kn9BwZsF/qfNPeY0yOpcsM0JMsEAeww8hIXlIQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 6156aabd-9e53-4be5-c347-08d8562895eb X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:18.9050 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2ayBcXEl4AV5VLD+ERrww+5MsJOqlG8ydO889/znKduuzYVKqFzo9yhE203SszawrT+BF3nIbfQLpgMdoeZFuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB1242 X-OriginatorOrg: hpe.com X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-11_02:2020-09-10,2020-09-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 mlxscore=0 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=2 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009110061 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Oh no, what did I do here... I don't return proper error codes at all in this file. I forgot to revise this after the initial implementation. So, good change but we should do that for all functions in this file. I'll do that on Monday. On 9/8/20 1:48 PM, Abner Chang wrote: > Return EFI_NOT_FOUND if opensbi firmware context can not be > located using SBI call. > > Signed-off-by: Abner Chang > Cc: Daniel Schaefer > Cc: Leif Lindholm > --- > .../ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c > index 0df505d267..64c30b950d 100644 > --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c > +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c > @@ -851,6 +851,8 @@ SbiGetMscratchHartid ( > > @param[out] FirmwareContext The firmware context pointer. > @retval EFI_SUCCESS The operation succeeds. > + @retval EFI_NOT_FOUND Failed to get the pointer of EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT. > + > **/ > EFI_STATUS > EFIAPI > @@ -866,8 +868,9 @@ SbiGetFirmwareContext ( > ScratchSpace = (SBI_SCRATCH *)Ret.Value; > SbiPlatform = (SBI_PLATFORM *)sbi_platform_ptr(ScratchSpace); > *FirmwareContext = (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)SbiPlatform->firmware_context; > + } else { > + return EFI_NOT_FOUND; > } > - > return EFI_SUCCESS; > } > >