Skip to content

Commit

Permalink
Merge branch 'tianocore:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tqh authored Apr 7, 2023
2 parents c977ce9 + cdf6ff1 commit b24be1a
Show file tree
Hide file tree
Showing 441 changed files with 18,596 additions and 6,544 deletions.
2 changes: 1 addition & 1 deletion .azurepipelines/templates/platform-build-run-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ steps:
filename: stuart_build
arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} TARGET=${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}} ${{ parameters.run_flags }} --FlashOnly
condition: and(and(gt(variables.pkg_count, 0), succeeded()), eq(variables['Run'], true))
timeoutInMinutes: 1
timeoutInMinutes: 2

# Copy the build logs to the artifact staging directory
- task: CopyFiles@2
Expand Down
7 changes: 5 additions & 2 deletions .azurepipelines/templates/pr-gate-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ jobs:
TARGET_FMP_FAT_TEST:
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_CRYPTO:
TARGET_CRYPTO_DEBUG:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Targets: 'DEBUG,NOOPT'
TARGET_CRYPTO_RELEASE:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'RELEASE,NO-TARGET'
TARGET_FSP:
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Expand Down
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"image": "ghcr.io/tianocore/containers/fedora-35-dev:latest",
"postCreateCommand": "git config --global --add safe.directory * && pip install --upgrade -r pip-requirements.txt",
"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.remote-containers",
"ms-vscode.cpptools",
"walonli.edk2-vscode",
"zachflower.uncrustify"
]
}
}
}
10 changes: 10 additions & 0 deletions .github/codeql/edk2.qls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@

# Enable individual queries below.

- include:
id: cpp/conditionallyuninitializedvariable
- include:
id: cpp/infinite-loop-with-unsatisfiable-exit-condition
- include:
id: cpp/overflow-buffer
- include:
id: cpp/overrunning-write
- include:
id: cpp/overrunning-write-with-float
- include:
id: cpp/pointer-overflow-check
- include:
id: cpp/very-likely-overrunning-write
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ updates:
- "makubacki"
- "mdkinney"
- "spbrogan"
rebase-strategy: "disabled"

- package-ecosystem: "github-actions"
directory: "/"
Expand All @@ -32,3 +33,4 @@ updates:
- "makubacki"
- "mdkinney"
- "spbrogan"
rebase-strategy: "disabled"
66 changes: 44 additions & 22 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,45 @@ jobs:
strategy:
fail-fast: false
matrix:
package: [
"ArmPkg",
"CryptoPkg",
"DynamicTablesPkg",
"FatPkg",
"FmpDevicePkg",
"IntelFsp2Pkg",
"IntelFsp2WrapperPkg",
"MdeModulePkg",
"MdePkg",
"PcAtChipsetPkg",
"PrmPkg",
"SecurityPkg",
"ShellPkg",
"SourceLevelDebugPkg",
"StandaloneMmPkg",
"UefiCpuPkg",
"UnitTestFrameworkPkg"]

include:
- Package: "ArmPkg"
ArchList: "IA32,X64"
- Package: "CryptoPkg"
ArchList: "IA32"
- Package: "CryptoPkg"
ArchList: "X64"
- Package: "DynamicTablesPkg"
ArchList: "IA32,X64"
- Package: "FatPkg"
ArchList: "IA32,X64"
- Package: "FmpDevicePkg"
ArchList: "IA32,X64"
- Package: "IntelFsp2Pkg"
ArchList: "IA32,X64"
- Package: "IntelFsp2WrapperPkg"
ArchList: "IA32,X64"
- Package: "MdeModulePkg"
ArchList: "IA32"
- Package: "MdeModulePkg"
ArchList: "X64"
- Package: "MdePkg"
ArchList: "IA32,X64"
- Package: "PcAtChipsetPkg"
ArchList: "IA32,X64"
- Package: "PrmPkg"
ArchList: "IA32,X64"
- Package: "SecurityPkg"
ArchList: "IA32,X64"
- Package: "ShellPkg"
ArchList: "IA32,X64"
- Package: "SourceLevelDebugPkg"
ArchList: "IA32,X64"
- Package: "StandaloneMmPkg"
ArchList: "IA32,X64"
- Package: "UefiCpuPkg"
ArchList: "IA32,X64"
- Package: "UnitTestFrameworkPkg"
ArchList: "IA32,X64"
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -66,6 +86,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10.6'
cache: 'pip'
cache-dependency-path: 'pip-requirements.txt'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -81,16 +103,16 @@ jobs:
run: pip install -r pip-requirements.txt --upgrade

- name: Setup
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a IA32,X64 TOOL_CHAIN_TAG=VS2019
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019

- name: Update
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a IA32,X64 TOOL_CHAIN_TAG=VS2019
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019

- name: Build Tools From Source
run: python BaseTools/Edk2ToolsBuild.py -t VS2019

- name: CI Build
run: stuart_ci_build -c .pytool/CISettings.py -p ${{ matrix.package }} -t DEBUG -a IA32,X64 TOOL_CHAIN_TAG=VS2019
run: stuart_ci_build -c .pytool/CISettings.py -p ${{ matrix.Package }} -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
1 change: 0 additions & 1 deletion .mergify/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pull_request_rules:
actions:
queue:
method: rebase
rebase_fallback: none
name: default

- name: Post a comment on a PR that can not be merged due to a merge conflict
Expand Down
9 changes: 8 additions & 1 deletion .pytool/Plugin/EccCheck/EccCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM,
env.set_shell_var('PACKAGES_PATH', os.pathsep.join(Edk2pathObj.PackagePathList))
self.ECC_PASS = True

abs_pkg_path = Edk2pathObj.GetAbsolutePathOnThisSystemFromEdk2RelativePath(packagename)

if abs_pkg_path is None:
tc.SetSkipped()
tc.LogStdError("No Package folder {0}".format(abs_pkg_path))
return 0

# Create temp directory
temp_path = os.path.join(workspace_path, 'Build', '.pytool', 'Plugin', 'EccCheck')
try:
Expand All @@ -77,7 +84,7 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM,
shutil.rmtree(temp_path)
# Copy package being scanned to temp_path
shutil.copytree (
os.path.join(workspace_path, packagename),
abs_pkg_path,
os.path.join(temp_path, packagename),
symlinks=True
)
Expand Down
39 changes: 16 additions & 23 deletions ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,7 @@ ClockDescribeRates (
*TotalRates = NUM_RATES (DescribeRates->NumRatesFlags)
+ NUM_REMAIN_RATES (DescribeRates->NumRatesFlags);

if (*Format == ScmiClockRateFormatDiscrete) {
RequiredArraySize = (*TotalRates) * sizeof (UINT64);
} else {
// We need to return triplet of 64 bit value for each rate
RequiredArraySize = (*TotalRates) * 3 * sizeof (UINT64);
}
RequiredArraySize = (*TotalRates) * sizeof (UINT64);

if (RequiredArraySize > (*RateArraySize)) {
*RateArraySize = RequiredArraySize;
Expand All @@ -259,23 +254,21 @@ ClockDescribeRates (
ConvertTo64Bit (Rate->Low, Rate->High);
}
} else {
for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {
// Linear clock rates from minimum to maximum in steps
// Minimum clock rate.
Rate = &DescribeRates->Rates[RateOffset++];
RateArray[RateIndex].ContinuousRate.Min =
ConvertTo64Bit (Rate->Low, Rate->High);

Rate = &DescribeRates->Rates[RateOffset++];
// Maximum clock rate.
RateArray[RateIndex].ContinuousRate.Max =
ConvertTo64Bit (Rate->Low, Rate->High);

Rate = &DescribeRates->Rates[RateOffset++];
// Step.
RateArray[RateIndex++].ContinuousRate.Step =
ConvertTo64Bit (Rate->Low, Rate->High);
}
// Linear clock rates from minimum to maximum in steps
// Minimum clock rate.
Rate = &DescribeRates->Rates[RateOffset++];
RateArray[RateIndex].ContinuousRate.Min =
ConvertTo64Bit (Rate->Low, Rate->High);

Rate = &DescribeRates->Rates[RateOffset++];
// Maximum clock rate.
RateArray[RateIndex].ContinuousRate.Max =
ConvertTo64Bit (Rate->Low, Rate->High);

Rate = &DescribeRates->Rates[RateOffset++];
// Step.
RateArray[RateIndex++].ContinuousRate.Step =
ConvertTo64Bit (Rate->Low, Rate->High);
}
} while (NUM_REMAIN_RATES (DescribeRates->NumRatesFlags) != 0);

Expand Down
25 changes: 24 additions & 1 deletion ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ PageAttributeToGcdAttribute (
}

// Determine protection attributes
if ((PageAttributes & TT_AF) == 0) {
GcdAttributes |= EFI_MEMORY_RP;
}

if (((PageAttributes & TT_AP_MASK) == TT_AP_NO_RO) ||
((PageAttributes & TT_AP_MASK) == TT_AP_RO_RO))
{
Expand All @@ -79,6 +83,23 @@ PageAttributeToGcdAttribute (
return GcdAttributes;
}

/**
Convert an arch specific set of page attributes into a mask
of EFI_MEMORY_xx constants.
@param PageAttributes The set of page attributes.
@retval The mask of EFI_MEMORY_xx constants.
**/
UINT64
RegionAttributeToGcdAttribute (
IN UINTN PageAttributes
)
{
return PageAttributeToGcdAttribute (PageAttributes);
}

STATIC
UINT64
GetFirstPageAttribute (
Expand Down Expand Up @@ -301,7 +322,9 @@ EfiAttributeToArmAttribute (
}

// Set the access flag to match the block attributes
ArmAttributes |= TT_AF;
if ((EfiAttributes & EFI_MEMORY_RP) == 0) {
ArmAttributes |= TT_AF;
}

// Determine protection attributes
if ((EfiAttributes & EFI_MEMORY_RO) != 0) {
Expand Down
Loading

0 comments on commit b24be1a

Please sign in to comment.