[PATCH v4 35/44] x86/boot: remove usage of mod_end by discard_initial_images

Daniel P. Smith posted 44 patches 3 months ago
There is a newer version of this series
[PATCH v4 35/44] x86/boot: remove usage of mod_end by discard_initial_images
Posted by Daniel P. Smith 3 months ago
This eliminates usage of early_mod by discard_initial_images

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/pv/dom0_build.c | 2 +-
 xen/arch/x86/setup.c         | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index dce62d76e41e..a403e23b2f93 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -641,7 +641,7 @@ int __init dom0_construct_pv(struct domain *d,
                 if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
                     BUG();
         }
-        initrd->size = initrd->early_mod->mod_end = 0;
+        initrd->size = 0;
 
         iommu_memory_setup(d, "initrd", mfn_to_page(_mfn(initrd_mfn)),
                            PFN_UP(initrd_len), &flush_flags);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 977b68098694..81610405a53c 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -353,12 +353,10 @@ void __init discard_initial_images(void)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t start =
-            (uint64_t)boot_info->mods[i].early_mod->mod_start << PAGE_SHIFT;
+        uint64_t start = boot_info->mods[i].start;
 
         init_domheap_pages(start,
-                           start +
-                           PAGE_ALIGN(boot_info->mods[i].early_mod->mod_end));
+                           start + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     boot_info->nr_mods = 0;
-- 
2.30.2