1296 Commits

Author SHA1 Message Date
Mikhail Krichanov
d8204d9779 UserSpace: Fixed compilation after rebasing upon edk2-stable202502 tag. 2025-04-14 21:58:57 +03:00
Mikhail Krichanov
36b11d3852 DefaultExceptionHandlerLib/AArch64: Added selection of the correct stack
for DEBUG printings.
2025-04-14 13:14:52 +03:00
Mikhail Krichanov
d20d45ae9b Ring3: Fixed memory leaks and passed UserArguments to CallBootService
through User stack for ARM, AARCH64.
2025-04-14 13:12:14 +03:00
Mikhail Krichanov
213713f790 Ring3: Saved ReturnSP on SysCallStack. 2025-04-14 13:12:14 +03:00
Mikhail Krichanov
a37ef161b6 Ring3: Fixed line endings. 2025-04-14 13:12:14 +03:00
Mikhail Krichanov
f532beefbd Ring3: Placed UnicodeCollation driver into User space. 2025-04-14 13:12:14 +03:00
Mikhail Krichanov
7a0bb88360 Ring3: Fixed line endings. 2025-04-14 13:06:18 +03:00
Mikhail Krichanov
56d7030ede ArmPkg: Fixed compilation. 2025-04-14 13:05:05 +03:00
Mikhail Krichanov
f4244d8d44 Ring3: Added support for ARM User page table. 2025-04-14 13:05:05 +03:00
Mikhail Krichanov
1c10e31d45 ArmPkg: Added CpuSetUserMemoryAttributes() for ARM. 2025-04-14 13:05:05 +03:00
Mikhail Krichanov
b739cbd2b5 Ring3: Added MakeUserPageTableTemplate() for ARM. 2025-04-14 13:05:05 +03:00
Mikhail Krichanov
6a09c07791 ArmPkg: Refactored SVC handling. 2025-04-14 13:05:05 +03:00
Mikhail Krichanov
2ca7937d11 Ring3: Added support for AARCH64 User page table. 2025-04-14 13:05:02 +03:00
Mikhail Krichanov
5194b674c2 ArmPkg: Added CpuSetUserMemoryAttributes() for AARCH64. 2025-04-14 13:00:53 +03:00
Mikhail Krichanov
2a0b76c4b9 Ring3: Added MakeUserPageTableTemplate() for AARCH64. 2025-04-14 13:00:53 +03:00
Mikhail Krichanov
5fee574a51 ArmPkg: Disabled UserSpace by default to fix CI,
as WinPE and Linux EFI stub can not boot in
EL2&0 translation regime.
2025-04-14 12:48:31 +03:00
Mikhail Krichanov
a071d15784 Ring3: Added support for AARCH64 EL2&0 translation regime. 2025-04-14 12:38:38 +03:00
Mikhail Krichanov
97371df2b6 Ring3: Fixed PAN page faults. 2025-04-14 12:15:43 +03:00
Mikhail Krichanov
4968eac71c ArmLib: Added Instruction Synchronization Barriers for PAN changes. 2025-04-14 12:12:47 +03:00
Mikhail Krichanov
48f5f4f667 Ring3: Fixed buggy timer interrupt handling for AARCH64. 2025-04-14 12:12:47 +03:00
Mikhail Krichanov
b986642b37 ArmPkg/Library/CpuArchLib: Refactored ARM to UEFI attribute conversion. 2025-04-14 12:12:47 +03:00
Mikhail Krichanov
1e5fbf7b87 ArmPkg: Forbade user access to supervisor sections. 2025-04-14 12:12:47 +03:00
Mikhail Krichanov
116f43d49c ArmMmuLib: Worked around lack of EL2&0 translation support. 2025-04-14 12:12:47 +03:00
Mikhail Krichanov
7f308c22c5 Ring3: Fixed ArmPkg and ArmVirtPkg compilation. 2025-04-14 12:12:47 +03:00
Mikhail Krichanov
6b814aff5c Ring3: Fixed several bugs for ARM. 2025-04-14 12:09:42 +03:00
Mikhail Krichanov
76f2ff7259 Ring3: Defined SysCallBootService() for ARM. 2025-04-14 12:09:40 +03:00
Mikhail Krichanov
83fa7ac1d3 Ring3: Added EL0 support for ARM. 2025-04-14 12:07:09 +03:00
Mikhail Krichanov
51824c3409 Ring3: Added PAN support for ARM. 2025-04-14 12:07:06 +03:00
Mikhail Krichanov
ad5f4944d6 Ring3: Removed -mcpu=cortex-a76 option from tools_def.template. 2025-04-14 11:54:25 +03:00
Mikhail Krichanov
8104e4543c Ring3: Refactored SysCallBootService() out of EFI_BOOT_SERVICES. 2025-04-14 11:52:51 +03:00
Mikhail Krichanov
f8c379de5f Ring3: Defined SysCallReturnToCore for AARCH64,
forbade ExceptionHanlders to use EL0 stack.
2025-04-14 11:52:51 +03:00
Mikhail Krichanov
393298742c Ring3: Defined SysCallBootService() for AARCH64. 2025-04-14 11:52:48 +03:00
Mikhail Krichanov
e40c47a69c Ring3: Defined CallRing3() for AARCH64. 2025-04-14 11:49:21 +03:00
Mikhail Krichanov
9059d7330a Ring3: Defined CpuGetMemoryAttributes(), DisableSMAP(), EnableSMAP() for AARCH64. 2025-04-14 11:49:21 +03:00
Mikhail Krichanov
57eb712768 Ring3: Added EL0 and PAN support for AARCH64. 2025-04-14 11:49:18 +03:00
Mikhail Krichanov
992385e15e SecurePE: Defined new PcdImageProtectionPolicy. 2025-04-07 12:30:28 +03:00
Mikhail Krichanov
1fef202932 MdePkg/UefiImageLib: Introduce DebugAddress
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2025-04-07 12:24:27 +03:00
Mikhail Krichanov
e46d356fc9 MdePkg/UefiImageLib: Support multi-format and multi-source architecture
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2025-04-07 12:24:27 +03:00
Mikhail Krichanov
20dd836214 MdeModulePkg/Core/Dxe: Integrate CPU Architectural producer
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3223

In the current design, memory protection is not available till CpuDxe
is loaded. To resolve this, introduce CpuArchLib to move the
CPU Architectural initialization to DxeCore.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2025-04-07 12:23:28 +03:00
Mikhail Krichanov
bc87d7b430 Drop support for the TE format 2025-04-07 12:18:22 +03:00
Marvin Häuser
9e2b1a158f ArmPkg/ArmMmuLib: ASSERT ArmReplaceLiveTranslationEntry alignment 2025-04-07 12:18:22 +03:00
Mikhail Krichanov
09a0c067d0 SecurePE: Replaced old PE loader with Secure one. 2025-04-07 12:12:35 +03:00
Kun Qin
523dbb6d59 ArmPkg: ArmFfaStandaloneMmLib: Fix non-FFA path
ArmFfaLibCommonInit will return EFI_UNSUPPORTED when there is no FFA
supported on the platform. This is expected behavior. However, the return
of error code will incur program asserts.

This change fixed the non-FFA path for the Standalone MM instance.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-02-11 21:21:40 +00:00
Oliver Smith-Denny
efbf5ed08c MdePkg: Move StackCheckLibStaticInit to StackCheckLib
This commit oves StackCheckLib from a NULL lib to an instance of
StackCheckLib. This requires every entry point to add a library
dependency on StackCheckLib. It also requires every SEC module
to have a dependency on StackCheckLib because there is no
standard SEC entry point.

It allows for greater flexibility for a platform to apply stack
cookies and simplifies DSC logic.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Ard Biesheuvel
62cd7d338b ArmPkg: Retire ArmDisassemblerLib
No longer used anywhere so can be retired.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-31 13:50:45 +00:00
Ard Biesheuvel
ef80dd8fad ArmPkg: Stop using ArmDisassemblerLib
ArmDisassemblerLib is used to pretty print the instruction that
triggered an unhandled exception, but it was never implemented for
AARCH64, and according to the existing file comment, Thumb2 support
(which is used predominantly when building EDK2 for 32-bit ARM due to
its smaller size) is incomplete.

The DEBUG diagnostics that are produced on an unhandled exception are
generally sufficient to dump the entire executable that triggered it,
and so this disassembly is of limited value, especially because it
doesn't work on AARCH64.

So let's start getting rid of it, by dropping references to it in code
and in the various .INF and .DSC files. Once out-of-tree platforms have
been allowed to catch up, we can remove the library implementation and
its class definition entirely.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 16:01:56 +00:00
Leif Lindholm
74376f0b72 ArmPkg,ArmPkg/ArmExceptionLib: drop vector relocation variant/support
There were several bugs in the vector table relocation code which means
it can't really have been used by anyone on AArch64 in the last decade or
so. So delete the support code from the library, as well as the
ArmRelocateExceptionLib.inf file.

This gets rid of PcdDebuggerExceptionSupport (including a duff reference
in CpuDxe), PcdCpuVectorBaseAddress and PcdRelocateVectorTable.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-01-30 15:09:09 +00:00
Ard Biesheuvel
c558a3b18b ArmPkg/ArmGicDxe: Map GIC MMIO regions before use
The GIC driver itself has intimate knowledge of the hardware, and so it
is the best suited to create the mappings of the MMIO control regions,
in case they have not been mapped yet by the platform code.

So call in the the CPU arch protocol to map the CPU interface,
distributor and redistributor regions as they are discovered by the GIC
driver startup code.

Note that creating these mappings has no effect if the regions in
question have already been mapped with the correct attributes.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00
Ard Biesheuvel
3c4c7a0fc9 ArmPkg/ArmGicDxe: Remove pointless passing around of MMIO addresses
The GIC distributor and redistributor addresses that are passed into the
interrupt enable and disable routines are always the same, so just use
the global variables directly.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00
Ard Biesheuvel
e68e784649 ArmPkg/ArmGicDxe: Avoid pointless repeated iteration over GIC frames
The GIC DXE driver only runs on the boot CPU, and so there is really no
point in iterating over all the redistributor frames every time an
interrupt is enabled, disabled or its state tested. Instead, do this
only at load time.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00