Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
FwRuntimeServices: Fixed enabling RO/WO variables before OS start
Browse files Browse the repository at this point in the history
Causes vsmc-status not being set when FwRuntimeServices.efi was loading before VirtualSmc.efi.
closes acidanthera/bugtracker#515
  • Loading branch information
vit9696 committed Oct 14, 2019
1 parent 7d1ee03 commit ab62b68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AppleSupport Changelog
======================

#### v2.1.2
- Fixed enabling RO/WO variables before OS start

#### v2.1.1
- Moved AppleGenericInput into OpenCore mainline

Expand Down
2 changes: 1 addition & 1 deletion Include/AppleSupportPkgVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef APPLE_SUPPORT_VERSION_H
#define APPLE_SUPPORT_VERSION_H

#define APPLE_SUPPORT_VERSION L"2.1.1"
#define APPLE_SUPPORT_VERSION L"2.1.2"


#endif // APPLE_SUPPORT_VERSION_H
8 changes: 8 additions & 0 deletions Platform/FwRuntimeServices/UefiRuntimeServices.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OC_FWRT_CONFIG *gCurrentConfig;
**/
STATIC EFI_EVENT mTranslateEvent;
STATIC EFI_GET_VARIABLE mCustomGetVariable;
STATIC BOOLEAN mKernelStarted;

STATIC
VOID
Expand Down Expand Up @@ -271,6 +272,7 @@ WrapGetVariable (
// Abort access to write-only variables.
//
if (gCurrentConfig->RestrictedVariables
&& mKernelStarted
&& CompareGuid (VendorGuid, &gOcWriteOnlyVariableGuid)) {
return EFI_SECURITY_VIOLATION;
}
Expand Down Expand Up @@ -528,6 +530,7 @@ WrapSetVariable (
// Abort access to read-only variables.
//
if (gCurrentConfig->RestrictedVariables
&& mKernelStarted
&& CompareGuid (VendorGuid, &gOcReadOnlyVariableGuid)) {
return EFI_SECURITY_VIOLATION;
}
Expand Down Expand Up @@ -641,6 +644,11 @@ TranslateAddressesHandler (

gRT->ConvertPointer (0, (VOID **) &gCurrentConfig);
mCustomGetVariable = NULL;

//
// Ideally we do that from ExitBootServices, but VirtualAddressChange is fine as well.
//
mKernelStarted = TRUE;
}

VOID
Expand Down

0 comments on commit ab62b68

Please sign in to comment.