BaseMemoryEncryptionNull.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /** @file
  2. Virtual Memory Management Services to set or clear the memory encryption
  3. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  4. Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. Code is derived from MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
  7. **/
  8. #include <Uefi.h>
  9. #include <Uefi/UefiBaseType.h>
  10. #include <Library/BaseLib.h>
  11. #include <Library/MemEncryptTdxLib.h>
  12. /**
  13. Returns boolean to indicate whether to indicate which, if any, memory encryption is enabled
  14. @param[in] Type Bitmask of encryption technologies to check is enabled
  15. @retval TRUE The encryption type(s) are enabled
  16. @retval FALSE The encryption type(s) are not enabled
  17. **/
  18. BOOLEAN
  19. EFIAPI
  20. MemEncryptTdxIsEnabled (
  21. VOID
  22. )
  23. {
  24. return FALSE;
  25. }
  26. /**
  27. This function clears memory encryption bit for the memory region specified by
  28. BaseAddress and NumPages from the current page table context.
  29. @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use
  30. current CR3)
  31. @param[in] BaseAddress The physical address that is the start
  32. address of a memory region.
  33. @param[in] NumPages The number of pages from start memory
  34. region.
  35. @retval RETURN_SUCCESS The attributes were cleared for the
  36. memory region.
  37. @retval RETURN_INVALID_PARAMETER Number of pages is zero.
  38. @retval RETURN_UNSUPPORTED Clearing the memory encryption attribute
  39. is not supported
  40. **/
  41. RETURN_STATUS
  42. EFIAPI
  43. MemEncryptTdxSetPageSharedBit (
  44. IN PHYSICAL_ADDRESS Cr3BaseAddress,
  45. IN PHYSICAL_ADDRESS BaseAddress,
  46. IN UINTN NumPages
  47. )
  48. {
  49. return EFI_UNSUPPORTED;
  50. }
  51. /**
  52. This function sets memory encryption bit for the memory region specified by
  53. BaseAddress and NumPages from the current page table context.
  54. @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use
  55. current CR3)
  56. @param[in] BaseAddress The physical address that is the start
  57. address of a memory region.
  58. @param[in] NumPages The number of pages from start memory
  59. region.
  60. @retval RETURN_SUCCESS The attributes were set for the memory
  61. region.
  62. @retval RETURN_INVALID_PARAMETER Number of pages is zero.
  63. @retval RETURN_UNSUPPORTED Setting the memory encryption attribute
  64. is not supported
  65. **/
  66. RETURN_STATUS
  67. EFIAPI
  68. MemEncryptTdxClearPageSharedBit (
  69. IN PHYSICAL_ADDRESS Cr3BaseAddress,
  70. IN PHYSICAL_ADDRESS BaseAddress,
  71. IN UINTN NumPages
  72. )
  73. {
  74. return EFI_UNSUPPORTED;
  75. }