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

Re: [Xen-devel] [v2][PATCH 1/1] xen:vtd: missing RMRR mapping while share EPT



Hi,

At 17:39 +0800 on 24 Jul (1406219964), Chen, Tiejun wrote:
> diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
> index 642ec28..d0cc586 100644
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -385,6 +385,19 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned 
> long gfn, mfn_t mfn,
>       return rc;
>   }
> 
> +/* Just hold p2m_lock then public. */

I can't understand this comment at all.  If you need to add a
new function, it should have a comment describing _what it does_.

> +int p2m_set_identity(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
> +                  unsigned int page_order, p2m_type_t p2mt, 
> p2m_access_t p2ma)

Also it shouldn't just allow the caller to set anything in a p2m
entry; that will cause endless trouble down the line as code outside
x86/mm breaks invariants that the p2m code is maintaining.

AFAICT a function to set an identity map should only need two
arguments, the domain and the mfn; it should then internally DTRT with
the other arguments.

But as mentioned in a few other emails, you might be able to use
set_mmio_p2m_entry() instead of adding new code.

Cheers,

Tim.


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