Skip to content
  1. Aug 03, 2017
  2. Jul 05, 2017
    • Ard Biesheuvel's avatar
      ArmVirtPkg: remove status code support · 59541d41
      Ard Biesheuvel authored
      
      
      Commit 7b1dc6c5 'ArmVirtPkg: switch to generic ResetSystemRuntimeDxe'
      replaced all references in ArmVirtPkg to the deprecated ResetRuntimeDxe
      from EmbeddedPkg with the well maintained generic alternative that lives
      in MdeModulePkg.
      
      However, as it turns out, the generic driver has a dependency on the
      library class ReportStatusCodeLib, whose default resolution is an
      implementation that is not safe for use at runtime, resulting in crashes
      when trying to invoke it from the OS.
      
      Since we have no use for status codes in any of the ArmVirtPkg
      platforms, let's replace all resolutions with a common one to the NULL
      implementation.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      59541d41
  3. Jul 03, 2017
    • Ard Biesheuvel's avatar
      ArmVirtPkg: switch to generic ResetSystemRuntimeDxe · 7b1dc6c5
      Ard Biesheuvel authored
      
      
      For obscure reasons, ARM platforms use a different implementation of
      the ResetSystem() runtime service call than other platforms. So let's
      switch all ArmVirtPkg platforms to the generic version instead.
      
      Given that all platforms use an implementation of EfiResetSystemLib [as
      consumed by the ResetRuntimeDxe in EmbeddedPkg that we are replacing]
      which is unlikely to be depended upon by out of tree platforms, let's
      simply modify this library into an implementation of ResetSystemLib
      instead [which is what the generic driver in MdeModulePkg consumes]
      
      This does mean we need to update all clients at the same time, which
      is why all changes are part of the same patch.
      
      As before, warm reset and platform specific reset are mapped onto
      cold reset (which is the only thing PSCI implements, at least the
      version we depend on). The new library function EnterS3WithImmediateWake()
      is left unimplemented, as permitted by the ResetSystemLib library class.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      7b1dc6c5
  4. May 10, 2017
  5. May 03, 2017
  6. Apr 13, 2017
  7. Apr 05, 2017
  8. Apr 04, 2017
  9. Mar 31, 2017
  10. Mar 28, 2017
    • Laszlo Ersek's avatar
      ArmVirtPkg: remove PURE_ACPI_BOOT_ENABLE and PcdPureAcpiBoot · 89ad870f
      Laszlo Ersek authored
      
      
      The build flag and the FeaturePCD have no effect any longer, remove them.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      89ad870f
    • Laszlo Ersek's avatar
      ArmVirtPkg/PlatformHasAcpiDtDxe: don't expose DT if QEMU provides ACPI · 110316a9
      Laszlo Ersek authored
      This will let QEMU's "-no-acpi" option exclusively expose DT vs. ACPI to
      the guest. Showing both is never needed (it is actually detrimental to the
      adoption of standards, such as SBSA / SBBR).
      
      * Without "-no-acpi", the firmware logs (from PlatformHasAcpiDtDxe)
      
      > Found FwCfg @ 0x9020008/0x9020000
      > Found FwCfg DMA @ 0x9020010
      > InstallProtocolInterface: [EdkiiPlatformHasAcpi] 0
      
      plus the usual messages. Later the guest kernel logs
      
      > [    0.000000] efi:  SMBIOS 3.0=0x13bdb0000  ACPI 2.0=0x138440000
      >                      MEMATTR=0x13a675018
      
      before it lists the ACPI tables one by one.
      
      In addition, in the guest, the "/sys/firmware/devicetree/*" shell pattern
      matches no files, while the "/sys/firmware/acpi/tables/*" pattern matches
      the ACPI tables.
      
      * With "-no-acpi", the firmware logs:
      
      > PlatformHasAcpiDtDxe | Found FwCfg @ 0x9020008/0x9020000
      > PlatformHasAcpiDtDxe | Found FwCfg DMA @ 0x9020010
      > PlatformHasAcpiDtDxe | InstallProtocolInterface:
      > PlatformHasAcpiDtDxe | [EdkiiPlatformHasDeviceTree] 0
      > FdtClientDxe         | OnPlatformHasDeviceTree: exposing DTB @
      > FdtClientDxe         | 0x13FFBF000 to OS
      > ...
      > DXE_CORE             | Driver [AcpiTableDxe] was discovered but not
      > DXE_CORE             | loaded!!
      > DXE_CORE             | Driver [QemuFwCfgAcpiPlatform] was discovered but
      > DXE_CORE             | not loaded!!
      > ...
      > RamDiskDxe           | RamDiskAcpiCheck: Cannot locate the EFI ACPI
      > RamDiskDxe           | Table Protocol, unable to publish RAM disks to
      > RamDiskDxe           | NFIT.
      
      (BootGraphicsResourceTableDxe's ReadyToBoot callback --
      InstallBootGraphicsResourceTable() -- handles the lack of
      EFI_ACPI_TABLE_PROTOCOL silently.) Later the guest kernel logs
      
      > [    0.000000] efi:  SMBIOS 3.0=0x13bdb0000  MEMATTR=0x138caa018
      
      In addition, in the guest, the "/sys/firmware/devicetree/*" shell pattern
      matches the directory "/sys/firmware/devicetree/base", which contains a
      large number of DT nodes, while the "/sys/firmware/acpi/tables/*" pattern
      matches no files.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1430262
      
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      110316a9
    • Laszlo Ersek's avatar
      ArmVirtPkg/FdtClientDxe: install DT as sysconfig table in protocol notify · 51b09a2c
      Laszlo Ersek authored
      
      
      Replace the dependency on PcdPureAcpiBoot with a Platform Has Device Tree
      notification callback. Move the sysconfig table installation from the
      entry point function to the callback.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      51b09a2c
    • Laszlo Ersek's avatar
      ArmVirtPkg: enable AcpiTableDxe and EFI_ACPI_TABLE_PROTOCOL dynamically · 3a2c1548
      Laszlo Ersek authored
      
      
      In this patch, the ACPI protocol / driver chain is enabled dynamically,
      when appropriate. This is being done in one larger patch, because
      ArmVirt.dsc.inc, where AcpiTableDxe is built, is used by all the platform
      DSCs.
      
      No change in behavior should be observable after this patch on any
      ArmVirtPkg platform.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      3a2c1548
    • Laszlo Ersek's avatar
      ArmVirtPkg: add XenPlatformHasAcpiDtDxe · a6141834
      Laszlo Ersek authored
      
      
      This driver produces the EDKII Platform Has ACPI and Platform Has Device
      Tree protocols, exactly matching the current ACPI / DT exposure on Xen,
      according to ARM vs. AARCH64. At this point it differs from the QEMU
      driver PlatformHasAcpiDtDxe in that this one always installs the DT.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      a6141834
    • Laszlo Ersek's avatar
      ArmVirtPkg: add PlatformHasAcpiDtDxe · 2558bfe3
      Laszlo Ersek authored
      
      
      This driver produces the EDKII Platform Has ACPI and Platform Has Device
      Tree protocols, exactly matching the current ACPI / DT exposure on QEMU,
      according to ARM vs. AARCH64, and (in the latter case) to PcdPureAcpiBoot.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      2558bfe3
    • Laszlo Ersek's avatar
      ArmVirtPkg/XenAcpiPlatformDxe: don't cast UINT64 to pointer directly · 6244c892
      Laszlo Ersek authored
      
      
      Because that breaks the (potential) 32-bit build of the driver.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      6244c892
    • Laszlo Ersek's avatar
      Revert "ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot" · a00601c6
      Laszlo Ersek authored
      
      
      This reverts commit 18f6d4df.
      
      We realized that DXE drivers that are independent of AcpiPlatformDxe (that
      is, independent of QEMU's ACPI generation), such as RamDiskDxe and
      BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables,
      at driver dispatch or even at Ready To Boot.
      
      This makes it unsafe for us to check for ACPI presence in the UEFI system
      config table in a Ready To Boot callback, in order to decide about
      exposing the DT.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      a00601c6
    • Laszlo Ersek's avatar
      Revert "ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent" · 30cb1485
      Laszlo Ersek authored
      
      
      This reverts commit 78c41ff5.
      
      We realized that DXE drivers that are independent of AcpiPlatformDxe (that
      is, independent of QEMU's ACPI generation), such as RamDiskDxe and
      BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables,
      at driver dispatch or even at Ready To Boot.
      
      This makes it unsafe for us to check for ACPI presence in the UEFI system
      config table in a Ready To Boot callback, in order to decide about
      exposing the DT.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      30cb1485
  11. Mar 22, 2017
  12. Mar 21, 2017
  13. Mar 14, 2017
  14. Mar 09, 2017
  15. Mar 08, 2017
  16. Mar 07, 2017
  17. Mar 01, 2017
    • Ard Biesheuvel's avatar
      ArmVirtPkg AARCH64: enable NX memory protection for all platforms · 1acd7c54
      Ard Biesheuvel authored
      
      
      This sets the recently introduced PCD PcdDxeNxMemoryProtectionPolicy to
      a value that protects all memory regions except code regions against
      inadvertent execution.
      
      Note that this does not [yet] protect EfiLoaderData regions, due to
      compatibility issues with shim and GRUB.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarJiewen Yao <jiewen.yao@intel.com>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Tested-by: default avatarLaszlo Ersek <lersek@redhat.com>
      1acd7c54
    • Ard Biesheuvel's avatar
      ArmVirtPkg: move UefiBootManagerLib resolution to ArmVirt.dsc.inc · dd320e63
      Ard Biesheuvel authored
      
      
      Recent changes to ShellPkg require a resolution for UefiBootManagerLib
      for all platforms in ArmVirtPkg. So move the resolution to the shared
      include ArmVirt.dsc.inc.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarRuiyu Ni <ruiyu.ni@intel.com>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      dd320e63
    • Ard Biesheuvel's avatar
      ArmVirtPkg/HighMemDxe: preserve non-exec permissions on newly added regions · 413edd47
      Ard Biesheuvel authored
      
      
      Using DxeServices::SetMemorySpaceAttributes to set cacheability
      attributes has the side effect of stripping permission attributes,
      given that those are bits in the same bitfield, and so setting the
      Attributes argument to EFI_MEMORY_WB implies not setting EFI_MEMORY_XP
      or EFI_MEMORY_RO attributes.
      
      In fact, the situation is even worse, given that the descriptor returned
      by DxeServices::GetMemorySpaceDescriptor does not reflect the permission
      attributes that may have been set by the preceding call to
      DxeServices::AddMemorySpace if PcdDxeNxMemoryProtectionPolicy has been
      configured to map EfiConventionalMemory with non-executable permissions.
      
      Note that this applies equally to the non-executable stack and to PE/COFF
      sections that may have been mapped with R-X or RW- permissions. This is
      due to the ambiguity in the meaning of the EFI_MEMORY_RO/EFI_MEMORY_XP
      attributes when used in the GCD memory map, i.e., between signifying
      that an underlying RAM region has the controls to be configured as
      read-only or non-executable, and signifying that the contents of a
      certain UEFI memory region allow them to be mapped with certain
      restricted permissions.
      
      So let's check the policy in PcdDxeNxMemoryProtectionPolicy directly,
      and set the EFI_MEMORY_XP attribute if appropriate for
      EfiConventionalMemory regions.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      413edd47
  18. Feb 27, 2017
    • Ard Biesheuvel's avatar
      ArmPkg: remove unused PcdArmUncachedMemoryMask PCD · 40f42465
      Ard Biesheuvel authored
      
      
      This removes the PCD PcdArmUncachedMemoryMask from ArmPkg, along with
      any remaining references to it in various platform .DSC files. It is
      no longer used now that we removed the virtual uncached pages protocol
      and the associated DebugUncachedMemoryAllocationLib library instance.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
      40f42465
    • Ard Biesheuvel's avatar
      ArmVirtPkg: clear PcdPerformanceLibraryPropertyMask PCD · 4b1dd5c4
      Ard Biesheuvel authored
      
      
      The only observeable effect of having PcdPerformanceLibraryPropertyMask
      set to 1 is that a EfiReservedMemory region of 4 pages is allocated right
      below the 4 GB mark. This region is out of bounds for the OS, which means
      it is not even allowed to map it, to avoid speculative loads from it.
      
      On Linux, this may prevent the kernel from using a 1 GB block mapping for
      this region, and instead it has to carve up the block as follows:
      
        0xffffffff80000000-0xffffffffbe000000         992M PMD CON BLK
        0xffffffffbe000000-0xffffffffbfe00000          30M PMD     BLK
        0xffffffffbfe00000-0xffffffffbfff0000        1984K PTE CON
        0xffffffffbfff0000-0xffffffffbfffc000          48K PTE
      
      where it would otherwise use a single 1 GB mapping (*), i.e.,
      
        0xffffffff80000000-0xffffffffc0000000           1G PGD
      
      To clarify, the latter is a single 8 byte entry in the top level page
      table, whereas in the former case, we have two additional levels of
      paging, requiring two extra 4 KB pages (on a 4 KB pagesize kernel).
      
      The real cost, however, is the TLB footprint, which goes up from a
      single entry to a number between 90 and 1020, depending on whether
      contiguous hints are honoured by the hardware.
      
      So let's remove PcdPerformanceLibraryPropertyMask until we find a reason
      why we need it.
      
      (*) provided that no other allocations were deliberately located right
          below the 4 GB mark, and that we are running with more than 3 GB of
          memory, in which case most allocations will be over 4 GB, given EDK2's
          default top-down allocation policy.
      
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      4b1dd5c4
  19. Feb 25, 2017
    • Laszlo Ersek's avatar
      ArmVirtPkg: resolve OpensslLib to OpensslLibCrypto · 622627f8
      Laszlo Ersek authored
      
      
      The OpensslLibCrypto library instance (which does not contain libssl
      functions) is sufficient for the Secure Boot feature. It would not be
      sufficient for HTTPS booting (which requires TLS), but in ArmVirtPkg, we
      don't even enable plaintext HTTP booting for the time being.
      
      Ease security analysis by excluding libssl functionality from the
      OpensslLib instance we use.
      
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Tomas Hoger <thoger@redhat.com>
      Contributed-under: TianoCore Contribution Agreement 1.0
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      622627f8
Loading