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

Re: [Xen-devel] [PATCH v8 02/14] arch/arm: add consistency check to REMOVE p2m changes



On Sun, 2014-05-25 at 12:51 +0200, Arianna Avanzini wrote:
>              case REMOVE:
>                  {
> +                    unsigned long mfn = pte.p2m.base;
> +
> +                    /*
> +                     * Ensure that the guest address given as argument to
> +                     * this function is actually mapped to the specified
> +                     * machine address. maddr here is the machine address
> +                     * given to the function, while mfn is the machine
> +                     * frame number actually mapped to the guest address:
> +                     * check if the two correspond.
> +                     */
> +                    if ( !pte.p2m.valid || maddr != pfn_to_paddr(mfn) )
> +                    {
> +                        printk("p2m_remove: nonexistent mapping: "

nonexistent is misleading here, since it might be present but not what
we think it should be. Say something like:
        p2m_remove: mapping at %"PRIpaddr" is of mfn %"PRIpaddr" not 
%"PRIpaddr" as expected

and I think it needs to be a gdprintk or something more restircted than
a regular printk -- otherwise a guest might be able to spam the console.

> +                               "%"PRIx64" and %"PRIx64"\n",
> +                               pfn_to_paddr(mfn), maddr);

The correct format code for a paddr_t is PRIpaddr.

> +                        /*
> +                         * If we have successfully removed other mappings,
> +                         * overload flush local variable to store if we need
> +                         * to flush TLBs.
> +                         */
> +                        if (count) flush = 1; else flush = 0;
> +                        rc = -EINVAL;
> +                        goto out_flush;
> +                    }
> +                }
> +                /* fall through */

Ian.


_______________________________________________
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®.