[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 08/44] x86/boot: convert mod refs to boot_module mod
- To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Thu, 17 Oct 2024 19:02:43 -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=rlssxS5dA+B8fy3sNYL4ak5z1TyaBT3rNYJ2kxgo62g=; b=t1Ojzk8lg/XQAJhy8OTmwvzmu6LsIZJr3NwcmC9+sSLwGregKxrEiXRuOAdyg6wImnL+LIH/fCRSN+t7T8ZNeyGT9bEoWQZ6CQD+cx4dVD/4mT6Ql5jMhfSBAmNtPM9f+S5MzshiqNtITN7bFCLr4wxrMnXZ7NkBrXfL+zAhm2YHvupgiDioOx8wDAAethZKAErKZVguVHWFlMmOdsXBhOV3yajOpxIZjT68Nd5jc2i0ZbTWXAWWKLpjyXX3tRUnr8F51uI9at7vPtkwKbwu052/YTyXnp+MczFEv5kr5r7GQSxgByhOoRU03Av71NECJqzZL4UItV1FTwsqrisRbg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QtTYJrXRKxSIYghynvQYpU+DhidnRGHneNMbZ2xBni2eNMLNecMfMdh1nKfr2jjNdw9bdM0fHDYWwn+W94MsVp/t9CgOml1WFh+b7t0R8gG4hw/NvuAv+yk0xgCZY2qDymuEHVLkNu8tjT1DhiFm7g2MP9QnY5YjzncJ6P9gVOh0TjXYiLd4/5sRrVGzibmqh+fwMPWAEUAzZS5g9gzL4BPZxItQH1IgZzU/iXfMgPQ2JHN7dBrwbmInqAXX+lCF/NeZDg298VACgZ2kVB3+2+VbcchR58Nl6iIDUAeIZLQuFpA6u7liQ2a8KLnW5uCRHFhQqHjgN5xWGfCH+xcJOQ==
- 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: Thu, 17 Oct 2024 23:03:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2024-10-17 13:02, Daniel P. Smith wrote:
To allow a slow conversion of x86 over to struct boot_module, start with
replacing all references to module_t mod, only in setup.c, to the mod element
of struct boot_module. These serves twofold, first to allow the incremental
transition from module_t fields to struct boot_module fields. The second is to
allow the conversion of function definitions from taking module_t parameters to
accepting struct boot_module as needed when a transitioned field will be
accessed.
Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
Changes since v5:
- rewrote commit message
- coding style changes
- added comment for initial_images assignment
---
xen/arch/x86/setup.c | 64 +++++++++++++++++++++++++-------------------
1 file changed, 37 insertions(+), 27 deletions(-)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 11e1027d72dd..1b56eaf26efe 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1460,9 +1465,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long
mbi_p)
* move mod[0], we incorporate this as extra space at the start.
*/
struct boot_module *bm = &bi->mods[j];
- unsigned long size = PAGE_ALIGN(bm->headroom + mod[j].mod_end);
+ unsigned long size = PAGE_ALIGN(bm->headroom + bm->mod->mod_end);
- if ( mod[j].reserved )
+ if ( bi->mods[j].mod->reserved )
Use bm->mod->reserved here?
continue;
/* Don't overlap with other modules (or Xen itself). */
@@ -1591,8 +1598,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) +
pfn_to_paddr and mod_start can fit on one line
+ bi->mods[j].mod->mod_end;
if ( map_e < end )
map_e = end;
@@ -1666,11 +1674,12 @@ 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));
Indent PFN_UP since it's a continuation of the previous argument?
+ map_pages_to_xen((unsigned
long)mfn_to_virt(bi->mods[i].mod->mod_start),
+ _mfn(bi->mods[i].mod->mod_start),
+ PFN_UP(bi->mods[i].mod->mod_end), PAGE_HYPERVISOR);
}
#ifdef CONFIG_KEXEC
Regards,
Jason
|