Index: trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c	(revision 80925)
+++ trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c	(revision 80934)
@@ -1011,5 +1011,5 @@
   *ppwszFileName = EFI_REMOVABLE_MEDIA_FILE_NAME;
 
-  Status = gBS->HandleProtocol(hSFs, &gEfiSimpleFileSystemProtocolGuid, &pSFs);
+  Status = gBS->HandleProtocol(hSFs, &gEfiSimpleFileSystemProtocolGuid, (void **)&pSFs);
   if (!EFI_ERROR(Status))
   {
Index: trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Disk/PartitionDxe/Apple.c
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Disk/PartitionDxe/Apple.c	(revision 80925)
+++ trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Disk/PartitionDxe/Apple.c	(revision 80934)
@@ -103,5 +103,4 @@
   UINT32                    Partition;
   UINT32                    PartitionEntries;
-  UINT32                    VolSpaceSize;
   UINT32                    SubBlockSize;
   UINT32                    BlkPerSec;
@@ -111,5 +110,4 @@
   Found         = EFI_NOT_FOUND;
   Media         = BlockIo->Media;
-  VolSpaceSize  = 0;
 
   Block = AllocatePool ((UINTN) Media->BlockSize);
Index: trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/MemDetect.c
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/MemDetect.c	(revision 80925)
+++ trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/MemDetect.c	(revision 80934)
@@ -765,6 +765,4 @@
   UINT64                      LowerMemorySize;
   UINT64                      UpperMemorySize;
-  EFI_PHYSICAL_ADDRESS        MemoryBase;
-  UINT64                      MemorySize;
 
   DEBUG ((EFI_D_INFO, "%a called\n", __FUNCTION__));
@@ -798,6 +796,4 @@
     //
     AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
-    MemoryBase = 0;
-    MemorySize = BASE_512KB + BASE_128KB;
   } else {
     LowerMemorySize = GetSystemMemorySizeBelow4gb ();
Index: trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.c
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.c	(revision 80925)
+++ trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.c	(revision 80934)
@@ -254,11 +254,14 @@
   if (!mXen) {
     UINT32  TopOfLowRam;
+#ifndef VBOX
     UINT64  PciExBarBase;
+#endif
     UINT32  PciBase;
     UINT32  PciSize;
 
     TopOfLowRam = GetSystemMemorySizeBelow4gb ();
+#ifndef VBOX
     PciExBarBase = 0;
-#ifndef VBOX
+
     if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
       //
Index: trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxAppleSim/VBoxAppleSim.c
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxAppleSim/VBoxAppleSim.c	(revision 80925)
+++ trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxAppleSim/VBoxAppleSim.c	(revision 80934)
@@ -245,46 +245,50 @@
 SetProperVariables(IN EFI_HANDLE ImageHandle, EFI_RUNTIME_SERVICES * rs)
 {
-     EFI_STATUS          rc;
-     UINT32              vBackgroundClear = 0x00000000;
-     UINT32              vFwFeatures      = 0x80000015;
-     UINT32              vFwFeaturesMask  = 0x800003ff;
-
-     // -legacy acpi=0xffffffff acpi_debug=0xfffffff panic_io_port=0xef11 io=0xfffffffe trace=4096  io=0xffffffef -v serial=2 serialbaud=9600
-     // 0x10 makes kdb default, thus 0x15e for kdb, 0x14e for gdb
-     // usb=0x800 is required to work around default behavior of the Apple xHCI driver which rejects high-speed
-     // USB devices and tries to force them to EHCI when running on the Intel Panther Point chipset.
-
-     //static const CHAR8  vBootArgs[]      = "debug=0x15e keepsyms=1 acpi=0xffffffff acpi_debug=0xff acpi_level=7 -v -x32 -s"; // or just "debug=0x8 -legacy"
-     // 0x14e for serial output
-     //static const CHAR8  vDefBootArgs[]      = "debug=0x146 usb=0x800 keepsyms=1 -v -serial=0x1";
-     static const CHAR8  vDefBootArgs[]      = "usb=0x800 keepsyms=1 -v -serial=0x1";
-     CHAR8  vBootArgs[256];
-     UINT32 BootArgsLen;
-
-     BootArgsLen = GetVmVariable(EFI_INFO_INDEX_BOOT_ARGS, vBootArgs, sizeof vBootArgs);
-     if (BootArgsLen <= 1)
-     {
-         BootArgsLen = sizeof vDefBootArgs;
-         CopyMem(vBootArgs, vDefBootArgs, BootArgsLen);
-     }
-     rc = rs->SetVariable(L"BackgroundClear",
-                          &gEfiAppleNvramGuid,
-                          /* EFI_VARIABLE_NON_VOLATILE | */ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
-                          sizeof(vBackgroundClear), &vBackgroundClear);
-
-     rc = rs->SetVariable(L"FirmwareFeatures",
-                          &gEfiAppleNvramGuid,
-                          EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
-                          sizeof(vFwFeatures), &vFwFeatures);
-
-     rc = rs->SetVariable(L"FirmwareFeaturesMask",
-                          &gEfiAppleNvramGuid,
-                          EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
-                          sizeof(vFwFeaturesMask), &vFwFeaturesMask);
-
-     rc = rs->SetVariable(L"boot-args",
-                          &gEfiAppleBootGuid,
-                          EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
-                          BootArgsLen, &vBootArgs);
+    EFI_STATUS          rc;
+    UINT32              vBackgroundClear = 0x00000000;
+    UINT32              vFwFeatures      = 0x80000015;
+    UINT32              vFwFeaturesMask  = 0x800003ff;
+
+    // -legacy acpi=0xffffffff acpi_debug=0xfffffff panic_io_port=0xef11 io=0xfffffffe trace=4096  io=0xffffffef -v serial=2 serialbaud=9600
+    // 0x10 makes kdb default, thus 0x15e for kdb, 0x14e for gdb
+    // usb=0x800 is required to work around default behavior of the Apple xHCI driver which rejects high-speed
+    // USB devices and tries to force them to EHCI when running on the Intel Panther Point chipset.
+
+    //static const CHAR8  vBootArgs[]      = "debug=0x15e keepsyms=1 acpi=0xffffffff acpi_debug=0xff acpi_level=7 -v -x32 -s"; // or just "debug=0x8 -legacy"
+    // 0x14e for serial output
+    //static const CHAR8  vDefBootArgs[]      = "debug=0x146 usb=0x800 keepsyms=1 -v -serial=0x1";
+    static const CHAR8  vDefBootArgs[]      = "usb=0x800 keepsyms=1 -v -serial=0x1";
+    CHAR8  vBootArgs[256];
+    UINT32 BootArgsLen;
+
+    BootArgsLen = GetVmVariable(EFI_INFO_INDEX_BOOT_ARGS, vBootArgs, sizeof vBootArgs);
+    if (BootArgsLen <= 1)
+    {
+        BootArgsLen = sizeof vDefBootArgs;
+        CopyMem(vBootArgs, vDefBootArgs, BootArgsLen);
+    }
+    rc = rs->SetVariable(L"BackgroundClear",
+                         &gEfiAppleNvramGuid,
+                         /* EFI_VARIABLE_NON_VOLATILE | */ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+                         sizeof(vBackgroundClear), &vBackgroundClear);
+    ASSERT_EFI_ERROR (rc);
+
+    rc = rs->SetVariable(L"FirmwareFeatures",
+                         &gEfiAppleNvramGuid,
+                         EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+                         sizeof(vFwFeatures), &vFwFeatures);
+    ASSERT_EFI_ERROR (rc);
+
+    rc = rs->SetVariable(L"FirmwareFeaturesMask",
+                         &gEfiAppleNvramGuid,
+                         EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+                         sizeof(vFwFeaturesMask), &vFwFeaturesMask);
+    ASSERT_EFI_ERROR (rc);
+
+    rc = rs->SetVariable(L"boot-args",
+                         &gEfiAppleBootGuid,
+                         EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+                         BootArgsLen, &vBootArgs);
+    ASSERT_EFI_ERROR (rc);
 
      return EFI_SUCCESS;
Index: trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxSysTables/VBoxSysTables.c
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxSysTables/VBoxSysTables.c	(revision 80925)
+++ trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxSysTables/VBoxSysTables.c	(revision 80934)
@@ -148,5 +148,8 @@
     ASSERT(Ptr != NULL);
     if (Ptr)
+    {
         rc = ConvertAndInstallTable(&gEfiSmbiosTableGuid, Ptr);
+        ASSERT_EFI_ERROR (rc);
+    }
 
     Ptr = FindMPSPtr();
