mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 14:44:28 +02:00
Ring3: Fixed PAN page faults.
This commit is contained in:
parent
51e767463a
commit
32768e43f3
@ -273,6 +273,10 @@ CommonCExceptionHandler (
|
|||||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (ArmHasPan ()) {
|
||||||
|
ArmClearPan ();
|
||||||
|
}
|
||||||
|
|
||||||
if (ExceptionType <= gMaxExceptionNumber) {
|
if (ExceptionType <= gMaxExceptionNumber) {
|
||||||
if (gExceptionHandlers[ExceptionType]) {
|
if (gExceptionHandlers[ExceptionType]) {
|
||||||
gExceptionHandlers[ExceptionType](ExceptionType, SystemContext);
|
gExceptionHandlers[ExceptionType](ExceptionType, SystemContext);
|
||||||
|
@ -256,8 +256,6 @@ DefaultExceptionHandler (
|
|||||||
DEBUG ((DEBUG_ERROR, "PC 0x%012lx\n", SystemContext.SystemContextAArch64->ELR));
|
DEBUG ((DEBUG_ERROR, "PC 0x%012lx\n", SystemContext.SystemContextAArch64->ELR));
|
||||||
}
|
}
|
||||||
|
|
||||||
ArmClearPan ();
|
|
||||||
|
|
||||||
if ((UINT64 *)SystemContext.SystemContextAArch64->FP != 0) {
|
if ((UINT64 *)SystemContext.SystemContextAArch64->FP != 0) {
|
||||||
Idx = 0;
|
Idx = 0;
|
||||||
|
|
||||||
|
@ -76,14 +76,14 @@ SysCallBootService (
|
|||||||
(RING3_STACK *)(UINTN)Physical
|
(RING3_STACK *)(UINTN)Physical
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
|
||||||
|
|
||||||
SetUefiImageMemoryAttributes (
|
SetUefiImageMemoryAttributes (
|
||||||
gUartBaseAddress,
|
gUartBaseAddress,
|
||||||
EFI_PAGE_SIZE,
|
EFI_PAGE_SIZE,
|
||||||
EFI_MEMORY_XP | EFI_MEMORY_USER
|
EFI_MEMORY_XP | EFI_MEMORY_USER
|
||||||
);
|
);
|
||||||
|
|
||||||
CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,14 +79,14 @@ SysCallBootService (
|
|||||||
(RING3_STACK *)(UINTN)Physical
|
(RING3_STACK *)(UINTN)Physical
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
|
||||||
|
|
||||||
SetUefiImageMemoryAttributes (
|
SetUefiImageMemoryAttributes (
|
||||||
gUartBaseAddress,
|
gUartBaseAddress,
|
||||||
EFI_PAGE_SIZE,
|
EFI_PAGE_SIZE,
|
||||||
EFI_MEMORY_XP | EFI_MEMORY_USER
|
EFI_MEMORY_XP | EFI_MEMORY_USER
|
||||||
);
|
);
|
||||||
|
|
||||||
CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,12 +94,7 @@ GoToRing3 (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
#elif defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
|
#elif defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
|
||||||
//
|
|
||||||
// Problem 2: Uart memory maped page is not allocated at the very beginnig
|
|
||||||
// and can be used for translation table later.
|
|
||||||
//
|
|
||||||
AllowSupervisorAccessToUserMemory ();
|
AllowSupervisorAccessToUserMemory ();
|
||||||
|
|
||||||
SetUefiImageMemoryAttributes (
|
SetUefiImageMemoryAttributes (
|
||||||
gUartBaseAddress,
|
gUartBaseAddress,
|
||||||
EFI_PAGE_SIZE,
|
EFI_PAGE_SIZE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user