mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-10-31 05:28:13 +00:00 
			
		
		
		
	 f32bfe6d06
			
		
	
	
		f32bfe6d06
		
	
	
	
	
		
			
			If PcdDxeNxMemoryProtectionPolicy is set to enable protection for memory of EfiBootServicesCode, EfiConventionalMemory, the BIOS will hang at a page fault exception during MP initialization. The root cause is that the AP wake up buffer, which is below 1MB and used to hold both AP init code and data, is type of EfiConventionalMemory (not really allocated because of potential conflict with legacy code), and is marked as non-executable. During the transition from real address mode to long mode, the AP init code has to enable paging which will then cause itself a page fault exception because it's just running in non-executable memory. The solution is splitting AP wake up buffer into two part: lower part is still below 1MB and shared with legacy system, higher part is really allocated memory of BootServicesCode type. The init code in the memory below 1MB will not enable paging but just switch to protected mode and jump to higher memory, in which the init code will enable paging and switch to long mode. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
		
			
				
	
	
		
			50 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| ;------------------------------------------------------------------------------ ;
 | |
| ; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
 | |
| ; This program and the accompanying materials
 | |
| ; are licensed and made available under the terms and conditions of the BSD License
 | |
| ; which accompanies this distribution.  The full text of the license may be found at
 | |
| ; http://opensource.org/licenses/bsd-license.php.
 | |
| ;
 | |
| ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | |
| ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | |
| ;
 | |
| ; Module Name:
 | |
| ;
 | |
| ;   MpEqu.inc
 | |
| ;
 | |
| ; Abstract:
 | |
| ;
 | |
| ;   This is the equates file for Multiple Processor support
 | |
| ;
 | |
| ;-------------------------------------------------------------------------------
 | |
| 
 | |
| VacantFlag                    equ        00h
 | |
| NotVacantFlag                 equ        0ffh
 | |
| 
 | |
| CPU_SWITCH_STATE_IDLE         equ        0
 | |
| CPU_SWITCH_STATE_STORED       equ        1
 | |
| CPU_SWITCH_STATE_LOADED       equ        2
 | |
| 
 | |
| LockLocation                  equ        (RendezvousFunnelProcEnd - RendezvousFunnelProcStart)
 | |
| StackStartAddressLocation     equ        LockLocation + 04h
 | |
| StackSizeLocation             equ        LockLocation + 08h
 | |
| ApProcedureLocation           equ        LockLocation + 0Ch
 | |
| GdtrLocation                  equ        LockLocation + 10h
 | |
| IdtrLocation                  equ        LockLocation + 16h
 | |
| BufferStartLocation           equ        LockLocation + 1Ch
 | |
| ModeOffsetLocation            equ        LockLocation + 20h
 | |
| ApIndexLocation               equ        LockLocation + 24h
 | |
| CodeSegmentLocation           equ        LockLocation + 28h
 | |
| DataSegmentLocation           equ        LockLocation + 2Ch
 | |
| EnableExecuteDisableLocation  equ        LockLocation + 30h
 | |
| Cr3Location                   equ        LockLocation + 34h
 | |
| InitFlagLocation              equ        LockLocation + 38h
 | |
| CpuInfoLocation               equ        LockLocation + 3Ch
 | |
| NumApsExecutingLocation       equ        LockLocation + 40h
 | |
| InitializeFloatingPointUnitsAddress equ  LockLocation + 48h
 | |
| ModeTransitionMemoryLocation        equ  LockLocation + 4Ch
 | |
| ModeTransitionSegmentLocation       equ  LockLocation + 50h
 | |
| ModeHighMemoryLocation              equ  LockLocation + 52h
 | |
| ModeHighSegmentLocation             equ  LockLocation + 56h
 | |
| 
 |