|
[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
On 2014/7/24 17:11, Andrew Cooper wrote: On 24/07/14 10:03, Chen, Tiejun wrote:On 2014/7/24 16:57, Andrew Cooper wrote:On 24/07/14 09:50, Tiejun Chen wrote: Sounds good so what about this? Subject: [PATCH 1/2] xen:p2m: introduce a public p2m_set_identity Often p2m_set_entry() always needs to hold p2m_lock but p2m_lock() is not easy included for some common occasions. So here introduce an new public p2m_set_identity holding this lock. Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx> --- xen/arch/x86/mm/p2m.c | 13 +++++++++++++ xen/include/asm-x86/p2m.h | 3 +++ 2 files changed, 16 insertions(+) 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. */
+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)
+{
+ int rc = 0;
+
+ p2m_lock(p2m);
+ rc = p2m_set_entry(p2m, gfn, mfn, page_order, p2mt, p2ma);
+ p2m_unlock(p2m);
+
+ return rc;
+}
+
struct page_info *p2m_alloc_ptp(struct p2m_domain *p2m, unsigned long
type)
{
struct page_info *pg;
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 0ddbadb..169bcd7 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -625,6 +625,9 @@ void p2m_free_ptp(struct p2m_domain *p2m, struct
page_info *pg);
int p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma); +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); +/* Set up function pointers for PT implementation: only for use by p2m code */ extern void p2m_pt_init(struct p2m_domain *p2m); -- 1.9.1 Thanks Tiejun _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |