Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On 2019/1/23 20:15, Julien Grall wrote: On 23/01/2019 01:41, Zeng, Star wrote: Hi Julien, Hi Star, On 2019/1/22 12:30, Zeng, Star wrote: On 2019/1/22 3:40, Ard Biesheuvel wrote: On Mon, 21 Jan 2019 at 14:36, Julien Grall wrote: diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index a8bb9cf25ebd..adaf6ccb48b0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -236,14 +236,16 @@ VariableClassAddressChangeEvent ( { UINTN Index; - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); - EfiConvertPointer (0x0, (VOID **) >FvbInstance); + if (mVariableModuleGlobal->FvbInstance != NULL) { + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); + EfiConvertPointer (0x0, (VOID **) >FvbInstance); + } EfiConvertPointer (0x0, (VOID **) >PlatformLangCodes); EfiConvertPointer (0x0, (VOID **) >LangCodes); EfiConvertPointer (0x0, (VOID **) >PlatformLang); Thanks Ard. I integrated it into the patch 10 of V4. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V4 Julien, could you help take a try? Sorry for a little push. Are you able to have a quick try? :) Sorry for the late, I didn't have time yesterday to test at it. I tried the new branch and was able to boot a Linux guest using UEFI. Feel free to add my tags to the series: Tested-by: Julien Grall Acked-by: Julien Grall It is really very helpful to make the patch higher quality. Many thanks to you, Ard and Laszlo for the feedback. Thanks all of you. Star Best regards, ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On 23/01/2019 01:41, Zeng, Star wrote: Hi Julien, Hi Star, On 2019/1/22 12:30, Zeng, Star wrote: On 2019/1/22 3:40, Ard Biesheuvel wrote: On Mon, 21 Jan 2019 at 14:36, Julien Grall wrote: diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index a8bb9cf25ebd..adaf6ccb48b0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -236,14 +236,16 @@ VariableClassAddressChangeEvent ( { UINTN Index; - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); - EfiConvertPointer (0x0, (VOID **) >FvbInstance); + if (mVariableModuleGlobal->FvbInstance != NULL) { + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); + EfiConvertPointer (0x0, (VOID **) >FvbInstance); + } EfiConvertPointer (0x0, (VOID **) >PlatformLangCodes); EfiConvertPointer (0x0, (VOID **) >LangCodes); EfiConvertPointer (0x0, (VOID **) >PlatformLang); Thanks Ard. I integrated it into the patch 10 of V4. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V4 Julien, could you help take a try? Sorry for a little push. Are you able to have a quick try? :) Sorry for the late, I didn't have time yesterday to test at it. I tried the new branch and was able to boot a Linux guest using UEFI. Feel free to add my tags to the series: Tested-by: Julien Grall Acked-by: Julien Grall Many thanks to you, Ard and Laszlo for the feedback. Best regards, -- Julien Grall ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi Julien, On 2019/1/22 12:30, Zeng, Star wrote: Hi, On 2019/1/22 3:40, Ard Biesheuvel wrote: On Mon, 21 Jan 2019 at 14:36, Julien Grall wrote: Hi, On 21/01/2019 10:46, Zeng, Star wrote: On 2019/1/18 2:59, Julien Grall wrote: I saw the discussion at https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. Fortunately, it has been fixed. So I did rebase for the code. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V3_rebased I was about to ask a branch as there were conflicts in the rebase. Thank you for providing the branch! If you can help have a quick test, that will be very helpful. :) With your series applied, EDK2 is crashing while the Linux EFI stub is running. See the log below. My knowledge of EDK2 is quite limited, so I am not entirely where to look at. I am happy to help debugging if you provide guidance. Thanks for the test. Fortunately, we could catch this before the patch is pushed. :) Hi Julien, Could you try the patch below please? diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index a8bb9cf25ebd..adaf6ccb48b0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -236,14 +236,16 @@ VariableClassAddressChangeEvent ( { UINTN Index; - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); - EfiConvertPointer (0x0, (VOID **) >FvbInstance); + if (mVariableModuleGlobal->FvbInstance != NULL) { + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); + EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); + EfiConvertPointer (0x0, (VOID **) >FvbInstance); + } EfiConvertPointer (0x0, (VOID **) >PlatformLangCodes); EfiConvertPointer (0x0, (VOID **) >LangCodes); EfiConvertPointer (0x0, (VOID **) >PlatformLang); Thanks Ard. I integrated it into the patch 10 of V4. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V4 Julien, could you help take a try? Sorry for a little push. Are you able to have a quick try? :) Thanks, Star Thanks, Star Press any key to continue... [Security] 3rd party image[0] can be loaded after EndOfDxe: MemoryMapped(0x2,0x67789000,0x68DF1200). InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 7AB2B040 Loading driver at 0x00065783000 EntryPoint=0x00066878664 Loading driver at 0x00065783000 EntryPoint=0x00066878664 InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 7AA54B18 ProtectUefiImageCommon - 0x7AB2B040 - 0x65783000 - 0x02006000 SetUefiImageMemoryAttributes - 0x65783000 - 0x1000 (0x4008) SetUefiImageMemoryAttributes - 0x65784000 - 0x011CD000 (0x00020008) SetUefiImageMemoryAttributes - 0x66951000 - 0x00E38000 (0x4008) EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map... XenBus: Set state to 5 XenBus: Set state to 5, done XenPvBlk: waiting backend state 5, current: 4 XenStore: Watch event 7B036698 XenBus: Set state to 6 XenBus: Set state to 6, done XenPvBlk: waiting backend state 6, current: 5 XenStore: Watch event 7B036698 XenBus: Set state to 1 XenBus: Set state to 1, done Xen GrantTable, removing 38003 Xen GrantTable, removing 38002 Xen GrantTable, removing 38001 Xen GrantTable, removing 38000 SetUefiImageMemoryAttributes - 0x7BE6 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x78AE - 0x0005 (0x0008) SetUefiImageMemoryAttributes - 0x78A9 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x789F - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x7895 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x788B - 0x0004 (0x0008) Synchronous Exception at 0x7BE70698 PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi, On 2019/1/22 3:40, Ard Biesheuvel wrote: On Mon, 21 Jan 2019 at 14:36, Julien Grall wrote: Hi, On 21/01/2019 10:46, Zeng, Star wrote: On 2019/1/18 2:59, Julien Grall wrote: I saw the discussion at https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. Fortunately, it has been fixed. So I did rebase for the code. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V3_rebased I was about to ask a branch as there were conflicts in the rebase. Thank you for providing the branch! If you can help have a quick test, that will be very helpful. :) With your series applied, EDK2 is crashing while the Linux EFI stub is running. See the log below. My knowledge of EDK2 is quite limited, so I am not entirely where to look at. I am happy to help debugging if you provide guidance. Thanks for the test. Fortunately, we could catch this before the patch is pushed. :) Hi Julien, Could you try the patch below please? diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index a8bb9cf25ebd..adaf6ccb48b0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -236,14 +236,16 @@ VariableClassAddressChangeEvent ( { UINTN Index; - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); - EfiConvertPointer (0x0, (VOID **) >FvbInstance); + if (mVariableModuleGlobal->FvbInstance != NULL) { +EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); +EfiConvertPointer (0x0, (VOID **) >FvbInstance); + } EfiConvertPointer (0x0, (VOID **) >PlatformLangCodes); EfiConvertPointer (0x0, (VOID **) >LangCodes); EfiConvertPointer (0x0, (VOID **) >PlatformLang); Thanks Ard. I integrated it into the patch 10 of V4. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V4 Julien, could you help take a try? Thanks, Star Press any key to continue... [Security] 3rd party image[0] can be loaded after EndOfDxe: MemoryMapped(0x2,0x67789000,0x68DF1200). InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 7AB2B040 Loading driver at 0x00065783000 EntryPoint=0x00066878664 Loading driver at 0x00065783000 EntryPoint=0x00066878664 InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 7AA54B18 ProtectUefiImageCommon - 0x7AB2B040 - 0x65783000 - 0x02006000 SetUefiImageMemoryAttributes - 0x65783000 - 0x1000 (0x4008) SetUefiImageMemoryAttributes - 0x65784000 - 0x011CD000 (0x00020008) SetUefiImageMemoryAttributes - 0x66951000 - 0x00E38000 (0x4008) EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map... XenBus: Set state to 5 XenBus: Set state to 5, done XenPvBlk: waiting backend state 5, current: 4 XenStore: Watch event 7B036698 XenBus: Set state to 6 XenBus: Set state to 6, done XenPvBlk: waiting backend state 6, current: 5 XenStore: Watch event 7B036698 XenBus: Set state to 1 XenBus: Set state to 1, done Xen GrantTable, removing 38003 Xen GrantTable, removing 38002 Xen GrantTable, removing 38001 Xen GrantTable, removing 38000 SetUefiImageMemoryAttributes - 0x7BE6 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x78AE - 0x0005 (0x0008) SetUefiImageMemoryAttributes - 0x78A9 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x789F - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x7895 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x788B - 0x0004 (0x0008) Synchronous Exception at 0x7BE70698 PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll PC 0x78AFECB0 (0x78AE+0x0001ECB0) [ 1] VariableRuntimeDxe.dll PC 0x78AF0AC8 (0x78AE+0x00010AC8) [ 1] VariableRuntimeDxe.dll
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On Mon, 21 Jan 2019 at 22:22, Ard Biesheuvel wrote: > > On Mon, 21 Jan 2019 at 22:15, Laszlo Ersek wrote: > > > > Hi Julien, > > > > On 01/21/19 14:36, Julien Grall wrote: > > > Hi, > > > > > > On 21/01/2019 10:46, Zeng, Star wrote: > > >> On 2019/1/18 2:59, Julien Grall wrote: > > >> I saw the discussion at > > >> https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. > > >> Fortunately, > > >> it has been fixed. > > >> So I did rebase for the code. > > >> Repo: g...@github.com:lzeng14/edk2.git > > >> Branch: MergedVariableDriver_EmuNvMode_V3_rebased > > > > > > I was about to ask a branch as there were conflicts in the rebase. > > > Thank you for providing the branch! > > > > > >> > > >> If you can help have a quick test, that will be very helpful. :) > > > > > > With your series applied, EDK2 is crashing while the Linux EFI stub > > > is running. See the log below. > > > > > > My knowledge of EDK2 is quite limited, so I am not entirely where to > > > look at. I am happy to help debugging if you provide guidance. > > > > Let's focus on the following excerpts: > > > > > Synchronous Exception at 0x7BE70698 > > > PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll > > > PC 0x78AFECB0 (0x78AE+0x0001ECB0) [ 1] VariableRuntimeDxe.dll > > > PC 0x78AF0AC8 (0x78AE+0x00010AC8) [ 1] VariableRuntimeDxe.dll > > > PC 0x7BE7094C (0x7BE6+0x0001094C) [ 2] RuntimeDxe.dll > > > > and > > > > > [ 0] > > > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll > > > [ 1] > > > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe/DEBUG/VariableRuntimeDxe.dll > > > [ 2] > > > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll > > > > Please run "objdump -S" on the DLL files listed in [0] through [2]. > > > > In the listings, please try to locate the neighborhood of the relative > > offsets that are listed in the stack dump (such as 0x10698 and 0x1094C > > in "RuntimeDxe.dll", and 0x1ECB0 and 0x10AC8 in "VariableRuntimeDxe.dll"). > > > > The disassembly should be intermixed with C source code, and four stack > > frames with C language snippets should help us establish a rudimentary > > call chain. > > > > (CC'ing Ard as well.) > > > > I already did the same. The crash is in a call to EfiConvertPointer () > from VariableClassAddressChangeEvent (), which dereferences > mVariableModuleGlobal->FvbInstance, which may be NULL in the EMU use > case. > > It is very surprising that this only happens on ARM, though ... Never mind. Another bug masked by the 'memory at address 0x0' issue. ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On Mon, 21 Jan 2019 at 22:15, Laszlo Ersek wrote: > > Hi Julien, > > On 01/21/19 14:36, Julien Grall wrote: > > Hi, > > > > On 21/01/2019 10:46, Zeng, Star wrote: > >> On 2019/1/18 2:59, Julien Grall wrote: > >> I saw the discussion at > >> https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. > >> Fortunately, > >> it has been fixed. > >> So I did rebase for the code. > >> Repo: g...@github.com:lzeng14/edk2.git > >> Branch: MergedVariableDriver_EmuNvMode_V3_rebased > > > > I was about to ask a branch as there were conflicts in the rebase. > > Thank you for providing the branch! > > > >> > >> If you can help have a quick test, that will be very helpful. :) > > > > With your series applied, EDK2 is crashing while the Linux EFI stub > > is running. See the log below. > > > > My knowledge of EDK2 is quite limited, so I am not entirely where to > > look at. I am happy to help debugging if you provide guidance. > > Let's focus on the following excerpts: > > > Synchronous Exception at 0x7BE70698 > > PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll > > PC 0x78AFECB0 (0x78AE+0x0001ECB0) [ 1] VariableRuntimeDxe.dll > > PC 0x78AF0AC8 (0x78AE+0x00010AC8) [ 1] VariableRuntimeDxe.dll > > PC 0x7BE7094C (0x7BE6+0x0001094C) [ 2] RuntimeDxe.dll > > and > > > [ 0] > > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll > > [ 1] > > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe/DEBUG/VariableRuntimeDxe.dll > > [ 2] > > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll > > Please run "objdump -S" on the DLL files listed in [0] through [2]. > > In the listings, please try to locate the neighborhood of the relative > offsets that are listed in the stack dump (such as 0x10698 and 0x1094C > in "RuntimeDxe.dll", and 0x1ECB0 and 0x10AC8 in "VariableRuntimeDxe.dll"). > > The disassembly should be intermixed with C source code, and four stack > frames with C language snippets should help us establish a rudimentary > call chain. > > (CC'ing Ard as well.) > I already did the same. The crash is in a call to EfiConvertPointer () from VariableClassAddressChangeEvent (), which dereferences mVariableModuleGlobal->FvbInstance, which may be NULL in the EMU use case. It is very surprising that this only happens on ARM, though ... ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi Julien, On 01/21/19 14:36, Julien Grall wrote: > Hi, > > On 21/01/2019 10:46, Zeng, Star wrote: >> On 2019/1/18 2:59, Julien Grall wrote: >> I saw the discussion at >> https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. >> Fortunately, >> it has been fixed. >> So I did rebase for the code. >> Repo: g...@github.com:lzeng14/edk2.git >> Branch: MergedVariableDriver_EmuNvMode_V3_rebased > > I was about to ask a branch as there were conflicts in the rebase. > Thank you for providing the branch! > >> >> If you can help have a quick test, that will be very helpful. :) > > With your series applied, EDK2 is crashing while the Linux EFI stub > is running. See the log below. > > My knowledge of EDK2 is quite limited, so I am not entirely where to > look at. I am happy to help debugging if you provide guidance. Let's focus on the following excerpts: > Synchronous Exception at 0x7BE70698 > PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll > PC 0x78AFECB0 (0x78AE+0x0001ECB0) [ 1] VariableRuntimeDxe.dll > PC 0x78AF0AC8 (0x78AE+0x00010AC8) [ 1] VariableRuntimeDxe.dll > PC 0x7BE7094C (0x7BE6+0x0001094C) [ 2] RuntimeDxe.dll and > [ 0] > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll > [ 1] > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe/DEBUG/VariableRuntimeDxe.dll > [ 2] > /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll Please run "objdump -S" on the DLL files listed in [0] through [2]. In the listings, please try to locate the neighborhood of the relative offsets that are listed in the stack dump (such as 0x10698 and 0x1094C in "RuntimeDxe.dll", and 0x1ECB0 and 0x10AC8 in "VariableRuntimeDxe.dll"). The disassembly should be intermixed with C source code, and four stack frames with C language snippets should help us establish a rudimentary call chain. (CC'ing Ard as well.) Thanks Laszlo ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On Mon, 21 Jan 2019 at 14:36, Julien Grall wrote: > > Hi, > > On 21/01/2019 10:46, Zeng, Star wrote: > > On 2019/1/18 2:59, Julien Grall wrote: > > I saw the discussion at > > https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. > > Fortunately, > > it has been fixed. > > So I did rebase for the code. > > Repo: g...@github.com:lzeng14/edk2.git > > Branch: MergedVariableDriver_EmuNvMode_V3_rebased > > I was about to ask a branch as there were conflicts in the rebase. > Thank you for providing the branch! > > > > > If you can help have a quick test, that will be very helpful. :) > > With your series applied, EDK2 is crashing while the Linux EFI stub > is running. See the log below. > > My knowledge of EDK2 is quite limited, so I am not entirely where to > look at. I am happy to help debugging if you provide guidance. > Hi Julien, Could you try the patch below please? diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index a8bb9cf25ebd..adaf6ccb48b0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -236,14 +236,16 @@ VariableClassAddressChangeEvent ( { UINTN Index; - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); - EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); - EfiConvertPointer (0x0, (VOID **) >FvbInstance); + if (mVariableModuleGlobal->FvbInstance != NULL) { +EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetBlockSize); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetPhysicalAddress); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->GetAttributes); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->SetAttributes); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->Read); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->Write); +EfiConvertPointer (0x0, (VOID **) >FvbInstance->EraseBlocks); +EfiConvertPointer (0x0, (VOID **) >FvbInstance); + } EfiConvertPointer (0x0, (VOID **) >PlatformLangCodes); EfiConvertPointer (0x0, (VOID **) >LangCodes); EfiConvertPointer (0x0, (VOID **) >PlatformLang); > Press any key to continue... > > [Security] 3rd party image[0] can be loaded after EndOfDxe: > MemoryMapped(0x2,0x67789000,0x68DF1200). > > InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 7AB2B040 > > Loading driver at 0x00065783000 EntryPoint=0x00066878664 > > Loading driver at 0x00065783000 EntryPoint=0x00066878664 > > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 7AA54B18 > > ProtectUefiImageCommon - 0x7AB2B040 > > - 0x65783000 - 0x02006000 > > SetUefiImageMemoryAttributes - 0x65783000 - 0x1000 > (0x4008) > > SetUefiImageMemoryAttributes - 0x65784000 - 0x011CD000 > (0x00020008) > > SetUefiImageMemoryAttributes - 0x66951000 - 0x00E38000 > (0x4008) > > EFI stub: Booting Linux Kernel... > > EFI stub: Using DTB from configuration table > > EFI stub: Exiting boot services and installing virtual address map... > > XenBus: Set state to 5 > > XenBus: Set state to 5, done > > XenPvBlk: waiting backend state 5, current: 4 > > XenStore: Watch event 7B036698 > > XenBus: Set state to 6 > > XenBus: Set state to 6, done > > XenPvBlk: waiting backend state 6, current: 5 > > XenStore: Watch event 7B036698 > > XenBus: Set state to 1 > > XenBus: Set state to 1, done > > Xen GrantTable, removing 38003 > > Xen GrantTable, removing 38002 > > Xen GrantTable, removing 38001 > > Xen GrantTable, removing 38000 > > SetUefiImageMemoryAttributes - 0x7BE6 - 0x0004 > (0x0008) > > SetUefiImageMemoryAttributes - 0x78AE - 0x0005 > (0x0008) > > SetUefiImageMemoryAttributes - 0x78A9 - 0x0004 > (0x0008) > > SetUefiImageMemoryAttributes - 0x789F - 0x0004 > (0x0008) > > SetUefiImageMemoryAttributes - 0x7895 - 0x0004 > (0x0008) > > SetUefiImageMemoryAttributes - 0x788B - 0x0004 > (0x0008) > > > > > > Synchronous Exception at 0x7BE70698 > > PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll > > PC 0x78AFECB0 (0x78AE+0x0001ECB0) [ 1] VariableRuntimeDxe.dll > > PC 0x78AF0AC8 (0x78AE+0x00010AC8) [ 1] VariableRuntimeDxe.dll > > PC 0x7BE7094C (0x7BE6+0x0001094C) [ 2] RuntimeDxe.dll > > PC 0x6687E014 > > PC 0x6687C348 > > PC 0x66878680 > > PC
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi, On 21/01/2019 10:46, Zeng, Star wrote: > On 2019/1/18 2:59, Julien Grall wrote: > I saw the discussion at > https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. > Fortunately, > it has been fixed. > So I did rebase for the code. > Repo: g...@github.com:lzeng14/edk2.git > Branch: MergedVariableDriver_EmuNvMode_V3_rebased I was about to ask a branch as there were conflicts in the rebase. Thank you for providing the branch! > > If you can help have a quick test, that will be very helpful. :) With your series applied, EDK2 is crashing while the Linux EFI stub is running. See the log below. My knowledge of EDK2 is quite limited, so I am not entirely where to look at. I am happy to help debugging if you provide guidance. Press any key to continue... [Security] 3rd party image[0] can be loaded after EndOfDxe: MemoryMapped(0x2,0x67789000,0x68DF1200). InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 7AB2B040 Loading driver at 0x00065783000 EntryPoint=0x00066878664 Loading driver at 0x00065783000 EntryPoint=0x00066878664 InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 7AA54B18 ProtectUefiImageCommon - 0x7AB2B040 - 0x65783000 - 0x02006000 SetUefiImageMemoryAttributes - 0x65783000 - 0x1000 (0x4008) SetUefiImageMemoryAttributes - 0x65784000 - 0x011CD000 (0x00020008) SetUefiImageMemoryAttributes - 0x66951000 - 0x00E38000 (0x4008) EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map... XenBus: Set state to 5 XenBus: Set state to 5, done XenPvBlk: waiting backend state 5, current: 4 XenStore: Watch event 7B036698 XenBus: Set state to 6 XenBus: Set state to 6, done XenPvBlk: waiting backend state 6, current: 5 XenStore: Watch event 7B036698 XenBus: Set state to 1 XenBus: Set state to 1, done Xen GrantTable, removing 38003 Xen GrantTable, removing 38002 Xen GrantTable, removing 38001 Xen GrantTable, removing 38000 SetUefiImageMemoryAttributes - 0x7BE6 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x78AE - 0x0005 (0x0008) SetUefiImageMemoryAttributes - 0x78A9 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x789F - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x7895 - 0x0004 (0x0008) SetUefiImageMemoryAttributes - 0x788B - 0x0004 (0x0008) Synchronous Exception at 0x7BE70698 PC 0x7BE70698 (0x7BE6+0x00010698) [ 0] RuntimeDxe.dll PC 0x78AFECB0 (0x78AE+0x0001ECB0) [ 1] VariableRuntimeDxe.dll PC 0x78AF0AC8 (0x78AE+0x00010AC8) [ 1] VariableRuntimeDxe.dll PC 0x7BE7094C (0x7BE6+0x0001094C) [ 2] RuntimeDxe.dll PC 0x6687E014 PC 0x6687C348 PC 0x66878680 PC 0x7F492BF4 (0x7F48C000+0x6BF4) [ 3] DxeCore.dll PC 0x783E6724 PC 0x783E6A38 PC 0x784BF888 PC 0x784605F8 PC 0x784602A4 PC 0x7845C608 PC 0x7845C838 PC 0x7845C914 PC 0x7845C974 PC 0x784DFB48 PC 0x786922D0 PC 0x7F492BF4 (0x7F48C000+0x6BF4) [ 3] DxeCore.dll PC 0x7875B27C PC 0x7877A2D0 PC 0x7F492BF4 (0x7F48C000+0x6BF4) [ 3] DxeCore.dll PC 0x7BD1912C (0x7BD0A000+0xF12C) [ 4] BdsDxe.dll PC 0x7BD0BFBC (0x7BD0A000+0x1FBC) [ 4] BdsDxe.dll PC 0x7BD0D5C8 (0x7BD0A000+0x35C8) [ 4] BdsDxe.dll PC 0x7F48E564 (0x7F48C000+0x2564) [ 5] DxeCore.dll PC 0x7F48D598 (0x7F48C000+0x1598) [ 5] DxeCore.dll PC 0x7F48D024 (0x7F48C000+0x1024) [ 5] DxeCore.dll PC 0x400895C8 PC 0x400897AC PC 0x40082B4C PC 0x40082C24 [ 0] /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll [ 1] /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe/DEBUG/VariableRuntimeDxe.dll [ 2] /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.dll [ 3] /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll [ 4] /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Universal/BdsDxe/BdsDxe/DEBUG/BdsDxe.dll [ 5] /home/julien/works/edk2/Build/ArmVirtXen-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll X0 0x0018 X1 0x0018 X2 0x7BE7066C X3 0x7BFDD998 X4 0x7BE707D8 X5 0x0004 X6 0x X7 0x7B036E18 X8
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi Julien, On 2019/1/18 2:59, Julien Grall wrote: Hi Star, On 17/01/2019 01:26, Zeng, Star wrote: On 2019/1/16 22:26, Julien Grall wrote: Hi Laszlo, On 15/01/2019 09:37, Laszlo Ersek wrote: On 01/14/19 16:19, Star Zeng wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323 Merge EmuVariable and Real variable driver. The real variable driver has been updated to support emulated variable NV mode and the EmuVariableRuntimeDxe will be removed later, so use merged variable driver for emulated NV mode. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Julien Grall Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- ArmVirtPkg/ArmVirtXen.dsc | 9 +++-- ArmVirtPkg/ArmVirtXen.fdf | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index a29d8a4ae717..db85fb3402d0 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -101,6 +101,11 @@ [PcdsFixedAtBuild.common] # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} + # + # Make VariableRuntimeDxe work at emulated non-volatile variable mode. + # + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE + [PcdsPatchableInModule.common] # # This will be overridden in the code @@ -172,7 +177,7 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 50e670254d52..5655c0df2926 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -137,7 +137,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf Reviewed-by: Laszlo Ersek Julien, can you please regression test this series on Xen? The repo URL and the branch name are in the blurb. I will have a try and let you know the result. Thank you, Julien. I think you can try based on V3 series although there is no essential difference between V2 and V3. :) Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V3 Thank you for the link. I am having trouble to get newer UEFI (without your patch) running in a Xen guest. I have an old binary working. I am not entirely sure why, I will let you know when I can test your series. I saw the discussion at https://lists.01.org/pipermail/edk2-devel/2019-January/035405.html. Fortunately, it has been fixed. So I did rebase for the code. Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V3_rebased If you can help have a quick test, that will be very helpful. :) Thanks, Star Cheers, ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi Star, On 17/01/2019 01:26, Zeng, Star wrote: On 2019/1/16 22:26, Julien Grall wrote: Hi Laszlo, On 15/01/2019 09:37, Laszlo Ersek wrote: On 01/14/19 16:19, Star Zeng wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323 Merge EmuVariable and Real variable driver. The real variable driver has been updated to support emulated variable NV mode and the EmuVariableRuntimeDxe will be removed later, so use merged variable driver for emulated NV mode. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Julien Grall Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- ArmVirtPkg/ArmVirtXen.dsc | 9 +++-- ArmVirtPkg/ArmVirtXen.fdf | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index a29d8a4ae717..db85fb3402d0 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -101,6 +101,11 @@ [PcdsFixedAtBuild.common] # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} + # + # Make VariableRuntimeDxe work at emulated non-volatile variable mode. + # + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE + [PcdsPatchableInModule.common] # # This will be overridden in the code @@ -172,7 +177,7 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 50e670254d52..5655c0df2926 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -137,7 +137,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf Reviewed-by: Laszlo Ersek Julien, can you please regression test this series on Xen? The repo URL and the branch name are in the blurb. I will have a try and let you know the result. Thank you, Julien. I think you can try based on V3 series although there is no essential difference between V2 and V3. :) Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V3 Thank you for the link. I am having trouble to get newer UEFI (without your patch) running in a Xen guest. I have an old binary working. I am not entirely sure why, I will let you know when I can test your series. Cheers, -- Julien Grall ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On 2019/1/16 22:26, Julien Grall wrote: Hi Laszlo, On 15/01/2019 09:37, Laszlo Ersek wrote: On 01/14/19 16:19, Star Zeng wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323 Merge EmuVariable and Real variable driver. The real variable driver has been updated to support emulated variable NV mode and the EmuVariableRuntimeDxe will be removed later, so use merged variable driver for emulated NV mode. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Julien Grall Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- ArmVirtPkg/ArmVirtXen.dsc | 9 +++-- ArmVirtPkg/ArmVirtXen.fdf | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index a29d8a4ae717..db85fb3402d0 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -101,6 +101,11 @@ [PcdsFixedAtBuild.common] # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} + # + # Make VariableRuntimeDxe work at emulated non-volatile variable mode. + # + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE + [PcdsPatchableInModule.common] # # This will be overridden in the code @@ -172,7 +177,7 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 50e670254d52..5655c0df2926 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -137,7 +137,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf Reviewed-by: Laszlo Ersek Julien, can you please regression test this series on Xen? The repo URL and the branch name are in the blurb. I will have a try and let you know the result. Thank you, Julien. I think you can try based on V3 series although there is no essential difference between V2 and V3. :) Repo: g...@github.com:lzeng14/edk2.git Branch: MergedVariableDriver_EmuNvMode_V3 Thanks, Star Cheers, ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
Hi Laszlo, On 15/01/2019 09:37, Laszlo Ersek wrote: On 01/14/19 16:19, Star Zeng wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323 Merge EmuVariable and Real variable driver. The real variable driver has been updated to support emulated variable NV mode and the EmuVariableRuntimeDxe will be removed later, so use merged variable driver for emulated NV mode. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Julien Grall Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- ArmVirtPkg/ArmVirtXen.dsc | 9 +++-- ArmVirtPkg/ArmVirtXen.fdf | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index a29d8a4ae717..db85fb3402d0 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -101,6 +101,11 @@ [PcdsFixedAtBuild.common] # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} + # + # Make VariableRuntimeDxe work at emulated non-volatile variable mode. + # + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE + [PcdsPatchableInModule.common] # # This will be overridden in the code @@ -172,7 +177,7 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 50e670254d52..5655c0df2926 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -137,7 +137,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf Reviewed-by: Laszlo Ersek Julien, can you please regression test this series on Xen? The repo URL and the branch name are in the blurb. I will have a try and let you know the result. Cheers, -- Julien Grall ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
On 01/14/19 16:19, Star Zeng wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323 > Merge EmuVariable and Real variable driver. > > The real variable driver has been updated to support emulated > variable NV mode and the EmuVariableRuntimeDxe will be removed > later, so use merged variable driver for emulated NV mode. > > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Julien Grall > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > ArmVirtPkg/ArmVirtXen.dsc | 9 +++-- > ArmVirtPkg/ArmVirtXen.fdf | 4 ++-- > 2 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc > index a29d8a4ae717..db85fb3402d0 100644 > --- a/ArmVirtPkg/ArmVirtXen.dsc > +++ b/ArmVirtPkg/ArmVirtXen.dsc > @@ -1,7 +1,7 @@ > # > # Copyright (c) 2011-2015, ARM Limited. All rights reserved. > # Copyright (c) 2014, Linaro Limited. All rights reserved. > -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. > +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. > # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the BSD > License > @@ -101,6 +101,11 @@ [PcdsFixedAtBuild.common] ># Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID >gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, > 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} > > + # > + # Make VariableRuntimeDxe work at emulated non-volatile variable mode. > + # > + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE > + > [PcdsPatchableInModule.common] ># ># This will be overridden in the code > @@ -172,7 +177,7 @@ [Components.common] >MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf >MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > > - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf > + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf > > > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf >MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf > index 50e670254d52..5655c0df2926 100644 > --- a/ArmVirtPkg/ArmVirtXen.fdf > +++ b/ArmVirtPkg/ArmVirtXen.fdf > @@ -1,7 +1,7 @@ > # > # Copyright (c) 2011-2015, ARM Limited. All rights reserved. > # Copyright (c) 2014, Linaro Limited. All rights reserved. > -# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. > +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. > # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the BSD > License > @@ -137,7 +137,7 @@ [FV.FvMain] >INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf >INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > > - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf > + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf > >INF > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf >INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > Reviewed-by: Laszlo Ersek Julien, can you please regression test this series on Xen? The repo URL and the branch name are in the blurb. Thanks! Laszlo ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH V2 10/15] ArmVirtXen: Use merged variable driver for emulated NV mode
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323 Merge EmuVariable and Real variable driver. The real variable driver has been updated to support emulated variable NV mode and the EmuVariableRuntimeDxe will be removed later, so use merged variable driver for emulated NV mode. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Julien Grall Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- ArmVirtPkg/ArmVirtXen.dsc | 9 +++-- ArmVirtPkg/ArmVirtXen.fdf | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index a29d8a4ae717..db85fb3402d0 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -101,6 +101,11 @@ [PcdsFixedAtBuild.common] # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} + # + # Make VariableRuntimeDxe work at emulated non-volatile variable mode. + # + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE + [PcdsPatchableInModule.common] # # This will be overridden in the code @@ -172,7 +177,7 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 50e670254d52..5655c0df2926 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -1,7 +1,7 @@ # # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. -# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -137,7 +137,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel