~kobuk-team/ubuntu/+source/edk2:main

Last commit made on 2023-08-28
Get this branch:
git clone -b main https://git.launchpad.net/~kobuk-team/ubuntu/+source/edk2
Members of The Kobuk team can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
main
Repository:
lp:~kobuk-team/ubuntu/+source/edk2

Recent commits

f5c177a... by dann frazier

Merge tag 'upstream/2023.08'

Upstream version 2023.08

9ef03af... by dann frazier

New upstream version 2023.08

819cfc6... by Qingyu Shang <email address hidden>

OvmfPkg/RiscVVirt: Fix issues in VarStore Blockmap config

The block size configuration of Blockmap does not match that in Qemu
VirtNorFlash, which causes variable data to be written into FtwWorkBlock
by mistake, resulting in data loss during reboot. Fix it and update
new checksum value.

Signed-off-by: Qingyu Shang <email address hidden>
Reviewed-by: Sunil V L <email address hidden>

00b51e0... by Oliver Smith-Denny <email address hidden>

MdeModulePkg: HeapGuard: Don't Assume Pool Head Allocated In First Page

Currently, HeapGuard, when in the GuardAlignedToTail mode, assumes that
the pool head has been allocated in the first page of memory that was
allocated. This is not the case for ARM64 platforms when allocating
runtime pools, as RUNTIME_PAGE_ALLOCATION_GRANULARITY is 64k, unlike
X64, which has RUNTIME_PAGE_ALLOCATION_GRANULARITY as 4k.

When a runtime pool is allocated on ARM64, the minimum number of pages
allocated is 16, to match the runtime granularity. When a small pool is
allocated and GuardAlignedToTail is true, HeapGuard instructs the pool
head to be placed as (MemoryAllocated + EFI_PAGES_TO_SIZE(Number of Pages)
- SizeRequiredForPool).

This gives this scenario:

|Head Guard|Large Free Number of Pages|PoolHead|TailGuard|

When this pool goes to be freed, HeapGuard instructs the pool code to
free from (PoolHead & ~EFI_PAGE_MASK). However, this assumes that the
PoolHead is in the first page allocated, which as shown above is not true
in this case. For the 4k granularity case (i.e. where the correct number of
pages are allocated for this pool), this logic does work.

In this failing case, HeapGuard then instructs the pool code to free 16
(or more depending) pages from the page the pool head was allocated on,
which as seen above means we overrun the pool and attempt to free memory
far past the pool. We end up running into the tail guard and getting an
access flag fault.

This causes ArmVirtQemu to fail to boot with an access flag fault when
GuardAlignedToTail is set to true (and pool guard enabled for runtime
memory). It should also cause all ARM64 platforms to fail in this
configuration, for exactly the same reason, as this is core code making
the assumption.

This patch removes HeapGuard's assumption that the pool head is allocated
on the first page and instead undoes the same logic that HeapGuard did
when allocating the pool head in the first place.

With this patch in place, ArmVirtQemu boots with GuardAlignedToTail
set to true (and when it is false, also).

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4521
Github PR: https://github.com/tianocore/edk2/pull/4731

Cc: Leif Lindholm <email address hidden>
Cc: Ard Biesheuvel <email address hidden>
Cc: Jian J Wang <email address hidden>
Cc: Liming Gao <email address hidden>
Cc: Dandan Bi <email address hidden>

Signed-off-by: Oliver Smith-Denny <email address hidden>
Reviewed-by: Ard Biesheuvel <email address hidden>
Acked-by: Leif Lindholm <email address hidden>
Reviewed-by: Liming Gao <email address hidden>

48089f3... by =?utf-8?q?Corvin_K=C3=B6hne?= <email address hidden>

OvmfPkg/Bhyve: build platform info HOB

Copy the function BuildPlatformInfoHob() from OvmfPkg/PlatformPei.

QemuFwCfgLib expect this HOB to be present, or fails to do anything.
InternalQemuFwCfgIsAvailable() from QemuFwCfgPeiLib module will not
check if the HOB is actually present for example and try to use a NULL
pointer.

Fixes: cda98df16228970dcf9a4ce2af5368219711b4b0 ("OvmfPkg/QemuFwCfgLib: remove mQemuFwCfgSupported + mQemuFwCfgDmaSupported")
Signed-off-by: Corvin Köhne <email address hidden>
Reviewed-by: Rebecca Cran <email address hidden>

eaffa1d... by YuanhaoXie <email address hidden>

UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.

The implementation of this new behavior aligns with the guidelines
outlined in the Intel SDM.

Following a power-up or RESET of an MP system, system hardware
dynamically selects one of the processors on the system bus as the BSP.
The remaining processors are designated as APs. The APs complete a
minimal self-configuration, then wait for a startup signal (a SIPI
message) from the BSP processor.

Additionally, the MP protocol is executed only after
a power-up or RESET. If the MP protocol has completed and a
BSP is chosen, subsequent INITs (either to a specific processor or
system wide) do not cause the MP protocol to be repeated. Instead, each
logical processor examines its BSP flag (in the IA32_APIC_BASE MSR) to
determine whether it should execute the BIOS boot-strap code (if it is
the BSP) or enter a wait-for-SIPI state (if it is an AP).

Cc: Eric Dong <email address hidden>
Cc: Ray Ni <email address hidden>
Cc: Rahul Kumar <email address hidden>
Cc: Gerd Hoffmann <email address hidden>
Signed-off-by: Ray Ni <email address hidden>
Signed-off-by: Yuanhao Xie <email address hidden>
Reviewed-by: Ray Ni <email address hidden>

1d76560... by YuanhaoXie <email address hidden>

OvmfPkg: Disable PcdFirstTimeWakeUpAPsBySipi.

Disable PcdFirstTimeWakeUpAPsBySipi for OVMF to let BSP wake up APs by
INIT-SIPI-SIPI.

Cc: Eric Dong <email address hidden>
Cc: Ray Ni <email address hidden>
Cc: Rahul Kumar <email address hidden>
Cc: Gerd Hoffmann <email address hidden>
Cc: Ard Biesheuvel <email address hidden>
Cc: Jiewen Yao <email address hidden>
Cc: Jordan Justen <email address hidden>
Signed-off-by: Yuanhao Xie <email address hidden>
Reviewed-by: Ray Ni <email address hidden>
Reviewed-by: Ard Biesheuvel <email address hidden>

98e9d29... by YuanhaoXie <email address hidden>

UefiCpuPkg: Add PcdFirstTimeWakeUpAPsBySipi

Add PcdFirstTimeWakeUpAPsBySipi to check if it is in the OVMF environment
 and necessary to wake up APs by INIT-SIPI-SIPI.

Cc: Eric Dong <email address hidden>
Cc: Ray Ni <email address hidden>
Cc: Rahul Kumar <email address hidden>
Cc: Gerd Hoffmann <email address hidden>
Signed-off-by: Yuanhao Xie <email address hidden>
Reviewed-by: Ray Ni <email address hidden>

055c7bd... by Yuanhao Xie <email address hidden>

UefiCpuPkg: Add SendStartupIpiAllExcludingSelf

Add new API SendStartupIpiAllExcludingSelf(), and modify
SendInitSipiSipiAllExcludingSelf() by let it call the new API.

Cc: Eric Dong <email address hidden>
Cc: Rahul Kumar <email address hidden>
Cc: Gerd Hoffmann <email address hidden>
Cc: Ray Ni <email address hidden>
Signed-off-by: Ray Ni <email address hidden>
Signed-off-by: Yuanhao Xie <email address hidden>
Reviewed-by: Ray Ni <email address hidden>

991515a... by Yi Li <email address hidden>

CryptoPkg: remove BN and EC accel for size optimization

BN and EC have not been fully tested, and will greatly increase
the size of the Crypto driver(>150KB).

Signed-off-by: Yi Li <email address hidden>
Cc: Jiewen Yao <email address hidden>
Cc: Xiaoyu Lu <email address hidden>
Cc: Guomin Jiang <email address hidden>
Reviewed-by: Jiewen Yao <email address hidden>
Acked-by: Ard Biesheuvel <email address hidden>
Tested-by: Ard Biesheuvel <email address hidden>
Tested-by: Brian J. Johnson <email address hidden>
Tested-by: Kenneth Lautner <email address hidden>