|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [v7][RFC][PATCH 08/13] xen/x86/p2m: set p2m_access_n for reserved device memory mapping
On 2014/10/24 23:11, Jan Beulich wrote: On 24.10.14 at 09:34, <tiejun.chen@xxxxxxxxx> wrote: --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c@@ -556,6 +556,17 @@ guest_physmap_remove_page(struct domain *d, unsigned long gfn,
gfn_unlock(p2m, gfn, page_order);
}
+/* Check if we are accessing rdm. */
+int p2m_check_reserved_device_memory(xen_pfn_t start,
+ xen_ulong_t nr,
+ void *d)
+{
+ unsigned long *gfn = d;
+ xen_pfn_t end = start + nr;
+
+ return ( *gfn >= start && *gfn <= end ) ? 1 : 0;
+}
+
int
guest_physmap_add_entry(struct domain *d, unsigned long gfn,
unsigned long mfn, unsigned int page_order,
+ if ( rc )And the return value from the called function is of type int - non-zero may not just mean "true" but (when negative) also "error". You need to distinguish these cases. But in our case its impossible to get a negative value.
There are two scenarios we should concern: #1 in case of shared-ept. We always need to check so iommu_use_hap_pt(d) is good. #2 in case of non-sharepd-ept If mfn != gfn I think guest don't access RMRR range, so its allowed.
Can P2M_DEBUG work here?
P2M_DEBUG("set rdm p2m failed: %#lx\n", gfn);
Thanks
Tiejun
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |