From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: ray.ni@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Thu, 23 May 2019 22:17:49 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 22:17:48 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 23 May 2019 22:17:48 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 23 May 2019 22:17:48 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 23 May 2019 22:17:47 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.33]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.70]) with mapi id 14.03.0415.000; Fri, 24 May 2019 13:17:46 +0800 From: "Ni, Ray" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Wu, Hao A" , "Zeng, Star" , "Gao, Liming" , Sean Brogan , Michael Turner , Bret Barkelew , "Kinney, Michael D" , "Dong, Eric" , Laszlo Ersek Subject: Re: [PATCH 0/6] Fix race condition and add event protocol Thread-Topic: [PATCH 0/6] Fix race condition and add event protocol Thread-Index: AQHVEe41BKZdEtNJB0+TtHHLcqx0waZ5u6Yg Date: Fri, 24 May 2019 05:17:44 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C15E506@SHSMSX104.ccr.corp.intel.com> References: <20190524050437.38616-1-zhichao.gao@intel.com> In-Reply-To: <20190524050437.38616-1-zhichao.gao@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWFhZjZmZTgtNWFjYi00OGUyLWI4NzgtMzNkOTFjZDE4NGUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOXBKeHBtc21sWldyRVpRWDk5K2ZOZGZ1XC9RXC9YeDBaNW10dDBcL3dyRWlPNFE2SGJGNFwvUWNpaU5BdXlcL3ZvZTl4In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Zhichao, Did your detailed patch commit message describe the consequence of the race= condition? (I haven't checked.) If no, could you please describe in detail about the consequence? Thanks, Ray > -----Original Message----- > From: Gao, Zhichao > Sent: Friday, May 24, 2019 1:05 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Ni, Ray ; Zeng, Star ; Gao, Liming > ; Sean Brogan ; > Michael Turner ; Bret Barkelew > ; Kinney, Michael D > ; Dong, Eric ; Laszlo > Ersek > Subject: [PATCH 0/6] Fix race condition and add event protocol >=20 > There is a race condition in CoreWaitForEvent function: > If an interrupt happens between CheckEvent and gIdleLoopEvent, there > would be a event pending during cpu sleep. > So it is required to check the gEventPending with the interrupt disabled. > Implement a gEfiCpu2ProtocolGuid to fix that. The protocol include one > interface to enable interrupt and put the cpu to sleep. >=20 > Add a event protocol gEdkiiCommonEventProtocolGuid to support all TPL > event. It is require for PI drivers that use HW interrput. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > cc: Ray Ni > Cc: Star Zeng > Cc: Liming gao > Cc: Sean Brogan > Cc: Michael Turner > Cc: Bret Barkelew > Cc: Michael D Kinney > Cc: Eric Dong > Cc: Laszlo Ersek >=20 > Sean Brogan (5): > MdeModulePkg: Add gEdkiiCommonEventProtocolGuid for event > MdePkg/BaseLib.h: Add EnableInterruptsAndSleep function declare > MdePkg/BaseLib: Implement EnableInterruptsAndSleep > MdePkg: Add gEfiCpu2ProtocolGuid and header file > MdeModulePkg/DxeMain: Implement common event protocol >=20 > Zhichao Gao (1): > UefiCpuPkg/CpuDxe: Implement Cpu2 protocol >=20 > MdeModulePkg/Core/Dxe/DxeMain.h | 64 ++++++++++- > MdeModulePkg/Core/Dxe/DxeMain.inf | 1 + > MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 22 ++++ > .../Core/Dxe/DxeMain/DxeProtocolNotify.c | 1 + > MdeModulePkg/Core/Dxe/Event/Event.c | 102 ++++++++++++++++-- > MdeModulePkg/Core/Dxe/Event/Event.h | 2 +- > MdeModulePkg/Include/Protocol/CommonEvent.h | 18 ++++ > MdeModulePkg/MdeModulePkg.dec | 3 + > MdePkg/Include/Library/BaseLib.h | 11 ++ > MdePkg/Include/Protocol/Cpu2.h | 43 ++++++++ > .../Library/BaseLib/Ia32/EnableInterrupts.c | 18 +++- > .../BaseLib/Ia32/EnableInterrupts.nasm | 15 ++- > .../Library/BaseLib/X64/EnableInterrupts.nasm | 15 ++- > MdePkg/MdePkg.dec | 3 + > UefiCpuPkg/CpuDxe/CpuDxe.c | 40 ++++++- > UefiCpuPkg/CpuDxe/CpuDxe.h | 15 +++ > UefiCpuPkg/CpuDxe/CpuDxe.inf | 3 +- > 17 files changed, 358 insertions(+), 18 deletions(-) create mode 100644 > MdeModulePkg/Include/Protocol/CommonEvent.h > create mode 100644 MdePkg/Include/Protocol/Cpu2.h >=20 > -- > 2.21.0.windows.1