Date
1 - 2 of 2
How to access EFI variables from MMI Handler
asallan3@...
I registered a root MMI handler and it's already working, my code is executed when SMI occurs and just prints something to QEMU DEBUG. As a next step, I'm trying to access gRT->GetVariable inside my root MMI handler, but I get an error on QEMU debug
`Code executed on IP(0x7EA97DCD) out of SMM range after SMM is locked!
It is invoked from the instruction before IP(0x7FD87257) in module (/home/allanalmeida/edk2/Build/Ovmf3264/NOOPT_GCC5/X64/HpeCimatecPkg/Drivers/SmmDriver/SmmDriver/DEBUG/SmmDriver.dll)`
Guess I can't use runtime services inside an MMI handler. So, how would I access EFI variables form inside my MMI handler?
`Code executed on IP(0x7EA97DCD) out of SMM range after SMM is locked!
It is invoked from the instruction before IP(0x7FD87257) in module (/home/allanalmeida/edk2/Build/Ovmf3264/NOOPT_GCC5/X64/HpeCimatecPkg/Drivers/SmmDriver/SmmDriver/DEBUG/SmmDriver.dll)`
Guess I can't use runtime services inside an MMI handler. So, how would I access EFI variables form inside my MMI handler?
Brian J. Johnson
Guess I can't use runtime services inside an MMI handler.True. Runtime services code lives outside of SMRAM, so it's not safe to call it from SMM/MM.
So, how would I access EFI variables form inside my MMI handler?You'd have to use a SMM/MM protocol. It looks like EFI_SMM_VARIABLE_PROTOCOL (gEfiSmmVariableProtocolGuid) should fit the bill, if it's available on your platform.
Brian J. Johnson
-------- Original Message --------
From: asallan3@...
Sent: Tuesday, November 29, 2022 at 8:31 AM
To: discuss@edk2.groups.io
Subject: [edk2-discuss] How to access EFI variables from MMI Handler
I registered a root MMI handler and it's already working, my code is executed when SMI occurs and just prints something to QEMU DEBUG. As a next step, I'm trying to access gRT->GetVariable inside my root MMI handler, but I get an error on QEMU debug
`Code executed on IP(0x7EA97DCD) out of SMM range after SMM is locked!
It is invoked from the instruction before IP(0x7FD87257) in module (/home/allanalmeida/edk2/Build/Ovmf3264/NOOPT_GCC5/X64/HpeCimatecPkg/Drivers/SmmDriver/SmmDriver/DEBUG/SmmDriver.dll)`
Guess I can't use runtime services inside an MMI handler. So, how would I access EFI variables form inside my MMI handler?