Hello Andrew,

        Does this fail for all addresses?  What address are you using when it 
fails.  You might want to try a DWORD access instead of a byte. 
Virtualbox might be picky about the register size while real systems
might not care.

Stephen

Andrew Peters wrote:
> Hello List,
> 
> 
> I have been trying to test my EFI application on various systems and so 
> far it works everywhere except the EFI implementation embedded in the 
> VirtualBox (uefi 2.31 x64). 
> The problem is related to the Mem.Read() function from EFI PCI IO 
> PROTOCOL. In VirtualBox this function returns EFI_ERROR(2) 
> (EFI_INVALID_PARAMETER). 
> I have tried different parameters variations but it still returns same 
> error even though it works 100% correctly on other systems. What is even 
> more surprising
> the built-in "dmem" shell application (shell version 2.0) that uses this 
> function by default works correctly in VirtualBox. Any ideas what is 
> wrong? I'm attaching a sample code snippet:
> 
> Note the Address and the Size arguments are 100% correct. Do you have 
> any idea what can be wrong? Is there any other function to resolve this 
> error?
> 
> UINTN DisplayMmioMemory(
>   IN CONST VOID   *Address,
>   IN CONST UINTN  Size
>   )
> {
>   EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRbIo;
>   EFI_STATUS                      Status;
>   VOID                            *Buffer;
>  
>  Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, 
> (VOID**)&PciRbIo);
>   if (EFI_ERROR(Status)) return 0;
> 
>   Buffer = AllocateZeroPool(Size);
>   ASSERT(Buffer != NULL);
> 
> // returns error
>   Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, 
> (UINT64)(UINTN)Address, Size, Buffer);
>   if (EFI_ERROR(Status)) {
>      Print(L"Error: %d", Status);
>      return 0;
>   }
> 
>   Print(L"Everything ok!");
> 
>   FreePool(Buffer);
>   return 1;
> }
> 
> 
> --
> Andrew
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to