mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/PV: make better use of assign_pages()
As of the referenced commit there's no reason to open-code the loop
anymore. With that replaced by a single call, there's then also no point
in using the local "mfn" in this code.
Amends: 5260e8fb93 ("xen: re-define assign_pages and introduce a new function assign_page")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: George Dunlap <gwd@xenproject.org>
This commit is contained in:
1 parent
9d6b6e4f73
commit
8ec581a118
1 file changed
+4
-5
@@ -618,12 +618,12 @@ static int __init dom0_construct(const struct boot_domain *bd)
|
||||
(vinitrd_start - v_start) >> PAGE_SHIFT :
|
||||
domain_tot_pages(d);
|
||||
initrd_mfn = paddr_to_pfn(initrd->start);
|
||||
mfn = initrd_mfn;
|
||||
count = PFN_UP(initrd_len);
|
||||
|
||||
#ifdef CONFIG_PV32
|
||||
if ( d->arch.pv.physaddr_bitsize &&
|
||||
((mfn + count - 1) >> (d->arch.pv.physaddr_bitsize - PAGE_SHIFT)) )
|
||||
((initrd_mfn + count - 1) >>
|
||||
(d->arch.pv.physaddr_bitsize - PAGE_SHIFT)) )
|
||||
{
|
||||
order = get_order_from_pages(count);
|
||||
page = alloc_domheap_pages(d, order, MEMF_no_scrub);
|
||||
@@ -648,9 +648,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
while ( count-- )
|
||||
if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
|
||||
BUG();
|
||||
if ( assign_pages(mfn_to_page(_mfn(initrd_mfn)), count, d, 0) )
|
||||
BUG();
|
||||
/*
|
||||
* We have mapped the initrd directly into dom0, and assigned the
|
||||
* pages. Tell the boot_module handling that we've freed it, so the
|
||||
|
||||