From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.3934.1591073530883066065 for ; Mon, 01 Jun 2020 21:52:10 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: ray.ni@intel.com) IronPort-SDR: O3pyyi/Ms4H+sd0YcSvh4LuvNbPsq2khbEHVzRlnfJFmYIiFvCq+4I5MM0Se5UHlaUqapvH/ZP 3AbR6fJri0vg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2020 21:52:03 -0700 IronPort-SDR: BBunpmWoFYccZGFsJNITC3LksnZ5hFGZ1ffhhAFU5nRd5VqMqnKqPWdH75u2e4v5pn33OdxmFb llmqbEwHm2XQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,463,1583222400"; d="scan'208";a="304103297" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 01 Jun 2020 21:52:03 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 1 Jun 2020 21:52:03 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 1 Jun 2020 21:51:00 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.85]) with mapi id 14.03.0439.000; Tue, 2 Jun 2020 12:50:56 +0800 From: "Ni, Ray" To: "Cole, Deric" , "devel@edk2.groups.io" CC: "Dong, Eric" , Laszlo Ersek Subject: Re: [PATCH] UefiCpuPkg/SecCore: Add pre-memory AP vector Thread-Topic: [PATCH] UefiCpuPkg/SecCore: Add pre-memory AP vector Thread-Index: AQHWOGSP8Y87h/ISNUejqBh9DEUEQajEwRbg Date: Tue, 2 Jun 2020 04:50:56 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C596480@SHSMSX104.ccr.corp.intel.com> References: <20200601223225.1925-1-deric.cole@intel.com> In-Reply-To: <20200601223225.1925-1-deric.cole@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 Deric, Can you explain why changing all padding 0x0 to 0x90 (nop) in your patch? Is it required to enable AP start up in pre-mem? Thanks, Ray > -----Original Message----- > From: Cole, Deric > Sent: Tuesday, June 2, 2020 6:32 AM > To: devel@edk2.groups.io > Cc: Cole, Deric ; Dong, Eric ;= Ni, > Ray ; Laszlo Ersek > Subject: [PATCH] UefiCpuPkg/SecCore: Add pre-memory AP vector >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2776 >=20 > Add a vector at 0xFF000 (0xFFFFF000) that can be used by Init-SIPI-SIPI > to start an AP before memory is initialized. This vector jumps into the > same SEC entry point as the ordinary reset vector, with a special value > of "AP" in the DI register. The platform-specific SEC code is expected > to check for that value and take a different path for APs, if this > feature is supported by the platform. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Deric Cole > --- > UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb | 31 > ++++++++++++++++++++++++------- > 1 file changed, 24 insertions(+), 7 deletions(-) >=20 > diff --git a/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb > b/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb > index f41b9669d0..1dfc4efe4c 100644 > --- a/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb > +++ b/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb > @@ -10,7 +10,7 @@ > ; Abstract: >=20 > ; >=20 > ; Reset Vector Data structure >=20 > -; This structure is located at 0xFFFFFFC0 >=20 > +; This structure is located at 0xFFFFF000 >=20 > ; >=20 > ;-----------------------------------------------------------------------= ------- >=20 >=20 >=20 > @@ -23,19 +23,36 @@ USE16 > ; >=20 >=20 >=20 > ORG 0h >=20 > + >=20 > +; >=20 > +; 0xFFFFF000 >=20 > +; >=20 > +; We enter here with CS:IP =3D 0xFF00:0x0000. Do a far-jump to change CS= to > 0xF000 >=20 > +; and IP to ApStartup. >=20 > +; >=20 > +ApVector: >=20 > + mov di, "AP" >=20 > + jmp 0xF000:0xF000+ApStartup >=20 > + >=20 > + TIMES 0xFC0-($-$$) nop >=20 > + >=20 > +; >=20 > +; This should be at 0xFFFFFFC0 >=20 > +; >=20 > + >=20 > ; >=20 > ; Reserved >=20 > ; >=20 > ReservedData: DD 0eeeeeeeeh, 0eeeeeeeeh >=20 >=20 >=20 > - TIMES 0x10-($-$$) DB 0 >=20 > + TIMES 0xFD0-($-$$) nop >=20 > ; >=20 > -; This is located at 0xFFFFFFD0h >=20 > +; This is located at 0xFFFFFFD0 >=20 > ; >=20 > mov di, "PA" >=20 > jmp ApStartup >=20 >=20 >=20 > - TIMES 0x20-($-$$) DB 0 >=20 > + TIMES 0xFE0-($-$$) nop >=20 > ; >=20 > ; Pointer to the entry point of the PEI core >=20 > ; It is located at 0xFFFFFFE0, and is fixed up by some build tool >=20 > @@ -53,7 +70,7 @@ ASM_PFX(InterruptHandler): > jmp $ >=20 > iret >=20 >=20 >=20 > - TIMES 0x30-($-$$) DB 0 >=20 > + TIMES 0xFF0-($-$$) nop >=20 > ; >=20 > ; For IA32, the reset vector must be at 0xFFFFFFF0, i.e., 4G-16 byte >=20 > ; Execution starts here upon power-on/platform-reset. >=20 > @@ -74,7 +91,7 @@ ApStartup: > DW -3 >=20 >=20 >=20 >=20 >=20 > - TIMES 0x38-($-$$) DB 0 >=20 > + TIMES 0xFF8-($-$$) nop >=20 > ; >=20 > ; Ap reset vector segment address is at 0xFFFFFFF8 >=20 > ; This will be fixed up by some build tool, >=20 > @@ -83,7 +100,7 @@ ApStartup: > ; >=20 > ApSegAddress: dd 12345678h >=20 >=20 >=20 > - TIMES 0x3c-($-$$) DB 0 >=20 > + TIMES 0xFFC-($-$$) nop >=20 > ; >=20 > ; BFV Base is at 0xFFFFFFFC >=20 > ; This will be fixed up by some build tool, >=20 > -- > 2.26.2.windows.1