On 2024-11-08 14:17, Daniel P. Smith wrote:
On 11/7/24 15:47, Jason Andryuk wrote:
On 2024-11-02 13:25, Daniel P. Smith wrote:
@@ -1745,13 +1733,11 @@ void asmlinkage __init noreturn
__start_xen(void)
for ( i = 0; i < bi->nr_modules; ++i )
{
- const struct boot_module *bm = &bi->mods[i];
+ unsigned long s = bi->mods[i].start, l = bi->mods[i].size;
- set_pdx_range(bm->mod->mod_start,
- bm->mod->mod_start + PFN_UP(bm->mod->mod_end));
- map_pages_to_xen((unsigned long)mfn_to_virt(bm->mod-
>mod_start),
- _mfn(bm->mod->mod_start),
- PFN_UP(bm->mod->mod_end), PAGE_HYPERVISOR);
+ set_pdx_range(paddr_to_pfn(s), paddr_to_pfn(s) + PFN_UP(l));
This is fine today since s (.start) is checked for page alignment.
The other option would be `paddr_to_pfn(s + l) + 1`, but I'm not sure
that is an improvement.
Out of curiosity, why are you thinking that module start would never be
paged aligned?
I think you have an extra negation - the module start is always page
aligned as checked elsewhere.
While reviewing, I was just noting that this code starts rounding
addresses when it previously operated on pfns. Non page-aligned s + l
could then cross a page boundary.
Regards,
Jason