]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen/pvh: remove code to map iomem from guest
authorMukesh Rathor <mukesh.rathor@oracle.com>
Wed, 30 Jan 2013 22:55:29 +0000 (14:55 -0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 6 Feb 2013 15:42:43 +0000 (10:42 -0500)
It was decided during xen patch review that xen map the iomem
transparently, so remove xen_set_clr_mmio_pvh_pte() and the sub
hypercall PHYSDEVOP_map_iomem.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
[v1: Fixed up the comment]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/xen/mmu.c
arch/x86/xen/setup.c
include/xen/interface/physdev.h

index 1a3806074b4342cb46616cb6237e6c6e3c2566c4..52936b3f2b2b428cdd81e9d071f9754574d9eff8 100644 (file)
@@ -333,20 +333,6 @@ static void xen_set_pte(pte_t *ptep, pte_t pteval)
        __xen_set_pte(ptep, pteval);
 }
 
-void xen_set_clr_mmio_pvh_pte(unsigned long pfn, unsigned long mfn,
-                             int nr_mfns, int add_mapping)
-{
-       struct physdev_map_iomem iomem;
-
-       iomem.first_gfn = pfn;
-       iomem.first_mfn = mfn;
-       iomem.nr_mfns = nr_mfns;
-       iomem.add_mapping = add_mapping;
-
-       if (HYPERVISOR_physdev_op(PHYSDEVOP_map_iomem, &iomem))
-               BUG();
-}
-
 static void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
                    pte_t *ptep, pte_t pteval)
 {
index 8cce47b98d5efe9435ba4432e0bf9ae51d9ba7e9..659dafc3b195f1b5fc3e508c160eba50292422a7 100644 (file)
@@ -235,20 +235,15 @@ static void __init xen_set_identity_and_release_chunk(
        *identity += set_phys_range_identity(start_pfn, end_pfn);
 }
 
-/* For PVH, the pfns [0..MAX] are mapped to mfn's in the EPT/NPT. The mfns
- * are released as part of this 1:1 mapping hypercall back to the dom heap.
- * Also, we map the entire IO space, ie, beyond max_pfn_mapped.
+
+/*
+ * PVH: xen has already mapped the IO space in the EPT/NPT for us, so we
+ * just need to adjust the released and identity count.
  */
-static void __init xen_pvh_identity_map_chunk(unsigned long start_pfn,
+static void __init xen_pvh_adjust_stats(unsigned long start_pfn,
                unsigned long end_pfn, unsigned long *released,
                unsigned long *identity, unsigned long max_pfn)
 {
-       unsigned long pfn;
-       int numpfns = 1, add_mapping = 1;
-
-       for (pfn = start_pfn; pfn < end_pfn; pfn++)
-               xen_set_clr_mmio_pvh_pte(pfn, pfn, numpfns, add_mapping);
-
        if (start_pfn <= max_pfn) {
                unsigned long end = min(max_pfn_mapped, end_pfn);
                *released += end - start_pfn;
@@ -288,7 +283,7 @@ static unsigned long __init xen_set_identity_and_release(
 
                        if (start_pfn < end_pfn) {
                                if (xlated_phys) {
-                                       xen_pvh_identity_map_chunk(start_pfn,
+                                       xen_pvh_adjust_stats(start_pfn,
                                                end_pfn, &released, &identity,
                                                nr_pages);
                                } else {
index 83050d32bf46243f9b09bfc494a7de98b0420c94..1844d31f45520fef57c93be90ba7e247e1a0b042 100644 (file)
@@ -274,16 +274,6 @@ struct physdev_dbgp_op {
     } u;
 };
 
-#define PHYSDEVOP_map_iomem        30
-struct physdev_map_iomem {
-    /* IN */
-    uint64_t first_gfn;
-    uint64_t first_mfn;
-    uint32_t nr_mfns;
-    uint32_t add_mapping; /* 1 == add mapping;  0 == unmap */
-
-};
-
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **