|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 3/5] x86: split PV dom0 builder to pv/dom0_builder.c
On 20/03/17 14:14, Wei Liu wrote:
> Long term we want to be able to disentangle PV and HVM code. Move the PV
> domain builder to a dedicated file.
>
> This in turn requires exposing a few functions and variables via a new
> header dom0_build.h. These functions and variables are now prefixed with
> "dom0_" if they weren't already so.
>
> No functional change.
>
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
A few minor style fixes...
> <big snip>
> + /* compatibility check */
> + compatible = 0;
> + compat32 = 0;
> + machine = elf_uval(&elf, elf.ehdr, e_machine);
> + printk(" Xen kernel: 64-bit, lsb, compat32\n");
> + if (elf_32bit(&elf) && parms.pae == XEN_PAE_BIMODAL)
Here.
> + parms.pae = XEN_PAE_EXTCR3;
> + if (elf_32bit(&elf) && parms.pae && machine == EM_386)
Here
> + {
> + compat32 = 1;
> + compatible = 1;
> + }
> + if (elf_64bit(&elf) && machine == EM_X86_64)
Here.
> <snip>
> +
> + l4tab += l4_table_offset(v_start);
> + pfn = alloc_spfn;
> + for ( count = 0; count < ((v_end-v_start)>>PAGE_SHIFT); count++ )
Here.
> <snip>
> +#ifndef NDEBUG
> +#define REVERSE_START ((v_end - v_start) >> PAGE_SHIFT)
> + if ( pfn > REVERSE_START && (vinitrd_start || pfn < initrd_pfn) )
> + mfn = alloc_epfn - (pfn - REVERSE_START);
> +#endif
> + dom0_update_physmap(d, pfn, mfn, vphysmap_start);
> + if (!(pfn & 0xfffff))
Here.
> + process_pending_softirqs();
> + }
> + si->first_p2m_pfn = pfn;
> + si->nr_p2m_frames = d->tot_pages - count;
> + page_list_for_each ( page, &d->page_list )
> + {
> + mfn = page_to_mfn(page);
> + BUG_ON(SHARED_M2P(get_gpfn_from_mfn(mfn)));
> + if ( get_gpfn_from_mfn(mfn) >= count )
> + {
> + BUG_ON(is_pv_32bit_domain(d));
> + if ( !paging_mode_translate(d) && !page->u.inuse.type_info &&
> + !get_page_and_type(page, d, PGT_writable_page) )
> + BUG();
> +
> + dom0_update_physmap(d, pfn, mfn, vphysmap_start);
> + ++pfn;
> + if (!(pfn & 0xfffff))
Here.
> + process_pending_softirqs();
> + }
> + }
> + BUG_ON(pfn != d->tot_pages);
> +#ifndef NDEBUG
> + alloc_epfn += PFN_UP(initrd_len) + si->nr_p2m_frames;
> +#endif
> + while ( pfn < nr_pages )
> + {
> + if ( (page = alloc_chunk(d, nr_pages - d->tot_pages)) == NULL )
> + panic("Not enough RAM for DOM0 reservation");
> + while ( pfn < d->tot_pages )
> + {
> + mfn = page_to_mfn(page);
> +#ifndef NDEBUG
> +#define pfn (nr_pages - 1 - (pfn - (alloc_epfn - alloc_spfn)))
> +#endif
> + dom0_update_physmap(d, pfn, mfn, vphysmap_start);
> +#undef pfn
> + page++; pfn++;
> + if (!(pfn & 0xfffff))
And here.
With these fixed, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |