From nobody Fri May 3 18:10:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60568+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60568+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591091713; cv=none; d=zohomail.com; s=zohoarc; b=NzBdXLFdrwKi8cLwDA3l5+/jwLixuq7fE7Qm/g26EglqkzdPMLjL/juHxg2ykYLjai5g4H60TSbZz0tpedcBM1dP5Z7eHgwk6v70NhFIfSC4bnRQ1WaOGwg4q9S/Ol6t+GzwTLy3mFgBey1IHCmWFqAA4AuUfWvJiBk5GzfGO4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591091713; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=/YRrHi7inohaBZBbCYQFIzoOfqbBEd/s6oEaU8jQHxc=; b=XxTon1RwWG+SI+AlqsZONsUiiKX6gFWCRHK04f/XjqZy19Tj9XHG/bihwd5NUDriJIA/L4JNYccmV/Au2TQ2jhTDE9/I385yRbiOWXlDBy71EtdFRio+5IV+++QyS8g4MT3dKZ8cEJHUQBRYK5zFjIVGJxyVozAJZ+W1ect4ar8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60568+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591091713620160.50655502998825; Tue, 2 Jun 2020 02:55:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Kdy5YY1788612xiXOCKrzwNE; Tue, 02 Jun 2020 02:55:13 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.49719.1591050756494545160 for ; Mon, 01 Jun 2020 15:32:36 -0700 IronPort-SDR: Ov6MnjX7SVQodMr3CWA4vD5gJVYPlo49OFey2axF2OlL0Yt4O2F1yCjG/hWLbH+s8mLWp+DJv5 XCvQS0FIhbYg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2020 15:32:35 -0700 IronPort-SDR: bi9/83mJvVDlZEdY617hkBqvfcD918IC+EQ0uPy7s79/N3fjdt7FtiLxaLzIGofd7m8Xaq6utX SKYnHjwX2DJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,462,1583222400"; d="scan'208";a="268478060" X-Received: from fcole-desk.amr.corp.intel.com ([10.7.144.170]) by orsmga003.jf.intel.com with ESMTP; 01 Jun 2020 15:32:35 -0700 From: Deric Cole To: devel@edk2.groups.io Cc: Deric Cole , Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH] UefiCpuPkg/SecCore: Add pre-memory AP vector Date: Mon, 1 Jun 2020 15:32:25 -0700 Message-Id: <20200601223225.1925-1-deric.cole@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,deric.cole@intel.com X-Gm-Message-State: NPhIcop3GGzTxE43D2PtpbxMx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591091713; bh=INSXf2YmKpuLY9IznVKJKeRR2YS5NaVKmsg0frfNCmw=; h=Cc:Date:From:Reply-To:Subject:To; b=OhisBFQAn6t1lOTijAxqnP7nwbQaf1GRi7h0O/ALWhfYIaKaoOWmurPewA8gEmzudlR MSZMyX4Bnwoge/wMgEhdbH1AstSienl2FyM1JDRYPht+AYB4GzwfzxDJ8XqB7/0q7tHj4 D4XJHOIWA/kehqgDShN7TmwX5ZoD7KNeGcA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2776 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. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Deric Cole Reviewed-by: Eric Dong eric.dong@intel.com Reviewed-by: Ray Ni > Reviewed-by: Ray Ni --- UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb b/UefiCpuPkg/SecCore/Ia= 32/ResetVec.nasmb index f41b9669d0..1dfc4efe4c 100644 --- a/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb +++ b/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb @@ -10,7 +10,7 @@ ; Abstract: ; ; Reset Vector Data structure -; This structure is located at 0xFFFFFFC0 +; This structure is located at 0xFFFFF000 ; ;-------------------------------------------------------------------------= ----- =20 @@ -23,19 +23,36 @@ USE16 ; =20 ORG 0h + +; +; 0xFFFFF000 +; +; We enter here with CS:IP =3D 0xFF00:0x0000. Do a far-jump to change CS t= o 0xF000 +; and IP to ApStartup. +; +ApVector: + mov di, "AP" + jmp 0xF000:0xF000+ApStartup + + TIMES 0xFC0-($-$$) nop + +; +; This should be at 0xFFFFFFC0 +; + ; ; Reserved ; ReservedData: DD 0eeeeeeeeh, 0eeeeeeeeh =20 - TIMES 0x10-($-$$) DB 0 + TIMES 0xFD0-($-$$) nop ; -; This is located at 0xFFFFFFD0h +; This is located at 0xFFFFFFD0 ; mov di, "PA" jmp ApStartup =20 - TIMES 0x20-($-$$) DB 0 + TIMES 0xFE0-($-$$) nop ; ; Pointer to the entry point of the PEI core ; It is located at 0xFFFFFFE0, and is fixed up by some build tool @@ -53,7 +70,7 @@ ASM_PFX(InterruptHandler): jmp $ iret =20 - TIMES 0x30-($-$$) DB 0 + TIMES 0xFF0-($-$$) nop ; ; For IA32, the reset vector must be at 0xFFFFFFF0, i.e., 4G-16 byte ; Execution starts here upon power-on/platform-reset. @@ -74,7 +91,7 @@ ApStartup: DW -3 =20 =20 - TIMES 0x38-($-$$) DB 0 + TIMES 0xFF8-($-$$) nop ; ; Ap reset vector segment address is at 0xFFFFFFF8 ; This will be fixed up by some build tool, @@ -83,7 +100,7 @@ ApStartup: ; ApSegAddress: dd 12345678h =20 - TIMES 0x3c-($-$$) DB 0 + TIMES 0xFFC-($-$$) nop ; ; BFV Base is at 0xFFFFFFFC ; This will be fixed up by some build tool, --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60568): https://edk2.groups.io/g/devel/message/60568 Mute This Topic: https://groups.io/mt/74621927/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-