From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EB47321A00AE6 for ; Tue, 11 Sep 2018 23:31:51 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2018 23:31:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,363,1531810800"; d="scan'208";a="85209931" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 11 Sep 2018 23:31:44 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 11 Sep 2018 23:31:43 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 11 Sep 2018 23:31:43 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.240]) with mapi id 14.03.0319.002; Wed, 12 Sep 2018 14:31:40 +0800 From: "Yao, Jiewen" To: "Gao, Liming" , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Dong, Eric" Thread-Topic: [Patch] UefiCpuPkg PiSmmCpuDxeSmm: Update SmiEntry function run the same position Thread-Index: AQHUSldtapiWZFZNcU65k2JX0AnNPqTsL72g Date: Wed, 12 Sep 2018 06:31:40 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AD5480F@shsmsx102.ccr.corp.intel.com> References: <1536729218-8884-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1536729218-8884-1-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmQ4ZWJmNmQtZjJkMi00ZDNiLTkwYTgtODJiNmMxNGFmYjZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMmU0MG1UQUM1aXV6MStjMW1oQWR4T3RBN3V5T2dzV3JQWllIMXVkOUpTNjg0OTlodzE1SklQSGNwOXNBVGc1ayJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] UefiCpuPkg PiSmmCpuDxeSmm: Update SmiEntry function run the same position X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2018 06:31:52 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you! Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Gao, Liming > Sent: Wednesday, September 12, 2018 1:14 PM > To: edk2-devel@lists.01.org > Cc: Laszlo Ersek ; Dong, Eric ; > Yao, Jiewen > Subject: [Patch] UefiCpuPkg PiSmmCpuDxeSmm: Update SmiEntry function > run the same position >=20 > 1. Remove jmp _SmiHandler, and run the code at the same position. > 2. Fix up the function call address as the absolute address. > Verify OVMF SMM boot to shell with VS2017, GCC5 and XCODE5 tool chain. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Liming Gao > Cc: Laszlo Ersek > Cc: Eric Dong > Cc: Jiewen Yao > --- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 34 > +++++++++++++++++++++-------- > 1 file changed, 25 insertions(+), 9 deletions(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm > b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm > index 315d0f8..d8259de 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm > @@ -173,9 +173,6 @@ SmiHandlerIdtrAbsAddr: > mov gs, eax > mov ax, [rbx + DSC_SS] > mov ss, eax > - mov rax, strict qword 0 ; mov rax, > _SmiHandler > -_SmiHandlerAbsAddr: > - jmp rax >=20 > _SmiHandler: > mov rbx, [rsp + 0x8] ; rcx <- CpuIndex > @@ -189,13 +186,19 @@ _SmiHandler: > add rsp, -0x20 >=20 > mov rcx, rbx > - call ASM_PFX(CpuSmmDebugEntry) > + mov rax, strict qword 0 ; call > ASM_PFX(CpuSmmDebugEntry) > +CpuSmmDebugEntryAbsAddr: > + call rax >=20 > mov rcx, rbx > - call ASM_PFX(SmiRendezvous) > + mov rax, strict qword 0 ; call > ASM_PFX(SmiRendezvous) > +SmiRendezvousAbsAddr: > + call rax >=20 > mov rcx, rbx > - call ASM_PFX(CpuSmmDebugExit) > + mov rax, strict qword 0 ; call > ASM_PFX(CpuSmmDebugExit) > +CpuSmmDebugExitAbsAddr: > + call rax >=20 > add rsp, 0x20 >=20 > @@ -206,7 +209,8 @@ _SmiHandler: >=20 > add rsp, 0x200 >=20 > - lea rax, [ASM_PFX(mXdSupported)] > + mov rax, strict qword 0 ; lea rax, > [ASM_PFX(mXdSupported)] > +mXdSupportedAbsAddr: > mov al, [rax] > cmp al, 0 > jz .1 > @@ -230,7 +234,19 @@ ASM_PFX(PiSmmCpuSmiEntryFixupAddress): > lea rcx, [SmiHandlerIdtrAbsAddr] > mov qword [rcx - 8], rax >=20 > - lea rax, [_SmiHandler] > - lea rcx, [_SmiHandlerAbsAddr] > + lea rax, [ASM_PFX(CpuSmmDebugEntry)] > + lea rcx, [CpuSmmDebugEntryAbsAddr] > + mov qword [rcx - 8], rax > + > + lea rax, [ASM_PFX(SmiRendezvous)] > + lea rcx, [SmiRendezvousAbsAddr] > + mov qword [rcx - 8], rax > + > + lea rax, [ASM_PFX(CpuSmmDebugExit)] > + lea rcx, [CpuSmmDebugExitAbsAddr] > + mov qword [rcx - 8], rax > + > + lea rax, [ASM_PFX(mXdSupported)] > + lea rcx, [mXdSupportedAbsAddr] > mov qword [rcx - 8], rax > ret > -- > 2.10.0.windows.1