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

[Xen-devel] [PATCH 07/14] xen: balloon: do not update stage 1 pagetable for autotranslated guests



This is unnecessary (since the page will be removed from the p2m) and
can be tricky if the page is in the middle of a superpage, as it is on
ARM.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
Also effects PVH but in a benign way I think.
---
 drivers/xen/balloon.c |   23 +++--------------------
 1 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 7885a19..1b56ae0 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -357,15 +357,7 @@ static enum bp_state increase_reservation(unsigned long 
nr_pages)
                BUG_ON(!xen_feature(XENFEAT_auto_translated_physmap) &&
                       phys_to_machine_mapping_valid(pfn));
 
-               if (xen_pv_domain() && 
-                   xen_feature(XENFEAT_auto_translated_physmap)) {
-                       /* PVH: we just need to update native page table */
-                       pte_t *ptep;
-                       unsigned int level;
-                       void *addr = __va(pfn << PAGE_SHIFT);
-                       ptep = lookup_address((unsigned long)addr, &level);
-                       set_pte(ptep, pfn_pte(pfn, PAGE_KERNEL));
-               } else
+               if (!xen_feature(XENFEAT_auto_translated_physmap))
                        set_phys_to_machine(pfn, frame_list[i]);
 
                /* Link back into the page tables if not highmem. */
@@ -427,21 +419,12 @@ static enum bp_state decrease_reservation(unsigned long 
nr_pages, gfp_t gfp)
 
                scrub_page(page);
 
-               if (xen_pv_domain() && !PageHighMem(page)) {
-                       if (xen_feature(XENFEAT_auto_translated_physmap)) {
-                               unsigned int level;
-                               pte_t *ptep;
-                               void *addr = __va(pfn << PAGE_SHIFT);
-                               ptep = lookup_address((unsigned long)addr, 
-                                                       &level);
-                               set_pte(ptep, __pte(0));
-
-                       } else {
+               if (xen_pv_domain() && !PageHighMem(page) &&
+                   !xen_feature(XENFEAT_auto_translated_physmap)) {
                                ret = HYPERVISOR_update_va_mapping(
                                        (unsigned long)__va(pfn << PAGE_SHIFT),
                                        __pte_ma(0), 0);
                                BUG_ON(ret);
-                       }
                }
        }
 
-- 
1.7.2.5


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