From nobody Mon May 13 03:06:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106758+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106758+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1688959039; cv=none; d=zohomail.com; s=zohoarc; b=ZbF1XqLcMCDyt/d0sO6rdAG6sK+sPvnQ+YNccjyDr4Ydv/48F40lLT8LmVmy752KtL1R0cVVzApY4Ow2/s+qs18kZCQzNG/Lx1L3dKSRNLvDvrR3yOa2P4uMnrRUkQm1WX861gcImQDp2WazEBoAG/6rn/uAT0mmG/VLrcZ4ipI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688959039; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IzH2ozoBSm6TCyIqhpFk9NbeHIEC0iJBsTOsU10JApo=; b=e1KjpB2F0j+ERhDcjaE7f3DLkzK489TrdLMfo3n3rljkO0pEAkBIH4SU5va5jxyhJRhNs2RB88EYhQE7EEfibZ5/JGZGl9WkbNVo2utdXZrOSEuIM/sPSdbJvHIw58Jd3PyXSHB9vo1cy3WKGWedgRRSJ9V+fqUx8WGtfLwioCE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106758+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1688959038976763.3878008761368; Sun, 9 Jul 2023 20:17:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id F7rbYY1788612xr52yE7iVda; Sun, 09 Jul 2023 20:17:18 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.32065.1688959036830470108 for ; Sun, 09 Jul 2023 20:17:18 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="430319054" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="430319054" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="834113157" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="834113157" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:15 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen Subject: [edk2-devel] [PATCH 1/4] BaseTools: Remove logic to create AP waking vector in GenFv Date: Mon, 10 Jul 2023 11:17:03 +0800 Message-Id: <20230710031706.1329-2-zhiguang.liu@intel.com> In-Reply-To: <20230710031706.1329-1-zhiguang.liu@intel.com> References: <20230710031706.1329-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,zhiguang.liu@intel.com X-Gm-Message-State: dpfGCs9Lpoh6lJElysmwloXFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1688959038; bh=hbbjXyRZcEDS2H5HZvanV4cUBNfXnqG9fV9eK6PBuHQ=; h=Cc:Date:From:Reply-To:Subject:To; b=GxF8QqxQuYHM9XYNXfHw5q4v5aGPzP5GEVgBcN/8/ZHXluGRxdaALUoi3jpE2bd4ZxD a7fOw/9HsQRVaB18eCoZzGiNyXrdwMKh+uipArxG8JBZoX8nk72dDjSAPmspc+d9e6aTw na4QmErPvOqcvvKNGtIo9atHH8MDjN0VAmo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1688959040270100005 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4494 Today for SEC core(not VTF-0), GenFv finds free 4K aligned space in FV for AP waking vector and JMP to 4G-30h in the waking vector. There is no usage of this today. Remove the logic to avoid confusing and save spaces in reset vector. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Signed-off-by: Zhiguang Liu Reviewed-by: Liming Gao Reviewed-by: Ray Ni --- BaseTools/Source/C/GenFv/GenFvInternalLib.c | 199 -------------------- 1 file changed, 199 deletions(-) diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source= /C/GenFv/GenFvInternalLib.c index f466324d61..29c3363a50 100644 --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c @@ -116,63 +116,6 @@ CHAR8 *mFvbAlignmentName[] =3D { EFI_FVB2_ALIGNMENT_2G_STRING }; =20 -// -// This data array will be located at the base of the Firmware Volume Head= er (FVH) -// in the boot block. It must not exceed 14 bytes of code. The last 2 by= tes -// will be used to keep the FVH checksum consistent. -// This code will be run in response to a startup IPI for HT-enabled syste= ms. -// -#define SIZEOF_STARTUP_DATA_ARRAY 0x10 - -UINT8 m128kRecoveryStartupApDataArray[SI= ZEOF_STARTUP_DATA_ARRAY] =3D { - // - // EA D0 FF 00 F0 ; far jmp F000:FFD0 - // 0, 0, 0, 0, 0, 0, 0, 0, 0, ; Reserved bytes - // 0, 0 ; Checksum Padding - // - 0xEA, - 0xD0, - 0xFF, - 0x0, - 0xF0, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 -}; - -UINT8 m64kRecoveryStartupApDataArray[SIZ= EOF_STARTUP_DATA_ARRAY] =3D { - // - // EB CE ; jmp short ($-0x30) - // ; (from offset 0x0 to offset 0xFFD0) - // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ; Reserved bytes - // 0, 0 ; Checksum Padding - // - 0xEB, - 0xCE, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 -}; - FV_INFO mFvDataInfo; CAP_INFO mCapDataInfo; BOOLEAN mIsLargeFfs =3D FALSE; @@ -1568,12 +1511,6 @@ Returns: EFI_PHYSICAL_ADDRESS SecCorePhysicalAddress; INT32 Ia32SecEntryOffset; UINT32 *Ia32ResetAddressPtr; - UINT8 *BytePointer; - UINT8 *BytePointer2; - UINT16 *WordPointer; - UINT16 CheckSum; - UINT32 IpiVector; - UINTN Index; EFI_FFS_FILE_STATE SavedState; BOOLEAN Vtf0Detected; UINT32 FfsHeaderSize; @@ -1745,65 +1682,6 @@ if (MachineType =3D=3D IMAGE_FILE_MACHINE_I386 || Ma= chineType =3D=3D IMAGE_FILE_MACHINE_ Ia32ResetAddressPtr =3D (UINT32 *) ((UINTN) FvImage->Eof - 4); *Ia32ResetAddressPtr =3D (UINT32) (FvInfo->BaseAddress); DebugMsg (NULL, 0, 9, "update BFV base address in the top FV image", "= BFV base address =3D 0x%llX.", (unsigned long long) FvInfo->BaseAddress); - - // - // Update the Startup AP in the FVH header block ZeroVector region. - // - BytePointer =3D (UINT8 *) ((UINTN) FvImage->FileImage); - if (FvInfo->Size <=3D 0x10000) { - BytePointer2 =3D m64kRecoveryStartupApDataArray; - } else if (FvInfo->Size <=3D 0x20000) { - BytePointer2 =3D m128kRecoveryStartupApDataArray; - } else { - BytePointer2 =3D m128kRecoveryStartupApDataArray; - // - // Find the position to place Ap reset vector, the offset - // between the position and the end of Fvrecovery.fv file - // should not exceed 128kB to prevent Ap reset vector from - // outside legacy E and F segment - // - Status =3D FindApResetVectorPosition (FvImage, &BytePointer); - if (EFI_ERROR (Status)) { - Error (NULL, 0, 3000, "Invalid", "FV image does not have enough sp= ace to place AP reset vector. The FV image needs to reserve at least 4KB of= unused space."); - return EFI_ABORTED; - } - } - - for (Index =3D 0; Index < SIZEOF_STARTUP_DATA_ARRAY; Index++) { - BytePointer[Index] =3D BytePointer2[Index]; - } - // - // Calculate the checksum - // - CheckSum =3D 0x0000; - WordPointer =3D (UINT16 *) (BytePointer); - for (Index =3D 0; Index < SIZEOF_STARTUP_DATA_ARRAY / 2; Index++) { - CheckSum =3D (UINT16) (CheckSum + ((UINT16) *WordPointer)); - WordPointer++; - } - // - // Update the checksum field - // - WordPointer =3D (UINT16 *) (BytePointer + SIZEOF_STARTUP_DATA_ARRAY = - 2); - *WordPointer =3D (UINT16) (0x10000 - (UINT32) CheckSum); - - // - // IpiVector at the 4k aligned address in the top 2 blocks in the PEI = FV. - // - IpiVector =3D (UINT32) (FV_IMAGES_TOP_ADDRESS - ((UINTN) FvImage->Eof= - (UINTN) BytePointer)); - DebugMsg (NULL, 0, 9, "Startup AP Vector address", "IpiVector at 0x%X"= , (unsigned) IpiVector); - if ((IpiVector & 0xFFF) !=3D 0) { - Error (NULL, 0, 3000, "Invalid", "Startup AP Vector address are not = 4K aligned, because the FV size is not 4K aligned"); - return EFI_ABORTED; - } - IpiVector =3D IpiVector >> 12; - IpiVector =3D IpiVector & 0xFF; - - // - // Write IPI Vector at Offset FvrecoveryFileSize - 8 - // - Ia32ResetAddressPtr =3D (UINT32 *) ((UINTN) FvImage->Eof - 8); - *Ia32ResetAddressPtr =3D IpiVector; } else if (MachineType =3D=3D IMAGE_FILE_MACHINE_ARMTHUMB_MIXED) { // // Since the ARM reset vector is in the FV Header you really don't nee= d a @@ -4190,83 +4068,6 @@ Returns: return EFI_SUCCESS; } =20 -EFI_STATUS -FindApResetVectorPosition ( - IN MEMORY_FILE *FvImage, - OUT UINT8 **Pointer - ) -/*++ - -Routine Description: - - Find the position in this FvImage to place Ap reset vector. - -Arguments: - - FvImage Memory file for the FV memory image. - Pointer Pointer to pointer to position. - -Returns: - - EFI_NOT_FOUND - No satisfied position is found. - EFI_SUCCESS - The suitable position is return. - ---*/ -{ - EFI_FFS_FILE_HEADER *PadFile; - UINT32 Index; - EFI_STATUS Status; - UINT8 *FixPoint; - UINT32 FileLength; - - for (Index =3D 1; ;Index ++) { - // - // Find Pad File to add ApResetVector info - // - Status =3D GetFileByType (EFI_FV_FILETYPE_FFS_PAD, Index, &PadFile); - if (EFI_ERROR (Status) || (PadFile =3D=3D NULL)) { - // - // No Pad file to be found. - // - break; - } - // - // Get Pad file size. - // - FileLength =3D GetFfsFileLength(PadFile); - FileLength =3D (FileLength + EFI_FFS_FILE_HEADER_ALIGNMENT - 1) & ~(EF= I_FFS_FILE_HEADER_ALIGNMENT - 1); - // - // FixPoint must be align on 0x1000 relative to FvImage Header - // - FixPoint =3D (UINT8*) PadFile + GetFfsHeaderLength(PadFile); - FixPoint =3D FixPoint + 0x1000 - (((UINTN) FixPoint - (UINTN) FvImage-= >FileImage) & 0xFFF); - // - // FixPoint be larger at the last place of one fv image. - // - while (((UINTN) FixPoint + SIZEOF_STARTUP_DATA_ARRAY - (UINTN) PadFile= ) <=3D FileLength) { - FixPoint +=3D 0x1000; - } - FixPoint -=3D 0x1000; - - if ((UINTN) FixPoint < ((UINTN) PadFile + GetFfsHeaderLength(PadFile))= ) { - // - // No alignment FixPoint in this Pad File. - // - continue; - } - - if ((UINTN) FvImage->Eof - (UINTN)FixPoint <=3D 0x20000) { - // - // Find the position to place ApResetVector - // - *Pointer =3D FixPoint; - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - EFI_STATUS ParseCapInf ( IN MEMORY_FILE *InfFile, --=20 2.31.1.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 (#106758): https://edk2.groups.io/g/devel/message/106758 Mute This Topic: https://groups.io/mt/100051788/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- From nobody Mon May 13 03:06:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106759+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106759+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1688959040; cv=none; d=zohomail.com; s=zohoarc; b=Rven8J3gNaTJLzfn6Zv7annIooNHWTnuWc7X28DY/DG0nofgjgjoHwRkisc/A4nvOuZoJz5EwqbBwp8TvCO102tIGVYFhSCeHvqF6WzvKBZbc5plHSSwaEejbbaPY4kxVvZAyZYzCB/YoliVAp4UdbK2ociAD49GgpsJorHGTO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688959040; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IzF1V8mLlU5qOOcf81LStHxnc6/VBqAw6dOl1gT1HXk=; b=Mdh8zXWkLDf54xfx7Z1PBi0+MEg0Lxi/GgbjfGPTo3RjrNpAMUxT/gQdicVTGjDLcpg3EF4jiSUF59OO0I1ZvWhfynJRUt7hW0NniG56T3FEVIY32mL4k77TDtmoVwNSiwEArkKxlChOvgq6V3oGKJ+uNbGm/pBFVkP8plpaouY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106759+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1688959040581384.93333140604284; Sun, 9 Jul 2023 20:17:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pR3LYY1788612xuVVQLYIXfj; Sun, 09 Jul 2023 20:17:20 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.32065.1688959036830470108 for ; Sun, 09 Jul 2023 20:17:19 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="430319075" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="430319075" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="834113163" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="834113163" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:17 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [PATCH 2/4] UefiCpuPkg/SecCore: Remove AP waking Vector logic in SecCore Date: Mon, 10 Jul 2023 11:17:04 +0800 Message-Id: <20230710031706.1329-3-zhiguang.liu@intel.com> In-Reply-To: <20230710031706.1329-1-zhiguang.liu@intel.com> References: <20230710031706.1329-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,zhiguang.liu@intel.com X-Gm-Message-State: 9QDXCU7blN7C8UjATzGufRR8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1688959040; bh=tXNwnLssggKMvsmZ42GvObPb8bcVGpGACZ7c4fyP/jU=; h=Cc:Date:From:Reply-To:Subject:To; b=vu3U4ePPOL/a2blww3KIslg9UOPd02So3YjQXDXhgYg8VRlPBqGbBwvo67ApPa9AHPn cNlrC1jcvESKK64Mgf2oDHUlvSuhOn4pQrGWvY/k8a663syYUs7czG5+AsVy/7+UPQHtG YrL8t/fD8D6ZzImWR/0CkGoTGsrhDO6sCKU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1688959042249100011 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4494 There are two part of AP waking Vector logic in SecCore. The first one working with GenFv to find a free 4K aligned space, use the 4K aligned address as AP waking Vector and jump to 4G-30h, and finally jump to ApStartup.. The second one hard code uses 4G-1000h as AP waking Vector and jump to ApStartup. Both usages are no longer used. Remove them. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Zhiguang Liu Reviewed-by: Ray Ni --- UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb | 36 +++----------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb b/UefiCpuPkg/SecCore/Ia= 32/ResetVec.nasmb index 1dfc4efe4c..df5f439c4e 100644 --- a/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb +++ b/UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb @@ -24,18 +24,6 @@ USE16 =20 ORG 0h =20 -; -; 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 ; @@ -45,14 +33,7 @@ ApVector: ; ReservedData: DD 0eeeeeeeeh, 0eeeeeeeeh =20 - TIMES 0xFD0-($-$$) nop -; -; This is located at 0xFFFFFFD0 -; - mov di, "PA" - jmp ApStartup - - TIMES 0xFE0-($-$$) nop + TIMES 0x20-($-$$) nop ; ; Pointer to the entry point of the PEI core ; It is located at 0xFFFFFFE0, and is fixed up by some build tool @@ -70,7 +51,7 @@ ASM_PFX(InterruptHandler): jmp $ iret =20 - TIMES 0xFF0-($-$$) nop + TIMES 0x30-($-$$) nop ; ; For IA32, the reset vector must be at 0xFFFFFFF0, i.e., 4G-16 byte ; Execution starts here upon power-on/platform-reset. @@ -78,7 +59,6 @@ ASM_PFX(InterruptHandler): ResetHandler: nop nop -ApStartup: ; ; Jmp Rel16 instruction ; Use machine code directly in case of the assembler optimization @@ -90,17 +70,7 @@ ApStartup: DB 0e9h DW -3 =20 - - TIMES 0xFF8-($-$$) nop -; -; Ap reset vector segment address is at 0xFFFFFFF8 -; This will be fixed up by some build tool, -; so if the value 1..8 appears in the final FD image, -; tool failure occurs -; -ApSegAddress: dd 12345678h - - TIMES 0xFFC-($-$$) nop + TIMES 0x3C-($-$$) nop ; ; BFV Base is at 0xFFFFFFFC ; This will be fixed up by some build tool, --=20 2.31.1.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 (#106759): https://edk2.groups.io/g/devel/message/106759 Mute This Topic: https://groups.io/mt/100051789/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- From nobody Mon May 13 03:06:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106760+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106760+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1688959042; cv=none; d=zohomail.com; s=zohoarc; b=ZJLCbbW6hiBIgm07fibTGLov29pEvA5tQTFJATXVRD4ukaTeQrokF5cddxHnC4gu0ITpIqz5wp1kbLfK565ok74npjBwxj3w1nKgVduX/oMFu1QkiZUlCA09IxDxXFyVGC5n+gBeR/05ChMKBKPI6ArMl9oLc/OGsYuigkgPc8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688959042; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ojAYa5FOj0rEoLLgZ6vm9JFORtF7yRYDOIAeLWTbdHw=; b=jNKp+6COP2V2NGT8wQVzDU/qtFv0eKNfcigH4/KJwEhVlTYhg05r/7ZvFQBcPXu24QHVjE3Dd3xJppC1d8pXkhMyPXRlumBdKxSEu3okVNaokseUlhORl+UpSZgXA8iCSu30xW25dbjwaw/Sn2uTmJ8hHh8lRVkHXeaov3bobNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106760+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1688959042961165.2038103528689; Sun, 9 Jul 2023 20:17:22 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DVYOYY1788612xIB9f5Cb51X; Sun, 09 Jul 2023 20:17:22 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.32065.1688959036830470108 for ; Sun, 09 Jul 2023 20:17:22 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="430319108" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="430319108" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="834113172" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="834113172" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:19 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Anthony Perard , Julien Grall Subject: [edk2-devel] [PATCH 3/4] OvmfPkg: Remove applicationProcessorEntryPoint Date: Mon, 10 Jul 2023 11:17:05 +0800 Message-Id: <20230710031706.1329-4-zhiguang.liu@intel.com> In-Reply-To: <20230710031706.1329-1-zhiguang.liu@intel.com> References: <20230710031706.1329-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,zhiguang.liu@intel.com X-Gm-Message-State: djqOR3cKGuy1TGk1BOoLuUKpx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1688959042; bh=MJVmV4AiRKzVKjCTwSdaPMtdGBd36Byek2Ap8Zl1yX0=; h=Cc:Date:From:Reply-To:Subject:To; b=HM8ZWyHSLdCnacXuu+eNw0CnCC1WzR+ExBO0H/a/b6Lm5yFJ+V6Jxxrj2MnYoz33Jwq sI/rCR19qV3+rwa6vylBrbQfX6pAusYSYvuIe7s1z4C9J641M4kjMs+0cNrc6N/eZcS8j 8KGnD67nCrafz/sBsFk8kqUWp98puQl0kQg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1688959044951100003 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4494 Current reset vector uses 0xffffffe0 as AP waking vector, and expects GenFv generates code aligned on a 4k boundary which will jump to this location. However, some issues are listed below 1. GenFV doesn't generate code as the comment expects, because GenFv assumes no modifications are required to the VTF-0 'Volume Top File'. 2. Even if removing VFT0 signature and let GenFv to modify, Genfv is hard-code using another flash address 0xffffffd0. 3. In the same patch series, AP waking vector code is removed from GenFv, because no such usage anymore. The existing of first two issues also approve the usage is not available for a long time. Therefore, remove AP waking vector related code. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Anthony Perard Cc: Julien Grall Signed-off-by: Zhiguang Liu Acked-by: Anthony PERARD Reviewed-by: Ray Ni --- OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm | 15 +++------------ OvmfPkg/XenResetVector/Ia16/ResetVectorVtf0.asm | 16 +++------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm b/OvmfPkg/ResetVe= ctor/Ia16/ResetVectorVtf0.asm index 12f2cedd67..8f94da89f7 100644 --- a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm +++ b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm @@ -160,22 +160,13 @@ guidedStructureEnd: =20 ALIGN 16 =20 -applicationProcessorEntryPoint: ; -; Application Processors entry point +; 0xffffffe0 ; -; GenFv generates code aligned on a 4k boundary which will jump to this -; location. (0xffffffe0) This allows the Local APIC Startup IPI to be -; used to wake up the application processors. -; - jmp EarlyApInitReal16 - -ALIGN 8 - - DD 0 + DD 0, 0, 0 =20 ; -; The VTF signature +; The VTF signature (0xffffffec) ; ; VTF-0 means that the VTF (Volume Top File) code does not require ; any fixups. diff --git a/OvmfPkg/XenResetVector/Ia16/ResetVectorVtf0.asm b/OvmfPkg/XenR= esetVector/Ia16/ResetVectorVtf0.asm index 56749bdbc9..67156d8252 100644 --- a/OvmfPkg/XenResetVector/Ia16/ResetVectorVtf0.asm +++ b/OvmfPkg/XenResetVector/Ia16/ResetVectorVtf0.asm @@ -39,23 +39,13 @@ xenPVHEntryPoint: =20 BITS 16 ALIGN 16 - -applicationProcessorEntryPoint: -; -; Application Processors entry point ; -; GenFv generates code aligned on a 4k boundary which will jump to this -; location. (0xffffffe0) This allows the Local APIC Startup IPI to be -; used to wake up the application processors. +; 0xffffffe0 ; - jmp EarlyApInitReal16 - -ALIGN 8 - - DD 0 + DD 0, 0, 0 =20 ; -; The VTF signature +; The VTF signature (0xffffffec) ; ; VTF-0 means that the VTF (Volume Top File) code does not require ; any fixups. --=20 2.31.1.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 (#106760): https://edk2.groups.io/g/devel/message/106760 Mute This Topic: https://groups.io/mt/100051790/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- From nobody Mon May 13 03:06:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106761+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106761+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1688959044; cv=none; d=zohomail.com; s=zohoarc; b=UMm5KNo5o2JpqZ6WenywzNxv5+bYauqT3bQrXadhF0uWUD1hc7ufl8Shh61MsxyxJKloXI0QNiRDI5Y+sfTjg6vNIUYMm81SVQJ4KSd89PdXoMu0YuwvfsnrcfaKScNWtQzvMcQMSKv+rPmjo9V0s6+Vd5GZ+ZBq7CMYlDuupYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688959044; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=WEJodJ0DX3wlubDJXBvxBP8goPGhw53d3xY48biZjRU=; b=bX6Ja7DmqL8NZHRrwtWQJkEDsnNRX4ZzYvGcYn7gKwe/+gP2qotzeyYu1Jq2cXqQS0SSGhKPmZz+zaf4j+zzL9rO57zEJjXgykh1CsIH0DbyDARZng5s1n1F4aXki+7aVzoR2VDyIf0kHpjDXQ4hbGhojDZzqdz39P6NrpTsVew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106761+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1688959044821914.8042922882498; Sun, 9 Jul 2023 20:17:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LBn2YY1788612x0ti6Dodcoe; Sun, 09 Jul 2023 20:17:24 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.32065.1688959036830470108 for ; Sun, 09 Jul 2023 20:17:24 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="430319136" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="430319136" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="834113176" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="834113176" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 20:17:21 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [PATCH 4/4] UefiCpuPk/ResetVector: Remove AP waking vector from ResetVector Date: Mon, 10 Jul 2023 11:17:06 +0800 Message-Id: <20230710031706.1329-5-zhiguang.liu@intel.com> In-Reply-To: <20230710031706.1329-1-zhiguang.liu@intel.com> References: <20230710031706.1329-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,zhiguang.liu@intel.com X-Gm-Message-State: vBNmS5Kl0ZLJHwn8181q4NPNx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1688959044; bh=jKzycfi7cVHdt/on1Doom46TGKGuvLpsx7vUi0OvAQs=; h=Cc:Date:From:Reply-To:Subject:To; b=gryvsZ9zVr7CgppMyoGoVCETM+JheFAf6TWMPV84DXC0FnbG4FmHjOxOdgcHyPsUN4o WXQ8QBZV/Pw7pN1ILa5Fpj0AB7bj1NwCphfi2Izmp5uWke2hV4a0fe8O/QpGpp7bKIKV7 oyE2LbGADxua+S/O77143W7l7LMT4CTzyCw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1688959045263100005 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4494 Current reset vector uses 0xffffffe0 as AP waking vector, and expects GenFv generates code aligned on a 4k boundary which will jump to this location. However, some issues are listed below 1. GenFV doesn't generate code as the comment expects, because GenFv assumes no modifications are required to the VTF-0 'Volume Top File'. 2. Even if removing VFT0 signature and let GenFv to modify, Genfv is hard-code using another flash address 0xffffffd0. 3. In the same patch series, AP waking vector code is removed from GenFv, because no such usage anymore. The existing of first two issues also approve the usage is not available for a long time. Therefore, remove AP waking vector related code. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Zhiguang Liu Reviewed-by: Ray Ni --- UefiCpuPkg/ResetVector/Vtf0/Ia16/Init16.asm | 7 ------- .../ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm | 15 +++------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia16/Init16.asm b/UefiCpuPkg/Reset= Vector/Vtf0/Ia16/Init16.asm index cbdadee166..02b9a0303c 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Ia16/Init16.asm +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia16/Init16.asm @@ -17,13 +17,6 @@ EarlyBspInitReal16: mov di, 'BP' jmp short Main16 =20 -; -; @param[out] DI 'AP' to indicate application processor -; -EarlyApInitReal16: - mov di, 'AP' - jmp short Main16 - ; ; Modified: EAX ; diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm b/UefiCpu= Pkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm index fe5bbea803..384b1d4d98 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm @@ -32,22 +32,13 @@ ALIGN 16 TIMES (0x1000 - 0x20) DB 0 %endif =20 -applicationProcessorEntryPoint: ; -; Application Processors entry point +; 0xffffffe0 ; -; GenFv generates code aligned on a 4k boundary which will jump to this -; location. (0xffffffe0) This allows the Local APIC Startup IPI to be -; used to wake up the application processors. -; - jmp EarlyApInitReal16 - -ALIGN 8 - - DD 0 + DD 0, 0, 0 =20 ; -; The VTF signature +; The VTF signature (0xffffffec) ; ; VTF-0 means that the VTF (Volume Top File) code does not require ; any fixups. --=20 2.31.1.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 (#106761): https://edk2.groups.io/g/devel/message/106761 Mute This Topic: https://groups.io/mt/100051791/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-