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.8910.1621102378922436977 for ; Sat, 15 May 2021 11:12:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=lIV4pZCa; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0769f7f67d=daniel.schaefer@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 14FI98gt000816; Sat, 15 May 2021 18:12:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=pps0720; bh=wmGbFcez0BoSuTXc8TY7odnK6CyFf6IkduA9vUMP7R4=; b=lIV4pZCae2aNAwh0n97fZhLDVzXjmSQGXc1eVfzCSjxn7tKVmMUKbwhE0Bs0ql0eW0QN HKNTY02TPv+rRu/C86tbf26NJt+CC3tjc1r5bjBP+6Ucx39Rvy94NSxnjU6bR9sK9siC M/40eytmw2aXAIWyXFiLZUYcr6gw5qj9ZzDsw6ob/WLU+W0gEfq24k7SzrnThjhvmcxK pPPq+2E+FyQt03mqgEKUkN6XY7iX3IuA2JUcEfvbDsyZpp/kp4CDB30L+lVLMktUn3u2 1vjyuUJSKWHD/Z0l5W0kge1BGyImVYoT2i+3Th9Ah/qbofy80PzDJvdhGwYcHYesYU6A 3w== Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 38j3p63uc9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 15 May 2021 18:12:51 +0000 Received: from G4W9119.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.210.20.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3427.houston.hpe.com (Postfix) with ESMTPS id C16E557; Sat, 15 May 2021 18:12:50 +0000 (UTC) Received: from G1W8107.americas.hpqcorp.net (2002:10c1:483b::10c1:483b) by G4W9119.americas.hpqcorp.net (2002:10d2:14d6::10d2:14d6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 15 May 2021 18:12:50 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (15.241.52.12) by G1W8107.americas.hpqcorp.net (16.193.72.59) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sat, 15 May 2021 18:12:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dCIaogByVjYzeRyAuUwXjcLmVe7Vmt/YJxyOJfsgfpRmY2fnIRvvfLr7cyH8dG4CDBRX2QUjZPad5hV0BGLbCX4yEtB+3mn1kn+WPEn+dhLWIAFZhjCq40XctIwTwhIbprPq5S2AJtqt9PalNtxAtBxtEGcEMmopQJY76LDjpzrnxS0DrCQCGALLaM0eiIuX1RoMWjRJFUFGs1AoCGj6SFcpZyiUq6CXPlOhL0Eg85tpY7LsZVtSeGKm/4YN/hUlN4gyduk9/WP0MYcQzPHuZecg2GqMgTOkdk6M829axTzCIHjGc4TxsTn/Al8CysoqrqqPiFH9uH4pgOADfc8uAg== 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=wmGbFcez0BoSuTXc8TY7odnK6CyFf6IkduA9vUMP7R4=; b=i/v1O1t+SkJJGqKnYidZkITlMislp3o1Cg/FuXtYYodhf96oEtVGckkhOiaE3VrEe6WNcZ8iq6LLm5y2CpjTKDRMTyagiZsnCdsIWwpIhEqZozz5uaK/2wF6lHI3GMtVEibO2AzFP3H+1lzw9PRR93moJ2TfvcUccIXsmP49L80XcGvkDvWOstkA6FU3wOcyw2+coAVC5XtvSZQng1h991F6LIuOY+bnsFdU+q08s8WvXdDX+sQ5ILKwnxM6IbcNjddOJXvdTc+hZ6dg7R4xF24Y4V6BZ+c6DP8wSKHcmZdofu0eOrrXImNcbNdOzrcXLsN8wJ8/YQ1yz+D8z0I+fw== 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: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB0953.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Sat, 15 May 2021 18:12:48 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::1055:761b:7ee6:52ca]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::1055:761b:7ee6:52ca%11]) with mapi id 15.20.4129.028; Sat, 15 May 2021 18:12:48 +0000 From: "Daniel Schaefer" To: CC: Abner Chang , Michael D Kinney , Liming Gao , Zhiguang Liu , Leif Lindholm Subject: [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Date: Sun, 16 May 2021 02:12:34 +0800 Message-ID: <20210515181234.15186-1-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.30.1 X-Originating-IP: [123.193.59.220] X-ClientProxiedBy: HK2PR02CA0142.apcprd02.prod.outlook.com (2603:1096:202:16::26) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from think-nix.hitronhub.home (123.193.59.220) by HK2PR02CA0142.apcprd02.prod.outlook.com (2603:1096:202:16::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.32 via Frontend Transport; Sat, 15 May 2021 18:12:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 913deb1e-8587-405b-660a-08d917cd0bd6 X-MS-TrafficTypeDiagnostic: DF4PR8401MB0953: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cHt6e94IjMrfRZ7DMHUre2zzma0Eo6bHx1KHDWC0eXF5skBDTUn9WOSlUw6gDsDAYrmhbrB4Hg9KlnK2LVWQg/PGGNQApNICnpn7dwBt5tYFAg2Ij0ov7U8d3C1S81UP3DM7r0CkHY3lK0PJ03zNlnXjfiBqKYBJM5Vqzz6ZtDDoSeM4J3vKr7e3zqY8yGs0+F/0RDpgKx0yuttyjO3f3/BpnjPGcVAjP5cgyomzjv3r+5LjmyKphhpfm+Nppov7RBMaLR6dl+TtnzPG6vJ3ahpu9GNUn9Wid29vRk0vSfbgvV1ya2e4CETtot2vXSUxMQcy2+9VV4aIVDYcMAGw6OpQQsAl6pn+dfcH6zVXhXECllJ6sBJ17UbJpJE/nSNnkLHu8f5KdA90dfxUjf6hHOdDxkV91wBW92B1e0lPR/NhKepQBSEq+vmco7Pl+txg9LtnoTpFhZgG9S9ftc3WmRfEi5PEkkF9Aw1dQbvoOO3zIls9uleetGZgCvXjd6cCBH9ovEUJSsuDWqiMrXqO5p/mSOvE8ZyIcPvXJ0QnmoA6uOyhFcCtFE2P3IGsa5RB5z+ZlxRzULMXyuxVqaYschgq8cGkCoCgwXyKCgcWG89uC7fYTTdhrA85qMxVy47TxEYUkVBWzqqCTu0aeoJFtGdCHhT3bX6uYt+rYrW5t9M= 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:(346002)(39860400002)(136003)(366004)(396003)(376002)(66946007)(16526019)(66476007)(6486002)(8676002)(19627235002)(5660300002)(66556008)(186003)(6916009)(44832011)(6506007)(38350700002)(6512007)(956004)(38100700002)(2616005)(1076003)(52116002)(54906003)(6666004)(478600001)(8936002)(36756003)(2906002)(26005)(86362001)(316002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?LFgR5raJ4RLD3mixiHZSLCgCjDyOZpAIIncvqyfI5uQn0ys7hTcXXpOODNP2?= =?us-ascii?Q?hiCMjyYTQQpnI09FyQTkAyWyvvuhAXwkR3culy96zLfs9DbNXfRUOoD1/sSK?= =?us-ascii?Q?R1LeyAGU+hLC75bfhiju4ahd0xfzCt61xdkQMYssfhQ287OTQmo2d1TNP6Rz?= =?us-ascii?Q?75eODYbIIOh91VbuqsUxAmSKWQ/PXbNDoCotabH9F4nmZ961AIyQ6n4AAYFR?= =?us-ascii?Q?EjmFcqGGRQwuESpeAuutCZ3Tc8CQ1aLktZsewgpvvnlu/a+kC53ix1ZJYUrx?= =?us-ascii?Q?4jvvYie4BWIDbaJPSLMboTX7+v2OevwfKUYjeruY51YYlUFL6xeNUPQkn65+?= =?us-ascii?Q?CwnPMI+6Hm5cnXRwbyqvmCsqvq/jfPKmdjJw/Q2VbnCHP3EO+0hEV+EueVpS?= =?us-ascii?Q?xViXjgVsAXaeYKeB13nN11RXMyTug7ljmGK4lFWgEy9TS90ymIhXAPeb3EMk?= =?us-ascii?Q?sT8Vrj2M8aMyZsqPFsoXpBY7VRTf7HOxX1zWiq9fQqhWToAm5Yr/XhAAsZmn?= =?us-ascii?Q?l+ZanWW39UN75jJIuNTFUVP38/YOUDsxmssFbIEWTLS9wEWEU4OMQqqkFOY0?= =?us-ascii?Q?Q0Ue1BbuLQ9KdHoSxhsZcfXuKowSVmXGULnTsNNGuduNYTYS0hN0/cr2l5R/?= =?us-ascii?Q?nZwhHLp2XoNGQEbvS8Vy1LkePgifq+eAZsVmTQm1DGpa3Ma6E8JmS94Ff9qM?= =?us-ascii?Q?wL8Dm0IxBNDS6hF6F9HSEtEOAuZpX6h8jSiEGLk02J5Jv5NEi47KlhRkGEGl?= =?us-ascii?Q?+gxNcNc1l9kRIp4ZYeUJ3sGS383jv86VbI8GJHTcpr+7cmPAlLsWvnG8Ve4g?= =?us-ascii?Q?RCr006+OS03+H9jIGb5nfoOiuhjKtH0iQmrNzS/n3x39l9b5llU5AI4DVEFc?= =?us-ascii?Q?nZ4poxISBzZW3FrfyQykxit2LiS+Jeo7hrE14WIs7jz4wr0u3FFFPAj1Grz8?= =?us-ascii?Q?ygdWnncv8x1ySSy1zcGpkF00akAP57u8VYzjQPMbAYRbsVCjg5trRbriIcpC?= =?us-ascii?Q?OMjj93aaw+t8325EznBhzv5IAsKoHjFxqK2izxLcRz+Ylk4pF7LtgAFF6fsN?= =?us-ascii?Q?DX3C3D8eRVXoycUNq2+c1fzvq/+jeqztBju0vvCLLB91A/A6S+ZH6jFBoqJ6?= =?us-ascii?Q?ry7RUckKdn1L4Usc8aKFEyOMfHElVAXcaasH/sM89oxFGjHFCUgLzuM2ZIUP?= =?us-ascii?Q?6hI+QXn+kmslgE/+ht1ZhBkotswpM2SiphKCOO7RRtGo/7WmAz7fu6Au79x8?= =?us-ascii?Q?pk3ZJFte9vmn57WOvlBf4yA4Qt2+jVxnbxwuQlmYQZ7ohK1wF6rfKMBaIUp9?= =?us-ascii?Q?7bOYcfUNB85W3h4vXrf21Z+F?= X-MS-Exchange-CrossTenant-Network-Message-Id: 913deb1e-8587-405b-660a-08d917cd0bd6 X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2021 18:12:48.6119 (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: FDwBRTrCOr0Xcvw5y0/K4evkuLzDu6Vz8fXMdfcQYWnhC1NqIAYvFQ+mn2YINa0jcnmiWrqrfr5p/kDoWo/G2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0953 X-OriginatorOrg: hpe.com X-Proofpoint-ORIG-GUID: qWNLdFDehnIjIFW7HWNIpRwtc9LCfhNj X-Proofpoint-GUID: qWNLdFDehnIjIFW7HWNIpRwtc9LCfhNj X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-15_12:2021-05-12,2021-05-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 priorityscore=1501 clxscore=1011 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105150139 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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(+) diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/Ba= seLib.inf index b76f3af380ea..b7ab5f632366 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -399,6 +399,7 @@ RiscV64/DisableInterrupts.c=0D RiscV64/EnableInterrupts.c=0D RiscV64/CpuPause.c=0D + RiscV64/MemoryFence.S | GCC=0D RiscV64/RiscVSetJumpLongJump.S | GCC=0D RiscV64/RiscVCpuBreakpoint.S | GCC=0D RiscV64/RiscVCpuPause.S | GCC=0D 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 @@ +##------------------------------------------------------------------------= ------=0D +#=0D +# MemoryFence() for RiscV64=0D +=0D +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights r= eserved.=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##------------------------------------------------------------------------= ------=0D +=0D +.text=0D +.p2align 2=0D +=0D +ASM_GLOBAL ASM_PFX(MemoryFence)=0D +=0D +=0D +#/**=0D +# Used to serialize load and store operations.=0D +#=0D +# All loads and stores that proceed calls to this function are guaranteed= to be=0D +# globally visible when this function returns.=0D +#=0D +#**/=0D +#VOID=0D +#EFIAPI=0D +#MemoryFence (=0D +# VOID=0D +# );=0D +#=0D +ASM_PFX(MemoryFence):=0D + // Fence on all memory and I/O=0D + fence=0D + ret=0D --=20 2.30.1