From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: eric.dong@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Thu, 05 Sep 2019 00:37:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 00:37:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,469,1559545200"; d="scan'208";a="207782829" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 05 Sep 2019 00:37:00 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 5 Sep 2019 00:36:59 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 5 Sep 2019 00:36:59 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.86]) with mapi id 14.03.0439.000; Thu, 5 Sep 2019 15:36:57 +0800 From: "Dong, Eric" To: "devel@edk2.groups.io" , "Lofgren, John E" CC: "Ni, Ray" , "Laszlo Ersek (lersek@redhat.com)" , "Dong, Eric" Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: Fix #AC split lock Thread-Topic: [edk2-devel] [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: Fix #AC split lock Thread-Index: AQHVYoPfQh+SzfBrdE6h+lBq9mDor6ccsqWA Date: Thu, 5 Sep 2019 07:36:56 +0000 Message-ID: References: <20190903181524.1132-1-john.e.lofgren@intel.com> In-Reply-To: <20190903181524.1132-1-john.e.lofgren@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi John, I'm not sure whether I understand the code correctly. If not, please corre= ct me. 1. You change to the code to only exchange 32 bits(eax) instead of 64 bits= (rax). After your change, how to handle the above 32 bits value (from bit 3= 2 to bit 63)? 2. In this file, also have another two xchg codes, do them need to be upda= ted also? Thanks, Eric > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Jo= hn > E Lofgren > Sent: Wednesday, September 4, 2019 2:15 AM > To: devel@edk2.groups.io > Subject: [edk2-devel] [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: Fix #AC > split lock >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2150 >=20 > Fix #AC split lock's caused by seperating base and limit from sgdt and s= idt by > changing xchg operands to 32-bit to stop from crossing cacheline. >=20 > Signed-off-by: John E Lofgren > --- > UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm > | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git > a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nas > m > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nas > m > index 4db1a09f28..6d83dca4b9 100644 > --- > a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nas > m > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm. > +++ nasm > @@ -184,17 +184,17 @@ HasErrorCode: > push rax > push rax > sidt [rsp] > - xchg rax, [rsp + 2] > - xchg rax, [rsp] > - xchg rax, [rsp + 8] > + xchg eax, [rsp + 2] > + xchg eax, [rsp] > + xchg eax, [rsp + 8] >=20 > xor rax, rax > push rax > push rax > sgdt [rsp] > - xchg rax, [rsp + 2] > - xchg rax, [rsp] > - xchg rax, [rsp + 8] > + xchg eax, [rsp + 2] > + xchg eax, [rsp] > + xchg eax, [rsp + 8] >=20 > ;; UINT64 Ldtr, Tr; > xor rax, rax > -- > 2.16.2.windows.1 >=20 >=20 >=20