From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web09.21.1631794033876854520 for ; Thu, 16 Sep 2021 05:07:14 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ashraf.ali.s@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10108"; a="202703763" X-IronPort-AV: E=Sophos;i="5.85,298,1624345200"; d="scan'208";a="202703763" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 05:07:12 -0700 X-IronPort-AV: E=Sophos;i="5.85,298,1624345200"; d="scan'208";a="509282567" Received: from basfe004.gar.corp.intel.com ([10.66.129.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 05:07:09 -0700 From: "Ashraf Ali S" To: devel@edk2.groups.io Cc: Ashraf Ali S , Ray Ni , Rahul Kumar , Debkumar De , Harry Han , Catharine West , Sangeetha V , Rangasai V Chaganty , Sahil Dureja Subject: [PATCH v7] UefiCpuPkg: VTF0 Linear-Address Translation to a 1-GByte Page till 512GB Date: Thu, 16 Sep 2021 17:36:53 +0530 Message-Id: X-Mailer: git-send-email 2.30.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3473 X64 Reset Vector Code can access the memory range till 4GB using the Linear-Address Translation to a 2-MByte Page, when user wants to use more than 4G using 2M Page it will leads to use more number of Page table entries. using the 1-GByte Page table user can use more than 4G Memory by reducing the page table entries using 1-GByte Page, this patch attached can access memory range till 512GByte via Linear- Address Translation to a 1-GByte Page. Build Tool: if the nasm is not found it will throw Build errors like FileNotFoundError: [WinError 2]The system cannot find the file specified run the command wil try except block to get meaningful error message Test Result: Tested in both Simulation environment and Hardware both works fine without any issues. Cc: Ray Ni Cc: Rahul Kumar Cc: Debkumar De Cc: Harry Han Cc: Catharine West Cc: Sangeetha V Cc: Rangasai V Chaganty Cc: Sahil Dureja Signed-off-by: Ashraf Ali S --- .../Vtf0/Bin/IA32/ResetVector.ia32.port80.raw | Bin 0 -> 484 bytes .../Vtf0/Bin/IA32/ResetVector.ia32.raw | Bin 0 -> 468 bytes .../Vtf0/Bin/IA32/ResetVector.ia32.serial.raw | Bin 0 -> 868 bytes .../Vtf0/Bin/ResetVector.ia32.port80.raw | Bin 516 -> 0 bytes .../ResetVector/Vtf0/Bin/ResetVector.ia32.raw | Bin 484 -> 0 bytes .../Vtf0/Bin/ResetVector.ia32.serial.raw | Bin 884 -> 0 bytes .../ResetVector/Vtf0/Bin/ResetVector.inf | 4 +- .../ResetVector/Vtf0/Bin/ResetVector1G.inf | 31 ++++++ .../PageTable1G/ResetVector.x64.port80.raw | Bin 0 -> 12292 bytes .../Bin/X64/PageTable1G/ResetVector.x64.raw | Bin 0 -> 12292 bytes .../PageTable1G/ResetVector.x64.serial.raw | Bin 0 -> 12292 bytes .../PageTable2M}/ResetVector.x64.port80.raw | Bin 28676 -> 28676 bytes .../{ => X64/PageTable2M}/ResetVector.x64.raw | Bin 28676 -> 28676 bytes .../PageTable2M}/ResetVector.x64.serial.raw | Bin 28676 -> 28676 bytes UefiCpuPkg/ResetVector/Vtf0/Build.py | 101 ++++++++++++------ UefiCpuPkg/ResetVector/Vtf0/PageTables.inc | 20 ++++ UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt | 2 +- UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb | 8 +- .../ResetVector/Vtf0/X64/PageTables1G.asm | 53 +++++++++ .../X64/{PageTables.asm => PageTables2M.asm} | 14 +-- UefiCpuPkg/UefiCpuPkg.ci.yaml | 3 +- 21 files changed, 187 insertions(+), 49 deletions(-) create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw delete mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw delete mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw delete mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector1G.inf create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw rename UefiCpuPkg/ResetVector/Vtf0/Bin/{ => X64/PageTable2M}/ResetVector.x64.port80.raw (56%) rename UefiCpuPkg/ResetVector/Vtf0/Bin/{ => X64/PageTable2M}/ResetVector.x64.raw (56%) rename UefiCpuPkg/ResetVector/Vtf0/Bin/{ => X64/PageTable2M}/ResetVector.x64.serial.raw (56%) create mode 100644 UefiCpuPkg/ResetVector/Vtf0/PageTables.inc create mode 100644 UefiCpuPkg/ResetVector/Vtf0/X64/PageTables1G.asm rename UefiCpuPkg/ResetVector/Vtf0/X64/{PageTables.asm => PageTables2M.asm} (74%) diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw new file mode 100644 index 0000000000000000000000000000000000000000..79b23c047bdc6e552d77d5c9e9aeae21ff04d91d GIT binary patch literal 484 zcmYk2!Alfz6vy8yHl)}V zcG*_&Hg-ER3P7>NzOzHK{_>8}w92SftcjYiOP;uF74pB9jiIw>#6GG&9iTswB!MfR z>~G3@yT|(CI{hlqFjo^q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LZpVHg=sf!J_y7O@JCCC3MmNn6O*f`#F9Vqv z7z}TB-s^mk)*WlWc%#VeB{R^K4n=mY2TH71*@5gLW0fCW5#rwtE0nzG_7G`&2(+1j z^JK|w#)BnHMOPatgqTY?U(N!mY&}rQ*?HpSA)o@o1D(fOzm+_q@(;fW zM0l~75#+LxB322Y6D>~^XEszY3zR4TNud&(Zi&XnApZb;9>@yvd6AdOpO@EwLaZ!6 zURtAtZ&ax{|MmzQ#>0))0j|L4)MR$nc&P@I1gq#goYrU^7F8cjO8KZ@=5gH#e8KmvtVCcKiccAY<-;2HrFU^6@7H3!h z3Ku8KdG*i#|1Vel1t!i1 c|DR2GeH)mmfB +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ResetVector + MODULE_UNI_FILE = ResetVector.uni + FILE_GUID = 1BA0062E-C779-4582-8566-336AE8F78F09 + MODULE_TYPE = SEC + VERSION_STRING = 1.1 + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Binaries.Ia32] + RAW|IA32/ResetVector.ia32.raw|* + +[Binaries.X64] + RAW|X64/PageTable1G/ResetVector.x64.raw|* + +[UserExtensions.TianoCore."ExtraFiles"] + ResetVectorExtra.uni diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw new file mode 100644 index 0000000000000000000000000000000000000000..279ba03b0c01f552a0d3ed8900e06b91f2555901 GIT binary patch literal 12292 zcmeI&+i#oo0mkts4Go0>4qZpX=tz11%2=TdhrvQ2P!8c7PF+^UX)tetZH!=pH%^Zg z70DEZNZf$9;~&6W5#XW^3Pp^YRpNq96(~?GYU&$$gElnPylKDiKWus}#UDH0_!sB7 zvLnyT%*?Ex?{-yQ$_2^=$_2^=$_2^=$_2^=$_2^=$_2^=$_2^={;wA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/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw new file mode 100644 index 0000000000000000000000000000000000000000..9b09a80f225736a413b7146b0e7bd4aafc73abe1 GIT binary patch literal 12292 zcmeI&TaT0n0mkuXS=a)$%ob6$1>NOPOO>TS?QuaD5Zs;w6>+83+N$HB2ko-cj*9Y3 zR!jz(brR!+@k4mYS}u5+EluG@5-&uFW|e4I-W$1T)ELHh;oqd6p?N3S`Mop$*>`rH ztC`JoI-Smjxo%h0rCOj`pjx0>pjx0>pjx0>pjx0>pjx0>pjx0>;C;QoWnNwB=)z&C zF{qyMV41YhJxM{2DO=v z#-N7jXbfr#9gRWVOGjf+Tj^*FY8xGmL2aj_F{u0KXbkF;bTkHaKOK!hJwQieP!H14 z7}P^_GzRrB9gRUfLPujzBXl$dwS$hvpmx&H7}TfeXbkGpbTkGvN=IW*yXa^PYBwE? zLG7WVF{sbb(HPWTIvRu8M@M5&pQWQQs4+SkgL;&X#-JXfqcNz*>1Yh<2|5~sdXkRD zpgu=OV^I6)XbkEA9gRVKo{q+#zCcG~P+z2@F{p!dGzRr0IvRsIL`P##U#6omsBt

)@^#UD@LA^*vV^A;A z(HPYC>1Yh<2Xr(B^)eleK~2!n7}OCu8iSgoqcNxk9gRV~LPujzuhP*NRFjUzpngb4 zV^BY$qcNx-)6p2zQ92rf`UxG4LH(4D#-NVT(U=9dmG2_^b>l5YcjCTQv%mR|*IsKB zt>&toC)Vz7{Jqs2`1SqmXB&TNHP;@W9sWb(!c=pk8t2=yz2ifT*<#tunex&;TU>9S zoj=x7p72upuk9=KlTUB$xi~RW^o~wEa6FUSr*g~0@Wy|i7+?L)?9k-ZlVht|f9sZC zJy>>b@-IDaOfH)Eqnj&x8-2y<<7xD@-!9H?OZ%Ep7O~?r_wtyvhjb#rKv2gw;p=(aAUZ3YJ5k}Y-{AeUa2wI zyJu4|SjP5jy)|;^aAQU9o~2XSR6F%l-#r(LB{St7nm<~et{AQj&DCDNvZS_t?st|_ z+g{#UTH9J1N_j9?Tc4|=*Sg&S&Ht+Wof%!|c5CY|7U%wZTK}59bo%Glw$y7qtLrlx z%72@b53XN*seE+5W=8v@@|^XVrJBAto$0yhE7KQ>y?3iq_VVi(orOPP;d0|!8NdAf zO@H&QzvcEXbY}N~V)>a}2Z|;2_M63`;y=aD=C@w&cIS^ST)sq|&vpO#p7Y;)mg>4%pjx0>pjx0>pjx0>pjx0>pjx0>pjzPlvcUYGuPuD6yz#m6 S(7}D`bmnJo-gD#b&i?@{82-Ef literal 0 HcmV?d00001 diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw new file mode 100644 index 0000000000000000000000000000000000000000..d9b051ff06d1d30b0dfd585e05e75c98ebd88b03 GIT binary patch literal 12292 zcmeI&No9KGfv*W2je6GiJ*aVq!UOdkWL_-KsteR0_g={ zW|6X+Od)I>T48a0WIfkrjcG0>>VbPP0V3LOKDI*5*e zMjcGYK%=J8G0><(=on~JmX3i&wa_ups6*)(Xw)=11{!r39RrP;PRBr_4yR+FQAf}* z(5M-73^b~hj)6uUNyk8=j-q3rQ8VcnXw)n^1{!rV9RrOzhK_+o&8B0ZQEhY#G-?hV z1C5$X$3Uaz(J|1d`E(34>R37k8g(2U1C2VKj)6ukpkts>C(tp_s1xZJXw*q`3^eLw zItCiGkdA>yokGVzqfVt`pi%8~3^b~Pj)6ukqGO;@i|H6>)M<1KG-?SQ1C3fr$3UY_ zr(>W|XV5XwsAY5vH0n$`1{$@Tj)6vfXw><13^eKjItChbAsqvax`>W}Ms?9K(5Q>)7--ZbbPP1=QaT12br~H4 zjk=tUfks_H$3UZ2(J|1d)pQIr>Pk8W8g&&N1C6?xj)6v9L&rd)uBBt3QETWJXw-Fd z3^b~nj)6v9Psc!`*3v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qKW7 z9~{39j&tBR2aa>#I0ue%;5Y}4bKp1!{-4c(!><51uHz0Ici^}K#~nECz;OqTJ8;~A z;|?5m;J5?F9r!=60}np@I*H379(DNE#Ko&0e*WBL=l=Ye&pdm}`E&Pp)YI?v__HrN zf9~?HecKBka`yMnpS#z!H$L#U&c68kx%(atjdy`d5y!P8=iMq7hZ7k z?-ws#Jn-yGA|Cvb3x9m!<}=TD+Ji2+>FURxTzWVvuYQMX`XTe|h>- z?)l0auej#sXIyoU^DjM=ao1nG<|UW>+%Y@z3YV+o&5aa zfCu-57he0yvv;`WRVR-=oZ|3eSD(84aLB`7^eG=*=PteMnkx>scf011&$#^jpWga< zhciF%)U9W}`f>ODkCWd$Jay`hhev15KkPl9diJ5GpYxPQUUK94M?B#%hkwokE`9X< zPwsd4!`qIyaO0Wtk9hJ^&))sgN8jbt{SVKce$EHn=>a#LoI2dS;qVbBXAUoRL(IjC zr?0%}^c8dZr*1xV`pWsqis;jCeRy=2(+@g*MIY|m`}CFl@&_J{zC2EzbtwPsx$$?` zz2vzcckwOHoWA6qXKr}o!@e92IrH)-9*(&zZpb?w&UWRTx#2Ex-A&i^b#vX#*S+}U zafkBWQHMkR_nYeQ^lj_5pTa-u*W)(7{=fafc-}id;g(l_-a9?vmOGuf@chFk;pCq$ zo_yBDlT)v{c=6<^x86ML@RC>EaJaec+jCdl=Y?0@=LJ{Y=lNG%n2UdLIMppT-hRGY SPx9m^JvI){eBb~48~hhX6Rzk0 diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw similarity index 56% rename from UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw rename to UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw index 61c71349a8a599916f3eeae8c5dee92efb56db71..f1d6536cec924d0e167cf1ee4e9309ed5fd7ad60 100644 GIT bin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aPy8A9X z?`5BK_&A?=>P62u`G~_`KD5Wh`_5c=-pgNk?n6$!=yBIS3biz{`4*LZ57d{pMBVR-05eXzPS$%o_hM0e#iO4 z-Zx!yl|1K~Y5VAFw*NPu>jxZ8+LiY1s~6g>m;cwT=R9KT36I!%{N}eRnR`C$a6KFj?aVu#beNVKweB}jn}{MWep$^j z58iO*;u}u#y@!kUM7JAA3bjNX3F;bkBC7rNV@_NLpP_QuoK+# diff --git a/UefiCpuPkg/ResetVector/Vtf0/Build.py b/UefiCpuPkg/ResetVector/Vtf0/Build.py index b791d32762..3f1d5cd2c8 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Build.py +++ b/UefiCpuPkg/ResetVector/Vtf0/Build.py @@ -6,45 +6,84 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent # -import glob import os import subprocess import sys +PAGE_TABLE_2M = 'PageTable2M' +PAGE_TABLE_1G = 'PageTable1G' +FILE_FORMAT = '.raw' +ALL_RAW_FORMAT = '*' + FILE_FORMAT +IA32 = 'IA32' +X64 = 'X64' + +# Pre-Define a Macros for Page Table +PAGE_TABLES = { + PAGE_TABLE_2M : "PAGE_TABLE_2M", + PAGE_TABLE_1G : "PAGE_TABLE_1G" +} + def RunCommand(commandLine): - #print ' '.join(commandLine) return subprocess.call(commandLine) -for filename in glob.glob(os.path.join('Bin', '*.raw')): - os.remove(filename) +# Check for all raw binaries and delete them +for root, dirs, files in os.walk('Bin'): + for file in files: + if file.endswith(FILE_FORMAT): + os.remove(os.path.join(root, file)) for arch in ('ia32', 'x64'): for debugType in (None, 'port80', 'serial'): - output = os.path.join('Bin', 'ResetVector') - output += '.' + arch - if debugType is not None: - output += '.' + debugType - output += '.raw' - commandLine = ( - 'nasm', - '-D', 'ARCH_%s' % arch.upper(), - '-D', 'DEBUG_%s' % str(debugType).upper(), - '-o', output, - 'Vtf0.nasmb', - ) - print(f"Command : {' '.join(commandLine)}") - ret = RunCommand(commandLine) - if ret != 0: - print(f"something went wrong while executing {commandLine[-1]}") - sys.exit() - print('\tASM\t' + output) - - commandLine = ( - 'python', - 'Tools/FixupForRawSection.py', - output, - ) - print('\tFIXUP\t' + output) - ret = RunCommand(commandLine) - if ret != 0: sys.exit(ret) + for pageTable in PAGE_TABLES.keys(): + ret = True + if arch.lower() == X64.lower(): + directory = os.path.join('Bin', X64, pageTable) + else: + directory = os.path.join('Bin', IA32) + + # output raw binary name with arch type + fileName = 'ResetVector' + '.' + arch + + if debugType is not None: + fileName += '.' + debugType + fileName += FILE_FORMAT + + output = os.path.join(directory, fileName) + + # if the directory not exists then create it + if not os.path.isdir(directory): + os.makedirs(directory) + + # Prepare the command to execute the nasmb + commandLine = ( + 'nasm', + '-D', 'ARCH_%s' % arch.upper(), + '-D', 'DEBUG_%s' % str(debugType).upper(), + '-D', PAGE_TABLES[pageTable].upper(), + '-o', output, + 'Vtf0.nasmb', + ) + + print(f"Command : {' '.join(commandLine)}") + + try: + ret = RunCommand(commandLine) + except FileNotFoundError: + print("NASM not found") + except: + pass + + if ret != 0: + print(f"something went wrong while executing {commandLine[-1]}") + sys.exit() + print('\tASM\t' + output) + + commandLine = ( + 'python', + 'Tools/FixupForRawSection.py', + output, + ) + print('\tFIXUP\t' + output) + ret = RunCommand(commandLine) + if ret != 0: sys.exit(ret) diff --git a/UefiCpuPkg/ResetVector/Vtf0/PageTables.inc b/UefiCpuPkg/ResetVector/Vtf0/PageTables.inc new file mode 100644 index 0000000000..31958ae878 --- /dev/null +++ b/UefiCpuPkg/ResetVector/Vtf0/PageTables.inc @@ -0,0 +1,20 @@ +;------------------------------------------------------------------------------ +; @file +; Definitions of Page Table Entry for the reset vector module +; +; Copyright (c) 2021, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; +;------------------------------------------------------------------------------ + +%define PAGE_PRESENT 0x01 +%define PAGE_READ_WRITE 0x02 +%define PAGE_USER_SUPERVISOR 0x04 +%define PAGE_WRITE_THROUGH 0x08 +%define PAGE_CACHE_DISABLE 0x010 +%define PAGE_ACCESSED 0x020 +%define PAGE_DIRTY 0x040 +%define PAGE_SIZE 0x080 +%define PAGE_GLOBAL 0x0100 +%define PAGE_2M_PAT 0x01000 + diff --git a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt index e6e5b54243..97f4600968 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt +++ b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt @@ -29,7 +29,7 @@ EBP/RBP - Pointer to the start of the Boot Firmware Volume === HOW TO BUILD VTF0 === Dependencies: -* Python 2.5~2.7 +* Python 3 or newer * Nasm 2.03 or newer To rebuild the VTF0 binaries: diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb index 493738c79c..bdea1fb875 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb +++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb @@ -35,8 +35,14 @@ %include "PostCodes.inc" +%include "PageTables.inc" + %ifdef ARCH_X64 -%include "X64/PageTables.asm" + %ifdef PAGE_TABLE_1G + %include "X64/PageTables1G.asm" + %else + %include "X64/PageTables2M.asm" + %endif %endif %ifdef DEBUG_PORT80 diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables1G.asm b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables1G.asm new file mode 100644 index 0000000000..19bd3d5a92 --- /dev/null +++ b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables1G.asm @@ -0,0 +1,53 @@ +;------------------------------------------------------------------------------ +; @file +; Emits Page Tables for 1:1 mapping of the addresses 0 - 0x8000000000 (512GB) +; +; Copyright (c) 2021, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; Linear-Address Translation to a 1-GByte Page +; +;------------------------------------------------------------------------------ + +BITS 64 + +%define ALIGN_TOP_TO_4K_FOR_PAGING + +%define PAGE_PDP_ATTR (PAGE_ACCESSED + \ + PAGE_READ_WRITE + \ + PAGE_PRESENT) + +%define PAGE_PDP_1G_ATTR (PAGE_ACCESSED + \ + PAGE_READ_WRITE + \ + PAGE_DIRTY + \ + PAGE_PRESENT + \ + PAGE_SIZE) + +%define PGTBLS_OFFSET(x) ((x) - TopLevelPageDirectory) +%define PGTBLS_ADDR(x) (ADDR_OF(TopLevelPageDirectory) + (x)) + +%define PDP(offset) (ADDR_OF(TopLevelPageDirectory) + (offset) + \ + PAGE_PDP_ATTR) + +%define PDP_1G(x) ((x << 30) + PAGE_PDP_1G_ATTR) + +ALIGN 16 + +TopLevelPageDirectory: + + ; + ; Top level Page Directory Pointers (1 * 512GB entry) + ; + DQ PDP(0x1000) + + TIMES 0x1000-PGTBLS_OFFSET($) DB 0 + ; + ; Next level Page Directory Pointers (512 * 1GB entries => 512GB) + ; +%assign i 0 +%rep 512 + DQ PDP_1G(i) + %assign i i+1 +%endrep + TIMES 0x2000-PGTBLS_OFFSET($) DB 0 + +EndOfPageTables: diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables2M.asm similarity index 74% rename from UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm rename to UefiCpuPkg/ResetVector/Vtf0/X64/PageTables2M.asm index 5bc3093f90..b97df384ac 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm +++ b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables2M.asm @@ -11,19 +11,7 @@ BITS 64 %define ALIGN_TOP_TO_4K_FOR_PAGING -%define PAGE_PRESENT 0x01 -%define PAGE_READ_WRITE 0x02 -%define PAGE_USER_SUPERVISOR 0x04 -%define PAGE_WRITE_THROUGH 0x08 -%define PAGE_CACHE_DISABLE 0x010 -%define PAGE_ACCESSED 0x020 -%define PAGE_DIRTY 0x040 -%define PAGE_PAT 0x080 -%define PAGE_GLOBAL 0x0100 -%define PAGE_2M_MBO 0x080 -%define PAGE_2M_PAT 0x01000 - -%define PAGE_2M_PDE_ATTR (PAGE_2M_MBO + \ +%define PAGE_2M_PDE_ATTR (PAGE_SIZE + \ PAGE_ACCESSED + \ PAGE_DIRTY + \ PAGE_READ_WRITE + \ diff --git a/UefiCpuPkg/UefiCpuPkg.ci.yaml b/UefiCpuPkg/UefiCpuPkg.ci.yaml index e32facd76e..6e0ab95fd8 100644 --- a/UefiCpuPkg/UefiCpuPkg.ci.yaml +++ b/UefiCpuPkg/UefiCpuPkg.ci.yaml @@ -48,7 +48,8 @@ "DscPath": "UefiCpuPkg.dsc", "IgnoreInf": [ "UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf", - "UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf" + "UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf", + "UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector1G.inf" ] }, "HostUnitTestDscCompleteCheck": { -- 2.30.2.windows.1