Skip to content

Commit

Permalink
Merge branch 'master' into devel/cpu-hotplug-unplug
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Sep 13, 2024
2 parents 738c09f + ec18fa8 commit 2ee2726
Show file tree
Hide file tree
Showing 581 changed files with 21,205 additions and 8,427 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

steps:
- name: Apply Labels Based on PR Description
uses: github/issue-labeler@v3.1
uses: github/issue-labeler@v3.4
with:
configuration-path: .github/workflows/pr-labeler/regex.yml
enable-versioned-regex: 0
Expand Down
27 changes: 0 additions & 27 deletions .pytool/CISettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,20 @@ def __init__(self):
self.ActualTargets = []
self.ActualArchitectures = []
self.ActualToolChainTag = ""
self.UseBuiltInBaseTools = None
self.ActualScopes = None

# ####################################################################################### #
# Extra CmdLine configuration #
# ####################################################################################### #

def AddCommandLineOptions(self, parserObj):
group = parserObj.add_mutually_exclusive_group()
group.add_argument("-force_piptools", "--fpt", dest="force_piptools", action="store_true", default=False, help="Force the system to use pip tools")
group.add_argument("-no_piptools", "--npt", dest="no_piptools", action="store_true", default=False, help="Force the system to not use pip tools")

try:
codeql_helpers.add_command_line_option(parserObj)
except NameError:
pass

def RetrieveCommandLineOptions(self, args):
super().RetrieveCommandLineOptions(args)
if args.force_piptools:
self.UseBuiltInBaseTools = True
if args.no_piptools:
self.UseBuiltInBaseTools = False

try:
self.codeql = codeql_helpers.is_codeql_enabled_on_command_line(args)
Expand Down Expand Up @@ -176,24 +167,6 @@ def GetActiveScopes(self):

self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "")

is_linux = GetHostInfo().os.upper() == "LINUX"

if self.UseBuiltInBaseTools is None:
is_linux = GetHostInfo().os.upper() == "LINUX"
# try and import the pip module for basetools
try:
import edk2basetools
self.UseBuiltInBaseTools = True
except ImportError:
self.UseBuiltInBaseTools = False
pass

if self.UseBuiltInBaseTools == True:
scopes += ('pipbuild-unix',) if is_linux else ('pipbuild-win',)
logging.warning("Using Pip Tools based BaseTools")
else:
logging.warning("Falling back to using in-tree BaseTools")

try:
scopes += codeql_helpers.get_scopes(self.codeql)

Expand Down
5 changes: 5 additions & 0 deletions .pytool/Plugin/EccCheck/EccCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ def GetModifyDir(self, pkg: str, temp_diff_output: str) -> List[str]:
#
file_dir = os.path.dirname(file_path[-1])
#
# strip the prefix path till the package name
#
if pkg in file_dir:
file_dir = file_dir[file_dir.find(pkg):]
#
# Skip directory names that do not start with the package being scanned.
#
if file_dir.split('/')[0] != pkg:
Expand Down
3 changes: 3 additions & 0 deletions ArmPkg/ArmPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"PrEval": {
"DscPath": "ArmPkg.dsc",
},
## options defined .pytool/Plugin/LicenseCheck
"LicenseCheck": {
"IgnoreFiles": []
Expand Down
11 changes: 4 additions & 7 deletions ArmPkg/ArmPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,21 @@

OemMiscLib|ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf

[LibraryClasses.common.SEC]
# ARM platforms have SEC modules with standard entry points, so we can generically link StackCheckLib
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf

[LibraryClasses.ARM, LibraryClasses.AARCH64]
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf

[Components.common]
ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf
ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
Expand Down
3 changes: 0 additions & 3 deletions ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,5 @@
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf

NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf

[Components.common]
ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
2 changes: 1 addition & 1 deletion ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
#

#include <AsmMacroIoLibV8.h>
#include <AsmMacroLib.h>

#if !defined(__clang__)

Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
#

#include <AsmMacroIoLib.h>
#include <AsmMacroLib.h>
#include <Library/ArmLib.h>

// For the moment we assume this will run in SVC mode on ARMv7
Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ GetProcessorInfo (

CopyMem (
ProcessorInfoBuffer,
&mCpuMpData.CpuData[ProcessorIndex],
&mCpuMpData.CpuData[ProcessorIndex].Info,
sizeof (EFI_PROCESSOR_INFORMATION)
);
return EFI_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.text
.align 3

#include <AsmMacroIoLibV8.h>
#include <AsmMacroLib.h>
#include <IndustryStandard/ArmStdSmc.h>
#include <Library/ArmLib.h>

Expand Down
55 changes: 49 additions & 6 deletions ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ SetGcdMemorySpaceAttributes (
UINTN EndIndex;
EFI_PHYSICAL_ADDRESS RegionStart;
UINT64 RegionLength;
UINT64 Capabilities;

DEBUG ((
DEBUG_GCD,
Expand Down Expand Up @@ -146,14 +147,56 @@ SetGcdMemorySpaceAttributes (
RegionLength = MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - RegionStart;
}

// Always add RO, RP, and XP, as all memory is capable of supporting these types (they are software constructs,
// not hardware features) and they are critical to maintaining a security boundary.
Capabilities = MemorySpaceMap[Index].Capabilities | EFI_MEMORY_RO | EFI_MEMORY_RP | EFI_MEMORY_XP;

// Update GCD capabilities as these may have changed in the page table from the original GCD setting
// this follows the same pattern as x86 GCD and Page Table syncing
Status = gDS->SetMemorySpaceCapabilities (
RegionStart,
RegionLength,
Capabilities
);

if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"%a - failed to update GCD capabilities: 0x%llx on memory region: 0x%llx length: 0x%llx Status: %r\n",
__func__,
Capabilities,
RegionStart,
RegionLength,
Status
));

// If we fail to set capabilities, we should assert as this is a GCD internal error, but follow the previous
// behavior and try to set the attributes (which may or may not fail)
ASSERT_EFI_ERROR (Status);
}

//
// Set memory attributes according to MTRR attribute and the original attribute of descriptor
// Set memory attributes according to page table attributes and the original attributes of descriptor
//
gDS->SetMemorySpaceAttributes (
RegionStart,
RegionLength,
(MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK) | (MemorySpaceMap[Index].Capabilities & Attributes)
);
Status = gDS->SetMemorySpaceAttributes (
RegionStart,
RegionLength,
(MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK) | (Attributes & Capabilities)
);

if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"%a - failed to update GCD attributes: 0x%llx on memory region: 0x%llx length: 0x%llx Status: %r\n",
__func__,
Attributes,
RegionStart,
RegionLength,
Status
));

ASSERT_EFI_ERROR (Status);
}
}

return EFI_SUCCESS;
Expand Down
4 changes: 2 additions & 2 deletions ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ GenericWatchdogEntry (
goto UnregisterHandler;
}

WatchdogDisable ();

// Install the Timer Architectural Protocol onto a new handle
Handle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
Expand All @@ -413,8 +415,6 @@ GenericWatchdogEntry (
);
ASSERT_EFI_ERROR (Status);

WatchdogDisable ();

return EFI_SUCCESS;

UnregisterHandler:
Expand Down
33 changes: 0 additions & 33 deletions ArmPkg/Include/AsmMacroIoLib.inc

This file was deleted.

14 changes: 10 additions & 4 deletions ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ MicroSecondDelay (
{
UINT64 TimerTicks64;
UINT64 SystemCounterVal;
UINT64 PreviousSystemCounterVal;
UINT64 DeltaCounterVal;

// Calculate counter ticks that represent requested delay:
// = MicroSeconds x TICKS_PER_MICRO_SEC
Expand All @@ -75,13 +77,17 @@ MicroSecondDelay (
);

// Read System Counter value
SystemCounterVal = ArmGenericTimerGetSystemCount ();

TimerTicks64 += SystemCounterVal;
PreviousSystemCounterVal = ArmGenericTimerGetSystemCount ();

// Wait until delay count expires.
while (SystemCounterVal < TimerTicks64) {
while (TimerTicks64 > 0) {
SystemCounterVal = ArmGenericTimerGetSystemCount ();
// Get how much we advanced this tick. Wrap around still has delta correct
DeltaCounterVal = (SystemCounterVal - PreviousSystemCounterVal)
& (MAX_UINT64 >> 8); // Account for a lesser (minimum) size
// Never wrap back around below zero by choosing the min and thus stop at 0
TimerTicks64 -= MIN (TimerTicks64, DeltaCounterVal);
PreviousSystemCounterVal = SystemCounterVal;
}

return MicroSeconds;
Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <AArch64/AArch64.h>
#include <Library/PcdLib.h>
#include <AsmMacroIoLibV8.h>
#include <AsmMacroLib.h>
#include <Protocol/DebugSupport.h> // for exception type definitions

/*
Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Library/ArmHvcLib/AArch64/ArmHvc.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//

#include <AsmMacroIoLibV8.h>
#include <AsmMacroLib.h>

ASM_FUNC(ArmCallHvc)
// Push x0 on the stack - The stack must always be quad-word aligned
Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//

#include <AsmMacroIoLib.h>
#include <AsmMacroLib.h>

.arch_extension virt

Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimerSupport.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
#------------------------------------------------------------------------------

#include <AsmMacroIoLibV8.h>
#include <AsmMacroLib.h>

ASM_FUNC(ArmReadCntFrq)
mrs x0, cntfrq_el0 // Read CNTFRQ
Expand Down
Loading

0 comments on commit 2ee2726

Please sign in to comment.