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.14825.1642785223626338119 for ; Fri, 21 Jan 2022 09:13:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=DFIzOh3Z; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=00207f782d=abner.chang@hpe.com) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20LGVsvn016865; Fri, 21 Jan 2022 17:13:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=pps0720; bh=D6K++05J4Rs6Sa/TsJADiNptsy7DlhTw2vIeWotHptE=; b=DFIzOh3Zc3OMdtzmU2Ws9YZECxENrtstFLKm+1p5eyKGqGJtwnXkyJJGwTDMeH0novun lZKTk5zFPYAc/sEyxsS7i1ADGMssijpfabQqgxiPDVkgwa62KeJl4yLJg8gUgAvpufzN sfn0idXh4m87CA+joAVivyjzYiJO1TdYNvtdXs5efardEKbS4DJ1flmZs1RtvZ/+4Yvy CgUK72TkNMH/sUkJXGJps+UqFTOojOzdb1uybWDzPaWAXSiOCbI6eUmtvEJkHTfrANcE GmxzkYAkPMqnfFDldwv7FUV1GiIanjQffqdbQ2ORhzlE+L7NZVWzty3r9a/vnKfT4ziw MA== Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3dqrf54kx8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jan 2022 17:13:32 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (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 5A84466; Fri, 21 Jan 2022 17:13:31 +0000 (UTC) Received: from G4W9331.americas.hpqcorp.net (16.208.32.117) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 21 Jan 2022 17:13:25 +0000 Received: from G9W9209.americas.hpqcorp.net (2002:10dc:429c::10dc:429c) by G4W9331.americas.hpqcorp.net (2002:10d0:2075::10d0:2075) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 21 Jan 2022 17:13:24 +0000 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (15.241.52.10) by G9W9209.americas.hpqcorp.net (16.220.66.156) with Microsoft SMTP Server (TLS) id 15.0.1497.23 via Frontend Transport; Fri, 21 Jan 2022 17:13:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MbNhx4POK5WGA+g1oMGs1Vu7PP0Bgt8WmF5PEaqtdYBUUFtD4t6gGWrfBz+g2yLCCmPOkjRaqcWcmBEvSGgnzQfErs+Sfo3jumrpmUeMgF59J9pc5heHu6vsgdLKi7qQYTUO8dyJ/3W+AZFwQO+j3XdJwGuJ1Dw3v9SPqNm9uEcPqWx19tFo1WMoeVqECIWX/6HocDan9b8W8lrd3CFELag3wRYlcvfYI3dkYVqXvSCNvc6Vxzbabt8Ac53A2z7TlNh1wiaNwxBEIaqL80O1vNbacXL876SZLQdWrreQC5jxdiiL0zH1gZie0XwcbscC34O5HCEgCy5fNjNJT3XmKQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qjzo1NQthK4uuSZ3S0BIl1OjgNT8ez9/I+h/SkKV9SQ=; b=oJtm7UO88+4kGld/ANmsxXfBugh2MDtvDEw7RK6eRGtJgkjT7z356t5cSlp+ZAopJLmMNtMpLYD8YaTVvHjOmwfxIotlnNieVjL/ZZET2YmS4CGJ3OKOn5sTmmSUbeji2jnwwLzd0yVUMbuP7v9EFVrELDclNvR1gMEdFbhSh25dQ9NEUXAE7IF6IX0GFjrQ4CkeEb4BQyb2nuQnDI24Lo2ktHNoeza2YzS8xLRhvx/MaRthkyqT027hm4yP4pvYW4xvyeKldgPG3pzHdvsrbg1Cc+mWH6LvleyrBsVm/zZFhdz8Kp1IEDlmt6O199uBM1RtFLaC+OIBPpowZlerLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:154::18) by PH0PR84MB2026.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:161::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.12; Fri, 21 Jan 2022 17:13:22 +0000 Received: from PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM ([fe80::29fe:6cc2:38e0:4b55]) by PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM ([fe80::29fe:6cc2:38e0:4b55%7]) with mapi id 15.20.4867.011; Fri, 21 Jan 2022 17:13:22 +0000 From: "Abner Chang" To: "Kinney, Michael D" , Leif Lindholm , "devel@edk2.groups.io" , "Ni, Ray" CC: Andrew Fish , Sami Mujawar Subject: Re: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add header files of RISC-V processor package Thread-Topic: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add header files of RISC-V processor package Thread-Index: AQHYBE3Ws8a+InXY4U2aPaCahLFdK6xcPmKAgAAt0oCAAADggIAEBp9ggAC7ioCAATeE0IAAVi8AgAsOPyc= Date: Fri, 21 Jan 2022 17:13:22 +0000 Message-ID: References: <20220108040753.15926-1-abner.chang@hpe.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 57799c13-87c6-80ac-9001-a05b03679616 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 975685ca-c4c4-4fce-28a4-08d9dd01540b x-ms-traffictypediagnostic: PH0PR84MB2026:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: M1ZQLvYnZmGQVLT+ThK9uzw9Op+DkIj4MsahA8qtpA+f2McI1cpG7S3/4Rg7R3fLip0mLr7TQH2GYAUGOm/Q/ciT0RE1v/WZ7cy14Lq9jRL3MPwb7wkjGCZ6F+0A7imPer6TB/CUVuTMRXCzLaoEe7BIVmXcD4uK7z3e9D/4bIbYghMeBPnOAmxKkvXAKw5Jcw0Wz2ep9Zt3xc08ZjMw3eEGYdmnX4qksvJ7jg4sMbhCwp6JyEmzfioE2lA3O9+k0LrrSqh2JvI9QcSpDuyAdJy0vqesSOA/MbDv7lG5bqUf3IBF0jA6zaY8aoY2fQkO8FuLOGMUFLqn68JUTYpftTo4WI+7GKCAvoBkDCK9QRiFGIKnQ7fcYj4Sb2Q2lNqlR1lk/7XMWNn4ExN6xNOdd/erwA7FGRojdWRoFP/645lBop2siYuRt2aHm0WbqwvCv+IAxdBrrFQS86bpCmOjqQ5feqVUyCUvmzVLnMAKavRaXpkVnbQbXDqOp4KB4DuUYBt8EIBET2mBPh6RyFjK/+NPxJOht+n4sY2VVy/INRhGl/1hnWPir0XG+kwytGAGneJFC5rZckeTfIDetEYx8vF8UZ6WK04KFLPPVvDVfzHZgy4GKv52qq4N8BchiigsSkdG+3iUFTCK4NX+ZvQ5JdkmCVT+D4unOapoHpINEVkOI2HCSMWT/0ffMmNMUxgEJren6bQQl5IvREWsYuxc0GJ/v59ItdiJ3sfxYwli7AgAGB2WQVNk5qFnsm3UGymucmNEu9ISgtvYvjlwjzCpp087um2Z/99kuxr92IuSXe2TeeXcZ7bybXrGn4PC2qMCGRRJWYrNFf2YVrdgnfrPfw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(5660300002)(83380400001)(2906002)(33656002)(8936002)(8676002)(316002)(9686003)(54906003)(71200400001)(110136005)(4326008)(55016003)(30864003)(86362001)(19627405001)(38070700005)(52536014)(166002)(66476007)(186003)(26005)(508600001)(82960400001)(966005)(55236004)(6506007)(53546011)(66556008)(64756008)(7696005)(122000001)(66946007)(66446008)(91956017)(38100700002)(76116006)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DMkXAGuMQjLAkw0ghXC0Tc/m324S74/hc1GRIJSe2LTUJILnfgSmkNuAbIzq?= =?us-ascii?Q?GT2O2cVmEQqGgOI59lUfvhkKQv1nLYnZFuY9CqW9EgIPsRLPvy4ESLgN4Bts?= =?us-ascii?Q?8Bi2mPr86Nij1dV2v3qeJhpy3vyF1mPqxpH9Lo6mxOeJ+M4Zbr2FtX9/KxIX?= =?us-ascii?Q?Vs44R06/5VLtVBP+XRDSb/5pay9tYqP8eHuJF0EJ2/0OTM1Ddys/Mw/RDT3e?= =?us-ascii?Q?esLb0o9ZyyrPjfTW9CHXTp59TJQooOBi+V9BPMuQdfP4ljBDGWMdlL6pQNB4?= =?us-ascii?Q?7HnG9QEpfzAva4rC4rUi00mqaHGWYRbFgY4Cm7Y/Vzlx5syIQ6+g8RS2ZnyV?= =?us-ascii?Q?FEdGO8cayhKcin3a68aF2xtwlz7Qj4WYommja1iu5ZApZ/jSzbwtygnahRoF?= =?us-ascii?Q?e76GE9ml//ESpS3A23S3eZAV1WMDS+vajSyzUL/BHtnrsOyzDU+VQ9FCL+O/?= =?us-ascii?Q?YhOWGiWp1ZrEWfGO6BVcg6WtS2Z75AwpN5eIeCpV96Rj23ZPseC2/1SUFG4p?= =?us-ascii?Q?YHoilmIoIa655Py/lhyD9yAhpugRxg3vESgyagDuQxyoYi6Akc74v89g/MXE?= =?us-ascii?Q?7kRQZNzUwpqLQ0LZyvrPeEu2bKhvje6HSo9mMypudRsqq0YCbVcl6+ozcBAv?= =?us-ascii?Q?ZjB/k5Pop7f0EJJ2i3uzzJPH387H3o3zQX4YmGp9AOU+NXmi0kTqzwrzaMUH?= =?us-ascii?Q?ysd6oIA2Ft/L23N0HDtc4vtM0+S3Xjo1tG49yD5VM3LS1WIsXe3Egiv3QHMu?= =?us-ascii?Q?oT+aXRw8UYQt+ek6Ck68dKdcBhXEwecSqlFZZevahQxPs+j/zZ8hx9JGZHhJ?= =?us-ascii?Q?gIXdQrrxIsQIXwGDggqeRLxrXFWoxfngpTrGemMZZCtXegRMuXnVgQI7O8Ir?= =?us-ascii?Q?Ik0RpMOCTxrTiktYUhErekXBCmNYuKBuzvziSqgPxQRNwDGxKwg/WkXgU3SC?= =?us-ascii?Q?uWu8KZFM+aiyYzhl1nICEHErzeeCfNBAxmw70ZIdXrqG/7tkEDq5xq2aEuQ5?= =?us-ascii?Q?pavs+BOJuQ89mRXLV8OKQLGmiOLTKl9xgsoVdGbHVg5ZF0wzjWqEjkMbk7Ev?= =?us-ascii?Q?OnHdPpXJ5A5D1/l2gaJ3PyCp9Bz1EJWgnqU6MqM1sOouKV6P5saPjhrueNcG?= =?us-ascii?Q?o0MTKjSy/aVRM5XIfP+Iqwr9EGKC9nmTt9WITzG7TJIW7dR7DS47Mv0eaAzc?= =?us-ascii?Q?CVhklEoGmnNoArIp/u4bCmMHx5qUN7/3fLjObCX9aaPieRZ1USkiyhoaGRkq?= =?us-ascii?Q?NHNlUk4IOjdIQ1tASs0OKXlIAiyuz9uQgz+JfW4HThSk+n0HI4VTh7CVkJHA?= =?us-ascii?Q?txJcwURHav68DEz49XIylVpigacp+nab4P/dod7Y0QTiiMWl44jz3MlSG3Su?= =?us-ascii?Q?PKlmoJHgyiFK/MRDnnZQ/oONMRaVyMEpfAmW6YbFHBdB4Kpm6ItIVD0o2GLt?= =?us-ascii?Q?Y4cpVesBXr0W0/Jj1dy1N8b0tsV8nR11X0qPnTLPl+4YIWmOirNxUtikHUeX?= =?us-ascii?Q?zh7NwVR4eWAEJrsiq1aFMdgifOqugdtqWjfo2pbnVrfgRPkVGYGwhU4AxRBw?= =?us-ascii?Q?VfJdlarmVSS66Fxg3EbQYn7ERtgjTdG24PSLJGK+9preVVLYUJiDAJGlY5S0?= =?us-ascii?Q?VgiCkZ1C3riTzSsok5vXEAU=3D?= X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 975685ca-c4c4-4fce-28a4-08d9dd01540b X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2022 17:13:22.2484 (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: BhGYLFUcc+IutZxtwFqGd0rb96LuW0ahs/c3iyKe9+TuuI9QYniBL8JrDZdtgniehdOmJ+d1+g1tso261O2NYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR84MB2026 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: O8G_1zUjtAPQSwY95QlIiHRkOSks4sKF X-Proofpoint-ORIG-GUID: O8G_1zUjtAPQSwY95QlIiHRkOSks4sKF X-Proofpoint-UnRewURL: 9 URL's were un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-21_09,2022-01-21_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 impostorscore=0 clxscore=1015 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210113 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_PH7PR84MB188585E0B90ED323FF1D99DAFF5B9PH7PR84MB1885NAMP_" --_000_PH7PR84MB188585E0B90ED323FF1D99DAFF5B9PH7PR84MB1885NAMP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ok Mike and Leif, Another question regarding to the location of RISC-V Virtual package for QE= MU. What is the location and package you think RISC-V or other processor ar= chitectures should stay with? Thanks Abner ________________________________ From: Kinney, Michael D Sent: Saturday, January 15, 2022 12:21 AM To: Chang, Abner (HPS SW/FW Technologist) ; Leif Lindh= olm ; devel@edk2.groups.io ; Ni, R= ay ; Kinney, Michael D Cc: Andrew Fish ; Sami Mujawar Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add header fi= les of RISC-V processor package Hi Abner, We already have a package for common platform content in the edk2 repo. This is the MdeModulePkg. However, the number of common platform features added to the MdeModulePkg o= ver time has made this a very large package, and this can be measured by how co= mplex the Maintainer.txt rules are for this package. The revised approach is to create feature packages that platforms can add if their platform requires that specific feature category. Examples are NetworkPkg, SecurityPkg, FmpDevicePkg, FatPkg, RedfishPkg, SourceLevelDebug= Pkg. Instead of adding another generic package such as CommonPlatformPkg, I would prefer to see the libs/modules either added to existing packages that match the feature category, or create new feature packages if there is a new feature category. We also try to limit the edk2 repo to components that are directly related the UEFI/PI specifications and are not Si/Platform specific. Si/Platform specific features go into the edk2-platforms repo. An example of a generic feature in the edk2-platforms repo is Features/Ext4. The UEFI spec only specifies FAT for UEFI boot from file system. There are a number of other feature packages in edk2-platforms in the Features directory, so you should review those as well to see if there is natural landing zone for any of your components. Mike > -----Original Message----- > From: Chang, Abner (HPS SW/FW Technologist) > Sent: Friday, January 14, 2022 3:15 AM > To: Kinney, Michael D ; Leif Lindholm ; devel@edk2.groups.io; Ni, Ray > > Cc: Andrew Fish ; Sami Mujawar > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add header = files of RISC-V processor package > > > > > -----Original Message----- > > From: Kinney, Michael D > > Sent: Friday, January 14, 2022 12:38 AM > > To: Chang, Abner (HPS SW/FW Technologist) ; Leif > > Lindholm ; devel@edk2.groups.io; Ni, Ray > > ; Kinney, Michael D > > Cc: Andrew Fish ; Sami Mujawar > > > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add heade= r > > files of RISC-V processor package > > > > Hi Abner, > > > > General recommendations included below. Of course each > > lib/modules/include needs to be reviewed and the > > best location selected. I am aware that there are components in edk2 t= hat > > do not follow these general > > recommendations. This is due to content that was added before these > > recommendations were established > > and we have work to do to get everything aligned. > > > > Mike > > > > > -----Original Message----- > > > From: Chang, Abner (HPS SW/FW Technologist) > > > Sent: Wednesday, January 12, 2022 9:34 PM > > > To: Kinney, Michael D ; Leif Lindholm > > ; devel@edk2.groups.io; Ni, Ray > > > > > > Cc: Andrew Fish ; Sami Mujawar > > > > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add > > header files of RISC-V processor package > > > > > > HI Mike, > > > It is no problem to meet there. However, I am not available to join t= he > > design meeting in the next two weeks. Before we can get > > > together to discuss the best locations, do you have information regar= ding > > the rationale of driver/library location? > > > > > > What is the best location for, > > > - Processor ARCH dependent modules > > > > MdePkg for libs > > UefiCpuPkg for modules > > > > > - Common modules for all processor ARCHs > > > > Feature Packages based on the common feature. Add to existing if it fi= ts. > > Create new for completely new feature area. > > > > > - Platform module that is specific to processor ARCH? > > > > edk2-platform repository > How about Leif's suggestion? The CommonPlatformPkg on edk2? > > Abner > > > > > The only exception so far are platform modules used to support > > OvmfPkg/QEMU to support CI. > > In this case the modules are added to OvmfPkg. > > > > > - Platform module that is common to processor ARCHs? > > > > edk2-platform repository > > > > The only exception so far are platform modules used to support > > OvmfPkg/QEMU to support CI. > > In this case the modules are added to OvmfPkg. > > > > > > > > Thanks > > > Abner > > > > > > > -----Original Message----- > > > > From: Kinney, Michael D > > > > Sent: Monday, January 10, 2022 11:58 PM > > > > To: Leif Lindholm ; devel@edk2.groups.io; Chang, > > Abner > > > > (HPS SW/FW Technologist) ; Kinney, Michael D > > > > ; Ni, Ray > > > > Cc: Andrew Fish ; Sami Mujawar > > > > > > > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add > > header > > > > files of RISC-V processor package > > > > > > > > Hi Abner, > > > > > > > > I see comments from Leif as well. > > > > > > > > Do you think a discussion in the design meeting Ray Ni runs would b= e > > > > valuable > > > > to review all the modules/libs/includes and discuss options for the= best > > > > location for them to reside in the edk2 repos? > > > > > > > > Thanks, > > > > > > > > Mike > > > > > > > > > -----Original Message----- > > > > > From: Kinney, Michael D > > > > > Sent: Monday, January 10, 2022 7:55 AM > > > > > To: Leif Lindholm ; devel@edk2.groups.io; Chan= g, > > > > Abner ; Kinney, Michael D > > > > > > > > > > Cc: Andrew Fish ; Sami Mujawar > > > > > > > > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add > > > > header files of RISC-V processor package > > > > > > > > > > Hi Abner, > > > > > > > > > > I would also like to see some proposals on adding the RiscV CPU s= coped > > > > content > > > > > to the existing MdePkg/UefiCpuPkg instead of adding a new top lev= el > > CPU > > > > package. > > > > > > > > > > There is already some work started to move some of the ARM specif= ic > > > > content > > > > > from ARM CPU packages into MdePkg. > > > > > > > > > > Thanks, > > > > > > > > > > Mike > > > > > > > > > > > -----Original Message----- > > > > > > From: Leif Lindholm > > > > > > Sent: Monday, January 10, 2022 5:11 AM > > > > > > To: devel@edk2.groups.io; Chang, Abner > > > > > > Cc: Andrew Fish ; Kinney, Michael D > > > > ; Sami Mujawar > > > > > > > > Subject: Re: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: A= dd > > > > header files of RISC-V processor package > > > > > > > > > > > > On Sat, Jan 08, 2022 at 12:07:53 +0800, Abner Chang wrote: > > > > > > > (This is migrated from edk2-platforms:Silicon/RISC-V) > > > > > > > > > > > > > > RISC-V processor package library definitions. > > > > > > > > > > > > > > IndustryStandard/RiscV.h > > > > > > > -Add RiscV.h which conform with RISC-V Privilege Spec v1.10. > > > > > > > > > > > > > > RiscVImpl.h > > > > > > > -Definition of EDK2 RISC-V implementation. > > > > > > > > > > > > > > Signed-off-by: Abner Chang > > > > > > > Co-authored-by: Daniel Schaefer > > > > > > > Co-authored-by: Gilbert Chen > > > > > > > Reviewed-by: Leif Lindholm > > > > > > > > > > > > Hmm, no. > > > > > > I gave a reviewed-by for that patch to be merged into edk2-plat= forms > > > > > > once upon a time. This is not relevant for migration to edk2. > > > > > > > > > > > > My proposal for migrating this code would be as follows: > > > > > > - Announce a hold on merging new code to RiscV portions of > > > > > > edk2-platforms. > > > > > > - Apply any and all bugfixes and CI/uncrustify fixes in place i= n > > > > > > edk2-platforms. > > > > > > - Get some level of agreement for what to do instead of > > > > > > RiscVPlatformPkg - i.e. slot into MdeModulePkg instead. > > > > > > - If that cannot be reached within a few days, create a new > > > > > > top-level directory called "CommonPlatformPkg" or somethin= g, > > > > > > with you, Daniel(/Gilbert?), Sami, me as maintainers. > > > > > > - Move all of the RiscVPlatformPkg code under there instea= d. > > > > > > - I'll follow with ArmPlatformPkg. > > > > > > - PC/AT code should move across too over time. > > > > > > - Move the rest of the code across unmodified as massive single > > > > > > patches per package (potentially more patches than that for > > > > > > RiscVPlatformPkg). > > > > > > - Drop all existing Reviewed-by/Acked-by. > > > > > > - After each "move" patch, insert a "fixup" patch to address = the > > > > > > things that need fixing due to path/name changes. > > > > > > > > > > > > / > > > > > > Leif > > > > > > > > > > > > > Cc: Leif Lindholm > > > > > > > Cc: Gilbert Chen > > > > > > > --- > > > > > > > .../Include/IndustryStandard/RiscV.h | 156 > > ++++++++++++++++++ > > > > > > > .../RISC-V/ProcessorPkg/Include/RiscVImpl.h | 87 ++++++++= ++ > > > > > > > 2 files changed, 243 insertions(+) > > > > > > > create mode 100644 Silicon/RISC- > > > > V/ProcessorPkg/Include/IndustryStandard/RiscV.h > > > > > > > create mode 100644 Silicon/RISC- > > V/ProcessorPkg/Include/RiscVImpl.h > > > > > > > > > > > > > > diff --git a/Silicon/RISC- > > > > V/ProcessorPkg/Include/IndustryStandard/RiscV.h b/Silicon/RISC- > > > > > > V/ProcessorPkg/Include/IndustryStandard/RiscV.h > > > > > > > new file mode 100644 > > > > > > > index 0000000000..2a992394ed > > > > > > > --- /dev/null > > > > > > > +++ b/Silicon/RISC- > > V/ProcessorPkg/Include/IndustryStandard/RiscV.h > > > > > > > @@ -0,0 +1,156 @@ > > > > > > > +/** @file > > > > > > > + RISC-V package definitions. > > > > > > > + > > > > > > > + Copyright (c) 2019, Hewlett Packard Enterprise Development= LP. > > All > > > > rights reserved.
> > > > > > > + > > > > > > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > + > > > > > > > +**/ > > > > > > > + > > > > > > > +#ifndef RISCV_INDUSTRY_STANDARD_H_ > > > > > > > +#define RISCV_INDUSTRY_STANDARD_H_ > > > > > > > + > > > > > > > +#if defined (MDE_CPU_RISCV64) > > > > > > > +#define RISC_V_XLEN_BITS 64 > > > > > > > +#else > > > > > > > +#endif > > > > > > > + > > > > > > > +#define RISC_V_ISA_ATOMIC_EXTENSION (0x00000= 001 << > > 0) > > > > > > > +#define RISC_V_ISA_BIT_OPERATION_EXTENSION > > (0x00000001 > > > > << 1) > > > > > > > +#define RISC_V_ISA_COMPRESSED_EXTENSION (0x00000= 001 > > << > > > > 2) > > > > > > > +#define RISC_V_ISA_DOUBLE_PRECISION_FP_EXTENSION > > > > (0x00000001 << 3) > > > > > > > +#define RISC_V_ISA_RV32E_ISA (0x00000= 001 << 4) > > > > > > > +#define RISC_V_ISA_SINGLE_PRECISION_FP_EXTENSION > > > > (0x00000001 << 5) > > > > > > > +#define RISC_V_ISA_ADDITIONAL_STANDARD_EXTENSION > > > > (0x00000001 << 6) > > > > > > > +#define RISC_V_ISA_RESERVED_1 (0x00000= 001 << 7) > > > > > > > +#define RISC_V_ISA_INTEGER_ISA_EXTENSION (0x00000= 001 > > << > > > > 8) > > > > > > > +#define > > > > RISC_V_ISA_DYNAMICALLY_TRANSLATED_LANGUAGE_EXTENSION > > > > (0x00000001 << 9) > > > > > > > +#define RISC_V_ISA_RESERVED_2 (0x00000= 001 << 10) > > > > > > > +#define RISC_V_ISA_DECIMAL_FP_EXTENSION (0x00000= 001 > > << > > > > 11) > > > > > > > +#define RISC_V_ISA_INTEGER_MUL_DIV_EXTENSION > > (0x00000001 > > > > << 12) > > > > > > > +#define RISC_V_ISA_USER_LEVEL_INTERRUPT_SUPPORTED > > > > (0x00000001 << 13) > > > > > > > +#define RISC_V_ISA_RESERVED_3 (0x00000= 001 << 14) > > > > > > > +#define RISC_V_ISA_PACKED_SIMD_EXTENSION > > (0x00000001 << > > > > 15) > > > > > > > +#define RISC_V_ISA_QUAD_PRECISION_FP_EXTENSION > > > > (0x00000001 << 16) > > > > > > > +#define RISC_V_ISA_RESERVED_4 (0x00000= 001 << 17) > > > > > > > +#define RISC_V_ISA_SUPERVISOR_MODE_IMPLEMENTED > > > > (0x00000001 << 18) > > > > > > > +#define RISC_V_ISA_TRANSATIONAL_MEMORY_EXTENSION > > > > (0x00000001 << 19) > > > > > > > +#define RISC_V_ISA_USER_MODE_IMPLEMENTED > > (0x00000001 > > > > << 20) > > > > > > > +#define RISC_V_ISA_VECTOR_EXTENSION (0x00000= 001 << > > 21) > > > > > > > +#define RISC_V_ISA_RESERVED_5 (0x00000= 001 << 22) > > > > > > > +#define RISC_V_ISA_NON_STANDARD_EXTENSION > > (0x00000001 > > > > << 23) > > > > > > > +#define RISC_V_ISA_RESERVED_6 (0x00000= 001 << 24) > > > > > > > +#define RISC_V_ISA_RESERVED_7 (0x00000= 001 << 25) > > > > > > > + > > > > > > > +// > > > > > > > +// RISC-V CSR definitions. > > > > > > > +// > > > > > > > +// > > > > > > > +// Machine information > > > > > > > +// > > > > > > > +#define RISCV_CSR_MACHINE_MVENDORID 0xF11 > > > > > > > +#define RISCV_CSR_MACHINE_MARCHID 0xF12 > > > > > > > +#define RISCV_CSR_MACHINE_MIMPID 0xF13 > > > > > > > +#define RISCV_CSR_MACHINE_HARRID 0xF14 > > > > > > > +// > > > > > > > +// Machine Trap Setup. > > > > > > > +// > > > > > > > +#define RISCV_CSR_MACHINE_MSTATUS 0x300 > > > > > > > +#define RISCV_CSR_MACHINE_MISA 0x301 > > > > > > > +#define RISCV_CSR_MACHINE_MEDELEG 0x302 > > > > > > > +#define RISCV_CSR_MACHINE_MIDELEG 0x303 > > > > > > > +#define RISCV_CSR_MACHINE_MIE 0x304 > > > > > > > +#define RISCV_CSR_MACHINE_MTVEC 0x305 > > > > > > > + > > > > > > > +#define RISCV_TIMER_COMPARE_BITS 32 > > > > > > > +// > > > > > > > +// Machine Timer and Counter. > > > > > > > +// > > > > > > > +//#define RISCV_CSR_MACHINE_MTIME 0x701 > > > > > > > +//#define RISCV_CSR_MACHINE_MTIMEH 0x741 > > > > > > > +// > > > > > > > +// Machine Trap Handling. > > > > > > > +// > > > > > > > +#define RISCV_CSR_MACHINE_MSCRATCH 0x340 > > > > > > > +#define RISCV_CSR_MACHINE_MEPC 0x341 > > > > > > > +#define RISCV_CSR_MACHINE_MCAUSE 0x342 > > > > > > > + #define MACHINE_MCAUSE_EXCEPTION_ MASK 0x0f > > > > > > > + #define MACHINE_MCAUSE_INTERRUPT (RISC_V_XLEN_BITS - > > 1) > > > > > > > +#define RISCV_CSR_MACHINE_MBADADDR 0x343 > > > > > > > +#define RISCV_CSR_MACHINE_MIP 0x344 > > > > > > > + > > > > > > > +// > > > > > > > +// Machine Protection and Translation. > > > > > > > +// > > > > > > > +#define RISCV_CSR_MACHINE_MBASE 0x380 > > > > > > > +#define RISCV_CSR_MACHINE_MBOUND 0x381 > > > > > > > +#define RISCV_CSR_MACHINE_MIBASE 0x382 > > > > > > > +#define RISCV_CSR_MACHINE_MIBOUND 0x383 > > > > > > > +#define RISCV_CSR_MACHINE_MDBASE 0x384 > > > > > > > +#define RISCV_CSR_MACHINE_MDBOUND 0x385 > > > > > > > + > > > > > > > +// > > > > > > > +// Supervisor mode CSR. > > > > > > > +// > > > > > > > +#define RISCV_CSR_SUPERVISOR_SSTATUS 0x100 > > > > > > > + #define SSTATUS_SIE_BIT_POSITION 1 > > > > > > > + #define SSTATUS_SPP_BIT_POSITION 8 > > > > > > > +#define RISCV_CSR_SUPERVISOR_SIE 0x104 > > > > > > > +#define RISCV_CSR_SUPERVISOR_SSCRATCH 0x140 > > > > > > > +#define RISCV_CSR_SUPERVISOR_SEPC 0x141 > > > > > > > +#define RISCV_CSR_SUPERVISOR_SCAUSE 0x142 > > > > > > > + #define SCAUSE_USER_SOFTWARE_INT 0 > > > > > > > + #define SCAUSE_SUPERVISOR_SOFTWARE_INT 1 > > > > > > > + #define SCAUSE_USER_TIMER_INT 4 > > > > > > > + #define SCAUSE_SUPERVISOR_TIMER_INT 5 > > > > > > > + #define SCAUSE_USER_EXTERNAL_INT 8 > > > > > > > + #define SCAUSE_SUPERVISOR_EXTERNAL_INT 9 > > > > > > > +#define RISCV_CSR_SUPERVISOR_STVAL 0x143 > > > > > > > +#define RISCV_CSR_SUPERVISOR_SIP 0x144 > > > > > > > +#define RISCV_CSR_SUPERVISOR_SATP 0x180 > > > > > > > + > > > > > > > +#if defined (MDE_CPU_RISCV64) > > > > > > > + #define RISCV_SATP_MODE_MASK 0xF000000000000000 > > > > > > > + #define RISCV_SATP_MODE_BIT_POSITION 60 > > > > > > > +#endif > > > > > > > + #define RISCV_SATP_MODE_OFF 0 > > > > > > > + #define RISCV_SATP_MODE_SV32 1 > > > > > > > + #define RISCV_SATP_MODE_SV39 8 > > > > > > > + #define RISCV_SATP_MODE_SV48 9 > > > > > > > + #define RISCV_SATP_MODE_SV57 10 > > > > > > > + #define RISCV_SATP_MODE_SV64 11 > > > > > > > + > > > > > > > + #define SATP64_ASID_MASK 0x0FFFF00000000000 > > > > > > > + #define SATP64_PPN_MASK 0x00000FFFFFFFFFFF > > > > > > > + > > > > > > > +#define RISCV_CAUSE_MISALIGNED_FETCH 0x0 > > > > > > > +#define RISCV_CAUSE_FETCH_ACCESS 0x1 > > > > > > > +#define RISCV_CAUSE_ILLEGAL_INSTRUCTION 0x2 > > > > > > > +#define RISCV_CAUSE_BREAKPOINT 0x3 > > > > > > > +#define RISCV_CAUSE_MISALIGNED_LOAD 0x4 > > > > > > > +#define RISCV_CAUSE_LOAD_ACCESS 0x5 > > > > > > > +#define RISCV_CAUSE_MISALIGNED_STORE 0x6 > > > > > > > +#define RISCV_CAUSE_STORE_ACCESS 0x7 > > > > > > > +#define RISCV_CAUSE_USER_ECALL 0x8 > > > > > > > +#define RISCV_CAUSE_HYPERVISOR_ECALL 0x9 > > > > > > > +#define RISCV_CAUSE_SUPERVISOR_ECALL 0xa > > > > > > > +#define RISCV_CAUSE_MACHINE_ECALL 0xb > > > > > > > +#define RISCV_CAUSE_FETCH_PAGE_FAULT 0xc > > > > > > > +#define RISCV_CAUSE_LOAD_PAGE_FAULT 0xd > > > > > > > +#define RISCV_CAUSE_STORE_PAGE_FAULT 0xf > > > > > > > +#define RISCV_CAUSE_FETCH_GUEST_PAGE_FAULT 0x14 > > > > > > > +#define RISCV_CAUSE_LOAD_GUEST_PAGE_FAULT 0x15 > > > > > > > +#define RISCV_CAUSE_STORE_GUEST_PAGE_FAULT 0x17 > > > > > > > + > > > > > > > +// > > > > > > > +// Machine Read-Write Shadow of Hypervisor Read-Only Registe= rs > > > > > > > +// > > > > > > > +#define RISCV_CSR_HTIMEW 0xB01 > > > > > > > +#define RISCV_CSR_HTIMEHW 0xB81 > > > > > > > +// > > > > > > > +// Machine Host-Target Interface (Non-Standard Berkeley > > Extension) > > > > > > > +// > > > > > > > +#define RISCV_CSR_MTOHOST 0x780 > > > > > > > +#define RISCV_CSR_MFROMHOST 0x781 > > > > > > > + > > > > > > > +#endif > > > > > > > diff --git a/Silicon/RISC-V/ProcessorPkg/Include/RiscVImpl.h > > > > b/Silicon/RISC-V/ProcessorPkg/Include/RiscVImpl.h > > > > > > > new file mode 100644 > > > > > > > index 0000000000..14092df174 > > > > > > > --- /dev/null > > > > > > > +++ b/Silicon/RISC-V/ProcessorPkg/Include/RiscVImpl.h > > > > > > > @@ -0,0 +1,87 @@ > > > > > > > +/** @file > > > > > > > + RISC-V package definitions. > > > > > > > + > > > > > > > + Copyright (c) 2016 - 2019, Hewlett Packard Enterprise > > Development > > > > LP. All rights reserved.
> > > > > > > + > > > > > > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > + > > > > > > > +**/ > > > > > > > + > > > > > > > +#ifndef RISCV_H_ > > > > > > > +#define RISCV_H_ > > > > > > > + > > > > > > > +#include > > > > > > > +#include > > > > > > > + > > > > > > > +#define _ASM_FUNC(Name, Section) \ > > > > > > > + .global Name ; \ > > > > > > > + .section #Section, "ax" ; \ > > > > > > > + .type Name, %function ; \ > > > > > > > + .p2align 2 ; \ > > > > > > > + Name: > > > > > > > + > > > > > > > +#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. > > ## > > > > Name) > > > > > > > + > > > > > > > +#if defined (MDE_CPU_RISCV64) > > > > > > > +typedef UINT64 RISC_V_REGS_PROTOTYPE; > > > > > > > +#else > > > > > > > +#endif > > > > > > > + > > > > > > > +// > > > > > > > +// Structure for 128-bit value > > > > > > > +// > > > > > > > +typedef struct { > > > > > > > + UINT64 Value64_L; > > > > > > > + UINT64 Value64_H; > > > > > > > +} RISCV_UINT128; > > > > > > > + > > > > > > > +#define RISCV_MACHINE_CONTEXT_SIZE 0x1000 > > > > > > > +typedef struct _RISCV_MACHINE_MODE_CONTEXT > > > > RISCV_MACHINE_MODE_CONTEXT; > > > > > > > + > > > > > > > +/// > > > > > > > +/// Exception handlers in context. > > > > > > > +/// > > > > > > > +typedef struct _EXCEPTION_HANDLER_CONTEXT { > > > > > > > + EFI_PHYSICAL_ADDRESS InstAddressMisalignedHander; > > > > > > > + EFI_PHYSICAL_ADDRESS InstAccessFaultHander; > > > > > > > + EFI_PHYSICAL_ADDRESS IllegalInstHander; > > > > > > > + EFI_PHYSICAL_ADDRESS BreakpointHander; > > > > > > > + EFI_PHYSICAL_ADDRESS LoadAddrMisalignedHander; > > > > > > > + EFI_PHYSICAL_ADDRESS LoadAccessFaultHander; > > > > > > > + EFI_PHYSICAL_ADDRESS StoreAmoAddrMisalignedHander; > > > > > > > + EFI_PHYSICAL_ADDRESS StoreAmoAccessFaultHander; > > > > > > > + EFI_PHYSICAL_ADDRESS EnvCallFromUModeHander; > > > > > > > + EFI_PHYSICAL_ADDRESS EnvCallFromSModeHander; > > > > > > > + EFI_PHYSICAL_ADDRESS EnvCallFromHModeHander; > > > > > > > + EFI_PHYSICAL_ADDRESS EnvCallFromMModeHander; > > > > > > > +} EXCEPTION_HANDLER_CONTEXT; > > > > > > > + > > > > > > > +/// > > > > > > > +/// Exception handlers in context. > > > > > > > +/// > > > > > > > +typedef struct _INTERRUPT_HANDLER_CONTEXT { > > > > > > > + EFI_PHYSICAL_ADDRESS SoftwareIntHandler; > > > > > > > + EFI_PHYSICAL_ADDRESS TimerIntHandler; > > > > > > > +} INTERRUPT_HANDLER_CONTEXT; > > > > > > > + > > > > > > > +/// > > > > > > > +/// Interrupt handlers in context. > > > > > > > +/// > > > > > > > +typedef struct _TRAP_HANDLER_CONTEXT { > > > > > > > + EXCEPTION_HANDLER_CONTEXT ExceptionHandlerContext; > > > > > > > + INTERRUPT_HANDLER_CONTEXT IntHandlerContext; > > > > > > > +} TRAP_HANDLER_CONTEXT; > > > > > > > + > > > > > > > +/// > > > > > > > +/// Machine mode context used for saveing hart-local context= . > > > > > > > +/// > > > > > > > +typedef struct _RISCV_MACHINE_MODE_CONTEXT { > > > > > > > + EFI_PHYSICAL_ADDRESS PeiService; /// PEI se= rvice. > > > > > > > + EFI_PHYSICAL_ADDRESS MachineModeTrapHandler; /// > > Machine > > > > mode trap handler. > > > > > > > + EFI_PHYSICAL_ADDRESS HypervisorModeTrapHandler; /// > > Hypervisor > > > > mode trap handler. > > > > > > > + EFI_PHYSICAL_ADDRESS SupervisorModeTrapHandler; /// > > Supervisor > > > > mode trap handler. > > > > > > > + EFI_PHYSICAL_ADDRESS UserModeTrapHandler; /// USer > > mode > > > > trap handler. > > > > > > > + TRAP_HANDLER_CONTEXT MModeHandler; /// Handle= r for > > > > machine mode. > > > > > > > +} RISCV_MACHINE_MODE_CONTEXT; > > > > > > > + > > > > > > > +#endif > > > > > > > -- > > > > > > > 2.31.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > > --_000_PH7PR84MB188585E0B90ED323FF1D99DAFF5B9PH7PR84MB1885NAMP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Ok Mike and Leif,
Another question regarding to the location of RISC-V Virtual package for QE= MU. What is the location and package you think RISC-V or oth= er processor architectures should stay with?

Thanks
Abner

From: Kinney, Michael D <= ;michael.d.kinney@intel.com>
Sent: Saturday, January 15, 2022 12:21 AM
To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>= ;; Leif Lindholm <leif@nuviainc.com>; devel@edk2.groups.io <devel@= edk2.groups.io>; Ni, Ray <ray.ni@intel.com>; Kinney, Michael D <= ;michael.d.kinney@intel.com>
Cc: Andrew Fish <afish@apple.com>; Sami Mujawar <Sami.Mujaw= ar@arm.com>
Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add he= ader files of RISC-V processor package
 
Hi Abner,

We already have a package for common platform content in the edk2 repo.
This is the MdeModulePkg.

However, the number of common platform features added to the MdeModulePkg o= ver
time has made this a very large package, and this can be measured by how co= mplex the
Maintainer.txt rules are for this package.

The revised approach is to create feature packages that platforms can add if their platform requires that specific feature category.  Examples a= re
NetworkPkg, SecurityPkg, FmpDevicePkg, FatPkg, RedfishPkg, SourceLevelDebug= Pkg.

Instead of adding another generic package such as CommonPlatformPkg, I
would prefer to see the libs/modules either added to existing packages
that match the feature category, or create new feature packages if
there is a new feature category.

We also try to limit the edk2 repo to components that are directly related<= br> the UEFI/PI specifications and are not Si/Platform specific.  Si/Platf= orm
specific features go into the edk2-platforms repo.  An example of a ge= neric
feature in the edk2-platforms repo is Features/Ext4.  The UEFI spec on= ly
specifies FAT for UEFI boot from file system.

There are a number of other feature packages in edk2-platforms in the
Features directory, so you should review those as well to see if there
is natural landing zone for any of your components.

Mike


> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>= ;
> Sent: Friday, January 14, 2022 3:15 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; Leif Lindhol= m <leif@nuviainc.com>; devel@edk2.groups.io; Ni, Ray
> <ray.ni@intel.com>
> Cc: Andrew Fish <afish@apple.com>; Sami Mujawar <Sami.Mujawar= @arm.com>
> Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add head= er files of RISC-V processor package
>
>
>
> > -----Original Message-----
> > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > Sent: Friday, January 14, 2022 12:38 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com= >; Leif
> > Lindholm <leif@nuviainc.com>; devel@edk2.groups.io; Ni, Ray=
> > <ray.ni@intel.com>; Kinney, Michael D <michael.d.kinney@= intel.com>
> > Cc: Andrew Fish <afish@apple.com>; Sami Mujawar
> > <Sami.Mujawar@arm.com>
> > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include: Add= header
> > files of RISC-V processor package
> >
> > Hi Abner,
> >
> > General recommendations included below.  Of course each
> > lib/modules/include needs to be reviewed and the
> > best location selected.  I am aware that there are component= s in edk2 that
> > do not follow these general
> > recommendations.  This is due to content that was added befo= re these
> > recommendations were established
> > and we have work to do to get everything aligned.
> >
> > Mike
> >
> > > -----Original Message-----
> > > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@= hpe.com>
> > > Sent: Wednesday, January 12, 2022 9:34 PM
> > > To: Kinney, Michael D <michael.d.kinney@intel.com>; Le= if Lindholm
> > <leif@nuviainc.com>; devel@edk2.groups.io; Ni, Ray
> > > <ray.ni@intel.com>
> > > Cc: Andrew Fish <afish@apple.com>; Sami Mujawar
> > <Sami.Mujawar@arm.com>
> > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/Include= : Add
> > header files of RISC-V processor package
> > >
> > > HI Mike,
> > > It is no problem to meet there. However, I am not available = to join the
> > design meeting in the next two weeks. Before we can get
> > > together to discuss the best locations, do you have informat= ion regarding
> > the rationale of driver/library location?
> > >
> > > What is the best location for,
> > > - Processor ARCH dependent modules
> >
> > MdePkg for libs
> > UefiCpuPkg for modules
> >
> > > - Common modules for all processor ARCHs
> >
> > Feature Packages based on the common feature.  Add to existi= ng if it fits.
> > Create new for completely new feature area.
> >
> > > - Platform module that is specific to processor ARCH?
> >
> > edk2-platform repository
> How about Leif's suggestion? The CommonPlatformPkg on edk2?
>
> Abner
>
> >
> > The only exception so far are platform modules used to support > > OvmfPkg/QEMU to support CI.
> > In this case the modules are added to OvmfPkg.
> >
> > > - Platform module that is common to processor ARCHs?
> >
> > edk2-platform repository
> >
> > The only exception so far are platform modules used to support > > OvmfPkg/QEMU to support CI.
> > In this case the modules are added to OvmfPkg.
> >
> > >
> > > Thanks
> > > Abner
> > >
> > > > -----Original Message-----
> > > > From: Kinney, Michael D <michael.d.kinney@intel.com&= gt;
> > > > Sent: Monday, January 10, 2022 11:58 PM
> > > > To: Leif Lindholm <leif@nuviainc.com>; devel@edk2= .groups.io; Chang,
> > Abner
> > > > (HPS SW/FW Technologist) <abner.chang@hpe.com>; K= inney, Michael D
> > > > <michael.d.kinney@intel.com>; Ni, Ray <ray.ni@= intel.com>
> > > > Cc: Andrew Fish <afish@apple.com>; Sami Mujawar > > > > <Sami.Mujawar@arm.com>
> > > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorPkg/In= clude: Add
> > header
> > > > files of RISC-V processor package
> > > >
> > > > Hi Abner,
> > > >
> > > > I see comments from Leif as well.
> > > >
> > > > Do you think a discussion in the design meeting Ray Ni = runs would be
> > > > valuable
> > > > to review all the modules/libs/includes and discuss opt= ions for the best
> > > > location for them to reside in the edk2 repos?
> > > >
> > > > Thanks,
> > > >
> > > > Mike
> > > >
> > > > > -----Original Message-----
> > > > > From: Kinney, Michael D <michael.d.kinney@intel= .com>
> > > > > Sent: Monday, January 10, 2022 7:55 AM
> > > > > To: Leif Lindholm <leif@nuviainc.com>; devel= @edk2.groups.io; Chang,
> > > > Abner <abner.chang@hpe.com>; Kinney, Michael D > > > > > <michael.d.kinney@intel.com>
> > > > > Cc: Andrew Fish <afish@apple.com>; Sami Muja= war
> > > > <Sami.Mujawar@arm.com>
> > > > > Subject: RE: [edk2-devel] [PATCH 01/79] ProcessorP= kg/Include: Add
> > > > header files of RISC-V processor package
> > > > >
> > > > > Hi Abner,
> > > > >
> > > > > I would also like to see some proposals on adding = the RiscV CPU scoped
> > > > content
> > > > > to the existing MdePkg/UefiCpuPkg instead of addin= g a new top level
> > CPU
> > > > package.
> > > > >
> > > > > There is already some work started to move some of= the ARM specific
> > > > content
> > > > > from ARM CPU packages into MdePkg.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Mike
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Leif Lindholm <leif@nuviainc.com>=
> > > > > > Sent: Monday, January 10, 2022 5:11 AM
> > > > > > To: devel@edk2.groups.io; Chang, Abner <ab= ner.chang@hpe.com>
> > > > > > Cc: Andrew Fish <afish@apple.com>; Kinn= ey, Michael D
> > > > <michael.d.kinney@intel.com>; Sami Mujawar
> > <Sami.Mujawar@arm.com>
> > > > > > Subject: Re: [edk2-devel] [PATCH 01/79] Proce= ssorPkg/Include: Add
> > > > header files of RISC-V processor package
> > > > > >
> > > > > > On Sat, Jan 08, 2022 at 12:07:53 +0800, Abner= Chang wrote:
> > > > > > > (This is migrated from edk2-platforms:Si= licon/RISC-V)
> > > > > > >
> > > > > > > RISC-V processor package library definit= ions.
> > > > > > >
> > > > > > > IndustryStandard/RiscV.h
> > > > > > > -Add RiscV.h which conform with RISC-V P= rivilege Spec v1.10.
> > > > > > >
> > > > > > > RiscVImpl.h
> > > > > > > -Definition of EDK2 RISC-V implementatio= n.
> > > > > > >
> > > > > > > Signed-off-by: Abner Chang <abner.cha= ng@hpe.com>
> > > > > > > Co-authored-by: Daniel Schaefer <dani= el.schaefer@hpe.com>
> > > > > > > Co-authored-by: Gilbert Chen <gilbert= .chen@hpe.com>
> > > > > > > Reviewed-by: Leif Lindholm <leif.lind= holm@linaro.org>
> > > > > >
> > > > > > Hmm, no.
> > > > > > I gave a reviewed-by for that patch to be mer= ged into edk2-platforms
> > > > > > once upon a time. This is not relevant for mi= gration to edk2.
> > > > > >
> > > > > > My proposal for migrating this code would be = as follows:
> > > > > > - Announce a hold on merging new code to Risc= V portions of
> > > > > >   edk2-platforms.
> > > > > > - Apply any and all bugfixes and CI/uncrustif= y fixes in place in
> > > > > >   edk2-platforms.
> > > > > > - Get some level of agreement for what to do = instead of
> > > > > >   RiscVPlatformPkg - i.e. slot into= MdeModulePkg instead.
> > > > > >   -  If that cannot be reached= within a few days, create a new
> > > > > >      top-level direc= tory called "CommonPlatformPkg" or something,
> > > > > >      with you, Danie= l(/Gilbert?), Sami, me as maintainers.
> > > > > >      - Move all of t= he RiscVPlatformPkg code under there instead.
> > > > > >      - I'll follow w= ith ArmPlatformPkg.
> > > > > >      - PC/AT code sh= ould move across too over time.
> > > > > > - Move the rest of the code across unmodified= as massive single
> > > > > >   patches per package (potentially = more patches than that for
> > > > > >   RiscVPlatformPkg).
> > > > > >   - Drop all existing Reviewed-by/A= cked-by.
> > > > > >   - After each "move" pat= ch, insert a "fixup" patch to address the
> > > > > >     things that need fixi= ng due to path/name changes.
> > > > > >
> > > > > > /
> > > > > >     Leif
> > > > > >
> > > > > > > Cc: Leif Lindholm <leif.lindholm@lina= ro.org>
> > > > > > > Cc: Gilbert Chen <gilbert.chen@hpe.co= m>
> > > > > > > ---
> > > > > > >  .../Include/IndustryStandard/RiscV= .h          | 156
> > ++++++++++++++++++
> > > > > > >  .../RISC-V/ProcessorPkg/Include/Ri= scVImpl.h   |  87 ++++++++++
> > > > > > >  2 files changed, 243 insertions(+)=
> > > > > > >  create mode 100644 Silicon/RISC- > > > > V/ProcessorPkg/Include/IndustryStandard/RiscV.h
> > > > > > >  create mode 100644 Silicon/RISC- > > V/ProcessorPkg/Include/RiscVImpl.h
> > > > > > >
> > > > > > > diff --git a/Silicon/RISC-
> > > > V/ProcessorPkg/Include/IndustryStandard/RiscV.h b/Silic= on/RISC-
> > > > > > V/ProcessorPkg/Include/IndustryStandard/RiscV= .h
> > > > > > > new file mode 100644
> > > > > > > index 0000000000..2a992394ed
> > > > > > > --- /dev/null
> > > > > > > +++ b/Silicon/RISC-
> > V/ProcessorPkg/Include/IndustryStandard/RiscV.h
> > > > > > > @@ -0,0 +1,156 @@
> > > > > > > +/** @file
> > > > > > > +  RISC-V package definitions.
> > > > > > > +
> > > > > > > +  Copyright (c) 2019, Hewlett Pack= ard Enterprise Development LP.
> > All
> > > > rights reserved.<BR>
> > > > > > > +
> > > > > > > +  SPDX-License-Identifier: BSD-2-C= lause-Patent
> > > > > > > +
> > > > > > > +**/
> > > > > > > +
> > > > > > > +#ifndef RISCV_INDUSTRY_STANDARD_H_
> > > > > > > +#define RISCV_INDUSTRY_STANDARD_H_
> > > > > > > +
> > > > > > > +#if defined (MDE_CPU_RISCV64)
> > > > > > > +#define RISC_V_XLEN_BITS 64
> > > > > > > +#else
> > > > > > > +#endif
> > > > > > > +
> > > > > > > +#define RISC_V_ISA_ATOMIC_EXTENSION&nbs= p;            &= nbsp;   (0x00000001 <<
> > 0)
> > > > > > > +#define RISC_V_ISA_BIT_OPERATION_EXTENS= ION
> > (0x00000001
> > > > << 1)
> > > > > > > +#define RISC_V_ISA_COMPRESSED_EXTENSION=              (0= x00000001
> > <<
> > > > 2)
> > > > > > > +#define RISC_V_ISA_DOUBLE_PRECISION_FP_= EXTENSION
> > > > (0x00000001 << 3)
> > > > > > > +#define RISC_V_ISA_RV32E_ISA  = ;            &n= bsp;         (0x00000001 << 4= )
> > > > > > > +#define RISC_V_ISA_SINGLE_PRECISION_FP_= EXTENSION
> > > > (0x00000001 << 5)
> > > > > > > +#define RISC_V_ISA_ADDITIONAL_STANDARD_= EXTENSION
> > > > (0x00000001 << 6)
> > > > > > > +#define RISC_V_ISA_RESERVED_1 &nbs= p;            &= nbsp;        (0x00000001 << 7)
> > > > > > > +#define RISC_V_ISA_INTEGER_ISA_EXTENSIO= N            (0x0000= 0001
> > <<
> > > > 8)
> > > > > > > +#define
> > > > RISC_V_ISA_DYNAMICALLY_TRANSLATED_LANGUAGE_EXTENSION > > > > (0x00000001 << 9)
> > > > > > > +#define RISC_V_ISA_RESERVED_2 &nbs= p;            &= nbsp;        (0x00000001 << 10) > > > > > > > +#define RISC_V_ISA_DECIMAL_FP_EXTENSION=              (0= x00000001
> > <<
> > > > 11)
> > > > > > > +#define RISC_V_ISA_INTEGER_MUL_DIV_EXTE= NSION
> > (0x00000001
> > > > << 12)
> > > > > > > +#define RISC_V_ISA_USER_LEVEL_INTERRUPT= _SUPPORTED
> > > > (0x00000001 << 13)
> > > > > > > +#define RISC_V_ISA_RESERVED_3 &nbs= p;            &= nbsp;        (0x00000001 << 14) > > > > > > > +#define RISC_V_ISA_PACKED_SIMD_EXTENSIO= N
> > (0x00000001 <<
> > > > 15)
> > > > > > > +#define RISC_V_ISA_QUAD_PRECISION_FP_EX= TENSION
> > > > (0x00000001 << 16)
> > > > > > > +#define RISC_V_ISA_RESERVED_4 &nbs= p;            &= nbsp;        (0x00000001 << 17) > > > > > > > +#define RISC_V_ISA_SUPERVISOR_MODE_IMPL= EMENTED
> > > > (0x00000001 << 18)
> > > > > > > +#define RISC_V_ISA_TRANSATIONAL_MEMORY_= EXTENSION
> > > > (0x00000001 << 19)
> > > > > > > +#define RISC_V_ISA_USER_MODE_IMPLEMENTE= D
> > (0x00000001
> > > > << 20)
> > > > > > > +#define RISC_V_ISA_VECTOR_EXTENSION&nbs= p;            &= nbsp;   (0x00000001 <<
> > 21)
> > > > > > > +#define RISC_V_ISA_RESERVED_5 &nbs= p;            &= nbsp;        (0x00000001 << 22) > > > > > > > +#define RISC_V_ISA_NON_STANDARD_EXTENSI= ON
> > (0x00000001
> > > > << 23)
> > > > > > > +#define RISC_V_ISA_RESERVED_6 &nbs= p;            &= nbsp;        (0x00000001 << 24) > > > > > > > +#define RISC_V_ISA_RESERVED_7 &nbs= p;            &= nbsp;        (0x00000001 << 25) > > > > > > > +
> > > > > > > +//
> > > > > > > +// RISC-V CSR definitions.
> > > > > > > +//
> > > > > > > +//
> > > > > > > +// Machine information
> > > > > > > +//
> > > > > > > +#define RISCV_CSR_MACHINE_MVENDORID&nbs= p;    0xF11
> > > > > > > +#define RISCV_CSR_MACHINE_MARCHID =       0xF12
> > > > > > > +#define RISCV_CSR_MACHINE_MIMPID &= nbsp;      0xF13
> > > > > > > +#define RISCV_CSR_MACHINE_HARRID &= nbsp;      0xF14
> > > > > > > +//
> > > > > > > +// Machine Trap Setup.
> > > > > > > +//
> > > > > > > +#define RISCV_CSR_MACHINE_MSTATUS =       0x300
> > > > > > > +#define RISCV_CSR_MACHINE_MISA &nb= sp;        0x301
> > > > > > > +#define RISCV_CSR_MACHINE_MEDELEG =       0x302
> > > > > > > +#define RISCV_CSR_MACHINE_MIDELEG =       0x303
> > > > > > > +#define RISCV_CSR_MACHINE_MIE &nbs= p;         0x304
> > > > > > > +#define RISCV_CSR_MACHINE_MTVEC &n= bsp;       0x305
> > > > > > > +
> > > > > > > +#define RISCV_TIMER_COMPARE_BITS &= nbsp;    32
> > > > > > > +//
> > > > > > > +// Machine Timer and Counter.
> > > > > > > +//
> > > > > > > +//#define RISCV_CSR_MACHINE_MTIME =         0x701
> > > > > > > +//#define RISCV_CSR_MACHINE_MTIMEH = ;       0x741
> > > > > > > +//
> > > > > > > +// Machine Trap Handling.
> > > > > > > +//
> > > > > > > +#define RISCV_CSR_MACHINE_MSCRATCH = ;     0x340
> > > > > > > +#define RISCV_CSR_MACHINE_MEPC &nb= sp;        0x341
> > > > > > > +#define RISCV_CSR_MACHINE_MCAUSE &= nbsp;      0x342
> > > > > > > +  #define MACHINE_MCAUSE_EXCEPTION= _ MASK 0x0f
> > > > > > > +  #define MACHINE_MCAUSE_INTERRUPT=       (RISC_V_XLEN_BITS -
> > 1)
> > > > > > > +#define RISCV_CSR_MACHINE_MBADADDR = ;     0x343
> > > > > > > +#define RISCV_CSR_MACHINE_MIP &nbs= p;         0x344
> > > > > > > +
> > > > > > > +//
> > > > > > > +// Machine Protection and Translation.<= br> > > > > > > > +//
> > > > > > > +#define RISCV_CSR_MACHINE_MBASE &n= bsp;       0x380
> > > > > > > +#define RISCV_CSR_MACHINE_MBOUND &= nbsp;      0x381
> > > > > > > +#define RISCV_CSR_MACHINE_MIBASE &= nbsp;      0x382
> > > > > > > +#define RISCV_CSR_MACHINE_MIBOUND =       0x383
> > > > > > > +#define RISCV_CSR_MACHINE_MDBASE &= nbsp;      0x384
> > > > > > > +#define RISCV_CSR_MACHINE_MDBOUND =       0x385
> > > > > > > +
> > > > > > > +//
> > > > > > > +// Supervisor mode CSR.
> > > > > > > +//
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SSTATUS&nb= sp;   0x100
> > > > > > > +  #define SSTATUS_SIE_BIT_POSITION=       1
> > > > > > > +  #define SSTATUS_SPP_BIT_POSITION=       8
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SIE &= nbsp;      0x104
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SSCRATCH&n= bsp;  0x140
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SEPC =       0x141
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SCAUSE&nbs= p;    0x142
> > > > > > > +  #define SCAUSE_USER_SOFTWARE_INT=         0
> > > > > > > +  #define SCAUSE_SUPERVISOR_SOFTWA= RE_INT  1
> > > > > > > +  #define SCAUSE_USER_TIMER_INT&nb= sp;          4
> > > > > > > +  #define SCAUSE_SUPERVISOR_TIMER_= INT     5
> > > > > > > +  #define SCAUSE_USER_EXTERNAL_INT=         8
> > > > > > > +  #define SCAUSE_SUPERVISOR_EXTERN= AL_INT  9
> > > > > > > +#define RISCV_CSR_SUPERVISOR_STVAL = ;     0x143
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SIP &= nbsp;      0x144
> > > > > > > +#define RISCV_CSR_SUPERVISOR_SATP =       0x180
> > > > > > > +
> > > > > > > +#if defined (MDE_CPU_RISCV64)
> > > > > > > +  #define RISCV_SATP_MODE_MASK&nbs= p;         0xF000000000000000
> > > > > > > +  #define RISCV_SATP_MODE_BIT_POSI= TION  60
> > > > > > > +#endif
> > > > > > > +    #define RISCV_SATP_M= ODE_OFF         0
> > > > > > > +    #define RISCV_SATP_M= ODE_SV32        1
> > > > > > > +    #define RISCV_SATP_M= ODE_SV39        8
> > > > > > > +    #define RISCV_SATP_M= ODE_SV48        9
> > > > > > > +    #define RISCV_SATP_M= ODE_SV57        10
> > > > > > > +    #define RISCV_SATP_M= ODE_SV64        11
> > > > > > > +
> > > > > > > +  #define SATP64_ASID_MASK &n= bsp;            0x0F= FFF00000000000
> > > > > > > +  #define SATP64_PPN_MASK &nb= sp;            = 0x00000FFFFFFFFFFF
> > > > > > > +
> > > > > > > +#define RISCV_CAUSE_MISALIGNED_FETCH&nb= sp;       0x0
> > > > > > > +#define RISCV_CAUSE_FETCH_ACCESS &= nbsp;          0x1
> > > > > > > +#define RISCV_CAUSE_ILLEGAL_INSTRUCTION=      0x2
> > > > > > > +#define RISCV_CAUSE_BREAKPOINT &nb= sp;            0x3 > > > > > > > +#define RISCV_CAUSE_MISALIGNED_LOAD&nbs= p;        0x4
> > > > > > > +#define RISCV_CAUSE_LOAD_ACCESS &n= bsp;           0x5
> > > > > > > +#define RISCV_CAUSE_MISALIGNED_STORE&nb= sp;       0x6
> > > > > > > +#define RISCV_CAUSE_STORE_ACCESS &= nbsp;          0x7
> > > > > > > +#define RISCV_CAUSE_USER_ECALL &nb= sp;            0x8 > > > > > > > +#define RISCV_CAUSE_HYPERVISOR_ECALL&nb= sp;       0x9
> > > > > > > +#define RISCV_CAUSE_SUPERVISOR_ECALL&nb= sp;       0xa
> > > > > > > +#define RISCV_CAUSE_MACHINE_ECALL =           0xb
> > > > > > > +#define RISCV_CAUSE_FETCH_PAGE_FAULT&nb= sp;       0xc
> > > > > > > +#define RISCV_CAUSE_LOAD_PAGE_FAULT&nbs= p;        0xd
> > > > > > > +#define RISCV_CAUSE_STORE_PAGE_FAULT&nb= sp;       0xf
> > > > > > > +#define RISCV_CAUSE_FETCH_GUEST_PAGE_FA= ULT  0x14
> > > > > > > +#define RISCV_CAUSE_LOAD_GUEST_PAGE_FAU= LT   0x15
> > > > > > > +#define RISCV_CAUSE_STORE_GUEST_PAGE_FA= ULT  0x17
> > > > > > > +
> > > > > > > +//
> > > > > > > +// Machine Read-Write Shadow of Hypervi= sor Read-Only Registers
> > > > > > > +//
> > > > > > > +#define RISCV_CSR_HTIMEW  &nb= sp;            = 0xB01
> > > > > > > +#define RISCV_CSR_HTIMEHW  &n= bsp;            0xB8= 1
> > > > > > > +//
> > > > > > > +// Machine Host-Target Interface (Non-S= tandard Berkeley
> > Extension)
> > > > > > > +//
> > > > > > > +#define RISCV_CSR_MTOHOST  &n= bsp;            0x78= 0
> > > > > > > +#define RISCV_CSR_MFROMHOST  =            0x781
> > > > > > > +
> > > > > > > +#endif
> > > > > > > diff --git a/Silicon/RISC-V/ProcessorPkg= /Include/RiscVImpl.h
> > > > b/Silicon/RISC-V/ProcessorPkg/Include/RiscVImpl.h
> > > > > > > new file mode 100644
> > > > > > > index 0000000000..14092df174
> > > > > > > --- /dev/null
> > > > > > > +++ b/Silicon/RISC-V/ProcessorPkg/Includ= e/RiscVImpl.h
> > > > > > > @@ -0,0 +1,87 @@
> > > > > > > +/** @file
> > > > > > > +  RISC-V package definitions.
> > > > > > > +
> > > > > > > +  Copyright (c) 2016 - 2019, Hewle= tt Packard Enterprise
> > Development
> > > > LP. All rights reserved.<BR>
> > > > > > > +
> > > > > > > +  SPDX-License-Identifier: BSD-2-C= lause-Patent
> > > > > > > +
> > > > > > > +**/
> > > > > > > +
> > > > > > > +#ifndef RISCV_H_
> > > > > > > +#define RISCV_H_
> > > > > > > +
> > > > > > > +#include <Uefi.h>
> > > > > > > +#include <IndustryStandard/RiscV.h&g= t;
> > > > > > > +
> > > > > > > +#define _ASM_FUNC(Name, Section) &= nbsp;  \
> > > > > > > +  .global   Name &n= bsp;            = ;    ; \
> > > > > > > +  .section  #Section, "a= x"        ; \
> > > > > > > +  .type     Na= me, %function       ; \
> > > > > > > +  .p2align  2  &nbs= p;            &= nbsp;     ; \
> > > > > > > +  Name:
> > > > > > > +
> > > > > > > +#define ASM_FUNC(Name) _ASM_FUNC(ASM_PF= X(Name), .text.
> > ##
> > > > Name)
> > > > > > > +
> > > > > > > +#if defined (MDE_CPU_RISCV64)
> > > > > > > +typedef UINT64 RISC_V_REGS_PROTOTYPE; > > > > > > > +#else
> > > > > > > +#endif
> > > > > > > +
> > > > > > > +//
> > > > > > > +// Structure for 128-bit value
> > > > > > > +//
> > > > > > > +typedef struct {
> > > > > > > +  UINT64    &n= bsp;       Value64_L;
> > > > > > > +  UINT64    &n= bsp;       Value64_H;
> > > > > > > +} RISCV_UINT128;
> > > > > > > +
> > > > > > > +#define RISCV_MACHINE_CONTEXT_SIZE = ; 0x1000
> > > > > > > +typedef struct _RISCV_MACHINE_MODE_CONT= EXT
> > > > RISCV_MACHINE_MODE_CONTEXT;
> > > > > > > +
> > > > > > > +///
> > > > > > > +/// Exception handlers in context.
> > > > > > > +///
> > > > > > > +typedef struct _EXCEPTION_HANDLER_CONTE= XT {
> > > > > > > +  EFI_PHYSICAL_ADDRESS InstAddress= MisalignedHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS InstAccessF= aultHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS IllegalInst= Hander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS BreakpointH= ander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS LoadAddrMis= alignedHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS LoadAccessF= aultHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS StoreAmoAdd= rMisalignedHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS StoreAmoAcc= essFaultHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS EnvCallFrom= UModeHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS EnvCallFrom= SModeHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS EnvCallFrom= HModeHander;
> > > > > > > +  EFI_PHYSICAL_ADDRESS EnvCallFrom= MModeHander;
> > > > > > > +} EXCEPTION_HANDLER_CONTEXT;
> > > > > > > +
> > > > > > > +///
> > > > > > > +/// Exception handlers in context.
> > > > > > > +///
> > > > > > > +typedef struct _INTERRUPT_HANDLER_CONTE= XT {
> > > > > > > +  EFI_PHYSICAL_ADDRESS SoftwareInt= Handler;
> > > > > > > +  EFI_PHYSICAL_ADDRESS TimerIntHan= dler;
> > > > > > > +} INTERRUPT_HANDLER_CONTEXT;
> > > > > > > +
> > > > > > > +///
> > > > > > > +/// Interrupt handlers in context.
> > > > > > > +///
> > > > > > > +typedef struct _TRAP_HANDLER_CONTEXT {<= br> > > > > > > > +  EXCEPTION_HANDLER_CONTEXT Except= ionHandlerContext;
> > > > > > > +  INTERRUPT_HANDLER_CONTEXT IntHan= dlerContext;
> > > > > > > +} TRAP_HANDLER_CONTEXT;
> > > > > > > +
> > > > > > > +///
> > > > > > > +/// Machine mode context used for savei= ng hart-local context.
> > > > > > > +///
> > > > > > > +typedef struct _RISCV_MACHINE_MODE_CONT= EXT {
> > > > > > > +  EFI_PHYSICAL_ADDRESS PeiService;=             &nb= sp;   /// PEI service.
> > > > > > > +  EFI_PHYSICAL_ADDRESS MachineMode= TrapHandler;    ///
> > Machine
> > > > mode trap handler.
> > > > > > > +  EFI_PHYSICAL_ADDRESS HypervisorM= odeTrapHandler; ///
> > Hypervisor
> > > > mode trap handler.
> > > > > > > +  EFI_PHYSICAL_ADDRESS SupervisorM= odeTrapHandler; ///
> > Supervisor
> > > > mode trap handler.
> > > > > > > +  EFI_PHYSICAL_ADDRESS UserModeTra= pHandler;       /// USer
> > mode
> > > > trap handler.
> > > > > > > +  TRAP_HANDLER_CONTEXT MModeHandle= r;            &= nbsp; /// Handler for
> > > > machine mode.
> > > > > > > +} RISCV_MACHINE_MODE_CONTEXT;
> > > > > > > +
> > > > > > > +#endif
> > > > > > > --
> > > > > > > 2.31.1
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
>

--_000_PH7PR84MB188585E0B90ED323FF1D99DAFF5B9PH7PR84MB1885NAMP_--