Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream tech debt: HighMemDxe is not actually needed in OVMF RISC-V #80

Open
andreiw opened this issue Feb 15, 2024 · 1 comment
Open

Comments

@andreiw
Copy link
Contributor

andreiw commented Feb 15, 2024

The RISC-V Sec code processes all the "memory" devices in Memory.c, so HighMemDxe code does absolutely nothing.

To test HighMemDxe, this is what I do:

--- a/OvmfPkg/RiscVVirt/Sec/Memory.c
+++ b/OvmfPkg/RiscVVirt/Sec/Memory.c
@@ -253,6 +253,7 @@ MemoryPeimInitialization (
   INT32                       Node, Prev;
   INT32                       Len;
   VOID                        *FdtPointer;
+  BOOLEAN                     Once = TRUE;

   FirmwareContext = NULL;
   GetFirmwareContextPointer (&FirmwareContext);
@@ -285,18 +286,21 @@ MemoryPeimInitialization (
         CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
         CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));

-        DEBUG ((
-          DEBUG_INFO,
-          "%a: System RAM @ 0x%lx - 0x%lx\n",
-          __func__,
-          CurBase,
-          CurBase + CurSize - 1
-          ));
+        if (Once) {
+          DEBUG ((
+            DEBUG_INFO,
+            "%a: System RAM @ 0x%lx - 0x%lx\n",
+            __func__,
+            CurBase,
+            CurBase + CurSize - 1
+            ));

-        InitializeRamRegions (
-          CurBase,
-          CurSize
-          );
+          InitializeRamRegions (
+            CurBase,
+            CurSize
+            );
+          Once = FALSE;
+        }
       } else {
         DEBUG ((
           DEBUG_ERROR,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant