From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.195.1614279812885662161 for ; Thu, 25 Feb 2021 11:03:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XGF2Z+T5; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614279812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RZjRmWImV4Mdr95pMDcTM7hUtjqXpUpvtvEagSweuX4=; b=XGF2Z+T5JgMc79uV0Pqo7cDBygB+W4361NzR5174kmofVlWyk/k6eNKgktrwXHfJarygPY 1WR1s/NdFpdL56j/dW9uJjVZFilz2WeIi3MASRbA7TWke01ppist84x2R4MsjPF73SkqqF qkzXZAAM4TEAj1N6D1ZRjCj19YV7ZA8= 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-475-Ny5OJkdJNKyojhYssaynIg-1; Thu, 25 Feb 2021 14:03:30 -0500 X-MC-Unique: Ny5OJkdJNKyojhYssaynIg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A96E85EE63; Thu, 25 Feb 2021 19:03:29 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-188.ams2.redhat.com [10.36.115.188]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F9E65C234; Thu, 25 Feb 2021 19:03:28 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 0/4] Use XADD to avoid lock acquire/release To: devel@edk2.groups.io, ray.ni@intel.com References: <20210209141634.1999-1-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: <81a43cb6-ff99-7504-c2ad-af5a99c50221@redhat.com> Date: Thu, 25 Feb 2021 20:03:27 +0100 MIME-Version: 1.0 In-Reply-To: <20210209141634.1999-1-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 02/09/21 15:16, Ni, Ray wrote: > Patch #1 follows Mike's suggestion to use XADD to avoid lock acquire/release. > Patch #2 follows Laszlo's suggestion to add global NASM macros for NASM struc usage. > Patch #3 simply remves all hardcode offset in NASM without changing any logic. > Patch #4 removes the dead code. > > The final code is the same as that of V2. Given that I was OK with v2: series Acked-by: Laszlo Ersek Thanks Laszlo > Ray Ni (4): > UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release > MdePkg/Nasm.inc: add macros for C types used in structure definition > UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset > UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO > > MdePkg/Include/Ia32/Nasm.inc | 38 ++++++ > MdePkg/Include/X64/Nasm.inc | 38 ++++++ > UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 5 +- > UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc | 43 ------- > .../Library/MpInitLib/Ia32/MpFuncs.nasm | 98 +++++++--------- > UefiCpuPkg/Library/MpInitLib/MpEqu.inc | 99 ++++++++++++++++ > UefiCpuPkg/Library/MpInitLib/MpLib.c | 1 - > UefiCpuPkg/Library/MpInitLib/MpLib.h | 3 +- > UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 5 +- > UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc | 45 -------- > UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 ++++++++---------- > 11 files changed, 272 insertions(+), 211 deletions(-) > delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc > create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc > delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc >