From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.21984.1594654321597538653 for ; Mon, 13 Jul 2020 08:32:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f6dAx35E; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594654320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0l9dFK4jyr8U8lxOtucgd4I54yCZhrRnBsfNP9YZ688=; b=f6dAx35EVpRPAMPqIt37ZRw2gFTdqFw9yZR+c2FODSxGk9PvMtNzrjXmrr2DRtq8X4P6Hj a9xVYmRtZcGB3/HK/+Smh5sD9R676wS9vhioPRJt36UoyJdmt0XVLo4Y9GX/RZknylVM7p g1g8REclfHw0HmMCIu2SM7YzB/V4Zak= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-86-VbOcha3jPpOoSS1aw6C_Tg-1; Mon, 13 Jul 2020 11:31:38 -0400 X-MC-Unique: VbOcha3jPpOoSS1aw6C_Tg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E60E19057A1; Mon, 13 Jul 2020 15:31:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-183.ams2.redhat.com [10.36.114.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 053485BAD5; Mon, 13 Jul 2020 15:31:35 +0000 (UTC) Subject: Re: [edk2-devel] [edk2-discuss] Need memory barriers in IoLib for AARCH64 To: devel@edk2.groups.io, afish@apple.com, wasim.khan@nxp.com Cc: Mike Kinney , "liming.gao@intel.com" , "Leif Lindholm (Nuvia address)" References: From: "Laszlo Ersek" Message-ID: <0d68b7da-01c9-f696-7eb4-ebbef8a5cf0f@redhat.com> Date: Mon, 13 Jul 2020 17:31:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 07/12/20 18:54, Andrew Fish via groups.io wrote: > > >> On Jul 11, 2020, at 10:17 PM, Wasim Khan wrote: >> >> Hello >> >> Any comments ? >> > > I don’t see IoLibArm.c in master? I see IoLibNoIo.c. That's due to the rename in commit 089e9c19a8c1 ("MdePkg/BaseIoLibIntrinsic: Rename IoLibArm.c=>IoLibNoIo.c", 2020-05-07), which has been first included in edk2-stable202005. I think Ard is away at the moment, so I'm adding Leif to the CC list. Thanks Laszlo > The MMIO function look like ARM assembler with the correct barrier instructions. The IO operations in this lib are the x86 in/out instructions, so they just ASSERT on ARM. > > On the X86 MemoryFence() is just a serializing intrinsic for the compiler to prevent optimizations from breaking the code, kind of like how you need to make MMIO as volatile in C. > > Thanks, > > Andrew Fish > >>> -----Original Message----- >>> From: Wasim Khan >>> Sent: Friday, July 10, 2020 6:20 PM >>> To: michael.d.kinney@intel.com; liming.gao@intel.com; devel@edk2.groups.io >>> Subject: [edk2-discuss] Need memory barriers in IoLib for AARCH64 >>> >>> Hello, >>> >>> MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf: >>> IoLib library uses IoLibArm.c for AARCH64/ARM architecture and IoLib.c for >>> other architectures. >>> >>> While IoLib.c already has memory barriers in MmioWrite functions, there >>> barriers are missing in IoLibArm.c Is there any reason for **not** adding these >>> memory barriers in IoLibArm.c to guarantee that all MMIO operations are >>> serialized ? >>> >>> I am facing some issues and I need to add memory barriers in IoLibArm.c for >>> AARCH64 also . >>> >>> >>> Regards, >>> Wasim >> >> >> > > > > >