Re: [edk2-devel] [PATCH] UefiPayloadPkg: Backward support with python 3.6
Reviewed-by: Guo Dong -Original Message- From: Liu, KasimX Sent: Thursday, June 23, 2022 8:44 PM To: devel@edk2.groups.io Cc: Liu, KasimX ; Dong, Guo ; Ni, Ray ; Lu, James ; Guo, Gua Subject: [PATCH] UefiPayloadPkg: Backward support with python 3.6 From: KasimX Liu REF: ttps://bugzilla.tianocore.org/show_bug.cgi?id=3960 Currently, UniversalPayloadBuild.py don't have support python3.6, we use python3.6 will encounter f"" failure use the change to fix it to support python3.6/3.7/3.8. Cc: Guo Dong Cc: Ray Ni Cc: James Lu Reviewed-by: Gua Guo Signed-off-by: KasimX Liu --- UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++-- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py index c71526e0a6..ab4c977ba5 100644 --- a/UefiPayloadPkg/UniversalPayloadBuild.py +++ b/UefiPayloadPkg/UniversalPayloadBuild.py @@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList): if Args.Arch == 'X64': BuildArch = "X64" ObjCopyFlag = "elf64-x86-64"-EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))+ EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) else: BuildArch = "IA32 -a X64" ObjCopyFlag= "elf32-i386"-EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))+ EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) EntryModuleInf = os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf") DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")- FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv"))+FvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv")) PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt") ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt") UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")@@ -94,14 +94,14 @@ def BuildUniversalPayload(Args, MacroList): # # Building DXE core and DXE drivers as DXEFV. #-BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath} {Quiet}"+BuildPayload = "build -p {} -b {} -a X64 -t {} -y {} {}".format (DscPath, BuildTarget, ToolChain, PayloadReportPath, Quiet) BuildPayload += Pcds BuildPayload += Defines RunCommand(BuildPayload) # # Building Universal Payload entry. #-BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath} {Quiet}"+BuildModule = "build -p {} -b {} -a {} -m {} -t {} -y {} {}".format (DscPath, BuildTarget, BuildArch, EntryModuleInf, ElfToolChain, ModuleReportPath, Quiet) BuildModule += Pcds BuildModule += Defines RunCommand(BuildModule)@@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): # # Copy the DXEFV as a section in elf format Universal Payload entry. #-remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --remove-section .upld_info --remove-section .upld.uefi_fv {EntryOutputDir}'-add_section= f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --add-section .upld_info={UpldInfoFile} --add-section .upld.uefi_fv={FvOutputDir} {EntryOutputDir}'-set_section= f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 {EntryOutputDir}'+ remove_section = '"{}" -I {} -O {} --remove-section .upld_info --remove-section .upld.uefi_fv {}'.format (+ LlvmObjcopyPath,+ ObjCopyFlag,+ ObjCopyFlag,+ EntryOutputDir+ )+ add_section= '"{}" -I {} -O {} --add-section .upld_info={} --add-section .upld.uefi_fv={} {}'.format (+ LlvmObjcopyPath,+ ObjCopyFlag,+ ObjCopyFlag,+ UpldInfoFile,+ FvOutputDir,+ EntryOutputDir+ )+set_section= '"{}" -I {} -O {} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 {}'.format (+
Re: [edk2-devel] [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro
Hi Sean, How about directly setting the PCD in the build command line instead of adding a MACRO? Prefer not adding new MACRO if we could avoid it. Thanks, Guo -Original Message- From: Sean Rhodes Sent: Friday, August 5, 2022 12:53 AM To: devel@edk2.groups.io Cc: Rhodes, Sean ; Dong, Guo ; Ni, Ray Subject: [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro Hook up MICROSOFT_RECOMMENDED macro to PcdFollowMicrosoftRecommended. Cc: Guo Dong Cc: Ray Ni Signed-off-by: Sean Rhodes --- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc index 91cd78dbf1..b3ed0f6a2e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -43,6 +43,7 @@ DEFINE SD_MMC_TIMEOUT = 100 DEFINE USE_CBMEM_FOR_CONSOLE= FALSE DEFINE BOOTSPLASH_IMAGE = FALSE + DEFINE MICROSOFT_RECOMMENDED= FALSE # # NULL:NullMemoryTestDxe @@ -440,6 +441,7 @@ gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY) gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE) + gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|$(MICROSOFT_RECOMMENDED) gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|180 -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92233): https://edk2.groups.io/g/devel/message/92233 Mute This Topic: https://groups.io/mt/92830996/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 00/10] UefiCpuPkg: Create CpuPageTableLib for manipulating X86 paging structs
Reviewed-by: Eric Dong -Original Message- From: devel@edk2.groups.io On Behalf Of Ni, Ray Sent: Monday, July 18, 2022 9:18 PM To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH 00/10] UefiCpuPkg: Create CpuPageTableLib for manipulating X86 paging structs Ray Ni (10): UefiCpuPkg: Create CpuPageTableLib for manipulating X86 paging structs UefiCpuPkg/CpuPageTableLib: Return error on invalid parameters CpuPageTableLib: Fix a bug when a bit is 1 in Attribute, 0 in Mask CpuPageTableLib: Refactor the logic CpuPageTableLib: Split the page entry when LA is aligned but PA is not CpuPageTableLib: Avoid treating non-leaf entry as leaf one CpuPageTableLib: Fix parent attributes are not inherited properly CpuPageTableLib: Fix a bug to avoid unnecessary changing to page table CpuPageTableLib: Fix bug that wrongly requires extra size for mapping CpuPageTableLib: define IA32_PAGE_LEVEL enum type internally UefiCpuPkg/Include/Library/CpuPageTableLib.h | 129 .../Library/CpuPageTableLib/CpuPageTable.h| 230 ++ .../CpuPageTableLib/CpuPageTableLib.inf | 35 + .../Library/CpuPageTableLib/CpuPageTableMap.c | 690 ++ .../CpuPageTableLib/CpuPageTableParse.c | 330 + UefiCpuPkg/UefiCpuPkg.dec | 3 + UefiCpuPkg/UefiCpuPkg.dsc | 4 +- 7 files changed, 1420 insertions(+), 1 deletion(-) create mode 100644 UefiCpuPkg/Include/Library/CpuPageTableLib.h create mode 100644 UefiCpuPkg/Library/CpuPageTableLib/CpuPageTable.h create mode 100644 UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf create mode 100644 UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c create mode 100644 UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableParse.c -- 2.35.1.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92232): https://edk2.groups.io/g/devel/message/92232 Mute This Topic: https://groups.io/mt/92458156/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 0/3] Simplify InitializeSeparateExceptionStacks
Reviewed-by: Ray Ni > -Original Message- > From: devel@edk2.groups.io On Behalf Of > Zhiguang Liu > Sent: Tuesday, August 9, 2022 9:26 AM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Dong, Eric > ; Ni, Ray ; Kumar, Rahul R > ; Leif Lindholm ; Bi, > Dandan ; Gao, Liming ; > Wang, Jian J ; Ard Biesheuvel > ; Sami Mujawar > Subject: [edk2-devel] [PATCH v3 0/3] Simplify > InitializeSeparateExceptionStacks > > The patch set is to hide the exception implementation details, > so that caller don't need to know anything about IDT when separate stack > for it. However, this patch set changes a library API, so I have to > change multiple packages inside one patch. Otherwise, I can make sure > every single commit can build and boot fine. If anyone has good idea to > separate the first big patch, please tell me. Thanks in advance. > > V2: > Add another patch to Simplify the CPU_EXCEPTION_INIT_DATA definition > Keep the memory layout picture in CpuExceptionHandlerLib. > Fix some code and comment issue according to Ray's comment > > V3: > Change the code behavior when the needed size is zero: skip instead of > assert > Fix the bug that treating the TSS as part of GDT > Reorder the modification in the patch set. > Code can be seen at https://github.com/tianocore/edk2/pull/3124 > > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Leif Lindholm > Cc: Dandan Bi > Cc: Liming Gao > Cc: Jian J Wang > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Signed-off-by: Zhiguang Liu > > Zhiguang Liu (3): > UefiCpuPkg: Simplify InitializeSeparateExceptionStacks > MdeModulePkg: Move CPU_EXCEPTION_INIT_DATA to UefiCpuPkg > UefiCpuPkg: Simplify the struct definition of CPU_EXCEPTION_INIT_DATA > > .../Library/ArmExceptionLib/ArmExceptionLib.c | 15 +- > MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 4 +- > .../Include/Library/CpuExceptionHandlerLib.h | 82 +--- > .../CpuExceptionHandlerLibNull.c | 15 +- > UefiCpuPkg/CpuDxe/CpuMp.c | 162 > UefiCpuPkg/CpuMpPei/CpuMpPei.c| 176 -- > .../CpuExceptionCommon.h | 57 +- > .../CpuExceptionHandlerLib/DxeException.c | 112 --- > .../Ia32/ArchExceptionHandler.c | 71 --- > .../CpuExceptionHandlerLib/PeiCpuException.c | 94 +- > .../PeiCpuExceptionHandlerLib.inf | 4 +- > .../SecPeiCpuException.c | 15 +- > .../CpuExceptionHandlerLib/SmmException.c | 15 +- > .../X64/ArchExceptionHandler.c| 67 --- > 14 files changed, 411 insertions(+), 478 deletions(-) > > -- > 2.31.1.windows.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92231): https://edk2.groups.io/g/devel/message/92231 Mute This Topic: https://groups.io/mt/92907048/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - 08/09/2022 #cal-reminder
*Reminder: TianoCore Bug Triage - APAC / NAMO* *When:* 08/09/2022 6:30pm to 7:30pm (UTC-07:00) America/Los Angeles *Where:* https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d *Organizer:* Liming Gao gaolim...@byosoft.com.cn ( gaolim...@byosoft.com.cn?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO ) View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1268262 ) *Description:* TianoCore Bug Triage - APAC / NAMO Hosted by Liming Gao Microsoft Teams meeting *Join on your computer or mobile app* Click here to join the meeting ( https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d ) *Join with a video conferencing device* te...@conf.intel.com Video Conference ID: 116 062 094 0 Alternate VTC dialing instructions ( https://conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=test_call ) *Or call in (audio only)* +1 916-245-6934,,77463821# ( tel:+19162456934,,77463821# ) United States, Sacramento Phone Conference ID: 774 638 21# Find a local number ( https://dialin.teams.microsoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821 ) | Reset PIN ( https://mysettings.lync.com/pstnconferencing ) Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( https://teams.microsoft.com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US ) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92230): https://edk2.groups.io/g/devel/message/92230 Mute This Topic: https://groups.io/mt/92907089/21656 Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 3/3] UefiCpuPkg: Simplify the struct definition of CPU_EXCEPTION_INIT_DATA
CPU_EXCEPTION_INIT_DATA is now an internal implementation of CpuExceptionHandlerLib. Union can be removed since Ia32 and X64 have the same definition. Also, two fields (Revision and InitDefaultHandlers)are useless, can be removed. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: Zhiguang Liu --- .../CpuExceptionCommon.h | 118 -- .../CpuExceptionHandlerLib/DxeException.c | 25 ++-- .../Ia32/ArchExceptionHandler.c | 71 ++- .../CpuExceptionHandlerLib/PeiCpuException.c | 25 ++-- .../X64/ArchExceptionHandler.c| 67 +- 5 files changed, 145 insertions(+), 161 deletions(-) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h index 443eaf359b..11a5624f51 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h @@ -49,71 +49,59 @@ #define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE) -#define CPU_EXCEPTION_INIT_DATA_REV 1 - -typedef union { - struct { -// -// Revision number of this structure. -// -UINT32 Revision; -// -// The address of top of known good stack reserved for *ALL* exceptions -// listed in field StackSwitchExceptions. -// -UINTN KnownGoodStackTop; -// -// The size of known good stack for *ONE* exception only. -// -UINTN KnownGoodStackSize; -// -// Buffer of exception vector list for stack switch. -// -UINT8 *StackSwitchExceptions; -// -// Number of exception vectors in StackSwitchExceptions. -// -UINTN StackSwitchExceptionNumber; -// -// Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR. -// Normally there's no need to change IDT table size. -// -VOID *IdtTable; -// -// Size of buffer for IdtTable. -// -UINTN IdtTableSize; -// -// Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR. -// -VOID *GdtTable; -// -// Size of buffer for GdtTable. -// -UINTN GdtTableSize; -// -// Pointer to start address of descriptor of exception task gate in the -// GDT table. It must be type of IA32_TSS_DESCRIPTOR. -// -VOID *ExceptionTssDesc; -// -// Size of buffer for ExceptionTssDesc. -// -UINTN ExceptionTssDescSize; -// -// Buffer of task-state segment for exceptions. It must be type of -// IA32_TASK_STATE_SEGMENT. -// -VOID *ExceptionTss; -// -// Size of buffer for ExceptionTss. -// -UINTN ExceptionTssSize; -// -// Flag to indicate if default handlers should be initialized or not. -// -BOOLEANInitDefaultHandlers; - } Ia32, X64; +typedef struct { + // + // The address of top of known good stack reserved for *ALL* exceptions + // listed in field StackSwitchExceptions. + // + UINTNKnownGoodStackTop; + // + // The size of known good stack for *ONE* exception only. + // + UINTNKnownGoodStackSize; + // + // Buffer of exception vector list for stack switch. + // + UINT8*StackSwitchExceptions; + // + // Number of exception vectors in StackSwitchExceptions. + // + UINTNStackSwitchExceptionNumber; + // + // Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR. + // Normally there's no need to change IDT table size. + // + VOID *IdtTable; + // + // Size of buffer for IdtTable. + // + UINTNIdtTableSize; + // + // Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR. + // + VOID *GdtTable; + // + // Size of buffer for GdtTable. + // + UINTNGdtTableSize; + // + // Pointer to start address of descriptor of exception task gate in the + // GDT table. It must be type of IA32_TSS_DESCRIPTOR. + // + VOID *ExceptionTssDesc; + // + // Size of buffer for ExceptionTssDesc. + // + UINTNExceptionTssDescSize; + // + // Buffer of task-state segment for exceptions. It must be type of + // IA32_TASK_STATE_SEGMENT. + // + VOID *ExceptionTss; + // + // Size of buffer for ExceptionTss. + // + UINTNExceptionTssSize; } CPU_EXCEPTION_INIT_DATA; // diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index 04e8409922..d90c607bd7 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -190,19 +190,18 @@ InitializeSeparateExceptionStacks ( } AsmReadIdtr (); - EssData.X64.Revision = CPU_EXCEPTION_INIT_DATA_REV; - EssData.X64.KnownGoodStackTop = StackTop; - EssData.X64.KnownGoodStackSize = CPU_KNOWN_GOOD_STACK_SIZE; - EssData.X64.StackSwitchExceptions = CPU_STACK_SWITCH_EXCEPTION_LIST; -
[edk2-devel] [PATCH v3 2/3] MdeModulePkg: Move CPU_EXCEPTION_INIT_DATA to UefiCpuPkg
Since the API InitializeSeparateExceptionStacks is simplified and does't use the struct CPU_EXCEPTION_INIT_DATA, CPU_EXCEPTION_INIT_DATA become a inner implementation of CpuExcetionHandlerLib. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Leif Lindholm Cc: Dandan Bi Cc: Liming Gao Cc: Jian J Wang Signed-off-by: Zhiguang Liu --- .../Include/Library/CpuExceptionHandlerLib.h | 67 -- .../CpuExceptionCommon.h | 69 ++- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h index 8d44ed916a..94e9b20ae1 100644 --- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h +++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h @@ -13,73 +13,6 @@ #include #include -#define CPU_EXCEPTION_INIT_DATA_REV 1 - -typedef union { - struct { -// -// Revision number of this structure. -// -UINT32 Revision; -// -// The address of top of known good stack reserved for *ALL* exceptions -// listed in field StackSwitchExceptions. -// -UINTN KnownGoodStackTop; -// -// The size of known good stack for *ONE* exception only. -// -UINTN KnownGoodStackSize; -// -// Buffer of exception vector list for stack switch. -// -UINT8 *StackSwitchExceptions; -// -// Number of exception vectors in StackSwitchExceptions. -// -UINTN StackSwitchExceptionNumber; -// -// Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR. -// Normally there's no need to change IDT table size. -// -VOID *IdtTable; -// -// Size of buffer for IdtTable. -// -UINTN IdtTableSize; -// -// Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR. -// -VOID *GdtTable; -// -// Size of buffer for GdtTable. -// -UINTN GdtTableSize; -// -// Pointer to start address of descriptor of exception task gate in the -// GDT table. It must be type of IA32_TSS_DESCRIPTOR. -// -VOID *ExceptionTssDesc; -// -// Size of buffer for ExceptionTssDesc. -// -UINTN ExceptionTssDescSize; -// -// Buffer of task-state segment for exceptions. It must be type of -// IA32_TASK_STATE_SEGMENT. -// -VOID *ExceptionTss; -// -// Size of buffer for ExceptionTss. -// -UINTN ExceptionTssSize; -// -// Flag to indicate if default handlers should be initialized or not. -// -BOOLEANInitDefaultHandlers; - } Ia32, X64; -} CPU_EXCEPTION_INIT_DATA; - /** Initializes all CPU exceptions entries and provides the default exception handlers. diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h index fd42c4be0f..443eaf359b 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h @@ -1,7 +1,7 @@ /** @file Common header file for CPU Exception Handler Library. - Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved. + Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -49,6 +49,73 @@ #define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE) +#define CPU_EXCEPTION_INIT_DATA_REV 1 + +typedef union { + struct { +// +// Revision number of this structure. +// +UINT32 Revision; +// +// The address of top of known good stack reserved for *ALL* exceptions +// listed in field StackSwitchExceptions. +// +UINTN KnownGoodStackTop; +// +// The size of known good stack for *ONE* exception only. +// +UINTN KnownGoodStackSize; +// +// Buffer of exception vector list for stack switch. +// +UINT8 *StackSwitchExceptions; +// +// Number of exception vectors in StackSwitchExceptions. +// +UINTN StackSwitchExceptionNumber; +// +// Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR. +// Normally there's no need to change IDT table size. +// +VOID *IdtTable; +// +// Size of buffer for IdtTable. +// +UINTN IdtTableSize; +// +// Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR. +// +VOID *GdtTable; +// +// Size of buffer for GdtTable. +// +UINTN GdtTableSize; +// +// Pointer to start address of descriptor of exception task gate in the +// GDT table. It must be type of IA32_TSS_DESCRIPTOR. +// +VOID *ExceptionTssDesc; +// +// Size of buffer for ExceptionTssDesc. +// +UINTN ExceptionTssDescSize; +// +// Buffer of task-state segment for exceptions. It must be type of +
[edk2-devel] [PATCH v3 1/3] UefiCpuPkg: Simplify InitializeSeparateExceptionStacks
Hide the Exception implementation details in CpuExcetionHandlerLib and caller only need to provide buffer Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Leif Lindholm Cc: Dandan Bi Cc: Liming Gao Cc: Jian J Wang Cc: Ard Biesheuvel Reviewed-by: Sami Mujawar Signed-off-by: Zhiguang Liu --- .../Library/ArmExceptionLib/ArmExceptionLib.c | 15 +- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 4 +- .../Include/Library/CpuExceptionHandlerLib.h | 15 +- .../CpuExceptionHandlerLibNull.c | 15 +- UefiCpuPkg/CpuDxe/CpuMp.c | 162 UefiCpuPkg/CpuMpPei/CpuMpPei.c| 176 -- .../CpuExceptionHandlerLib/DxeException.c | 113 --- .../CpuExceptionHandlerLib/PeiCpuException.c | 95 +- .../PeiCpuExceptionHandlerLib.inf | 4 +- .../SecPeiCpuException.c | 15 +- .../CpuExceptionHandlerLib/SmmException.c | 15 +- 11 files changed, 289 insertions(+), 340 deletions(-) diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c index 2c7bc66aa7..a521c33f32 100644 --- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c +++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c @@ -288,20 +288,23 @@ CommonCExceptionHandler ( /** Setup separate stacks for certain exception handlers. + If the input Buffer and BufferSize are both NULL, use global variable if possible. - InitData is optional and processor arch dependent. - - @param[in] InitData Pointer to data optional for information about how -to assign stacks for certain exception handlers. + @param[in] BufferPoint to buffer used to separate exception stack. + @param[in, out] BufferSizeOn input, it indicates the byte size of Buffer. + If the size is not enough, the return status will + be EFI_BUFFER_TOO_SMALL, and output BufferSize + will be the size it needs. @retval EFI_SUCCESS The stacks are assigned successfully. @retval EFI_UNSUPPORTED This function is not supported. - + @retval EFI_BUFFER_TOO_SMALLThis BufferSize is too small. **/ EFI_STATUS EFIAPI InitializeSeparateExceptionStacks ( - IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL + IN VOID *Buffer, + IN OUT UINTN *BufferSize ) { return EFI_SUCCESS; diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 0a1f3d79e2..5733f0c8ec 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -1,7 +1,7 @@ /** @file DXE Core Main Entry Point -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -260,7 +260,7 @@ DxeMain ( // Setup Stack Guard // if (PcdGetBool (PcdCpuStackGuard)) { -Status = InitializeSeparateExceptionStacks (NULL); +Status = InitializeSeparateExceptionStacks (NULL, NULL); ASSERT_EFI_ERROR (Status); } diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h index 9a495081f7..8d44ed916a 100644 --- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h +++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h @@ -104,20 +104,23 @@ InitializeCpuExceptionHandlers ( /** Setup separate stacks for certain exception handlers. + If the input Buffer and BufferSize are both NULL, use global variable if possible. - InitData is optional and processor arch dependent. - - @param[in] InitData Pointer to data optional for information about how -to assign stacks for certain exception handlers. + @param[in] BufferPoint to buffer used to separate exception stack. + @param[in, out] BufferSizeOn input, it indicates the byte size of Buffer. + If the size is not enough, the return status will + be EFI_BUFFER_TOO_SMALL, and output BufferSize + will be the size it needs. @retval EFI_SUCCESS The stacks are assigned successfully. @retval EFI_UNSUPPORTED This function is not supported. - + @retval EFI_BUFFER_TOO_SMALLThis BufferSize is too small. **/ EFI_STATUS EFIAPI InitializeSeparateExceptionStacks ( - IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL + IN VOID *Buffer, + IN OUT UINTN *BufferSize ); /** diff --git a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c index 8aeedcb4d1..74908a379b 100644 --- a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
[edk2-devel] [PATCH v3 0/3] Simplify InitializeSeparateExceptionStacks
The patch set is to hide the exception implementation details, so that caller don't need to know anything about IDT when separate stack for it. However, this patch set changes a library API, so I have to change multiple packages inside one patch. Otherwise, I can make sure every single commit can build and boot fine. If anyone has good idea to separate the first big patch, please tell me. Thanks in advance. V2: Add another patch to Simplify the CPU_EXCEPTION_INIT_DATA definition Keep the memory layout picture in CpuExceptionHandlerLib. Fix some code and comment issue according to Ray's comment V3: Change the code behavior when the needed size is zero: skip instead of assert Fix the bug that treating the TSS as part of GDT Reorder the modification in the patch set. Code can be seen at https://github.com/tianocore/edk2/pull/3124 Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Leif Lindholm Cc: Dandan Bi Cc: Liming Gao Cc: Jian J Wang Cc: Ard Biesheuvel Cc: Sami Mujawar Signed-off-by: Zhiguang Liu Zhiguang Liu (3): UefiCpuPkg: Simplify InitializeSeparateExceptionStacks MdeModulePkg: Move CPU_EXCEPTION_INIT_DATA to UefiCpuPkg UefiCpuPkg: Simplify the struct definition of CPU_EXCEPTION_INIT_DATA .../Library/ArmExceptionLib/ArmExceptionLib.c | 15 +- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 4 +- .../Include/Library/CpuExceptionHandlerLib.h | 82 +--- .../CpuExceptionHandlerLibNull.c | 15 +- UefiCpuPkg/CpuDxe/CpuMp.c | 162 UefiCpuPkg/CpuMpPei/CpuMpPei.c| 176 -- .../CpuExceptionCommon.h | 57 +- .../CpuExceptionHandlerLib/DxeException.c | 112 --- .../Ia32/ArchExceptionHandler.c | 71 --- .../CpuExceptionHandlerLib/PeiCpuException.c | 94 +- .../PeiCpuExceptionHandlerLib.inf | 4 +- .../SecPeiCpuException.c | 15 +- .../CpuExceptionHandlerLib/SmmException.c | 15 +- .../X64/ArchExceptionHandler.c| 67 --- 14 files changed, 411 insertions(+), 478 deletions(-) -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92226): https://edk2.groups.io/g/devel/message/92226 Mute This Topic: https://groups.io/mt/92907048/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables
Hi Sami, Thank you for taking time testing this change! I have a question about one comment you have for this specific patch inline (marked with [KQ]). Could you please provide more details? I also responded to your other comments, please let me know if the proposed change makes sense to you. Looking forward to your reply. Thanks, Kun On 8/8/2022 8:39 AM, Sami Mujawar wrote: Hi Kun, Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 08/08/2022 02:05 pm, Sami Mujawar wrote: Hi Kun, Thank you for this patch. Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 This change added an extra step to allow check for installed ACPI tables. For FADT, MADT, GTDT, DSDT, DBG2 and SPCR tables, either pre-installed or supplied through AcpiTableInfo can be accepted. An extra check for FADT ACPI table existence during installation step is also added. Cc: Sami Mujawar Cc: Alexei Fedorov Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Pierre Gondois --- Notes: v2: - Function description updates [Sami] - Refactorized the table verification [Pierre] v3: - Added descriptions for new structures [Pierre] - Added check for SDT protocol PCD before using it [Pierre] DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 214 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 + 2 files changed, 138 insertions(+), 80 deletions(-) diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c index ed62299f9bbd..7f3deef08a66 100644 --- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c @@ -10,6 +10,7 @@ #include #include #include +#include #include // Module specific include files. @@ -22,6 +23,58 @@ #include #include +/// +/// Bit definitions for acceptable ACPI table presence formats. +/// Currently only ACPI tables present in the ACPI info list and +/// already installed will count towards "Table Present" during +/// verification routine. +/// +#define ACPI_TABLE_PRESENT_INFO_LIST BIT0 +#define ACPI_TABLE_PRESENT_INSTALLED BIT1 + +/// +/// Order of ACPI table being verified during presence inspection. +/// +#define ACPI_TABLE_VERIFY_FADT 0 +#define ACPI_TABLE_VERIFY_MADT 1 +#define ACPI_TABLE_VERIFY_GTDT 2 +#define ACPI_TABLE_VERIFY_DSDT 3 +#define ACPI_TABLE_VERIFY_DBG2 4 +#define ACPI_TABLE_VERIFY_SPCR 5 +#define ACPI_TABLE_VERIFY_COUNT 6 + +/// +/// Private data structure to verify the presence of mandatory +/// or optional ACPI tables. +/// +typedef struct { + /// ESTD ID for the ACPI table of interest. + ESTD_ACPI_TABLE_ID EstdTableId; + /// Standard UINT32 ACPI signature. + UINT32 AcpiTableSignature; + /// 4 character ACPI table name (the 5th char8 is for null terminator). + CHAR8 AcpiTableName[sizeof (UINT32) + 1]; + /// Indicator on whether the ACPI table is required. + BOOLEAN IsMandatory; + /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_* + /// This field should be initialized to 0 and will be populated during + /// verification routine. + UINT16 Presence; +} ACPI_TABLE_PRESENCE_INFO; + +/// +/// We require the FADT, MADT, GTDT and the DSDT tables to boot. +/// This list also include optional ACPI tables: DBG2, SPCR. +/// +ACPI_TABLE_PRESENCE_INFO mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] = { + { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, "FADT", TRUE, 0 }, + { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, "MADT", TRUE, 0 }, + { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, "GTDT", TRUE, 0 }, + { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, "DSDT", TRUE, 0 }, + { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, "DBG2", FALSE, 0 }, + { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, "SPCR", FALSE, 0 }, +}; + /** This macro expands to a function that retrieves the ACPI Table List from the Configuration Manager. */ @@ -395,6 +448,7 @@ BuildAndInstallAcpiTable ( @retval EFI_SUCCESS Success. @retval EFI_NOT_FOUND If mandatory table is not found. + @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo is already installed. **/ STATIC EFI_STATUS @@ -404,75 +458,71 @@ VerifyMandatoryTablesArePresent ( IN UINT32 AcpiTableCount ) { -
[edk2-devel] Now: Tools, CI, Code base construction meeting series - 08/08/2022 #cal-notice
*Tools, CI, Code base construction meeting series* *When:* 08/08/2022 4:30pm to 5:30pm (UTC-07:00) America/Los Angeles *Where:* https://github.com/tianocore/edk2/discussions/2614 View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1608785 ) *Description:* TianoCore community, Microsoft and Intel will be hosting a series of open meetings to discuss build, CI, tools, and other related topics. If you are interested, have ideas/opinions please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft Teams. MS Teams Link in following discussion: * https://github.com/tianocore/edk2/discussions/2614 Anyone is welcome to join. * tianocore/edk2: EDK II (github.com) * tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module (github.com) https://github.com/tianocore/edk2-basetools * tianocore/edk2-pytool-extensions: Extensions to the edk2 build system allowing for a more robust and plugin based build system and tool execution environment (github.com) https://github.com/tianocore/edk2-pytool-extensions * tianocore/edk2-pytool-library: Python library package that supports UEFI development (github.com) https://github.com/tianocore/edk2-pytool-library MS Teams Browser Clients * https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92224): https://edk2.groups.io/g/devel/message/92224 Mute This Topic: https://groups.io/mt/92905003/21656 Mute #cal-notice:https://edk2.groups.io/g/devel/mutehashtag/cal-notice Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 2/3] UserAuthFeaturePkg: Included DXE versions are mutually exclusive
Benjamin, Can you update the readme with descriptions of the modules and their functionality? Can you comment the PcdUseVersion1 declaration in the DEC file? If you can think of a more descriptive name than "version 1", that would be better. Note that convention (maybe requirement) is to preface non-edk2 repo changes with the mailing list and repo info [edk2-devel][edk2-platforms] so that rules can filter more easily. And multi-commit reviews should have a cover-letter enabled as well so you can provide an overview of the patch series. Here is the command I use: git format-patch -M --thread origin/master --cover-letter --subject-prefix="edk2-devel][edk2-platforms][PATCH V1" Regards, Isaac -Original Message- From: Benjamin Doron Sent: Monday, July 25, 2022 10:12 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Oram, Isaac W ; Desimone, Nathaniel L ; Sinha, Ankit ; Gao, Liming ; Bi, Dandan Subject: [PATCH v1 2/3] UserAuthFeaturePkg: Included DXE versions are mutually exclusive Versions of the DXE module perform nearly identical functions, and are therefore mutually exclusive. Including both modules results in at least a duplicate HII package and an "already started" assert. Therefore, add a new PCD to determine which module will be included. However, now a second bug can be seen: version 2 does not challenge for the password. An RSC handler to hook UiApp entry is probably needed, as in version 1. Cc: Sai Chaganty Cc: Isaac Oram Cc: Nate DeSimone Cc: Ankit Sinha Cc: Liming Gao Cc: Dandan Bi Signed-off-by: Benjamin Doron --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc| 1 + Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 1 + Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf | 9 ++--- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 3 +++ Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index 908fe4d1f7a9..8924dadcaa18 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -79,6 +79,7 @@ # gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable |TRUE gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |TRUE+ gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 |FALSE gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable |TRUE #diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc index d59e3e61b9b9..5365f0a1b844 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc @@ -75,6 +75,7 @@ gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable |FALSE gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |FALSE+ gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 |FALSE gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable |FALSE #diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf index 030dcbe763d8..827deb08de7e 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory +++ .fdf @@ -7,6 +7,9 @@ # ## -INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf-INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf-INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf+!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 == TRUE+ INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf+!else+ INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf+!endif+ INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.infdiff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc index 2f39a5580caf..022678d5c852 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFe +++ ature.dsc @@ -72,6 +72,9 @@ UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf# Add components here that should be included in the package build.+!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 == TRUE
Re: [edk2-devel] [PATCH v1 0/5] Add support to build PRM for AARCH64 using GCC
Responses inline. On 8/8/2022 6:35 AM, Sami Mujawar wrote: Hi Michael, Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 04/08/2022 05:09 am, Michael Kubacki wrote: For the series: Reviewed-by: Michael Kubacki The patch formatting seems a little strange: 1. The patches don't have "Cc" lines. [SAMI] I have not been following the convention to add Cc lines to the patches. However, I will start from the next patch series. 2. What is this GUID message at the bottom of each patch? 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' [SAMI] I have added this so that I can easily search my patches. It does not affect the patch though. Okay, no problem I had just not seen it before. By the way, I tested the AARCH64 PRM build with sample modules on VS2019 a while back, so I see that you mentioned only testing GCC (thanks for helping get the functions in the export table there) but it should work in VS as well. [SAMI] I have tried building PrmPkg with VS2019 and found that the AARCH64 builds do not work. "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\bin\Hostx86\arm64\armasm64.exe" /Fow:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.obj /nologo /g /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe\AArch64 /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe\Arm /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe\AArch64 /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe /Iw:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\DEBUG /Iw:\edk2-exports\edk2\MdePkg /Iw:\edk2-exports\edk2\MdePkg\Include /Iw:\edk2-exports\edk2\MdePkg\Test\UnitTest\Include /Iw:\edk2-exports\edk2\MdePkg\Include\AArch64 w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid. w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(7) : error A2034: unknown opcode: . .text w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(8) : error A2034: unknown opcode: . .align 5 w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(9) : error A2034: unknown opcode: InternalMemCompareGuid ASM_GLOBAL InternalMemCompareGuid w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(13) : error A2173: syntax error in expression cbz x1, 0f w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(19) : warning A4045: missing END directive ret NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\bin\Hostx86\arm64\armasm64.exe"' : return code '0x1' Stop. Can you please let me know if this is a configuration/environment issue or the AARCH64 assembly files need to be ported for Visual Studio? I have tried building other Arm packages and though the assembler files need porting, which I believe has been done as part of ProjectMu (https://github.com/microsoft/mu_silicon_arm_tiano). It would be good to have AARCH64 builds of edk2 with Visual Studio as this would allow to use the VS static analysis tool. Can you let me know if you have any plans to enable this support in Tianocore\edk2 project, please? [/SAMI] I did build it with Project Mu picking up PrmPkg as a submodule. Yes, I will investigate enabling this in edk2. Regards, Michael On 8/3/2022 10:35 AM, Sami Mujawar wrote: This patch series adds support to build PRM for AARCH64 using GCC. The changes can be seen at: https://github.com/samimujawar/edk2/tree/2238_aarch64_prm_support_v1 Jose Marinho (5): Basetools/GenFw: Allow AARCH64 builds to use the --prm flag PrmPkg: Enable external visibility on PRM symbols PrmPkg: Build Prm Samples with GCC for AARCH64 PrmPkg: Support AArch64 builds using GCC PrmPkg: Add details on AArch64 build to the Readme. BaseTools/Source/C/GenFw/Elf64Convert.c | 6 ++--- PrmPkg/Include/Prm.h | 3 +++ PrmPkg/PrmPkg.ci.yaml | 1 + PrmPkg/PrmPkg.dsc | 24 +--- PrmPkg/Readme.md | 11 + PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf | 4 PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf | 4 7 files changed, 47 insertions(+), 6 deletions(-) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#9): https://edk2.groups.io/g/devel/message/9 Mute This Topic:
Re: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT
Pushed as d85e4251ce..306c2d1cef -Original Message- From: devel@edk2.groups.io On Behalf Of Oram, Isaac W Sent: Monday, August 8, 2022 3:41 PM To: Sinha, Ankit ; devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Dong, Eric Subject: Re: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT Reviewed-by: Isaac Oram -Original Message- From: Sinha, Ankit Sent: Monday, August 8, 2022 2:05 PM To: devel@edk2.groups.io Cc: Oram, Isaac W ; Desimone, Nathaniel L ; Dong, Eric Subject: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT Add mapping for all enabled and disabled threads in MADT Cc: Isaac Oram Cc: Nate DeSimone Cc: Eric Dong Signed-off-by: Ankit Sinha --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 49 +++- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index e68b6070607f..5a282e7c18f2 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -243,46 +243,54 @@ SortCpuLocalApicInTable ( } } - // - // 1. Sort TempCpuApicIdOrderTable, - //sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must in the fist location of the table. - //So, start sorting the table from the second element and total elements are mNumberOfCpus-1. - // + /* + 1. Sort TempCpuApicIdOrderTable, +Sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must be in the fist location of the table. + + 2. Sort and map all the enabled threads after BSP in + CpuApicIdOrderTable + + 3. Threads that are not enabled are placed in the bottom of + CpuApicIdOrderTable + + 4. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. + */ + PerformQuickSort ((TempCpuApicIdOrderTable + 1), (mNumberOfCpus - 1), sizeof (EFI_CPU_ID_ORDER_MAP), (SORT_COMPARE) ApicIdCompareFunction); - // - // 2. Sort and map the primary threads to the front of the CpuApicIdOrderTable - // for (CurrProcessor = 0, Index = 0; Index < mNumberOfCpus; Index++) { -if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { // primary thread +if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 3. Sort and map the second threads to the middle of the CpuApicIdOrderTable - // for (Index = 0; Index < mNumberOfCpus; Index++) { -if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { //second thread +if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 4. Sort and map the not enabled threads to the bottom of the CpuApicIdOrderTable - // for (Index = 0; Index < mNumberOfCpus; Index++) { -if (TempCpuApicIdOrderTable[Index].Flags == 0) { // not enabled +if ((TempCpuApicIdOrderTable[Index].Thread) == 2) { + CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; +} + } + + for (Index = 0; Index < mNumberOfCpus; Index++) { +if ((TempCpuApicIdOrderTable[Index].Thread) == 3) { + CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; +} + } + + for (Index = 0; Index < mNumberOfCpus; Index++) { +if (TempCpuApicIdOrderTable[Index].Flags == 0) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 5. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. - // for (Socket = 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketCount); Socket++) { for (CurrProcessor = 0, Index = 0; CurrProcessor < mNumberOfCpus; CurrProcessor++) { if (mCpuApicIdOrderTable[CurrProcessor].Flags && (mCpuApicIdOrderTable[CurrProcessor].SocketNum == Socket)) { @@ -292,7 +300,6 @@ SortCpuLocalApicInTable ( } } - //keep for debug purpose DEBUG ((DEBUG_INFO, "APIC ID Order Table ReOrdered\n")); DebugDisplayReOrderTable (mCpuApicIdOrderTable); -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92221): https://edk2.groups.io/g/devel/message/92221 Mute This Topic: https://groups.io/mt/92902463/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT
Reviewed-by: Isaac Oram -Original Message- From: Sinha, Ankit Sent: Monday, August 8, 2022 2:05 PM To: devel@edk2.groups.io Cc: Oram, Isaac W ; Desimone, Nathaniel L ; Dong, Eric Subject: [edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT Add mapping for all enabled and disabled threads in MADT Cc: Isaac Oram Cc: Nate DeSimone Cc: Eric Dong Signed-off-by: Ankit Sinha --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 49 +++- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index e68b6070607f..5a282e7c18f2 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -243,46 +243,54 @@ SortCpuLocalApicInTable ( } } - // - // 1. Sort TempCpuApicIdOrderTable, - //sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must in the fist location of the table. - //So, start sorting the table from the second element and total elements are mNumberOfCpus-1. - // + /* + 1. Sort TempCpuApicIdOrderTable, +Sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must be in the fist location of the table. + + 2. Sort and map all the enabled threads after BSP in + CpuApicIdOrderTable + + 3. Threads that are not enabled are placed in the bottom of + CpuApicIdOrderTable + + 4. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. + */ + PerformQuickSort ((TempCpuApicIdOrderTable + 1), (mNumberOfCpus - 1), sizeof (EFI_CPU_ID_ORDER_MAP), (SORT_COMPARE) ApicIdCompareFunction); - // - // 2. Sort and map the primary threads to the front of the CpuApicIdOrderTable - // for (CurrProcessor = 0, Index = 0; Index < mNumberOfCpus; Index++) { -if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { // primary thread +if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 3. Sort and map the second threads to the middle of the CpuApicIdOrderTable - // for (Index = 0; Index < mNumberOfCpus; Index++) { -if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { //second thread +if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 4. Sort and map the not enabled threads to the bottom of the CpuApicIdOrderTable - // for (Index = 0; Index < mNumberOfCpus; Index++) { -if (TempCpuApicIdOrderTable[Index].Flags == 0) { // not enabled +if ((TempCpuApicIdOrderTable[Index].Thread) == 2) { + CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; +} + } + + for (Index = 0; Index < mNumberOfCpus; Index++) { +if ((TempCpuApicIdOrderTable[Index].Thread) == 3) { + CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; +} + } + + for (Index = 0; Index < mNumberOfCpus; Index++) { +if (TempCpuApicIdOrderTable[Index].Flags == 0) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 5. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. - // for (Socket = 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketCount); Socket++) { for (CurrProcessor = 0, Index = 0; CurrProcessor < mNumberOfCpus; CurrProcessor++) { if (mCpuApicIdOrderTable[CurrProcessor].Flags && (mCpuApicIdOrderTable[CurrProcessor].SocketNum == Socket)) { @@ -292,7 +300,6 @@ SortCpuLocalApicInTable ( } } - //keep for debug purpose DEBUG ((DEBUG_INFO, "APIC ID Order Table ReOrdered\n")); DebugDisplayReOrderTable (mCpuApicIdOrderTable); -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92220): https://edk2.groups.io/g/devel/message/92220 Mute This Topic: https://groups.io/mt/92902463/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] Event: Tools, CI, Code base construction meeting series - 08/08/2022 #cal-reminder
*Reminder: Tools, CI, Code base construction meeting series* *When:* 08/08/2022 4:30pm to 5:30pm (UTC-07:00) America/Los Angeles *Where:* https://github.com/tianocore/edk2/discussions/2614 View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1608785 ) *Description:* TianoCore community, Microsoft and Intel will be hosting a series of open meetings to discuss build, CI, tools, and other related topics. If you are interested, have ideas/opinions please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft Teams. MS Teams Link in following discussion: * https://github.com/tianocore/edk2/discussions/2614 Anyone is welcome to join. * tianocore/edk2: EDK II (github.com) * tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module (github.com) https://github.com/tianocore/edk2-basetools * tianocore/edk2-pytool-extensions: Extensions to the edk2 build system allowing for a more robust and plugin based build system and tool execution environment (github.com) https://github.com/tianocore/edk2-pytool-extensions * tianocore/edk2-pytool-library: Python library package that supports UEFI development (github.com) https://github.com/tianocore/edk2-pytool-library MS Teams Browser Clients * https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92219): https://edk2.groups.io/g/devel/message/92219 Mute This Topic: https://groups.io/mt/92882339/21656 Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel][edk2-platforms][PATCH V3 1/1] MinPlatformPkg/AcpiTables: Add additional thread mapping in MADT
Add mapping for all enabled and disabled threads in MADT Cc: Isaac Oram Cc: Nate DeSimone Cc: Eric Dong Signed-off-by: Ankit Sinha --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 49 +++- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index e68b6070607f..5a282e7c18f2 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -243,46 +243,54 @@ SortCpuLocalApicInTable ( } } - // - // 1. Sort TempCpuApicIdOrderTable, - //sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must in the fist location of the table. - //So, start sorting the table from the second element and total elements are mNumberOfCpus-1. - // + /* + 1. Sort TempCpuApicIdOrderTable, +Sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must be in the fist location of the table. + + 2. Sort and map all the enabled threads after BSP in CpuApicIdOrderTable + + 3. Threads that are not enabled are placed in the bottom of CpuApicIdOrderTable + + 4. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. + */ + PerformQuickSort ((TempCpuApicIdOrderTable + 1), (mNumberOfCpus - 1), sizeof (EFI_CPU_ID_ORDER_MAP), (SORT_COMPARE) ApicIdCompareFunction); - // - // 2. Sort and map the primary threads to the front of the CpuApicIdOrderTable - // for (CurrProcessor = 0, Index = 0; Index < mNumberOfCpus; Index++) { -if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { // primary thread +if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 3. Sort and map the second threads to the middle of the CpuApicIdOrderTable - // for (Index = 0; Index < mNumberOfCpus; Index++) { -if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { //second thread +if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 4. Sort and map the not enabled threads to the bottom of the CpuApicIdOrderTable - // for (Index = 0; Index < mNumberOfCpus; Index++) { -if (TempCpuApicIdOrderTable[Index].Flags == 0) { // not enabled +if ((TempCpuApicIdOrderTable[Index].Thread) == 2) { + CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; +} + } + + for (Index = 0; Index < mNumberOfCpus; Index++) { +if ((TempCpuApicIdOrderTable[Index].Thread) == 3) { + CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); + CurrProcessor++; +} + } + + for (Index = 0; Index < mNumberOfCpus; Index++) { +if (TempCpuApicIdOrderTable[Index].Flags == 0) { CopyMem ([CurrProcessor], [Index], sizeof (EFI_CPU_ID_ORDER_MAP)); CurrProcessor++; } } - // - // 5. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose. - // for (Socket = 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketCount); Socket++) { for (CurrProcessor = 0, Index = 0; CurrProcessor < mNumberOfCpus; CurrProcessor++) { if (mCpuApicIdOrderTable[CurrProcessor].Flags && (mCpuApicIdOrderTable[CurrProcessor].SocketNum == Socket)) { @@ -292,7 +300,6 @@ SortCpuLocalApicInTable ( } } - //keep for debug purpose DEBUG ((DEBUG_INFO, "APIC ID Order Table ReOrdered\n")); DebugDisplayReOrderTable (mCpuApicIdOrderTable); -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92218): https://edk2.groups.io/g/devel/message/92218 Mute This Topic: https://groups.io/mt/92902463/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 0/6] Enhance DynamicTablesPkg modules
Hi Sami, Thanks for the deep dive on those patches. I will work on the patches and reply on those threads. Regards, Kun On 8/8/2022 8:44 AM, Sami Mujawar wrote: Hi Kun, I have just replied to your patch series. I think patches 4 & 5 may need some adjustment. Can you look into those, please? Regards, Sami Mujawar On 08/08/2022, 16:34, "Kun Qin" wrote: Hi DynamicTablePkg maintainers, Just a gentle ping on this patch series. If there is no further feedback, can we merge them into the mainline? Otherwise, any feedback is appreciated. Regards, Kun On 8/3/2022 9:57 AM, Kun Qin wrote: > Hi DynamicTablePkg maintainers, > > Do you have any further feedback on this patch series? Any input is > appreciated. > > Thanks, > Kun > > On 7/30/2022 10:37 PM, Kun Qin via groups.io wrote: >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996 >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 >> >> This patch series is a follow-up of previous submission: >> https://edk2.groups.io/g/devel/message/91926 >> >> The main changes between v2 and v3 patches are: >>- Added reviewed-by collected from previous iteration >>- Added descriptions for newly introduced structures >>- Updated functions names >> >> Current DynamicTablesPkg provide great support for creating dynamic ACPI >> tables during boot time. >> >> However, there are some modules needs minor tweaks to expand support and >> compatibility for OS requirements and platform needs. >> >> This patch series proposes a few fixes to resolve minor issues >> discovered >> in DynamicPlatRepoLib, AcpiSsdtPcieLibArm and DynamicTableManagerDxe. >> >> Patch v3 branch: https://github.com/kuqin12/edk2/tree/dynamic_update_v3 >> >> Cc: Sami Mujawar >> Cc: Alexei Fedorov >> Cc: Pierre Gondois >> >> Kun Qin (6): >>DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to >> inf >>DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing >>DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers >>DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed >> tables >>DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM >> space >>DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI >> config >> >> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c >> | 214 >> DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c >> | 176 >> DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c >> | 80 +++- >> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf >> | 4 + >> DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf >> | 1 + >> 5 files changed, 391 insertions(+), 84 deletions(-) >> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92217): https://edk2.groups.io/g/devel/message/92217 Mute This Topic: https://groups.io/mt/92722838/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive
Pushed as edc718521e..d85e4251ce -Original Message- From: devel@edk2.groups.io On Behalf Of Oram, Isaac W Sent: Monday, August 8, 2022 12:22 PM To: devel@edk2.groups.io; benjamin.doro...@gmail.com Cc: Chaganty, Rangasai V ; Desimone, Nathaniel L ; Sinha, Ankit ; Gao, Liming ; Dong, Eric Subject: Re: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive Reviewed-by: Isaac Oram -Original Message- From: devel@edk2.groups.io On Behalf Of Benjamin Doron Sent: Monday, July 25, 2022 10:12 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Oram, Isaac W ; Desimone, Nathaniel L ; Sinha, Ankit ; Gao, Liming ; Dong, Eric Subject: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive The DXE and SMM versions of AcpiDebug perform the same task and are therefore mutually exclusive. Including both modules results in a duplicate ACPI table, resulting in the feature not working at all. Therefore, add a new PCD to determine which module will be included. Now, either version successfully write to the debug buffer. Cc: Sai Chaganty Cc: Isaac Oram Cc: Nate DeSimone Cc: Ankit Sinha Cc: Liming Gao Cc: Eric Dong Signed-off-by: Benjamin Doron --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 1 + Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 1 + Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c | 4 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec | 1 + Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 3 +++ Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf | 7 +-- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index 28530b8c674b..908fe4d1f7a9 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -48,6 +48,7 @@ # Debugging features # gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |TRUE+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion |FALSE gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |TRUE gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |TRUE gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |TRUEdiff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc index e214175edaf7..d59e3e61b9b9 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc @@ -59,6 +59,7 @@ # [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |FALSE+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion |FALSE gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |FALSE gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |FALSE gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |FALSEdiff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c index 4caeffc7dec9..0b28e2f7a6d5 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiD +++ ebug.c @@ -483,6 +483,10 @@ InitializeAcpiDebugSmm ( EFI_SMM_BASE2_PROTOCOL*SmmBase2; BOOLEAN InSmm; + if (!PcdGetBool (PcdAcpiDebugFeatureActive)) {+return EFI_SUCCESS;+ }+ Status = gBS->LocateProtocol (, NULL, (VOID **) ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) {diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec index 915923100731..1a290bab29d9 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.d +++ ec @@ -28,6 +28,7 @@ [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|FALSE|BOOLEAN|0xA001+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion|FALSE|BOOLEAN|0xA002 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This PCD specifies the ACPI debug message buffer size.diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc index f5b8bacee039..684549bbdd78 100644 ---
Re: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive
Reviewed-by: Isaac Oram -Original Message- From: devel@edk2.groups.io On Behalf Of Benjamin Doron Sent: Monday, July 25, 2022 10:12 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Oram, Isaac W ; Desimone, Nathaniel L ; Sinha, Ankit ; Gao, Liming ; Dong, Eric Subject: [edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive The DXE and SMM versions of AcpiDebug perform the same task and are therefore mutually exclusive. Including both modules results in a duplicate ACPI table, resulting in the feature not working at all. Therefore, add a new PCD to determine which module will be included. Now, either version successfully write to the debug buffer. Cc: Sai Chaganty Cc: Isaac Oram Cc: Nate DeSimone Cc: Ankit Sinha Cc: Liming Gao Cc: Eric Dong Signed-off-by: Benjamin Doron --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 1 + Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 1 + Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c | 4 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec | 1 + Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 3 +++ Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf | 7 +-- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index 28530b8c674b..908fe4d1f7a9 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -48,6 +48,7 @@ # Debugging features # gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |TRUE+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion |FALSE gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |TRUE gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |TRUE gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |TRUEdiff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc index e214175edaf7..d59e3e61b9b9 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc @@ -59,6 +59,7 @@ # [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |FALSE+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion |FALSE gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |FALSE gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |FALSE gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |FALSEdiff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c index 4caeffc7dec9..0b28e2f7a6d5 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiD +++ ebug.c @@ -483,6 +483,10 @@ InitializeAcpiDebugSmm ( EFI_SMM_BASE2_PROTOCOL*SmmBase2; BOOLEAN InSmm; + if (!PcdGetBool (PcdAcpiDebugFeatureActive)) {+return EFI_SUCCESS;+ }+ Status = gBS->LocateProtocol (, NULL, (VOID **) ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) {diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec index 915923100731..1a290bab29d9 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.d +++ ec @@ -28,6 +28,7 @@ [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|FALSE|BOOLEAN|0xA001+ gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion|FALSE|BOOLEAN|0xA002 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This PCD specifies the ACPI debug message buffer size.diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc index f5b8bacee039..684549bbdd78 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeat +++ ure.dsc @@ -54,5 +54,8 @@ # in the package build.# Add components here that should be included in the package build.+!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion == FALSE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf+!else
Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Remove unnecessary GetVariable2() call
Pushed as ea2a520c83..60053f3077 -Original Message- From: devel@edk2.groups.io On Behalf Of Oram, Isaac W Sent: Friday, August 5, 2022 1:40 PM To: mikub...@linux.microsoft.com; devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Gao, Liming ; Dong, Eric Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Remove unnecessary GetVariable2() call Reviewed-by: Isaac Oram -Original Message- From: mikub...@linux.microsoft.com Sent: Friday, August 5, 2022 11:02 AM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Oram, Isaac W ; Gao, Liming ; Dong, Eric Subject: [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Remove unnecessary GetVariable2() call From: Michael Kubacki The data buffer returned from the GetVariable2() call in TestPointCheckMemoryTypeInformation() is not actually used or freed. This change removes the unnecessary function call. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Isaac Oram Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c | 8 1 file changed, 8 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c index 9ee9dd252c7e..0ff6789ac621 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c @@ -109,7 +109,6 @@ TestPointCheckMemoryTypeInformation ( EFI_HOB_GUID_TYPE *GuidHob; VOID*CurrentMemoryTypeInformation; VOID*PreviousMemoryTypeInformation; - VOID*VariableMemoryTypeInformation; DEBUG ((DEBUG_INFO, " TestPointCheckMemoryTypeInformation - Enter\n")); CurrentMemoryTypeInformation = NULL; @@ -128,13 +127,6 @@ TestPointCheckMemoryTypeInformation ( goto Done; } - GetVariable2 ( - EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME, - , - , - NULL - ); - if ((CurrentMemoryTypeInformation != NULL) && (PreviousMemoryTypeInformation != NULL)) { DumpMemoryTypeInfoSummary(CurrentMemoryTypeInformation, PreviousMemoryTypeInformation); } -- 2.28.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92213): https://edk2.groups.io/g/devel/message/92213 Mute This Topic: https://groups.io/mt/92840556/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Prevent modification of HOB data
Pushed as 436a8612ae..ea2a520c83 -Original Message- From: devel@edk2.groups.io On Behalf Of Oram, Isaac W Sent: Friday, August 5, 2022 1:30 PM To: mikub...@linux.microsoft.com; devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Gao, Liming ; Dong, Eric Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Prevent modification of HOB data Reviewed-by: Isaac Oram -Original Message- From: mikub...@linux.microsoft.com Sent: Friday, August 5, 2022 10:16 AM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Oram, Isaac W ; Gao, Liming ; Dong, Eric Subject: [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Prevent modification of HOB data From: Michael Kubacki DumpMemoryTypeInfoSummary() is used to dump information about the MemoryTypeInformation HOB. The dump function currently modifies the data which can corrupt the data for later HOB consumers in the DXE phase. This change makes DumpMemoryTypeInfoSummary() treat the data as read-only. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Isaac Oram Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c index 9ee9dd252c7e..a30b69dd787c 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryTypeInformation.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh +++ eckMemoryTypeInformation.c @@ -22,8 +22,8 @@ ShortNameOfMemoryType( VOID DumpMemoryTypeInfoSummary ( - IN EFI_MEMORY_TYPE_INFORMATION *CurrentMemoryTypeInformation, - IN EFI_MEMORY_TYPE_INFORMATION *PreviousMemoryTypeInformation + IN CONST EFI_MEMORY_TYPE_INFORMATION *CurrentMemoryTypeInformation, + IN CONST EFI_MEMORY_TYPE_INFORMATION *PreviousMemoryTypeInformation ) { UINTNIndex; @@ -83,7 +83,6 @@ DumpMemoryTypeInfoSummary ( } if (Next != Previous) { - PreviousMemoryTypeInformation[Index].NumberOfPages = Next; MemoryTypeInformationModified = TRUE; } @@ -110,7 +109,7 @@ TestPointCheckMemoryTypeInformation ( VOID*CurrentMemoryTypeInformation; VOID*PreviousMemoryTypeInformation; VOID*VariableMemoryTypeInformation; - + DEBUG ((DEBUG_INFO, " TestPointCheckMemoryTypeInformation - Enter\n")); CurrentMemoryTypeInformation = NULL; PreviousMemoryTypeInformation = NULL; -- 2.28.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92212): https://edk2.groups.io/g/devel/message/92212 Mute This Topic: https://groups.io/mt/92839532/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] Ext4Pkg: Sanity check the inode size
Reviewed-by: Marvin Häuser > On 7. Aug 2022, at 01:39, Pedro Falcato wrote: > > Check its alignment and value for possible bad values. > > Cc: Marvin Häuser > Signed-off-by: Pedro Falcato > --- > Features/Ext4Pkg/Ext4Dxe/Superblock.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c > b/Features/Ext4Pkg/Ext4Dxe/Superblock.c > index c22155ba11b4..edee051c41e8 100644 > --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c > +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c > @@ -189,6 +189,12 @@ Ext4OpenSuperblock ( > Partition->FeaturesIncompat = Sb->s_feature_incompat; > Partition->FeaturesRoCompat = Sb->s_feature_ro_compat; > Partition->InodeSize= Sb->s_inode_size; > + > +// Check for proper alignment of InodeSize and that InodeSize is indeed > larger than > +// the minimum size, 128 bytes. > +if (((Partition->InodeSize % 4) != 0) || (Partition->InodeSize < > EXT4_GOOD_OLD_INODE_SIZE)) { > + return EFI_VOLUME_CORRUPTED; > +} > } else { > // GOOD_OLD_REV > Partition->FeaturesCompat = Partition->FeaturesIncompat = > Partition->FeaturesRoCompat = 0; > -- > 2.37.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92211): https://edk2.groups.io/g/devel/message/92211 Mute This Topic: https://groups.io/mt/92863643/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] ShellPkg/SmbiosView: Smbiosview tool is not show Extended Speed and Extended Configured Memory Speed in type 17.
From: Shengfengx Xue REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4014 if Configured Memory Speed is 65,535 MT/s or greater, and the actual speed is stored in the Extended Configured Memory Speed field. but current Smbiosview have no this logic. Signed-off-by: Shengfengx Xue --- .../UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c| 5 + 1 file changed, 5 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index a0ee286c9a..0ab9f5063a 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -878,6 +878,11 @@ SmbiosPrintStructure ( } } + if (AE_SMBIOS_VERSION (0x3, 0x3) && (Struct->Hdr->Length > 0x54)) { +PRINT_STRUCT_VALUE_H (Struct, Type17, ExtendedSpeed); +PRINT_STRUCT_VALUE_H (Struct, Type17, ExtendedConfiguredMemorySpeed); + } + break; // -- 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92208): https://edk2.groups.io/g/devel/message/92208 Mute This Topic: https://groups.io/mt/92898444/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platform][PATCH] Silicon/NXP: avoid integer overflow when computing Serdes protocol map
SerDesProtocolMap is a UINT64, but BIT0 is an unadorned int. Shifting BIT0 left by more than 31 bits is undefined behaviour. This would cause SerDesProtocolMap to be filled with incorrect values when using Serdes protocols numbered 32 and above, such as the SGMII protocols. This fixes a hang at boot time on the Solidrun Honeycomb with SERDES configuration 4_5_2. Signed-off-by: Dan Callaghan --- Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 2 +- Silicon/NXP/Library/SerDesHelperLib/SerDesHelperLib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c index 7f11d7a602..127eb3e175 100644 --- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -748,7 +748,7 @@ IsPcieNumEnabled( // Reading serdes protocol map GetSerDesProtocolMap (); - return (SerDesProtocolMap & (BIT0 << (PcieNum))) != 0; + return (SerDesProtocolMap & ((UINT64) BIT0 << (PcieNum))) != 0; } /** diff --git a/Silicon/NXP/Library/SerDesHelperLib/SerDesHelperLib.c b/Silicon/NXP/Library/SerDesHelperLib/SerDesHelperLib.c index 1e8158541c..62a32d5caf 100644 --- a/Silicon/NXP/Library/SerDesHelperLib/SerDesHelperLib.c +++ b/Silicon/NXP/Library/SerDesHelperLib/SerDesHelperLib.c @@ -157,7 +157,7 @@ GetSerDesMap ( DEBUG ((DEBUG_ERROR, "Unknown SerDes lane protocol %d\n", LaneProtocol)); return EFI_NO_MAPPING; } -*SerDesProtocolMap |= (BIT0 << (LaneProtocol)); +*SerDesProtocolMap |= ((UINT64) BIT0 << (LaneProtocol)); } return EFI_SUCCESS; -- 2.36.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92209): https://edk2.groups.io/g/devel/message/92209 Mute This Topic: https://groups.io/mt/92898445/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] AsfPkg: Add Alert standard format support
Hi, I would like to propose to add Alert standard format support which is based on ASF2.0 specification(DSP0136). REF:https://www.dmtf.org/sites/default/files/standards/documents/DSP0136.pdf Could you suggest which package is suitable for this feature? Since I'm not sure which package to include this feature, I create a temporarily Asfpkg to include my patch. Asf branch in forked edk2 reop REF:https://github.com/CrystalLee-77/edk2/tree/AlertStandardFormatSupport Currently, the drivers focus on below features 1. ASF Smbus alert-relate messages (progress logs or error logs) 2. Publish ASF ACPI table for remote control and other information Drivers description: Asf Pei driver: send Bios present and memory initial related messages. Asf Dxe driver: 1. Get boot options from device(DSP0136, ch5.2 boot option messages) 2. Install Asf Acpi table. 3. Register callback function through RscHandler Protocol, the function will send standard messages base on the reported status code. 4. Register callback function on ready to boot event, this function will send set system state(S0) message to device. 5. Install Asf protocol, the protocol include the boot options information in step 1 so other drivers can get the information. Alert Standard format specification(DSP0136) REF:https://www.dmtf.org/sites/default/files/standards/documents/DSP0136.pdf Send standard alert message base on the status code reported by drivers. Report Asf configuration and capabilities in Asf ACPI table Signed-off-by: Crystal Lee --- AsfPkg/Asf/AsfDxe/AsfDxe.c | 338 + AsfPkg/Asf/AsfDxe/AsfDxeEvent.c| 319 AsfPkg/Asf/AsfPei/AsfPei.c | 384 AsfPkg/Library/AsfAcpiTableLib/AsfAcpiTableLib.c | 210 +++ AsfPkg/Asf/AsfDxe/AsfDxe.h | 67 AsfPkg/Asf/AsfDxe/AsfDxe.inf | 52 +++ AsfPkg/Asf/AsfDxe/AsfDxe.uni | 15 + AsfPkg/Asf/AsfDxe/AsfDxeExtra.uni | 13 + AsfPkg/Asf/AsfPei/AsfPei.inf | 57 +++ AsfPkg/Asf/AsfPei/AsfPei.uni | 15 + AsfPkg/Asf/AsfPei/AsfPeiExtra.uni | 13 + AsfPkg/AsfPkg.dec | 47 +++ AsfPkg/AsfPkg.dsc | 59 +++ AsfPkg/Include/AsfMessages.h | 104 ++ AsfPkg/Include/IndustryStandard/Asf.h | 145 AsfPkg/Include/Library/AsfAcpiTableLib.h | 26 ++ AsfPkg/Include/Protocol/AsfProtocol.h | 57 +++ AsfPkg/Library/AsfAcpiTableLib/AsfAcpiTableLib.inf | 30 ++ AsfPkg/Library/AsfAcpiTableLib/AsfAcpiTableLib.uni | 15 + 19 files changed, 1966 insertions(+) diff --git a/AsfPkg/Asf/AsfDxe/AsfDxe.c b/AsfPkg/Asf/AsfDxe/AsfDxe.c new file mode 100644 index ..1919dec6d095 --- /dev/null +++ b/AsfPkg/Asf/AsfDxe/AsfDxe.c @@ -0,0 +1,338 @@ +/** @file + Asf Dxe driver which is used for sending event record log to NIC or receiving + boot option command from NIC and provide in Asf Dxe protocol. + + Copyright (c) 1985 - 2022, AMI. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +ASF_BOOT_OPTION gAsfBootOption = { 0, 0, 0, 0, 0, 0, 0 }; +ASF_PROTOCOL gAsfProtocol = { AsfPushEvent, NULL }; +EFI_SMBUS_DEVICE_ADDRESS mFixedTargetAddress; +EFI_SMBUS_HC_PROTOCOL *mSmBus = NULL; + +/** + Send message through SmBus to lan card. + + @param[in] Command Command of System Firmware Events. + @param[in] Length Length of the data in bytes. + @param[in] AsfEvent Message data. + + @retval EFI_SUCCESS Push Event successfully. + @retval Others Push Event error. +**/ +EFI_STATUS +EFIAPI +AsfPushEvent ( + IN UINT8 Command, + IN UINTN Length, + IN UINT8 *AsfEvent + ) +{ + EFI_STATUS Status; + + if (mSmBus == NULL) { +return EFI_UNSUPPORTED; + } + + Status = mSmBus->Execute ( + mSmBus, + mFixedTargetAddress, + Command, + EfiSmbusWriteBlock, + TRUE, + , + AsfEvent + ); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "AsfPushEvent Status = %r\n", Status)); + } + + return Status; +} + +/** + This function pushes the System Firmware State Events. + + @param[in] SystemStateSystem Firmware State. + +**/ +VOID +EFIAPI +AsfPushSystemState ( + IN UINT8 SystemState + ) +{ + mAsfSystemState.EventSensorType = SystemState; + AsfPushEvent ( +mAsfSystemState.Command, +mAsfSystemState.ByteCount, +(UINT8 *)&(mAsfSystemState.SubCommand) +); + return; +} + +/** + This function processes the System Firmware Progress/Error Events. + + @param[in] MessageErrorLevel
[edk2-devel] [PATCH] Local Buffer allocated for Copy of data, is not freed in ShellPkg for CP command
--- ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index c3927ca35b..2d7e7d0bb4 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -246,6 +246,7 @@ CopySingleFile ( break; } } + SHELL_FREE_NON_NULL (Buffer); } SHELL_FREE_NON_NULL (DestVolumeInfo); -- 2.26.0.windows.1 -The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92207): https://edk2.groups.io/g/devel/message/92207 Mute This Topic: https://groups.io/mt/92898443/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 0/6] Enhance DynamicTablesPkg modules
Hi Kun, I have just replied to your patch series. I think patches 4 & 5 may need some adjustment. Can you look into those, please? Regards, Sami Mujawar On 08/08/2022, 16:34, "Kun Qin" wrote: Hi DynamicTablePkg maintainers, Just a gentle ping on this patch series. If there is no further feedback, can we merge them into the mainline? Otherwise, any feedback is appreciated. Regards, Kun On 8/3/2022 9:57 AM, Kun Qin wrote: > Hi DynamicTablePkg maintainers, > > Do you have any further feedback on this patch series? Any input is > appreciated. > > Thanks, > Kun > > On 7/30/2022 10:37 PM, Kun Qin via groups.io wrote: >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996 >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 >> >> This patch series is a follow-up of previous submission: >> https://edk2.groups.io/g/devel/message/91926 >> >> The main changes between v2 and v3 patches are: >>- Added reviewed-by collected from previous iteration >>- Added descriptions for newly introduced structures >>- Updated functions names >> >> Current DynamicTablesPkg provide great support for creating dynamic ACPI >> tables during boot time. >> >> However, there are some modules needs minor tweaks to expand support and >> compatibility for OS requirements and platform needs. >> >> This patch series proposes a few fixes to resolve minor issues >> discovered >> in DynamicPlatRepoLib, AcpiSsdtPcieLibArm and DynamicTableManagerDxe. >> >> Patch v3 branch: https://github.com/kuqin12/edk2/tree/dynamic_update_v3 >> >> Cc: Sami Mujawar >> Cc: Alexei Fedorov >> Cc: Pierre Gondois >> >> Kun Qin (6): >>DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to >> inf >>DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing >>DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers >>DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed >> tables >>DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM >> space >>DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI >> config >> >> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c >> | 214 >> DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c >> | 176 >> DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c >> | 80 +++- >> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf >> | 4 + >> DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf >> | 1 + >> 5 files changed, 391 insertions(+), 84 deletions(-) >> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92206): https://edk2.groups.io/g/devel/message/92206 Mute This Topic: https://groups.io/mt/92722838/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables
Hi Kun, Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 08/08/2022 02:05 pm, Sami Mujawar wrote: Hi Kun, Thank you for this patch. Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 This change added an extra step to allow check for installed ACPI tables. For FADT, MADT, GTDT, DSDT, DBG2 and SPCR tables, either pre-installed or supplied through AcpiTableInfo can be accepted. An extra check for FADT ACPI table existence during installation step is also added. Cc: Sami Mujawar Cc: Alexei Fedorov Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Pierre Gondois --- Notes: v2: - Function description updates [Sami] - Refactorized the table verification [Pierre] v3: - Added descriptions for new structures [Pierre] - Added check for SDT protocol PCD before using it [Pierre] DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 214 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 + 2 files changed, 138 insertions(+), 80 deletions(-) diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c index ed62299f9bbd..7f3deef08a66 100644 --- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c @@ -10,6 +10,7 @@ #include #include #include +#include #include // Module specific include files. @@ -22,6 +23,58 @@ #include #include +/// +/// Bit definitions for acceptable ACPI table presence formats. +/// Currently only ACPI tables present in the ACPI info list and +/// already installed will count towards "Table Present" during +/// verification routine. +/// +#define ACPI_TABLE_PRESENT_INFO_LIST BIT0 +#define ACPI_TABLE_PRESENT_INSTALLED BIT1 + +/// +/// Order of ACPI table being verified during presence inspection. +/// +#define ACPI_TABLE_VERIFY_FADT 0 +#define ACPI_TABLE_VERIFY_MADT 1 +#define ACPI_TABLE_VERIFY_GTDT 2 +#define ACPI_TABLE_VERIFY_DSDT 3 +#define ACPI_TABLE_VERIFY_DBG2 4 +#define ACPI_TABLE_VERIFY_SPCR 5 +#define ACPI_TABLE_VERIFY_COUNT 6 + +/// +/// Private data structure to verify the presence of mandatory +/// or optional ACPI tables. +/// +typedef struct { + /// ESTD ID for the ACPI table of interest. + ESTD_ACPI_TABLE_ID EstdTableId; + /// Standard UINT32 ACPI signature. + UINT32 AcpiTableSignature; + /// 4 character ACPI table name (the 5th char8 is for null terminator). + CHAR8 AcpiTableName[sizeof (UINT32) + 1]; + /// Indicator on whether the ACPI table is required. + BOOLEAN IsMandatory; + /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_* + /// This field should be initialized to 0 and will be populated during + /// verification routine. + UINT16 Presence; +} ACPI_TABLE_PRESENCE_INFO; + +/// +/// We require the FADT, MADT, GTDT and the DSDT tables to boot. +/// This list also include optional ACPI tables: DBG2, SPCR. +/// +ACPI_TABLE_PRESENCE_INFO mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] = { + { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, "FADT", TRUE, 0 }, + { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, "MADT", TRUE, 0 }, + { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, "GTDT", TRUE, 0 }, + { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, "DSDT", TRUE, 0 }, + { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, "DBG2", FALSE, 0 }, + { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, "SPCR", FALSE, 0 }, +}; + /** This macro expands to a function that retrieves the ACPI Table List from the Configuration Manager. */ @@ -395,6 +448,7 @@ BuildAndInstallAcpiTable ( @retval EFI_SUCCESS Success. @retval EFI_NOT_FOUND If mandatory table is not found. + @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo is already installed. **/ STATIC EFI_STATUS @@ -404,75 +458,71 @@ VerifyMandatoryTablesArePresent ( IN UINT32 AcpiTableCount ) { - EFI_STATUS Status; - BOOLEAN FadtFound; - BOOLEAN MadtFound; - BOOLEAN GtdtFound; - BOOLEAN DsdtFound; - BOOLEAN Dbg2Found; - BOOLEAN SpcrFound; + EFI_STATUS Status; + UINTN Handle; + UINTN Index; + UINTN InstalledTableIndex; +
Re: [edk2-devel] [PATCH v3 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space
Hi Kun, I have just tried testing your patch with Kvmtool guest firmware and think this patch may need some modifications. Also, the patch 4/6 may need some adjustment, which I will reply back on that patch separately. Regards, Sami Mujawar On 08/08/2022 02:22 pm, Sami Mujawar wrote: Hi Kun, Thank you for this patch. These changes look good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin via groups.io wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 Certain OSes will complain if the ECAM config space is not reserved in the ACPI namespace. This change adds a function to reserve PNP motherboard resources for a given PCI node. Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Pierre Gondois --- Notes: v2: - Only create RES0 after config space checking [Pierre] v3: - Updated function names and descriptions [Pierre] - Moved translation calculation to CONFIG case [Pierre] DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 171 1 file changed, 171 insertions(+) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c index ceffe2838c03..658a089c8f1f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c @@ -616,6 +616,169 @@ GeneratePciCrs ( return Status; } +/** Generate a RES0 device node to reserve PNP motherboard resources + for a given PCI node. + + @param [in] PciNode Parent PCI node handle of the generated + resource object. + @param [out] CrsNode CRS node of the AML tree to populate. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid input parameter. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +GenerateMotherboardDevice ( + IN AML_OBJECT_NODE_HANDLE PciNode, + OUT AML_OBJECT_NODE_HANDLE *CrsNode + ) +{ + EFI_STATUS Status; + UINT32 EisaId; + AML_OBJECT_NODE_HANDLE ResNode; + + if (CrsNode == NULL) { + ASSERT (0); + return EFI_INVALID_PARAMETER; + } + + // ASL: Device (RES0) {} + Status = AmlCodeGenDevice ("RES0", PciNode, ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // ASL: Name (_HID, EISAID ("PNP0C02")) + Status = AmlGetEisaIdFromString ("PNP0C02", ); /* PNP Motherboard Resources */ + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NULL); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // ASL: Name (_CRS, ResourceTemplate () {}) + Status = AmlCodeGenNameResourceTemplate ("_CRS", ResNode, CrsNode); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + return Status; +} + +/** Reserves ECAM space for PCI config space + + @param [in] Generator The SSDT Pci generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol interface. + @param [in] PciInfo Pci device information. + @param [in, out] PciNode RootNode of the AML tree to populate. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +ReserveEcamSpace ( + IN ACPI_PCI_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo, + IN OUT AML_OBJECT_NODE_HANDLE PciNode + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE CrsNode; + BOOLEAN Translation; + UINT32 Index; + CM_ARM_OBJ_REF *RefInfo; + UINT32 RefCount; + CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo; + BOOLEAN IsPosDecode; + + // Get the array of CM_ARM_OBJ_REF referencing the + // CM_ARM_PCI_ADDRESS_MAP_INFO objects. + Status = GetEArmObjCmRef ( + CfgMgrProtocol, + PciInfo->AddressMapToken, + , + + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + for (Index = 0; Index < RefCount; Index++) { + // Get CM_ARM_PCI_ADDRESS_MAP_INFO structures one by one. + Status = GetEArmObjPciAddressMapInfo ( + CfgMgrProtocol, + RefInfo[Index].ReferenceToken, + , +
Re: [edk2-devel] [PATCH v3 0/6] Enhance DynamicTablesPkg modules
Hi DynamicTablePkg maintainers, Just a gentle ping on this patch series. If there is no further feedback, can we merge them into the mainline? Otherwise, any feedback is appreciated. Regards, Kun On 8/3/2022 9:57 AM, Kun Qin wrote: Hi DynamicTablePkg maintainers, Do you have any further feedback on this patch series? Any input is appreciated. Thanks, Kun On 7/30/2022 10:37 PM, Kun Qin via groups.io wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 This patch series is a follow-up of previous submission: https://edk2.groups.io/g/devel/message/91926 The main changes between v2 and v3 patches are: - Added reviewed-by collected from previous iteration - Added descriptions for newly introduced structures - Updated functions names Current DynamicTablesPkg provide great support for creating dynamic ACPI tables during boot time. However, there are some modules needs minor tweaks to expand support and compatibility for OS requirements and platform needs. This patch series proposes a few fixes to resolve minor issues discovered in DynamicPlatRepoLib, AcpiSsdtPcieLibArm and DynamicTableManagerDxe. Patch v3 branch: https://github.com/kuqin12/edk2/tree/dynamic_update_v3 Cc: Sami Mujawar Cc: Alexei Fedorov Cc: Pierre Gondois Kun Qin (6): DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to inf DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 214 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 176 DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | 80 +++- DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 + DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf | 1 + 5 files changed, 391 insertions(+), 84 deletions(-) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92203): https://edk2.groups.io/g/devel/message/92203 Mute This Topic: https://groups.io/mt/92722838/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 6/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config
Hi Kun, Thank you for this patch. This change looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 This change added a switch case handling for PCI_SS_CONFIG during SSDT generation. This will allow PCI config case return EFI_SUCCESS instead of EFI_INVALID_PARAMETER. Cc: Sami Mujawar Cc: Alexei Fedorov Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Pierre Gondois --- Notes: v2: - Added Reviewed-by tag [Pierre] v3: - No change DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 5 + 1 file changed, 5 insertions(+) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c index 658a089c8f1f..740271b504ca 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c @@ -603,6 +603,11 @@ GeneratePciCrs ( ); break; + case PCI_SS_CONFIG: +// Do nothing +Status = EFI_SUCCESS; +break; + default: Status = EFI_INVALID_PARAMETER; } // switch -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92202): https://edk2.groups.io/g/devel/message/92202 Mute This Topic: https://groups.io/mt/92722844/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space
Hi Kun, Thank you for this patch. These changes look good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin via groups.io wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 Certain OSes will complain if the ECAM config space is not reserved in the ACPI namespace. This change adds a function to reserve PNP motherboard resources for a given PCI node. Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Pierre Gondois --- Notes: v2: - Only create RES0 after config space checking [Pierre] v3: - Updated function names and descriptions [Pierre] - Moved translation calculation to CONFIG case [Pierre] DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 171 1 file changed, 171 insertions(+) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c index ceffe2838c03..658a089c8f1f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c @@ -616,6 +616,169 @@ GeneratePciCrs ( return Status; } +/** Generate a RES0 device node to reserve PNP motherboard resources + for a given PCI node. + + @param [in] PciNode Parent PCI node handle of the generated + resource object. + @param [out] CrsNode CRS node of the AML tree to populate. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid input parameter. + @retval EFI_OUT_OF_RESOURCESCould not allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +GenerateMotherboardDevice ( + IN AML_OBJECT_NODE_HANDLE PciNode, + OUT AML_OBJECT_NODE_HANDLE *CrsNode + ) +{ + EFI_STATUS Status; + UINT32 EisaId; + AML_OBJECT_NODE_HANDLE ResNode; + + if (CrsNode == NULL) { +ASSERT (0); +return EFI_INVALID_PARAMETER; + } + + // ASL: Device (RES0) {} + Status = AmlCodeGenDevice ("RES0", PciNode, ); + if (EFI_ERROR (Status)) { +ASSERT (0); +return Status; + } + + // ASL: Name (_HID, EISAID ("PNP0C02")) + Status = AmlGetEisaIdFromString ("PNP0C02", ); /* PNP Motherboard Resources */ + if (EFI_ERROR (Status)) { +ASSERT (0); +return Status; + } + + Status = AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NULL); + if (EFI_ERROR (Status)) { +ASSERT (0); +return Status; + } + + // ASL: Name (_CRS, ResourceTemplate () {}) + Status = AmlCodeGenNameResourceTemplate ("_CRS", ResNode, CrsNode); + if (EFI_ERROR (Status)) { +ASSERT (0); +return Status; + } + + return Status; +} + +/** Reserves ECAM space for PCI config space + + @param [in] Generator The SSDT Pci generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager +Protocol interface. + @param [in] PciInfo Pci device information. + @param [in, out] PciNode RootNode of the AML tree to populate. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCESCould not allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +ReserveEcamSpace ( + INACPI_PCI_GENERATOR*Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo, + IN OUT AML_OBJECT_NODE_HANDLEPciNode + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE CrsNode; + BOOLEAN Translation; + UINT32 Index; + CM_ARM_OBJ_REF *RefInfo; + UINT32 RefCount; + CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo; + BOOLEAN IsPosDecode; + + // Get the array of CM_ARM_OBJ_REF referencing the + // CM_ARM_PCI_ADDRESS_MAP_INFO objects. + Status = GetEArmObjCmRef ( + CfgMgrProtocol, + PciInfo->AddressMapToken, + , + + ); + if (EFI_ERROR (Status)) { +ASSERT (0); +return Status; + } + + for (Index = 0; Index < RefCount; Index++) { +// Get CM_ARM_PCI_ADDRESS_MAP_INFO structures one by one. +Status = GetEArmObjPciAddressMapInfo ( + CfgMgrProtocol, + RefInfo[Index].ReferenceToken, + , + NULL + ); +if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; +} + +switch (AddrMapInfo->SpaceCode) { + case PCI_SS_CONFIG: +Translation = (AddrMapInfo->CpuAddress !=
Re: [edk2-devel] [PATCH v3 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables
Hi Kun, Thank you for this patch. Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 This change added an extra step to allow check for installed ACPI tables. For FADT, MADT, GTDT, DSDT, DBG2 and SPCR tables, either pre-installed or supplied through AcpiTableInfo can be accepted. An extra check for FADT ACPI table existence during installation step is also added. Cc: Sami Mujawar Cc: Alexei Fedorov Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Pierre Gondois --- Notes: v2: - Function description updates [Sami] - Refactorized the table verification [Pierre] v3: - Added descriptions for new structures [Pierre] - Added check for SDT protocol PCD before using it [Pierre] DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 214 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 + 2 files changed, 138 insertions(+), 80 deletions(-) diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c index ed62299f9bbd..7f3deef08a66 100644 --- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c @@ -10,6 +10,7 @@ #include #include #include +#include #include // Module specific include files. @@ -22,6 +23,58 @@ #include #include +/// +/// Bit definitions for acceptable ACPI table presence formats. +/// Currently only ACPI tables present in the ACPI info list and +/// already installed will count towards "Table Present" during +/// verification routine. +/// +#define ACPI_TABLE_PRESENT_INFO_LIST BIT0 +#define ACPI_TABLE_PRESENT_INSTALLED BIT1 + +/// +/// Order of ACPI table being verified during presence inspection. +/// +#define ACPI_TABLE_VERIFY_FADT 0 +#define ACPI_TABLE_VERIFY_MADT 1 +#define ACPI_TABLE_VERIFY_GTDT 2 +#define ACPI_TABLE_VERIFY_DSDT 3 +#define ACPI_TABLE_VERIFY_DBG2 4 +#define ACPI_TABLE_VERIFY_SPCR 5 +#define ACPI_TABLE_VERIFY_COUNT 6 + +/// +/// Private data structure to verify the presence of mandatory +/// or optional ACPI tables. +/// +typedef struct { + /// ESTD ID for the ACPI table of interest. + ESTD_ACPI_TABLE_IDEstdTableId; + /// Standard UINT32 ACPI signature. + UINT32AcpiTableSignature; + /// 4 character ACPI table name (the 5th char8 is for null terminator). + CHAR8 AcpiTableName[sizeof (UINT32) + 1]; + /// Indicator on whether the ACPI table is required. + BOOLEAN IsMandatory; + /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_* + /// This field should be initialized to 0 and will be populated during + /// verification routine. + UINT16Presence; +} ACPI_TABLE_PRESENCE_INFO; + +/// +/// We require the FADT, MADT, GTDT and the DSDT tables to boot. +/// This list also include optional ACPI tables: DBG2, SPCR. +/// +ACPI_TABLE_PRESENCE_INFO mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] = { + { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, "FADT", TRUE, 0 }, + { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, "MADT", TRUE, 0 }, + { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, "GTDT", TRUE, 0 }, + { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, "DSDT", TRUE, 0 }, + { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, "DBG2", FALSE, 0 }, + { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, "SPCR", FALSE, 0 }, +}; + /** This macro expands to a function that retrieves the ACPI Table List from the Configuration Manager. */ @@ -395,6 +448,7 @@ BuildAndInstallAcpiTable ( @retval EFI_SUCCESS Success. @retval EFI_NOT_FOUND If mandatory table is not found. + @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo is already installed. **/ STATIC EFI_STATUS @@ -404,75 +458,71 @@ VerifyMandatoryTablesArePresent ( IN UINT32 AcpiTableCount ) { - EFI_STATUS Status; - BOOLEAN FadtFound; - BOOLEAN MadtFound; - BOOLEAN GtdtFound; - BOOLEAN DsdtFound; - BOOLEAN Dbg2Found; - BOOLEAN SpcrFound; + EFI_STATUS Status; + UINTNHandle; + UINTNIndex; + UINTNInstalledTableIndex; + EFI_ACPI_DESCRIPTION_HEADER *DescHeader; + EFI_ACPI_TABLE_VERSION Version; +
Re: [edk2-devel] [PATCH 2/2] CloudHv/arm: switch PeiMemLib to its own
Hi Jianyong, Thank you for this patch. This change looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 29/07/2022 08:21 am, Jianyong Wu wrote: As Cloud Hypervisor has its own PeiMemLib, change it in dsc file accordingly. Signed-off-by: Jianyong Wu --- ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc index 7559386a1d..7ca7a391d9 100644 --- a/ArmVirtPkg/ArmVirtCloudHv.dsc +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc @@ -60,7 +60,7 @@ !include MdePkg/MdeLibs.dsc.inc [LibraryClasses.common.PEIM] - ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf + ArmVirtMemInfoLib|ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf [LibraryClasses.common.DXE_DRIVER] ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92199): https://edk2.groups.io/g/devel/message/92199 Mute This Topic: https://groups.io/mt/92686350/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/2] CloudHv/arm: add PeiMemInfoLib
Hi Jianyong, Thank you for this patch. Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 29/07/2022 08:21 am, Jianyong Wu wrote: Memory layout in CLoud Hypervisor for arm is changed and is different with Qemu, thus we should build its own PeiMemInfoLib. The main change in the memory layout is that normal ram may not contiguous under 4G. The top 64M under 4G is reserved for 32bit device. What this patch does: 1. get all of the memory node from DT; 2. Init page table for each memory node; 3. Add all of the memory nodes to Hob; Signed-off-by: Jianyong Wu --- .../CloudHvVirtMemInfoLib.c | 251 ++ .../CloudHvVirtMemInfoPeiLib.inf | 46 2 files changed, 297 insertions(+) create mode 100755 ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c create mode 100755 ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf diff --git a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c new file mode 100755 index 00..7ae24641d3 --- /dev/null +++ b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c @@ -0,0 +1,251 @@ +/** @file + + Copyright (c) 2022, Arm Limited. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +// The first memnory node is the one whose base address is the lowest. +UINT64 FirMemNodeBase = 0, FirMemNodeSize = 0; [SAMI] Is it possible to move the above variables within the scope of CloudHvVirtMemInfoPeiLibConstructor() ? +// +// Cloud Hypervisor may have more than one memory nodes. Even there is no limit for that, +// I think 10 is enough in general. +// +#define CLOUDHV_MAX_MEM_NODE_NUM 10 + +// Record memory node info (base address and size) +struct CloudHvMemNodeInfo { + UINT64 Base; + UINT64 Size; +}; [SAMI] The edk2 coding guidelines require definition of a typedef for structures, see section 5.6.3.[1,2,3] at https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5_source_files/56_declarations_and_types#5.6.3.1-structures-shall-not-be-directly-declared. + +struct CloudHvMemNodeInfo CloudHvMemNode[CLOUDHV_MAX_MEM_NODE_NUM]; + +RETURN_STATUS +EFIAPI +CloudHvVirtMemInfoPeiLibConstructor ( + VOID + ) +{ + VOID *DeviceTreeBase; + EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes; + INT32 Node, Prev; + UINT64 CurBase, MemBase; + UINT64 CurSize; + CONST CHAR8*Type; + INT32 Len; + CONST UINT64 *RegProp; + RETURN_STATUS PcdStatus; + UINT8 Index; + + ZeroMem (CloudHvMemNode, sizeof(CloudHvMemNode[0]) * CLOUDHV_MAX_MEM_NODE_NUM); [SAMI] Will sizeof (CloudHvMemNode) should be sufficient above? Also can you run uncrustify on your patches, please? + + Index = 0; + MemBase = FixedPcdGet64 (PcdSystemMemoryBase); + ResourceAttributes = ( +EFI_RESOURCE_ATTRIBUTE_PRESENT | +EFI_RESOURCE_ATTRIBUTE_INITIALIZED | +EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | +EFI_RESOURCE_ATTRIBUTE_TESTED +); + DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress); + ASSERT (DeviceTreeBase != NULL); + + // + // Make sure we have a valid device tree blob + // + ASSERT (fdt_check_header (DeviceTreeBase) == 0); [SAMI] I think the two ASSERTs above must return an error, otherwise they would result in a crash in release builds. + + // + // Look for the lowest memory node + // + for (Prev = 0; ; Prev = Node) { +Node = fdt_next_node (DeviceTreeBase, Prev, NULL); +if (Node < 0) { + break; +} + +// +// Check for memory node +// +Type = fdt_getprop (DeviceTreeBase, Node, "device_type", ); +if (Type && (AsciiStrnCmp (Type, "memory", Len) == 0)) { + // + // Get the 'reg' property of this node. For now, we will assume + // two 8 byte quantities for base and size, respectively. + // + RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", ); + if ((RegProp != 0) && (Len == (2 * sizeof (UINT64 { +CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp)); +CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); + +DEBUG (( + DEBUG_INFO, + "%a: System RAM @ 0x%lx - 0x%lx\n", + __FUNCTION__, + CurBase, + CurBase + CurSize - 1 + )); + +if (CurBase == MemBase) { +FirMemNodeBase = CurBase; +FirMemNodeSize = CurSize; +} + +CloudHvMemNode[Index].Base = CurBase; +CloudHvMemNode[Index].Size = CurSize; +Index++; +// We should build Hob seperately for the memory node except the first one +if (CurBase != MemBase) { [SAMI] Can this be made an
Re: [edk2-devel] [PATCH v1 0/5] Add support to build PRM for AARCH64 using GCC
Hi Michael, Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 04/08/2022 05:09 am, Michael Kubacki wrote: For the series: Reviewed-by: Michael Kubacki The patch formatting seems a little strange: 1. The patches don't have "Cc" lines. [SAMI] I have not been following the convention to add Cc lines to the patches. However, I will start from the next patch series. 2. What is this GUID message at the bottom of each patch? 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' [SAMI] I have added this so that I can easily search my patches. It does not affect the patch though. By the way, I tested the AARCH64 PRM build with sample modules on VS2019 a while back, so I see that you mentioned only testing GCC (thanks for helping get the functions in the export table there) but it should work in VS as well. [SAMI] I have tried building PrmPkg with VS2019 and found that the AARCH64 builds do not work. "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\bin\Hostx86\arm64\armasm64.exe" /Fow:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.obj /nologo /g /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe\AArch64 /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe\Arm /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe\AArch64 /Iw:\edk2-exports\edk2\MdePkg\Library\BaseMemoryLibOptDxe /Iw:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\DEBUG /Iw:\edk2-exports\edk2\MdePkg /Iw:\edk2-exports\edk2\MdePkg\Include /Iw:\edk2-exports\edk2\MdePkg\Test\UnitTest\Include /Iw:\edk2-exports\edk2\MdePkg\Include\AArch64 w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid. w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(7) : error A2034: unknown opcode: . .text w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(8) : error A2034: unknown opcode: . .align 5 w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(9) : error A2034: unknown opcode: InternalMemCompareGuid ASM_GLOBAL InternalMemCompareGuid w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(13) : error A2173: syntax error in expression cbz x1, 0f w:\edk2-exports\Build\Prm\DEBUG_VS2019\AARCH64\MdePkg\Library\BaseMemoryLibOptDxe\BaseMemoryLibOptDxe\OUTPUT\AArch64\CompareGuid.(19) : warning A4045: missing END directive ret NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\bin\Hostx86\arm64\armasm64.exe"' : return code '0x1' Stop. Can you please let me know if this is a configuration/environment issue or the AARCH64 assembly files need to be ported for Visual Studio? I have tried building other Arm packages and though the assembler files need porting, which I believe has been done as part of ProjectMu (https://github.com/microsoft/mu_silicon_arm_tiano). It would be good to have AARCH64 builds of edk2 with Visual Studio as this would allow to use the VS static analysis tool. Can you let me know if you have any plans to enable this support in Tianocore\edk2 project, please? [/SAMI] Regards, Michael On 8/3/2022 10:35 AM, Sami Mujawar wrote: This patch series adds support to build PRM for AARCH64 using GCC. The changes can be seen at: https://github.com/samimujawar/edk2/tree/2238_aarch64_prm_support_v1 Jose Marinho (5): Basetools/GenFw: Allow AARCH64 builds to use the --prm flag PrmPkg: Enable external visibility on PRM symbols PrmPkg: Build Prm Samples with GCC for AARCH64 PrmPkg: Support AArch64 builds using GCC PrmPkg: Add details on AArch64 build to the Readme. BaseTools/Source/C/GenFw/Elf64Convert.c | 6 ++--- PrmPkg/Include/Prm.h | 3 +++ PrmPkg/PrmPkg.ci.yaml | 1 + PrmPkg/PrmPkg.dsc | 24 +--- PrmPkg/Readme.md | 11 + PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf | 4 PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf | 4 7 files changed, 47 insertions(+), 6 deletions(-) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92196): https://edk2.groups.io/g/devel/message/92196 Mute This Topic: https://groups.io/mt/92793389/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 0/5] Add support to build PRM for AARCH64 using GCC
Hi Michael, Please find the link for the pull request with the review tags updated at https://github.com/tianocore/edk2/pull/3183 Regards, Sami Mujawar On 05/08/2022 04:08 pm, Michael Kubacki wrote: Hi Sami, I see you created a PR that is marked as draft with these changes: https://github.com/tianocore/edk2/pull/3167 When you're ready for them to be submitted, if you could please create a non-draft PR with the review tags added, I'd be happy to push it. Thanks, Michael On 8/3/2022 10:35 AM, Sami Mujawar wrote: This patch series adds support to build PRM for AARCH64 using GCC. The changes can be seen at: https://github.com/samimujawar/edk2/tree/2238_aarch64_prm_support_v1 Jose Marinho (5): Basetools/GenFw: Allow AARCH64 builds to use the --prm flag PrmPkg: Enable external visibility on PRM symbols PrmPkg: Build Prm Samples with GCC for AARCH64 PrmPkg: Support AArch64 builds using GCC PrmPkg: Add details on AArch64 build to the Readme. BaseTools/Source/C/GenFw/Elf64Convert.c | 6 ++--- PrmPkg/Include/Prm.h | 3 +++ PrmPkg/PrmPkg.ci.yaml | 1 + PrmPkg/PrmPkg.dsc | 24 +--- PrmPkg/Readme.md | 11 + PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf | 4 PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf | 4 7 files changed, 47 insertions(+), 6 deletions(-) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92195): https://edk2.groups.io/g/devel/message/92195 Mute This Topic: https://groups.io/mt/92793389/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms: PATCH] Modify processor _UID ordering by CPU default fused in MADT
BIOS should not reordering cpu processor_uid Signed-off-by: JackX Lin Cc: Chasel Chiu Cc: Dong Eric Cc: Jiewen Yao Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Donald Kuo Cc: Chandana C Kumar Cc: Palakshareddy, Lavanya C Cc: JackX Lin --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 174 +++--- 1 file changed, 39 insertions(+), 135 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index c7e87cbd7d..176e422e81 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -57,38 +57,9 @@ BOOLEAN mForceX2ApicId; BOOLEAN mX2ApicEnabled; EFI_MP_SERVICES_PROTOCOL*mMpService; -BOOLEAN mCpuOrderSorted; -EFI_CPU_ID_ORDER_MAP*mCpuApicIdOrderTable = NULL; UINTN mNumberOfCpus = 0; UINTN mNumberOfEnabledCPUs = 0; - -/** - The function is called by PerformQuickSort to compare int values. - - @param[in] LeftThe pointer to first buffer. - @param[in] Right The pointer to second buffer. - - @return -1 Buffer1 is less than Buffer2. - @return 1 Buffer1 is greater than Buffer2. - -**/ -INTN -EFIAPI -ApicIdCompareFunction ( - IN CONST VOID *Left, - IN CONST VOID *Right - ) -{ - UINT32 LeftApicId; - UINT32 RightApicId; - - LeftApicId = ((EFI_CPU_ID_ORDER_MAP *) Left)->ApicId; - RightApicId = ((EFI_CPU_ID_ORDER_MAP *) Right)->ApicId; - - return (LeftApicId > RightApicId)? 1 : (-1); -} - /** Print Cpu Apic ID Table @@ -116,7 +87,8 @@ DebugDisplayReOrderTable ( EFI_STATUS AppendCpuMapTableEntry ( IN VOID *ApicPtr, -IN UINT32 LocalApicCounter +IN UINT32 LocalApicCounter, +IN EFI_CPU_ID_ORDER_MAP *CpuApicIdOrderTable ) { EFI_STATUSStatus; @@ -131,9 +103,9 @@ AppendCpuMapTableEntry ( if(Type == EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC) { if(!mX2ApicEnabled) { - LocalApicPtr->Flags= (UINT8)mCpuApicIdOrderTable[LocalApicCounter].Flags; - LocalApicPtr->ApicId = (UINT8)mCpuApicIdOrderTable[LocalApicCounter].ApicId; - LocalApicPtr->AcpiProcessorUid = (UINT8)mCpuApicIdOrderTable[LocalApicCounter].AcpiProcessorUid; + LocalApicPtr->Flags= (UINT8)CpuApicIdOrderTable[LocalApicCounter].Flags; + LocalApicPtr->ApicId = (UINT8)CpuApicIdOrderTable[LocalApicCounter].ApicId; + LocalApicPtr->AcpiProcessorUid = (UINT8)CpuApicIdOrderTable[LocalApicCounter].AcpiProcessorUid; } else { LocalApicPtr->Flags= 0; LocalApicPtr->ApicId = 0xFF; @@ -142,9 +114,9 @@ AppendCpuMapTableEntry ( } } else if(Type == EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC) { if(mX2ApicEnabled) { - LocalX2ApicPtr->Flags= (UINT8)mCpuApicIdOrderTable[LocalApicCounter].Flags; - LocalX2ApicPtr->X2ApicId = mCpuApicIdOrderTable[LocalApicCounter].ApicId; - LocalX2ApicPtr->AcpiProcessorUid = mCpuApicIdOrderTable[LocalApicCounter].AcpiProcessorUid; + LocalX2ApicPtr->Flags= (UINT8)CpuApicIdOrderTable[LocalApicCounter].Flags; + LocalX2ApicPtr->X2ApicId = CpuApicIdOrderTable[LocalApicCounter].ApicId; + LocalX2ApicPtr->AcpiProcessorUid = CpuApicIdOrderTable[LocalApicCounter].AcpiProcessorUid; } else { LocalX2ApicPtr->Flags= 0; LocalX2ApicPtr->X2ApicId = (UINT32)-1; @@ -159,32 +131,25 @@ AppendCpuMapTableEntry ( } +/** + Collect all processors information and create a Cpu Apic Id table. + + @param[in] CpuApicIdOrderTable Buffer to store information of Cpu. +**/ EFI_STATUS -SortCpuLocalApicInTable ( - VOID +CreateCpuLocalApicInTable ( + IN EFI_CPU_ID_ORDER_MAP *CpuApicIdOrderTable ) { EFI_STATUSStatus; EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer; UINT32Index; UINT32CurrProcessor; - UINT32BspApicId; - EFI_CPU_ID_ORDER_MAP TempVal; EFI_CPU_ID_ORDER_MAP *CpuIdMapPtr; - UINT32CoreThreadMask; - EFI_CPU_ID_ORDER_MAP *TempCpuApicIdOrderTable; UINT32Socket; - Index = 0; Status = EFI_SUCCESS; - if (mCpuOrderSorted) { -return Status; - } - - TempCpuApicIdOrderTable = AllocateZeroPool (mNumberOfCpus * sizeof (EFI_CPU_ID_ORDER_MAP)); - CoreThreadMask = (UINT32) ((1 <<
Re: [edk2-devel] [edk2-platforms:PATCH] Modify processor _UID ordering by CPU default fused in MADT
Hi Ray, Sure, I will complete all these below. Thank you. Jack -Original Message- From: Ni, Ray Sent: Friday, August 5, 2022 2:43 PM To: Lin, JackX ; devel@edk2.groups.io Cc: Chiu, Chasel ; Dong, Eric ; Yao, Jiewen ; Chaganty, Rangasai V ; Kuo, Donald ; Kumar, Chandana C ; Palakshareddy, Lavanya C ; Palakshareddy, Lavanya C Subject: RE: [edk2-platforms:PATCH] Modify processor _UID ordering by CPU default fused in MADT Jack, The patch removes all the sorting logic. It simplifies the logic a lot. Thanks for that! ACPI spec " 5.2.12.1 MADT Processor Local APIC / SAPIC Structure Entry Order" talked about why the BSP needs to be in the first entry of MADT and why first logical processor of each core needs to be before second logical processor. With the reasons, I totally agree that we don't need to sort the MADT any more after the hyper-threading and many-core support have been enabled for quite a long time in OS. Some minor comments: 1. Can you check if "CoreThreadMask" can be removed? 2. Can you please rename the SortCpuLocalApicInTable? Maybe just use "CreateCpuLocalApicInTable"? There is no sorting any more 3. Can you please check if " mCpuOrderSorted" is needed? It's needed when the function is called multiple times. 4. If it's needed, can you please rename it to "mCpuLocalApicInTableCreated"? 5. If it's not needed, can you please think about if " mCpuApicIdOrderTable" can be changed to a local variable? Thanks, Ray > -Original Message- > From: Lin, JackX > Sent: Thursday, July 28, 2022 3:25 PM > To: devel@edk2.groups.io > Cc: Lin, JackX ; Lin, JackX > ; Chiu, Chasel ; Dong, > Eric ; Yao, Jiewen ; Ni, > Ray ; Chaganty, Rangasai V > ; Kuo, Donald ; > Kumar, Chandana C ; Palakshareddy; > Palakshareddy, Lavanya C > Subject: [edk2-platforms:PATCH] Modify processor _UID ordering by CPU > default fused in MADT > > BIOS should not reordering cpu processor_uid > > Signed-off-by: JackX Lin > Cc: Chasel Chiu > Cc: Dong Eric > Cc: Jiewen Yao > Cc: Ray Ni > Cc: Rangasai V Chaganty > Cc: Donald Kuo > Cc: Chandana C Kumar > Cc: Palakshareddy, Lavanya C > Cc: JackX Lin > --- > Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 99 > --- > -- > -- > 1 file changed, 4 insertions(+), 95 deletions(-) > > diff --git > a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > index c7e87cbd7d..d0e8891918 100644 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > @@ -62,33 +62,6 @@ EFI_CPU_ID_ORDER_MAP*mCpuApicIdOrderTable > = NULL; > UINTN mNumberOfCpus = 0; > UINTN mNumberOfEnabledCPUs = 0; > > - > -/** > - The function is called by PerformQuickSort to compare int values. > - > - @param[in] LeftThe pointer to first buffer. > - @param[in] Right The pointer to second buffer. > - > - @return -1 Buffer1 is less than Buffer2. > - @return 1 Buffer1 is greater than Buffer2. > - > -**/ > -INTN > -EFIAPI > -ApicIdCompareFunction ( > - IN CONST VOID *Left, > - IN CONST VOID *Right > - ) > -{ > - UINT32 LeftApicId; > - UINT32 RightApicId; > - > - LeftApicId = ((EFI_CPU_ID_ORDER_MAP *) Left)->ApicId; > - RightApicId = ((EFI_CPU_ID_ORDER_MAP *) Right)->ApicId; > - > - return (LeftApicId > RightApicId)? 1 : (-1); -} > - > /** >Print Cpu Apic ID Table > > @@ -168,21 +141,16 @@ SortCpuLocalApicInTable ( >EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer; >UINT32Index; >UINT32CurrProcessor; > - UINT32BspApicId; > - EFI_CPU_ID_ORDER_MAP TempVal; >EFI_CPU_ID_ORDER_MAP *CpuIdMapPtr; >UINT32CoreThreadMask; > - EFI_CPU_ID_ORDER_MAP *TempCpuApicIdOrderTable; >UINT32Socket; > > - Index = 0; >Status = EFI_SUCCESS; > >if (mCpuOrderSorted) { > return Status; >} > > - TempCpuApicIdOrderTable = AllocateZeroPool (mNumberOfCpus * sizeof > (EFI_CPU_ID_ORDER_MAP)); >CoreThreadMask = (UINT32) ((1 << mNumOfBitShift) - 1); > >for (CurrProcessor = 0, Index = 0; CurrProcessor < mNumberOfCpus; > CurrProcessor++, Index++) { > @@ -192,7 +160,7 @@ SortCpuLocalApicInTable ( > > ); > > -CpuIdMapPtr = (EFI_CPU_ID_ORDER_MAP *) > [Index]; > +CpuIdMapPtr = (EFI_CPU_ID_ORDER_MAP *) > [Index]; > if ((ProcessorInfoBuffer.StatusFlag & PROCESSOR_ENABLED_BIT) != 0) { >
Re: [edk2-devel] [PATCH 1/2] CloudHv/arm: add PeiMemInfoLib
+cc: Ard Biesheuvel, Leif Lindholm, Gerd Hoffmann > -Original Message- > From: devel@edk2.groups.io On Behalf Of Jianyong > Wu via groups.io > Sent: Friday, July 29, 2022 3:22 PM > To: devel@edk2.groups.io; Sami Mujawar > Cc: ard.biesheu...@linaro.org; Justin He ; Jianyong > Wu > Subject: [edk2-devel] [PATCH 1/2] CloudHv/arm: add PeiMemInfoLib > > Memory layout in CLoud Hypervisor for arm is changed and is different with > Qemu, thus we should build its own PeiMemInfoLib. > The main change in the memory layout is that normal ram may not > contiguous under 4G. The top 64M under 4G is reserved for 32bit device. > > What this patch does: > 1. get all of the memory node from DT; > 2. Init page table for each memory node; 3. Add all of the memory nodes to > Hob; > > Signed-off-by: Jianyong Wu > --- > .../CloudHvVirtMemInfoLib.c | 251 ++ > .../CloudHvVirtMemInfoPeiLib.inf | 46 > 2 files changed, 297 insertions(+) > create mode 100755 > ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c > create mode 100755 > ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf > > diff --git > a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c > b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c > new file mode 100755 > index 00..7ae24641d3 > --- /dev/null > +++ > b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c > @@ -0,0 +1,251 @@ > +/** @file > + > + Copyright (c) 2022, Arm Limited. All rights reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include #include > + > +#include > + > +// The first memnory node is the one whose base address is the lowest. > +UINT64 FirMemNodeBase = 0, FirMemNodeSize = 0; // // Cloud Hypervisor > +may have more than one memory nodes. Even there is no limit for that, > +// I think 10 is enough in general. > +// > +#define CLOUDHV_MAX_MEM_NODE_NUM 10 > + > +// Record memory node info (base address and size) struct > +CloudHvMemNodeInfo { > + UINT64 Base; > + UINT64 Size; > +}; > + > +struct CloudHvMemNodeInfo > CloudHvMemNode[CLOUDHV_MAX_MEM_NODE_NUM]; > + > +RETURN_STATUS > +EFIAPI > +CloudHvVirtMemInfoPeiLibConstructor ( > + VOID > + ) > +{ > + VOID *DeviceTreeBase; > + EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes; > + INT32 Node, Prev; > + UINT64 CurBase, MemBase; > + UINT64 CurSize; > + CONST CHAR8*Type; > + INT32 Len; > + CONST UINT64 *RegProp; > + RETURN_STATUS PcdStatus; > + UINT8 Index; > + > + ZeroMem (CloudHvMemNode, sizeof(CloudHvMemNode[0]) * > + CLOUDHV_MAX_MEM_NODE_NUM); > + > + Index = 0; > + MemBase = FixedPcdGet64 (PcdSystemMemoryBase); ResourceAttributes > = > + ( > +EFI_RESOURCE_ATTRIBUTE_PRESENT | > +EFI_RESOURCE_ATTRIBUTE_INITIALIZED | > +EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | > +EFI_RESOURCE_ATTRIBUTE_TESTED > +); > + DeviceTreeBase = (VOID *)(UINTN)PcdGet64 > + (PcdDeviceTreeInitialBaseAddress); > + ASSERT (DeviceTreeBase != NULL); > + > + // > + // Make sure we have a valid device tree blob // ASSERT > + (fdt_check_header (DeviceTreeBase) == 0); > + > + // > + // Look for the lowest memory node > + // > + for (Prev = 0; ; Prev = Node) { > +Node = fdt_next_node (DeviceTreeBase, Prev, NULL); > +if (Node < 0) { > + break; > +} > + > +// > +// Check for memory node > +// > +Type = fdt_getprop (DeviceTreeBase, Node, "device_type", ); > +if (Type && (AsciiStrnCmp (Type, "memory", Len) == 0)) { > + // > + // Get the 'reg' property of this node. For now, we will assume > + // two 8 byte quantities for base and size, respectively. > + // > + RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", ); > + if ((RegProp != 0) && (Len == (2 * sizeof (UINT64 { > +CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp)); > +CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); > + > +DEBUG (( > + DEBUG_INFO, > + "%a: System RAM @ 0x%lx - 0x%lx\n", > + __FUNCTION__, > + CurBase, > + CurBase + CurSize - 1 > + )); > + > +if (CurBase == MemBase) { > +FirMemNodeBase = CurBase; > +FirMemNodeSize = CurSize; > +} > + > +CloudHvMemNode[Index].Base = CurBase; > +CloudHvMemNode[Index].Size = CurSize; > +Index++; > +// We should build Hob seperately for the memory node except the > first one > +if (CurBase != MemBase) { > + BuildResourceDescriptorHob ( > +EFI_RESOURCE_SYSTEM_MEMORY, > +ResourceAttributes, > +CurBase, > +CurSize > +
Re: [edk2-devel] [PATCH 2/2] CloudHv/arm: switch PeiMemLib to its own
+cc: Ard Biesheuvel, Leif Lindholm, Gerd Hoffmann > -Original Message- > From: devel@edk2.groups.io On Behalf Of Jianyong > Wu via groups.io > Sent: Friday, July 29, 2022 3:22 PM > To: devel@edk2.groups.io; Sami Mujawar > Cc: ard.biesheu...@linaro.org; Justin He ; Jianyong > Wu > Subject: [edk2-devel] [PATCH 2/2] CloudHv/arm: switch PeiMemLib to its own > > As Cloud Hypervisor has its own PeiMemLib, change it in dsc file accordingly. > > Signed-off-by: Jianyong Wu > --- > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc > b/ArmVirtPkg/ArmVirtCloudHv.dsc index 7559386a1d..7ca7a391d9 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -60,7 +60,7 @@ > !include MdePkg/MdeLibs.dsc.inc > > [LibraryClasses.common.PEIM] > - > ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMe > mInfoPeiLib.inf > + > + > ArmVirtMemInfoLib|ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVi > rt > + MemInfoPeiLib.inf > > [LibraryClasses.common.DXE_DRIVER] > > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/Dxe > ReportStatusCodeLib.inf > -- > 2.17.1 > > > > > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92191): https://edk2.groups.io/g/devel/message/92191 Mute This Topic: https://groups.io/mt/92887204/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/2] CloudHv/arm: Add specific mem info lib
+cc: Ard Biesheuvel, Leif Lindholm, Gerd Hoffmann > -Original Message- > From: devel@edk2.groups.io On Behalf Of Jianyong > Wu via groups.io > Sent: Friday, July 29, 2022 3:22 PM > To: devel@edk2.groups.io; Sami Mujawar > Cc: ard.biesheu...@linaro.org; Justin He ; Jianyong > Wu > Subject: [edk2-devel] [PATCH 0/2] CloudHv/arm: Add specific mem info lib > > Currently, the meminfo lib for CloudHv/arm is reusing QEMU's. As the > memory layout for cloud hypervisor is changed, it needs a new meminfo lib. > > Signed-off-by: Jianyong Wu > > Jianyong Wu (2): > CloudHv/arm: add PeiMemInfoLib > CloudHv/arm: switch PeiMemLib to its own > > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > .../CloudHvVirtMemInfoLib.c | 251 ++ > .../CloudHvVirtMemInfoPeiLib.inf | 46 > 3 files changed, 298 insertions(+), 1 deletion(-) create mode 100755 > ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c > create mode 100755 > ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf > > -- > 2.17.1 > > > > > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92189): https://edk2.groups.io/g/devel/message/92189 Mute This Topic: https://groups.io/mt/92686348/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-