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

Re: [Xen-devel] [PATCH 11/14] xen/x86: mm: Re-implement set_gpfn_from_mfn() as a static inline function



>>> On 07.05.19 at 17:14, <julien.grall@xxxxxxx> wrote:
> +static inline void set_gpfn_from_mfn(unsigned long mfn, unsigned long pfn)
> +{
> +    struct domain *d = page_get_owner(mfn_to_page(_mfn(mfn)));
> +    unsigned long entry = (d && (d == dom_cow)) ? SHARED_M2P_ENTRY : pfn;

The && here looks, ehm, funny, but I guess it's needed for early boot?
But that's perhaps a separate thing to clean up. However, looking at
this - why is Arm setting up dom_cow in the first place?

> +    if (!machine_to_phys_mapping_valid)

Please add the missing blanks.

> +        return;
> +
> +    if ( mfn >= (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) / 4 )

You've inverted the original condition (by re-using it verbatim) - I'm pretty
sure this is going to crash.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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