VirtualBox

Ignore:
Timestamp:
Oct 16, 2024 2:15:04 PM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165199
Message:

Devices/EFI/Firmware: Make the BaseRngLib work on ARM platform where the initial firmware is mapped RX, bugref:10777

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseRngLib/AArch64/Rndr.c

    r105670 r106386  
    2020#include "BaseRngLibInternals.h"
    2121
     22/*
     23 * This is non XIP (eXecute In Place) safe.
     24 * This is used very early on in the TPM code when tings are still directly running from the ROM region which is RX only,
     25 * causing a write access fault, so avoid caching the flag and query it always.
     26 */
     27#ifndef VBOX
    2228STATIC BOOLEAN  mRndrSupported;
     29#endif
    2330
    2431//
     
    4451  )
    4552{
     53#ifndef VBOX
    4654  UINT64  Isar0;
    4755
     
    5361
    5462  mRndrSupported = ((Isar0 & RNDR_MASK) != 0);
     63#endif
    5564
    5665  return EFI_SUCCESS;
     
    138147  )
    139148{
     149#ifndef VBOX
    140150  return mRndrSupported;
     151#else
     152  return (ArmReadIdIsar0() & RNDR_MASK) != 0;
     153#endif
    141154}
    142155
     
    163176  }
    164177
     178#ifndef VBOX
    165179  if (!mRndrSupported) {
    166180    return EFI_UNSUPPORTED;
    167181  }
     182#else
     183  if (!(ArmReadIdIsar0() & RNDR_MASK)) {
     184    return EFI_UNSUPPORTED;
     185  }
     186#endif
    168187
    169188  //
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette