[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [V3 PATCH 2/9] PVH dom0: create add_mem_mapping_for_xlate() function



>>> On 27.11.13 at 03:27, Mukesh Rathor <mukesh.rathor@xxxxxxxxxx> wrote:
> In this preparatory patch, add portion of XEN_DOMCTL_memory_mapping
> code is put into a function so it can be called later for PVH from
> construct_dom0. There is no change in it's functionality.
> The function is made non-static in the construct_dom0 patch.

At this point I start questioning the purpose of the whole patch
(and hence I'm glad I requested the scope of the broken out
code to be further restricted):

> +static int add_mem_mapping_for_xlate(struct domain *d, unsigned long gfn,
> +                              unsigned long mfn, unsigned long nr_mfns)
> +{
> +    unsigned long i;
> +    int ret = 0;
> +
> +    for ( i = 0; i < nr_mfns; i++ )
> +        if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
> +            ret = -EIO;
> +    if ( ret )
> +    {
> +        if ( is_hardware_domain(d) )
> +            panic("Failed setting p2m. ret:%d gfn:%lx mfn:%lx i:%ld\n",
> +                  ret, gfn, mfn, i);

In effect for Dom0 all you need is the code up to here, so the code
re-used from the domctl is _only_ the loop at the beginning of the
function. That doesn't look like a worthwhile refactoring - just add
the loop to domain_build.c verbatim.

Jan


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.