xen/pvh: Don't setup P2M tree.
[linux-2.6-microblaze.git] / arch / x86 / xen / p2m.c
index a61c7d5..fb7ee0a 100644 (file)
@@ -280,6 +280,9 @@ void __ref xen_build_mfn_list_list(void)
 {
        unsigned long pfn;
 
+       if (xen_feature(XENFEAT_auto_translated_physmap))
+               return;
+
        /* Pre-initialize p2m_top_mfn to be completely missing */
        if (p2m_top_mfn == NULL) {
                p2m_mid_missing_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE);
@@ -346,10 +349,15 @@ void xen_setup_mfn_list_list(void)
 /* Set up p2m_top to point to the domain-builder provided p2m pages */
 void __init xen_build_dynamic_phys_to_machine(void)
 {
-       unsigned long *mfn_list = (unsigned long *)xen_start_info->mfn_list;
-       unsigned long max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages);
+       unsigned long *mfn_list;
+       unsigned long max_pfn;
        unsigned long pfn;
 
+        if (xen_feature(XENFEAT_auto_translated_physmap))
+               return;
+
+       mfn_list = (unsigned long *)xen_start_info->mfn_list;
+       max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages);
        xen_max_p2m_pfn = max_pfn;
 
        p2m_missing = extend_brk(PAGE_SIZE, PAGE_SIZE);
@@ -799,10 +807,10 @@ bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 {
        unsigned topidx, mididx, idx;
 
-       if (unlikely(xen_feature(XENFEAT_auto_translated_physmap))) {
-               BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
+       /* don't track P2M changes in autotranslate guests */
+       if (unlikely(xen_feature(XENFEAT_auto_translated_physmap)))
                return true;
-       }
+
        if (unlikely(pfn >= MAX_P2M_PFN)) {
                BUG_ON(mfn != INVALID_P2M_ENTRY);
                return true;