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

Re: [Xen-devel] [v6][PATCH 1/2] xen:x86:mm:p2m: introduce set_identity_p2m_entry



>>> On 01.08.14 at 04:25, <tiejun.chen@xxxxxxxxx> wrote:
> On 2014/8/1 6:29, Tian, Kevin wrote:
>> what about !mfn_valid but the GFN has been used for emulated MMIOs? w/o
>> a guest e820 view you can't avoid overlapping by just looking at mfn...
> 
> What about the follows based on this patch?
> 
> @@ -865,14 +865,26 @@ int set_identity_p2m_entry(struct domain *d, unsigned 
> long gfn)
>       mfn_t mfn;
>       struct p2m_domain *p2m = p2m_get_hostp2m(d);
>       int ret = -EBUSY;
> +    u64 base_addr, end_addr;
> 
>       gfn_lock(p2m, gfn, 0);
> 
>       mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
> 
>       if ( !mfn_valid(mfn) )
> +    {
> +        base_addr = gfn << PAGE_ORDER_4K;
> +        end_addr = base_addr + PAGE_MASK;
> +        if ( (!page_is_ram_type(paddr_to_pfn(base_addr), RAM_TYPE_RESERVED)) 
> ||
> +             (!page_is_ram_type(paddr_to_pfn(end_add), RAM_TYPE_RESERVED)) )
> +        {
> +            gfn_unlock(p2m, gfn, 0);
> +            return ret;
> +        }
> +

That you're looking at the host E820, whereas Kevin asked about the
guest one. But see also my other reply just sent to him.

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