From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 907AE740047 for ; Fri, 17 May 2024 09:46:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UqXNjSBRhK8YOwKBb/OjC0k6GCsAGlXfu7XEXKrd69U=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1715939217; v=1; b=ETbvuhU9eX3pttVq/xyu+s5QnMSMqgGhvSuJ/fDBlowUvgT2/Z16spNvuOUCbFj0E1yuerI8 dWaB9Qbsts1HHw2sHV9R9mEDPlM8h0D13EBkqeh7ZWprcf/etLrRnU932ojEdhTnsi9QXnF/4qO 5JMO53rPpHPlKIiZqbloSkoOaTs2e2KBOTkwzeZtzAhNvchW0V0vr4Z19ogYXUC84Jlhqt73apF Eyby1bluyQxwQUl2d+4bg1FpWqaUXfmwC38uQXwX6bk5i+1S0hafNKgVHUD42chwc0UaEq30A5g jqvcBVYosw+W0PW2hOtCXKhyQaPJakSBdstMUycvxc8DQ== X-Received: by 127.0.0.2 with SMTP id PnZWYY7687511xjqIJWn2y3O; Fri, 17 May 2024 02:46:57 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mx.groups.io with SMTP id smtpd.web10.35981.1715939207425420009 for ; Fri, 17 May 2024 02:46:56 -0700 X-CSE-ConnectionGUID: XULbribrRyKxmv1NwkE4PA== X-CSE-MsgGUID: bQymvqi2QjCzruGRuM07ng== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="12318761" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="12318761" X-Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:46:57 -0700 X-CSE-ConnectionGUID: woqeqtapTcq+i8VdnFNoPQ== X-CSE-MsgGUID: QjJeY3zHT32omq1EsKPpqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="36646843" X-Received: from unknown (HELO shwdeopenlab702.ccr.corp.intel.com) ([10.239.55.43]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:46:55 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Ray Ni , Rahul Kumar , Gerd Hoffmann , Jiaxin Wu Subject: [edk2-devel] [Patch V2 09/18] UefiCpuPkg: Disable PG in IA32 ApLoopCode Date: Fri, 17 May 2024 17:46:01 +0800 Message-Id: <20240517094610.533-10-dun.tan@intel.com> In-Reply-To: <20240517094610.533-1-dun.tan@intel.com> References: <20240517094610.533-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 17 May 2024 02:46:56 -0700 Resent-From: dun.tan@intel.com Reply-To: devel@edk2.groups.io,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: fcPt8PNav3F0LAoMVaELMkX5x7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ETbvuhU9; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Disable paging in IA32 RelocateApLoop assembly code to fix the issue that the AP page table is unavailiable after boot OS under IA32 execution mode. This issue exist in IA32 PEI + IA32 DXE normal boot (also S3 boot with IA32 PEI after previous three commits are accepted). In current MpLib code, the IA32 execution mode code did not create page table in reserved memory like what X64 code did. If PcdCpuStackGuard is TRUE, the PG is enabled for AP in current RelocateApLoop assembly code. And the page table for AP is unavailiable after boot OS. This might cause potential issue. So disable PG in IA32 RelocateApLoop. Signed-off-by: Dun Tan Reviewed-by: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Jiaxin Wu --- UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm index d117f09ef5..c0fe631635 100644 --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm @@ -1,5 +1,5 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
+; Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.
; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: @@ -225,6 +225,10 @@ RendezvousFunnelProcEnd: ; specific to SEV-ES support and are not applicable on IA32. ;------------------------------------------------------------------------------------- AsmRelocateApLoopGenericStart: + mov eax, cr0 + btr eax, 31 ; Clear CR0.PG + mov cr0, eax ; Disable paging since the page table might be unavailiable + mov eax, esp mov esp, [eax + 12] ; TopOfApStack push dword [eax] ; push return address for stack trace -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119006): https://edk2.groups.io/g/devel/message/119006 Mute This Topic: https://groups.io/mt/106150767/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-