All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v3 3/5] x86: split PV dom0 builder to pv/dom0_builder.c
Date: Mon, 20 Mar 2017 14:43:52 +0000	[thread overview]
Message-ID: <6ef6811a-829f-da48-aaec-fa5218668e38@citrix.com> (raw)
In-Reply-To: <20170320141426.20780-4-wei.liu2@citrix.com>

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@citrix.com>

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@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-20 14:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 14:14 [PATCH v3 0/5] Refactor x86 dom0 builder Wei Liu
2017-03-20 14:14 ` [PATCH v3 1/5] x86: rename domain_build.c to dom0_build.c Wei Liu
2017-03-20 14:14 ` [PATCH v3 2/5] x86: modify setup_dom0_vcpu to use dom0_cpus internally Wei Liu
2017-03-20 14:21   ` Andrew Cooper
2017-03-20 15:19   ` Jan Beulich
2017-03-20 15:20     ` Wei Liu
2017-03-20 14:14 ` [PATCH v3 3/5] x86: split PV dom0 builder to pv/dom0_builder.c Wei Liu
2017-03-20 14:43   ` Andrew Cooper [this message]
2017-03-20 14:14 ` [PATCH v3 4/5] x86: split PVH dom0 builder to hvm/dom0_build.c Wei Liu
2017-03-20 14:51   ` Andrew Cooper
2017-03-20 14:14 ` [PATCH v3 5/5] x86: clean up header files in dom0_build.c Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ef6811a-829f-da48-aaec-fa5218668e38@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.