[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 08/44] x86/boot: convert setup.c mod refs to early_mod
- To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Mon, 7 Oct 2024 15:34:34 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+Br5IqemP5mmEKm3QmgCNxQLdckF52FE8XN2atHAZPg=; b=HI0itcflEx9L4XMx2sCRn58B2hU74rcULT7dqKI/YWB3x96bQz5JOn9jgmsQZuF2M+TpM/EZiEZX0/aoGAwyulSpKGXBdNrRh0uRDt2HIRQC7ZcZFWMCkY62mFa22XA21r5kJxvIJIazA2iKZTyTs7VL/p75g8RAsUFbpEseo1KnO9SY5ezf8jB3LuRGGzF3+t/zFGvzu5A5c4oV/k8dYabQt3OOzjcc/FkNAcTkJFbrYAUPRcjzVbMEnkS0Tf5I9h6FOTpTQPjP79fEeXFiMuZeKM5zUT9UUuSwYQbkFzlRYcQ2UWCVfZdsjmWIHx83ziLavUNj5/NN98hwoRcIlw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t3mTZWyhz9IAhFQZjUqFnuP22UK6KrHl+UIk0Nb4eD+y6bLbbdcnLdrVcZkQJJVh7Ar+hSJpf6AaNGS3kF4ZkSPL6NOcO325ovkIh7WWeJOHKRs2do1uVcIYMBm5kMkyeFVpdC6iXv0n48GIXP1bCi1BX5jEjls2t8E+bEA1To5pZUVsmLxDtqUbzGX/Q0VXw+1EGQvLHH+6RP9zk0qj043X6WdmEAFG7Azll0Vs512SOlGNm0u0x32MrUmt/FWdRkm42iIyBKdsnUWz9/t4MM+E0BaR1saHpOFaxyxjOxuzC/wm/j4BpuD4mf1Mhqi8W6L7LL3mBuhxbHGjC8hBWg==
- Cc: <christopher.w.clark@xxxxxxxxx>, <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 07 Oct 2024 19:35:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2024-10-06 17:49, Daniel P. Smith wrote:
To allow a slow conversion of x86 over to struct boot_module, start with
replacing all references to struct mod to the early_mod element of struct
boot_module. These serves twofold, first to allow the incremental transition
from struct mod fields to struct boot_module fields. The second is to allow
the conversion of function definitions from taking struct mod parameters to
accepting struct boot_module as needed when a transitioned field will be
accessed.
Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
xen/arch/x86/setup.c | 61 ++++++++++++++++++++++++--------------------
1 file changed, 34 insertions(+), 27 deletions(-)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index dd82ca3d43e2..ba4bee6b93af 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1341,15 +1341,15 @@ void asmlinkage __init noreturn __start_xen(unsigned
long mbi_p)
set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
kexec_reserve_area();
- initial_images = mod;
+ initial_images = bi->mods[0].mod;
Isn't this wrong?
mod is the array of module_t * of *all* modules, but bi->mods[0].mod is
a single module_t *?
for ( i = 0; !efi_enabled(EFI_LOADER) && i < bi->nr_modules; i++ )
{
- if ( mod[i].mod_start & (PAGE_SIZE - 1) )
+ if ( bi->mods[i].mod->mod_start & (PAGE_SIZE - 1) )
panic("Bootloader didn't honor module alignment request\n");
- mod[i].mod_end -= mod[i].mod_start;
- mod[i].mod_start >>= PAGE_SHIFT;
- mod[i].reserved = 0;
+ bi->mods[i].mod->mod_end -= bi->mods[i].mod->mod_start;
+ bi->mods[i].mod->mod_start >>= PAGE_SHIFT;
+ bi->mods[i].mod->reserved = 0;
}
/*
@@ -1509,13 +1510,15 @@ void asmlinkage __init noreturn __start_xen(unsigned
long mbi_p)
#endif
}
- if ( bi->mods[0].headroom && !mod->reserved )
+ if ( bi->mods[0].headroom && !bi->mods[0].mod->reserved )
panic("Not enough memory to relocate the dom0 kernel image\n");
for ( i = 0; i < bi->nr_modules; ++i )
{
- uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
+ uint64_t s = (uint64_t)bi->mods[i].mod->mod_start
+ << PAGE_SHIFT;
pfn_to_paddr() ?
- reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(mod[i].mod_end));
+ reserve_e820_ram(&boot_e820, s,
+ s + PAGE_ALIGN(bi->mods[i].mod->mod_end));
}
if ( !xen_phys_start )
@@ -1593,8 +1596,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long
mbi_p)
map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
for ( j = 0; j < bi->nr_modules; ++j )
{
- uint64_t end = pfn_to_paddr(mod[j].mod_start) +
- mod[j].mod_end;
+ uint64_t end = pfn_to_paddr(
+ bi->mods[j].mod->mod_start) +
+ bi->mods[j].mod->mod_end;
I think you want a different indent. I think
uint64_t end = pfn_to_paddr(bi->mods[j].mod->mod_start)
will all fit on one line (indented all the way). (Thunderbird makes it
difficult me to send indented.)
if ( map_e < end )
map_e = end;
@@ -1668,11 +1672,13 @@ void asmlinkage __init noreturn __start_xen(unsigned
long mbi_p)
for ( i = 0; i < bi->nr_modules; ++i )
{
- set_pdx_range(mod[i].mod_start,
- mod[i].mod_start + PFN_UP(mod[i].mod_end));
- map_pages_to_xen((unsigned long)mfn_to_virt(mod[i].mod_start),
- _mfn(mod[i].mod_start),
- PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
+ set_pdx_range(bi->mods[i].mod->mod_start,
+ bi->mods[i].mod->mod_start +
+ PFN_UP(bi->mods[i].mod->mod_end));
+ map_pages_to_xen(
+ (unsigned long)mfn_to_virt(bi->mods[i].mod->mod_start),
map_pages_to_xen((unsigned long)maddr_to_virt(bi->mods[i].start),
All fits on one line.
+ _mfn(bi->mods[i].mod->mod_start),
+ PFN_UP(bi->mods[i].mod->mod_end), PAGE_HYPERVISOR);
}
#ifdef CONFIG_KEXEC
Regards,
Jason
|