X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FLibrary%2FMpInitLib%2FIa32%2FMpFuncs.nasm;h=8bacb4283641370eab2be4d83a8e9894fe649cdf;hb=5c66d125eaae51945c0a14ef6d5d3fa2ce7d7a66;hp=0852a5bc848cfe00d4d108666620224d3d8e39c2;hpb=d94e5f672994f67ea7bd16aaf577bf4cde65cfc1;p=mirror_edk2.git diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm index 0852a5bc84..8bacb42836 100644 --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm @@ -71,8 +71,8 @@ o32 lidt [cs:si] xor ax, ax mov ds, ax - mov eax, cr0 ;Get control register 0 - or eax, 000000003h ;Set PE bit (bit #0) & MP + mov eax, cr0 ; Get control register 0 + or eax, 000000003h ; Set PE bit (bit #0) & MP mov cr0, eax jmp 0:strict dword 0 ; far jump to protected mode @@ -85,6 +85,36 @@ Flat32Start: ; protected mode entry point mov ss, dx mov esi, ebx + + mov edi, esi + add edi, EnableExecuteDisableLocation + cmp byte [edi], 0 + jz SkipEnableExecuteDisable + + ; + ; Enable IA32 PAE execute disable + ; + + mov ecx, 0xc0000080 + rdmsr + bts eax, 11 + wrmsr + + mov edi, esi + add edi, Cr3Location + mov eax, dword [edi] + mov cr3, eax + + mov eax, cr4 + bts eax, 5 + mov cr4, eax + + mov eax, cr0 + bts eax, 31 + mov cr0, eax + +SkipEnableExecuteDisable: + mov edi, esi add edi, LockLocation mov eax, NotVacantFlag @@ -95,7 +125,7 @@ TestLock: jz TestLock mov edi, esi - add edi, NumApsExecutingLoction + add edi, NumApsExecutingLocation inc dword [edi] mov ebx, [edi] @@ -133,9 +163,9 @@ CProcedureInvoke: add edi, ApProcedureLocation mov eax, [edi] - call eax ; invoke C function + call eax ; Invoke C function - jmp $ ; never reach here + jmp $ ; Never reach here RendezvousFunnelProcEnd: ;-------------------------------------------------------------------------------------