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.web08.7261.1626271914378503817 for ; Wed, 14 Jul 2021 07:11:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=bwS2rfbS; 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=082937abdb=abner.chang@hpe.com) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16EE9nC9016623; Wed, 14 Jul 2021 14:11:43 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 : content-transfer-encoding : mime-version; s=pps0720; bh=tFe6Bt0Kp3WJZ6+g5ZNctPFCyeLmO4MngW2tOvAIC/Y=; b=bwS2rfbSeacNNe0EWJc7f96Clo3mH8O357+TxxgGyU3X2oJ/EOLbJY6vCx1kTLrymdtW oVAj0f7ALNqSSh5DNY7+aOeew1RD9tP4nE6c9AGDXVuMav5x2xvkCVWCkMtQT0H4+fOf yxDcmjiLtz4W7U7GiLqZXHOpitZu+eGcmIa2l07KRQaPiLR7TPWARpRDsvJu5HCkana1 Ny1FliGRrh6RuRhamZP4aLOErUBNm+Z90UMj4H9o7/pIlF2yScOIv2H/4p/Gnfx84RVp tLDAqHC40uj7IQMe1OaqluXkF6xkv4bYDWWDjgzNxR28B3rdG5EZ9qLlaVmcYbm2wFet 8w== Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 39s81g4vyu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Jul 2021 14:11:42 +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 g4t3425.houston.hpe.com (Postfix) with ESMTPS id E35AEA8; Wed, 14 Jul 2021 14:11:41 +0000 (UTC) Received: from G4W9334.americas.hpqcorp.net (16.208.32.120) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 14 Jul 2021 14:11:40 +0000 Received: from G4W10204.americas.hpqcorp.net (2002:10cf:5210::10cf:5210) by G4W9334.americas.hpqcorp.net (2002:10d0:2078::10d0:2078) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 14 Jul 2021 14:11:33 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (15.241.52.12) by G4W10204.americas.hpqcorp.net (16.207.82.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18 via Frontend Transport; Wed, 14 Jul 2021 14:11:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVdikRnkgXFSNHgfQFgO/pHcsv0eNPlIoDEpJHlpsf9DeVZzd7FKWzamVDu7c6/AI/PmqFtqrdGomJ4uVyk0KIN4UdJ9lmWEHIpDtRBNt/0pvLt7FIu7F1GVqKgXxLYdTzh9M2BVcU7xbR0JmhtExh4DFYm2mKZ26i/7VwVnsn/tf6APlBNidRYwLBgFooNR3DBuRzu//oTLKqU30ALTPDhoreW/bmyO6DaSI3mXm/j//zrBvbrh4Hlub6VYeIFDbz8Xbz8GAAmYwO/r1W8AYGZE+/MqOYmhCPjYcRckmT1z8mT8FAQXqTr0ObkWBSgydQE2LV1RSS/B9est97DsLQ== 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=tFe6Bt0Kp3WJZ6+g5ZNctPFCyeLmO4MngW2tOvAIC/Y=; b=bLFXxJcbJjpJgLD1EwTRrUCveJtufWmV9alwOVdV9Yi+QAWp7jh+nFAVarvPpUZy3U3LOfzBr+LcwkTlvj/69j/ysoQnc2LGhyj5z1Lfvfj8vRqss76fwtn3WcpZsRasx3Cb5LNKueIRmnv+dCPI1kQwqBkEdKNWZ9xoN9rQOuLhPMYTbzK7K+DSsFL5JC0W/YgeKMvKfkHafXs/TqMIT2zBOGbHtN3U4zKLJcVwZtCsuLfNZVfIbUENH2uEGEcsd6D6RAddPwDwP/HIU9JKamNeq32JGoYCyeRBy84uX2lu4QdTJur6OMlPNXeozIWpqAkLvxie3Cla5PTkLjd/Mg== 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 CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7508::16) by CS1PR8401MB0342.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:750a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Wed, 14 Jul 2021 14:11:31 +0000 Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d447:2f82:1c6e:831f]) by CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d447:2f82:1c6e:831f%4]) with mapi id 15.20.4308.027; Wed, 14 Jul 2021 14:11:31 +0000 From: "Abner Chang" To: "Schaefer, Daniel" , "devel@edk2.groups.io" CC: Michael D Kinney , Liming Gao , Zhiguang Liu , "Leif Lindholm" Subject: Re: [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Thread-Topic: [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Thread-Index: AQHXSbXqCXzXGapFMk2LF5MB7xy9pKtC4MQA Date: Wed, 14 Jul 2021 14:11:31 +0000 Message-ID: References: <20210515181234.15186-1-daniel.schaefer@hpe.com> In-Reply-To: <20210515181234.15186-1-daniel.schaefer@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: hpe.com; dkim=none (message not signed) header.d=none;hpe.com; dmarc=none action=none header.from=hpe.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3c9a8f89-34bd-4706-40cd-08d946d147e5 x-ms-traffictypediagnostic: CS1PR8401MB0342: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:792; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sEo3XoCkQ0KAS3Y8zGeaFh9D/KTAmMHM8gdfIsZE+1yDR0qr0wmCmrXfTEkPzvFvq4/4uQNy5r4h5xxHxZjc0Eq9bHI8M9kKm5dg5iwmM1i2d2SgBDCvKVq3tk3fUY1DPGYT2T3mKjlZLrVXvkVByVzQgiNHzbf58QVAEVmoSn8MRawwHXgtqeFkxvV7iYp676DRznZCc27Xxgd8qkeoj0QXTepoTTYxvoEEsU65rqx2FPZEp2AeqUjnMjsuYDGH2dvd/ZZW6yaG0qzKJPCnyzyZAaq8JZ3jDEEZaFcMm0V3IfSlYNiXyF3mI+VouyCuZJne4NMclqJAqwqPClf/BWzLhnoxPvk4SRIDRhadZ2L+9FLZTAQkNSMG053jPV7qXXL9N3PMB9T37GAY6ip1SWV97CRmitnAb8SpADnvFpjDpSgYd10Qa+/IG+mm7HuQZzm/gZ+f9CNvz4+o1lKyX/ZoYd/pCxfX0XpV11J8k4ju2o+CubXMg8U2TiUNWgPOUuhtWk6fbX5+/ANN+WIjedmzbB5RguglvYXcd4lfJZ7j5k9/WCrNvMc6mHMZOnhiQkgiSa0vWxG16mqXXIN6S5CjESfyzweV1BeTXCGBMf5gZ042gQwWjoJLafSfrkOKRkVWbjefSmrcUunmnk/7AcVIXEL5MJemOyaUIbuJx5U1mP4AQLAwribSkyFLBHB8D322gENqnai+uVBPxv0kAw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(39860400002)(396003)(376002)(366004)(346002)(136003)(7696005)(71200400001)(5660300002)(38100700002)(6506007)(53546011)(186003)(55016002)(52536014)(4326008)(9686003)(26005)(66446008)(64756008)(66946007)(66556008)(66476007)(76116006)(316002)(8676002)(86362001)(110136005)(19627235002)(54906003)(122000001)(8936002)(83380400001)(478600001)(2906002)(33656002)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?M5mbC/jAII1y1gzuwmMNP+rMvuTJQamatY0aVUx0RLeva90vyJRERTf+7fRn?= =?us-ascii?Q?YfI7erJRAgMcjWv0iT9D30rZDOSM8QlGhOB4RvPwQXiqUZClxTQdhE30ozlk?= =?us-ascii?Q?5y3yqiZHKAwMlM0/3I+fQPi+JEFg7DNjznv5TrpIyyQxcWM6//ClszjLO2Oj?= =?us-ascii?Q?+QqC0cpdz0DsmdHaQPUFaRpD/VDwoaoVDql3YJSzPXHOUmBzbTVCgqAtLhdh?= =?us-ascii?Q?lSzXPrE5uEhp5z+ecW8MMWcZieb9eSTBZRRBj6B2qzIjcsw4P4UiZKaE2234?= =?us-ascii?Q?v2+CA9tw9a+dnUFExJ+/NNjPuNqVUmuAc8zP+bn38qN3eu3lHs36qlKC+6Pl?= =?us-ascii?Q?9rf21wd8TWpE/OakerdyVcBuvZJFfqblw2/Lsqeft6r//UhjIpnQeUhgaUog?= =?us-ascii?Q?r1Vjj9g946mm6v0BVsMpWWAsmCldGpVVmFLohgi/4RYD89QgvnNO4y0ncoDt?= =?us-ascii?Q?UJbu5l7cdDrFOoOE/Yx6ONIruKcmQ2WzdR4JgSRmoxYKVo62717RWUzSqLuL?= =?us-ascii?Q?qCH2IAGbbivB2WxS1YVDZGWd/wovuUCLclJXTmgmDd0fVbQL/lY7KypEqOek?= =?us-ascii?Q?V1DqSUkcXjFiUS/hZPI4M8ixLl59jEtPk47sGIORo9isNzxihGMpbGOSupzq?= =?us-ascii?Q?Xo4TFEH+/sj4o4mWI/0yDdWkrvJtx57+XxZIS6he9F+tHXV0jYoty/xTTSKC?= =?us-ascii?Q?8BcyiOYhMzWacoXTTxd+yQgo0njuf0G1wjXPFtUjtxCOBPz1Ox26+6Ek8nu5?= =?us-ascii?Q?BnUFh4O8dRsjQkhnG4OzmlJ/p+zO07/tzis4kEVdXrDSMRUzlY0DG5ebgpic?= =?us-ascii?Q?ouDc6JD5IuM52VAMo7jcnDbYZDX50zQtrGOrIa+qJqr36649OM2XVXuQ8Bre?= =?us-ascii?Q?3P/66WM2bseaGAtbhjKSqHa3DrT9f4U8e8ivBekYdgSQD8XXN9E9dWmHCiBz?= =?us-ascii?Q?G6P8ZHkw+RInYmEb9ezoswG1HP5PyRwGd9HZWCR8IX/oja1WEG+OfQCH9BgH?= =?us-ascii?Q?gg+d0piNuwqhh5P8OnK6+qvzF1xgfhYOCNHTFo01jC1gQFYCOKm6xWDfxGsn?= =?us-ascii?Q?lmS8Hl8gxiSkbYBjsF7xlZbgMwWIGU9ipWcyfLaXLft5vP7Kw3mWwTM6RUUk?= =?us-ascii?Q?xhfWyo5shtWo11m34hcEnXUvIFduzu0BRnwqYkVO20YgKYx/LNsbmeThm4id?= =?us-ascii?Q?ehB6gVrqF77NimubVZ7gtO1r4eUQ/mq3Dk4FL5DYKd6QOmhdhzyBB4EaYnbs?= =?us-ascii?Q?wF1YZWuDSkKkFwDzo+fBNJ2Qk/b/kGpX9jLe3V74REUWwZPaPxYSQ7bB5B8T?= =?us-ascii?Q?TcqZ30wPcl7bPqxT4GMztIEV?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 3c9a8f89-34bd-4706-40cd-08d946d147e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2021 14:11:31.6942 (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: sbhwexed5L0i6Bgxx0HXSrWsScMaFxJ9QNMQYobiWsGzOlSk73TwjsTA6EW2QRnmQt6MC4lYiSIe2BMiZT7edw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0342 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: snIt2racIBV7BjuOJ3JC7A8mEXElyA4s X-Proofpoint-ORIG-GUID: snIt2racIBV7BjuOJ3JC7A8mEXElyA4s X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-14_07:2021-07-14,2021-07-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107140086 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Abner Chang > -----Original Message----- > From: Schaefer, Daniel > Sent: Sunday, May 16, 2021 2:13 AM > To: devel@edk2.groups.io > Cc: Chang, Abner (HPS SW/FW Technologist) ; > Michael D Kinney ; Liming Gao > ; Zhiguang Liu ; Leif > Lindholm > Subject: [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 >=20 > Cc: Abner Chang > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Leif Lindholm > Signed-off-by: Daniel Schaefer > --- > MdePkg/Library/BaseLib/BaseLib.inf | 1 + > MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33 > ++++++++++++++++++++ > 2 files changed, 34 insertions(+) >=20 > diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > b/MdePkg/Library/BaseLib/BaseLib.inf > index b76f3af380ea..b7ab5f632366 100644 > --- a/MdePkg/Library/BaseLib/BaseLib.inf > +++ b/MdePkg/Library/BaseLib/BaseLib.inf > @@ -399,6 +399,7 @@ > RiscV64/DisableInterrupts.c >=20 > RiscV64/EnableInterrupts.c >=20 > RiscV64/CpuPause.c >=20 > + RiscV64/MemoryFence.S | GCC >=20 > RiscV64/RiscVSetJumpLongJump.S | GCC >=20 > RiscV64/RiscVCpuBreakpoint.S | GCC >=20 > RiscV64/RiscVCpuPause.S | GCC >=20 > diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > new file mode 100644 > index 000000000000..283df9356a9a > --- /dev/null > +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > @@ -0,0 +1,33 @@ > +##----------------------------------------------------------------------= -------- >=20 > +# >=20 > +# MemoryFence() for RiscV64 >=20 > + >=20 > +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights > reserved. >=20 > +# >=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +##----------------------------------------------------------------------= -------- >=20 > + >=20 > +.text >=20 > +.p2align 2 >=20 > + >=20 > +ASM_GLOBAL ASM_PFX(MemoryFence) >=20 > + >=20 > + >=20 > +#/** >=20 > +# Used to serialize load and store operations. >=20 > +# >=20 > +# All loads and stores that proceed calls to this function are guarante= ed to > be >=20 > +# globally visible when this function returns. >=20 > +# >=20 > +#**/ >=20 > +#VOID >=20 > +#EFIAPI >=20 > +#MemoryFence ( >=20 > +# VOID >=20 > +# ); >=20 > +# >=20 > +ASM_PFX(MemoryFence): >=20 > + // Fence on all memory and I/O >=20 > + fence >=20 > + ret >=20 > -- > 2.30.1