From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.4101.1571153185080810349 for ; Tue, 15 Oct 2019 08:26:25 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=019184da0c=abner.chang@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9FFCXlU025199; Tue, 15 Oct 2019 15:26:24 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 2vnft30ymm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Oct 2019 15:26:24 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id 540CC62; Tue, 15 Oct 2019 15:26:23 +0000 (UTC) Received: from G9W8676.americas.hpqcorp.net (16.220.49.23) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 15:26:23 +0000 Received: from G4W10205.americas.hpqcorp.net (2002:10cf:520f::10cf:520f) by G9W8676.americas.hpqcorp.net (2002:10dc:3117::10dc:3117) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 15:26:23 +0000 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (15.241.52.13) by G4W10205.americas.hpqcorp.net (16.207.82.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 15 Oct 2019 15:26:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TI3ECfYzMXHsmNqTtV7c5zLB/ZReGPCP4L0uJ7zaHBLkbLGRJmL8NBeXazbdUUndMh0J/GFMwi0FiAQLJ0ekHnUFTJRdycj9uqnrIloQn/6TxEEadd++BaoWW6xRjU8h6NFeqFDK5ih54/cTu2yk5Wngs8LX3WB+xNUihTkJ/mAlemlWs3Wgxl3exnFK9HREjtsUKiGYeGd2wPjSN5asZ0BwWIx5N30JQU0szW395Oda3vQPbvJxHCO2XHNw1z6VViP+/5N94Wa3A3gZ+R9w5SFbsdrT/rCz6xQIVxOaQWQi1KzSOb8Ypl5pLuu6l+ocIDKxLz5rHjrm4Mg1SWvf5A== 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=kaXH0UrCihKSUwwmCZrXKljZdrLl+DBJMSFEdRl7i+g=; b=fmf1OMZprPf+S+uLW+WL8e1+qgYeUPNiXryInJ0OQjL3VrH5HPrE1xDbv202fy9i+v9sBVRQQukH1NPIw4XGuqmkj4F4RHTlVeOwj9qPLUsIhJn7z1T85hdOdnO7u7xHPKQONvP2eMSWH5cmGTwcGWAlqbV7UxKNjI6oI5HRBPzeRTiL6ca7dflL0LkB8mciHByPG1KucoZaZdRXz/mroqn/S8+kWseMLfM85iwL8Q8V3mRW7OWWnsolNJBzEl2vB2Wgmb4kvMh+TlKyEGd24Fs0htxj6LkQCd5lg47/HuTAnvQOGx9gFeX+9d3UcUuEj4fJN0tY8xcLDXShBCJ7uQ== 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 Received: from CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM (10.169.12.151) by CS1PR8401MB0438.NAMPRD84.PROD.OUTLOOK.COM (10.169.24.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Tue, 15 Oct 2019 15:26:21 +0000 Received: from CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4fb:84b9:76e6:1cde]) by CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4fb:84b9:76e6:1cde%8]) with mapi id 15.20.2347.023; Tue, 15 Oct 2019 15:26:21 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "leif.lindholm@linaro.org" , "Chen, Gilbert" CC: Palmer Dabbelt Subject: Re: [edk2-devel] [plaforms/devel-riscv-v2 PATCHv2 05/14] RiscV/Library: Initial version of libraries introduced in RISC-V platform package Thread-Topic: [edk2-devel] [plaforms/devel-riscv-v2 PATCHv2 05/14] RiscV/Library: Initial version of libraries introduced in RISC-V platform package Thread-Index: AQHVbp2WDOXAC/gipEWXvj/mxP4zJ6dHqcoAgBRSkrA= Date: Tue, 15 Oct 2019 15:26:21 +0000 Message-ID: References: <20190919035131.4700-1-gilbert.chen@hpe.com> <20190919035131.4700-6-gilbert.chen@hpe.com> <20191002170454.GE25504@bivouac.eciton.net> In-Reply-To: <20191002170454.GE25504@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a2002109-8974-461e-d3c4-08d751840858 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: CS1PR8401MB0438: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:364; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(396003)(136003)(346002)(366004)(376002)(13464003)(189003)(199004)(25786009)(2501003)(76176011)(7736002)(2906002)(110136005)(316002)(52536014)(6116002)(3846002)(305945005)(81156014)(81166006)(8936002)(8676002)(229853002)(6636002)(186003)(102836004)(53546011)(6506007)(26005)(7696005)(66066001)(486006)(11346002)(446003)(99286004)(476003)(4326008)(6246003)(5660300002)(14454004)(55016002)(6306002)(6436002)(478600001)(9686003)(966005)(66476007)(71200400001)(66556008)(86362001)(76116006)(256004)(33656002)(14444005)(19627235002)(71190400001)(66446008)(74316002)(66946007)(64756008);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR8401MB0438;H:CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3o/f38izXdj7rpxx0sbJTDyX82rvWW6ezWulA/Li1EmyDohNVqd2YRX9O91YQIm0QG/1GSu8wYWXlSJAMUV6FLLumC6DLQ3IkloNhjRlc1TRnV70B08tL4nSRjOWQ3TxbyUFa35L04jwMrOTLn4pMNYqSE9lj024tOBs6ZK2cJxIR6jZ5bFtZAr+TNJhx6UZ9dsUrsCXeTTF4WllAI6atqX7EeUYze+0DQW04eYuHaNeIVypGiIX4a35areYMyu/jbSwqPj3q0rQ1Oen4GOvk3X+pVRSOn1ZMkutsZm5JsJ9yccEEmeeF2tJdl6/hrWwPawCQCXqVXOzDft4GGfl0PP/O9kyGDUV1KmR85w3UNrEaNjymtBqbdnL3UnNwZFEg7qhKVzscPLvkvNBjZvofIYkO1Yvm1g5kvtpHc24SGkKEJuWy0pCZ0BFyHYxXkBt7y23NomvS8Rpf8uu7YKqew== X-MS-Exchange-CrossTenant-Network-Message-Id: a2002109-8974-461e-d3c4-08d751840858 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2019 15:26:21.2767 (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: cZcW+tFSc9oF1LwwoPWTmfhkOs27e9hcpB/r8PTwhetZTDWb3TsBz8QN6ZZqu6jQZXUEyFdk46QUesc4FQXikA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0438 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-15_05:2019-10-15,2019-10-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 impostorscore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910150135 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Leif Lindholm > Sent: Thursday, October 3, 2019 1:05 AM > To: devel@edk2.groups.io; Chen, Gilbert > Cc: Palmer Dabbelt > Subject: Re: [edk2-devel] [plaforms/devel-riscv-v2 PATCHv2 05/14] > RiscV/Library: Initial version of libraries introduced in RISC-V platfor= m > package >=20 > On Thu, Sep 19, 2019 at 11:51:22AM +0800, Gilbert Chen wrote: > > FirmwareContextProcessorSpecificLib > > - Common library to consume > EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC > > and build up processor specific data HOB. > > > > RealTimClockLibNull > > - NULL instance of Real Time Clock library. > > > > Signed-off-by: Gilbert Chen > > --- > > .../FirmwareContextProcessorSpecificLib.c | 82 +++++++++ > > .../FirmwareContextProcessorSpecificLib.inf | 33 ++++ > > .../RealTimeClockLibNull/RealTimeClockLibNull.c | 204 > +++++++++++++++++++++ > > .../RealTimeClockLibNull/RealTimeClockLibNull.inf | 30 +++ >=20 > I think you can replace this NULL RealTimeClockLib implementation with > EmbeddedPkg/Library/VirtualRealTimeClockLib/ (which did not exist at the > time of the original port). >=20 > > 4 files changed, 349 insertions(+) > > create mode 100644 > > > Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/FirmwareCon > > textProcessorSpecificLib.c create mode 100644 > > > Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/FirmwareCon > > textProcessorSpecificLib.inf create mode 100644 > > Platform/RiscV/Library/RealTimeClockLibNull/RealTimeClockLibNull.c > > create mode 100644 > > Platform/RiscV/Library/RealTimeClockLibNull/RealTimeClockLibNull.inf > > > > diff --git > > a/Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/FirmwareC > > ontextProcessorSpecificLib.c > > > b/Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/FirmwareC > > ontextProcessorSpecificLib.c > > new file mode 100644 > > index 00000000..4d4c51dc > > --- /dev/null > > +++ b/Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/Firmw > > +++ areContextProcessorSpecificLib.c > > @@ -0,0 +1,82 @@ > > +/**@file > > + Common library to build upfirmware context processor-specific > > +information > > + > > + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All > > + rights reserved.
> > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +// > > +// The package level header files this module uses // #include > > + > > + > > +// > > +// The Library classes this module consumes // #include > > + #include #include > > + >=20 > Please sort these includes alphabetically. >=20 > > + > > +#include > > +#include #include > > + >=20 > Please sort these includes alphabetically. >=20 > > +#include > > +#include > > +#include > > + > > +/** > > + Build up common firmware context processor-specific information > > + > > + @param FirmwareContextHartSpecific Pointer to > EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC > > + @param ParentProcessorGuid Pointer to GUID of Processor w= hich > contains this core > > + @param ParentProcessorUid Unique ID of pysical processor= which > owns this core. > > + @param CoreGuid Pointer to GUID of core > > + @param HartId Hart ID of this core. > > + @param IsBootHart This is boot hart or not > > + @param ProcessorSpecDataHob Pointer to > RISC_V_PROCESSOR_SPECIFIC_DATA_HOB > > + > > + @return EFI_STATUS > > + > > +**/ > > +EFI_STATUS > > +EFIAPI > > +CommonFirmwareContextHartSpecificInfo ( > > + EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC > > +*FirmwareContextHartSpecific, > > + EFI_GUID *ParentProcessorGuid, > > + UINTN ParentProcessorUid, > > + EFI_GUID *CoreGuid, > > + UINTN HartId, > > + BOOLEAN IsBootHart, > > + RISC_V_PROCESSOR_SPECIFIC_DATA_HOB *ProcessorSpecDataHob >=20 > Spec is not a clear enough abbreviation, please use Specific. > Or call it something else. If you keep the name, it certainly wouldn't h= urt to > use a local variable with a shorter name.. This will be RISC_V_PROCESSOR_SPECIFIC_HOB_DATA in v3 edk2-staging patches= . >=20 > > + ) > > +{ > > + // > > + // Build up RISC_V_PROCESSOR_SPECIFIC_DATA_HOB. > > + // > > + CopyGuid (&ProcessorSpecDataHob->ParentPrcessorGuid, > > +ParentProcessorGuid); > > + ProcessorSpecDataHob->ParentProcessorUid =3D ParentProcessorUid; > > + CopyGuid (&ProcessorSpecDataHob->CoreGuid, CoreGuid); > > + ProcessorSpecDataHob->Context =3D NULL; > > + ProcessorSpecDataHob->ProcessorSpecificData.Revision =3D > SMBIOS_RISC_V_PROCESSOR_SPECIFIC_DATA_REVISION; >=20 > 80 Characters is up to = here -> > These lines are way too long, please wrap them. >=20 > > + ProcessorSpecDataHob->ProcessorSpecificData.Length =3D si= zeof > (SMBIOS_RISC_V_PROCESSOR_SPECIFIC_DATA); > > + ProcessorSpecDataHob->ProcessorSpecificData.HartId.Value64_L =3D > > +(UINT64)HartId; > > + ProcessorSpecDataHob->ProcessorSpecificData.HartId.Value64_H =3D 0; > > + ProcessorSpecDataHob->ProcessorSpecificData.BootHartId =3D > (UINT8)IsBootHart; > > + ProcessorSpecDataHob->ProcessorSpecificData.InstSetSupported =3D > FirmwareContextHartSpecific->IsaExtensionSupported; > > + ProcessorSpecDataHob- > >ProcessorSpecificData.PrivilegeModeSupported =3D > SMBIOS_RISC_V_PSD_MACHINE_MODE_SUPPORTED; > > + if ((ProcessorSpecDataHob->ProcessorSpecificData.InstSetSupported & > RISC_V_ISA_SUPERVISOR_MODE_IMPLEMENTED) !=3D 0) { > > + > > +ProcessorSpecDataHob->ProcessorSpecificData.PrivilegeModeSupported > |=3D > > +SMBIOS_RISC_V_PSD_SUPERVISOR_MODE_SUPPORTED; > > + } > > + if ((ProcessorSpecDataHob->ProcessorSpecificData.InstSetSupported & > RISC_V_ISA_USER_MODE_IMPLEMENTED) !=3D 0) { > > + > > +ProcessorSpecDataHob->ProcessorSpecificData.PrivilegeModeSupported > |=3D > > +SMBIOS_RISC_V_PSD_USER_MODE_SUPPORTED; > > + } > > + > > +ProcessorSpecDataHob- > >ProcessorSpecificData.MachineVendorId.Value64_L > > +=3D FirmwareContextHartSpecific->MachineVendorId.Value64_L; > > + > > +ProcessorSpecDataHob- > >ProcessorSpecificData.MachineVendorId.Value64_H > > +=3D FirmwareContextHartSpecific->MachineVendorId.Value64_H; > > + ProcessorSpecDataHob- > >ProcessorSpecificData.MachineArchId.Value64_L > > +=3D FirmwareContextHartSpecific->MachineArchId.Value64_L; > > + ProcessorSpecDataHob- > >ProcessorSpecificData.MachineArchId.Value64_H > > +=3D FirmwareContextHartSpecific->MachineArchId.Value64_H; > > + ProcessorSpecDataHob- > >ProcessorSpecificData.MachineImplId.Value64_L > > +=3D FirmwareContextHartSpecific->MachineImplId.Value64_L; > > + ProcessorSpecDataHob- > >ProcessorSpecificData.MachineImplId.Value64_H > > +=3D FirmwareContextHartSpecific->MachineImplId.Value64_H; > > + return EFI_SUCCESS; > > +} > > diff --git > > a/Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/FirmwareC > > ontextProcessorSpecificLib.inf > > > b/Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/FirmwareC > > ontextProcessorSpecificLib.inf > > new file mode 100644 > > index 00000000..ff841c3e > > --- /dev/null > > +++ b/Platform/RiscV/Library/FirmwareContextProcessorSpecificLib/Firmw > > +++ areContextProcessorSpecificLib.inf > > @@ -0,0 +1,33 @@ > > +#/** @file > > +# > > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All > > +rights reserved.
# # SPDX-License-Identifier: > > +BSD-2-Clause-Patent # #**/ > > + > > +[Defines] > > + INF_VERSION =3D 0x00010005 >=20 > Can we update to a more recent specification version? >=20 > > + BASE_NAME =3D FirmwareContextProcessorSpecific= Lib > > + FILE_GUID =3D 8BEC9FD7-C554-403A-94F1-0EBBFD81= A242 > > + MODULE_TYPE =3D PEIM > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D FirmwareContextProcessorSpecific= Lib > > + > > +[Sources.common] > > + FirmwareContextProcessorSpecificLib.c > > + > > +[Packages] > > + MdePkg/MdePkg.dec > > + MdeModulePkg/MdeModulePkg.dec >=20 > Please sort the above alphabetically. >=20 > > + RiscVPkg/RiscVPkg.dec > > + Silicon/SiFive/SiFive.dec > > + > > +[LibraryClasses] > > + BaseLib > > + PcdLib > > + MemoryAllocationLib >=20 > Please sort the above alphabetically. >=20 > > + PrintLib > > + > > +[Pcd] > > + >=20 > / > Leif >=20 >=20