[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 13/44] x86/boot: transition relocation calculations to struct boot_module
- To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Thu, 17 Oct 2024 20:42:39 -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=wSrMqtuJMc2lXNjsjYK9vb2y0nNh0jXdP0MkdIJ7OLE=; b=SBTp6eKN4KjRBzXqEDr/enN0+qth4brJxzYN7hUWUmQKJoBB7KbVXDtu08Rx8kfIYZq0FYDoPcX2abCvity68+vCeVshEyeCtzndl+9osk4qeOrvpYWaAt1MYMaF/vJT1Sb4yTJAzkwp6SP4jXCeovJKaQBMyu0cHce7iBayffvukrzBN67nrQdgMIOnk08rURH92OVnAik2T/I94NEkYuYMTFj2eVLk8wY4czaL5Tpq/dSCKGtZ0d9vdznvojixVavAdOUKGXXRN2VQSSQfixTLPhqAhYcL7yiT4sN0tMrHJWLVIJgA6S/0pDIu77xfdfVgFsCTAURQ00oQeSSKVg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=opET5GyILpUYiawNrdmM6DVi4sK4gltuYag5lJzDt9Hd/YUBx65jnsS5LE4qDADY6zwsBPluNda8sF+uqItZPAxQcB2OlQPHouSeaYP+6drPMFYfzrMhDA4fCOQGGKQ6dCgAcDb4fk7w5rvvyqfF6ZTCvek0Fq6l1M1JNXLbJoH9jhFulyMRBcgkpmDQtWokrGXZxaZZuadAoK5FjedtHQRCd12svircPjqNrFJi73iJiKdtBzKCuMUkS7CXl514CQwAth5F/byjZnVgf5MohcNe3oG2DWVZyxrZErpzI+8AyTTG/MNaSz0oZaxpCDx99u8BB35rbnpYM0f0JzS7Vg==
- 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: Fri, 18 Oct 2024 00:42:55 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2024-10-17 13:02, Daniel P. Smith wrote:
Use struct boot_module fields, start and size, when calculating the relocation
address and size. It also ensures that early_mod references are kept in sync.
Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
Changes since v5:
- removed unnecessary paddr_to_pfn, allowing condition to collapse to one line
- correct a missed conversion from .mod->mod_start to .start
---
xen/arch/x86/setup.c | 38 +++++++++++++++++---------------------
1 file changed, 17 insertions(+), 21 deletions(-)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d51b0b03bc97..44cec48fc877 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1528,11 +1526,10 @@ void asmlinkage __init noreturn __start_xen(unsigned
long mbi_p)
panic("Not enough memory to relocate the dom0 kernel image\n");
for ( i = 0; i < bi->nr_modules; ++i )
{
- uint64_t s = (uint64_t)bi->mods[i].mod->mod_start
- << PAGE_SHIFT;
+ uint64_t s = (uint64_t)bi->mods[i].start;
I don't think this cast is necessary.
reserve_e820_ram(&boot_e820, s,
- s + PAGE_ALIGN(bi->mods[i].mod->mod_end));
+ s + PAGE_ALIGN(bi->mods[i].size));
}
if ( !xen_phys_start )
@@ -1686,12 +1682,12 @@ void asmlinkage __init noreturn __start_xen(unsigned
long mbi_p)
for ( i = 0; i < bi->nr_modules; ++i )
{
- 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),
- _mfn(bi->mods[i].mod->mod_start),
- PFN_UP(bi->mods[i].mod->mod_end), PAGE_HYPERVISOR);
+ set_pdx_range(paddr_to_pfn(bi->mods[i].start),
+ paddr_to_pfn(bi->mods[i].start) +
+ PFN_UP(bi->mods[i].size));
+ map_pages_to_xen((unsigned long)maddr_to_virt(bi->mods[i].start),
+ maddr_to_mfn(bi->mods[i].start),
+ PFN_UP(bi->mods[i].size), PAGE_HYPERVISOR);
I would vertically align all the parameters inside the (.
}
#ifdef CONFIG_KEXEC
With those:
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Regards,
Jason
|