Re: [edk2] edk vs edk2 DUET

Subject: Re: [edk2] edk vs edk2 DUET

From: Andrew Fish <afish@apple.com>

To: edk2-devel@lists.sourceforge.net

Date: 2010-04-09 18:11:21

Ken,

How is gBS->Stall() runtime safe? 

The DXE core zeros out the things gBS points to in CoreExitBootServices().

  //
  // Zero out the Boot Service Table
  //
  ZeroMem (gBS, sizeof (EFI_BOOT_SERVICES));


  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf



Andrew Fish





On Apr 9, 2010, at 9:09 AM, Lu, Ken wrote:

Hi, Andrew:

I mean MicroSecondDelay() implemented by DuetPkg\Library\DuetTimerLib is not runtime safe. But gBS->Stall() is runtime safe.

 

Best Regard

K

---------------------------

hear and you forget; see and you remember; do and you understand

 


From: Andrew Fish [mailto:afish@apple.com]
Sent: 2010
410 0:00
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] edk vs edk2 DUET

 

Ken,

 

I'm confused gBS->Stall (10) is not runtime safe. 

 

Andrew Fish

 

 



 

On Apr 9, 2010, at 8:53 AM, Lu, Ken wrote:



Hi, KENSHAV P.R.

     Thanks for useful picture and you are using 2.6.34 rc2 kernel, it is very new even I can not found it in kernel.org

 From the panic stack:

     page_fault

sysfs_create_dir

     efi_call3

     virt_efi_get_next_variable

 

     We can get it is raised by efi_get_next_variable runtime service, the efi_call3 from linux mean this runtime service contains 3 parameters, so it must be the EFI_RUNTIME_SERVICES->GetNextVariableName() function.

     Unfortunally, FsVariable driver is updated by many times by many peoples from svn log, it is hard to use SVN to get a old version to test.

     I just trace the linuxs kernel source and share some investigation for your:

     1) When linux init the EFI variable, linux will call runtime service EFI_RUNTIME_SERVICES->GetNextVariableName() to loop all available variable from firmware variable range (in duet is faked file),

     2) Linux will treat each available variable as a kernel object.

     3) When create a kernel object, linux will create a file entry in /sys in ramdisk

     4) The file entry use variable name as short name of kernel object.

     Seems when dealing with variables name, page fault is generated

     So from your picture, the bug maybe exist in GetNextVariableName() in DuetPkg\FSVariable.

 

     I am realizing another potential issue for PcAtChipsetPkg\PcatRealTimeClockRuntimeDxe driver which produce EFI_RUNTIME_SERVICE->GetTime/SetTime/GetWakeUpTime/SetWakeUpTime, etc. In PcRtc.c function RtcWaitToUpdate(),MicroSecondDelay() is used which is different with EDKI, EDKI use gBS->Stall(). The MicroSecondDelay() is implemented in DuetPkg\Library\DuetTimerLib\X86TimerLib.c, this implementation is try to get use AcpiTimer from legacy bios which duet run on. I think this library instance will cause problem in EFI OS runtime.

     So could you replace the MircoSecondDelay() in PcRtc.c to gBS->Stall(10)?

    

 

Best Regard

K

 

-----Original Message-----
From: KESHAV P.R. [mailto:skodabenz@gmail.com]
Sent: 2010
49 21:43
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] edk vs edk2 DUET

 

Hi Ken Lu,

                 Thanks for the response. UpdateCapsule is enabled in

Duet FDF. Is it possible to enable "KBC legacy port" in EDK2 DuetPkg.

If that is indeed the only change between "Runtime Services" of EDK

and EDK2, then that is the only code which is causing the Blue Screen

and kernel Panic.

 

I have attached the "dmesg | grep EFI" and "dmesg | grep reset* "

outputs in Fedora 12 x64 which has been booted using EDK1 DUET UEFI64

using GRUB2 x64 EFI binary. Sorry, I am unable to get a similar output

for EDK2 DUET since the screen locks up and upon restart no log info

is found about the bug in /var/log/* files. But I have taken photos

of the kernel panic taken using my mobile which you can download from

http://www.4shared.com/dir/28138560/e865bd7c/Tianocore_EFI_DUET.html .

 

May be GetTime can be ruled out, the bug must be in

SetVirtualAddressMap, GetVariable, or in the Reset service you

mentioned (most likely the last one or something to do with virtual

addressing). Thank you.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel