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

[Xen-changelog] [xen master] Revert "x86/HVM: differentiate IO/mem resources tracked by ioreq server"



commit 19e5e7832400fa9b3e73f86d6a0175c5fbb7f4a2
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Feb 17 16:23:31 2016 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 17 16:23:31 2016 +0100

    Revert "x86/HVM: differentiate IO/mem resources tracked by ioreq server"
    
    This reverts commit f5a32c5b8eacbcd727939c9b4d2d98cf619bcbd6;
    we're aiming at a different solution now.
---
 tools/libxc/include/xenctrl.h    | 31 ----------------------
 tools/libxc/xc_domain.c          | 55 ----------------------------------------
 xen/arch/x86/hvm/hvm.c           | 27 +++-----------------
 xen/include/asm-x86/hvm/domain.h |  2 +-
 xen/include/public/hvm/hvm_op.h  |  1 -
 5 files changed, 5 insertions(+), 111 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 42eafa4..150d727 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1714,37 +1714,6 @@ int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface 
*xch,
                                             int is_mmio,
                                             uint64_t start,
                                             uint64_t end);
-/**
- * This function registers a range of write-protected memory for emulation.
- *
- * @parm xch a handle to an open hypervisor interface.
- * @parm domid the domain id to be serviced
- * @parm id the IOREQ Server id.
- * @parm start start of range
- * @parm end end of range (inclusive).
- * @return 0 on success, -1 on failure.
- */
-int xc_hvm_map_wp_mem_range_to_ioreq_server(xc_interface *xch,
-                                            domid_t domid,
-                                            ioservid_t id,
-                                            xen_pfn_t start,
-                                            xen_pfn_t end);
-
-/**
- * This function deregisters a range of write-protected memory for emulation.
- *
- * @parm xch a handle to an open hypervisor interface.
- * @parm domid the domain id to be serviced
- * @parm id the IOREQ Server id.
- * @parm start start of range
- * @parm end end of range (inclusive).
- * @return 0 on success, -1 on failure.
- */
-int xc_hvm_unmap_wp_mem_range_from_ioreq_server(xc_interface *xch,
-                                                domid_t domid,
-                                                ioservid_t id,
-                                                xen_pfn_t start,
-                                                xen_pfn_t end);
 
 /**
  * This function registers a PCI device for config space emulation.
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 4fa993a..050216e 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1523,61 +1523,6 @@ int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface 
*xch, domid_t domid,
     return rc;
 }
 
-int xc_hvm_map_wp_mem_range_to_ioreq_server(xc_interface *xch,
-                                            domid_t domid,
-                                            ioservid_t id,
-                                            xen_pfn_t start,
-                                            xen_pfn_t end)
-{
-    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
-    int rc;
-
-    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
-    if ( arg == NULL )
-        return -1;
-
-    arg->domid = domid;
-    arg->id = id;
-    arg->type = HVMOP_IO_RANGE_WP_MEM;
-    arg->start = start;
-    arg->end = end;
-
-    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
-                  HVMOP_map_io_range_to_ioreq_server,
-                  HYPERCALL_BUFFER_AS_ARG(arg));
-
-    xc_hypercall_buffer_free(xch, arg);
-    return rc;
-}
-
-int xc_hvm_unmap_wp_mem_range_from_ioreq_server(xc_interface *xch,
-                                                domid_t domid,
-                                                ioservid_t id,
-                                                xen_pfn_t start,
-                                                xen_pfn_t end)
-{
-    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
-    int rc;
-
-    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
-    if ( arg == NULL )
-        return -1;
-
-    arg->domid = domid;
-    arg->id = id;
-    arg->type = HVMOP_IO_RANGE_WP_MEM;
-    arg->start = start;
-    arg->end = end;
-
-    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
-                  HVMOP_unmap_io_range_from_ioreq_server,
-                  HYPERCALL_BUFFER_AS_ARG(arg));
-
-    xc_hypercall_buffer_free(xch, arg);
-    return rc;
-
-}
-
 int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
                                       ioservid_t id, uint16_t segment,
                                       uint8_t bus, uint8_t device,
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3362637..a29c421 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -947,9 +947,6 @@ static void hvm_ioreq_server_free_rangesets(struct 
hvm_ioreq_server *s,
         rangeset_destroy(s->range[i]);
 }
 
-const char *const io_range_name[NR_IO_RANGE_TYPES] =
-                                {"port", "mmio", "pci", "wp-mem"};
-
 static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s, 
                                             bool_t is_default)
 {
@@ -964,7 +961,10 @@ static int hvm_ioreq_server_alloc_rangesets(struct 
hvm_ioreq_server *s,
         char *name;
 
         rc = asprintf(&name, "ioreq_server %d %s", s->id,
-                      (i < NR_IO_RANGE_TYPES) ? io_range_name[i] : "");
+                      (i == HVMOP_IO_RANGE_PORT) ? "port" :
+                      (i == HVMOP_IO_RANGE_MEMORY) ? "memory" :
+                      (i == HVMOP_IO_RANGE_PCI) ? "pci" :
+                      "");
         if ( rc )
             goto fail;
 
@@ -1282,7 +1282,6 @@ static int hvm_map_io_range_to_ioreq_server(struct domain 
*d, ioservid_t id,
             case HVMOP_IO_RANGE_PORT:
             case HVMOP_IO_RANGE_MEMORY:
             case HVMOP_IO_RANGE_PCI:
-            case HVMOP_IO_RANGE_WP_MEM:
                 r = s->range[type];
                 break;
 
@@ -1334,7 +1333,6 @@ static int hvm_unmap_io_range_from_ioreq_server(struct 
domain *d, ioservid_t id,
             case HVMOP_IO_RANGE_PORT:
             case HVMOP_IO_RANGE_MEMORY:
             case HVMOP_IO_RANGE_PCI:
-            case HVMOP_IO_RANGE_WP_MEM:
                 r = s->range[type];
                 break;
 
@@ -2650,18 +2648,6 @@ struct hvm_ioreq_server *hvm_select_ioreq_server(struct 
domain *d,
         type = (p->type == IOREQ_TYPE_PIO) ?
                 HVMOP_IO_RANGE_PORT : HVMOP_IO_RANGE_MEMORY;
         addr = p->addr;
-        if ( type == HVMOP_IO_RANGE_MEMORY )
-        {
-            p2m_type_t p2mt;
-            struct page_info *ram_page;
-
-            ram_page = get_page_from_gfn(d, PFN_DOWN(p->addr), &p2mt, 0);
-            if ( p2mt == p2m_mmio_write_dm )
-                type = HVMOP_IO_RANGE_WP_MEM;
-
-            if ( ram_page )
-                put_page(ram_page);
-        }
     }
 
     list_for_each_entry ( s,
@@ -2703,11 +2689,6 @@ struct hvm_ioreq_server *hvm_select_ioreq_server(struct 
domain *d,
             }
 
             break;
-        case HVMOP_IO_RANGE_WP_MEM:
-            if ( rangeset_contains_singleton(r, PFN_DOWN(addr)) )
-                return s;
-
-            break;
         }
     }
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 4b54c5d..2446586 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -48,7 +48,7 @@ struct hvm_ioreq_vcpu {
     bool_t           pending;
 };
 
-#define NR_IO_RANGE_TYPES (HVMOP_IO_RANGE_WP_MEM + 1)
+#define NR_IO_RANGE_TYPES (HVMOP_IO_RANGE_PCI + 1)
 #define MAX_NR_IO_RANGES  256
 
 struct hvm_ioreq_server {
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index c0b1e30..1606185 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -333,7 +333,6 @@ struct xen_hvm_io_range {
 # define HVMOP_IO_RANGE_PORT   0 /* I/O port range */
 # define HVMOP_IO_RANGE_MEMORY 1 /* MMIO range */
 # define HVMOP_IO_RANGE_PCI    2 /* PCI segment/bus/dev/func range */
-# define HVMOP_IO_RANGE_WP_MEM 3 /* Write-protected ram range */
     uint64_aligned_t start, end; /* IN - inclusive start and end of range */
 };
 typedef struct xen_hvm_io_range xen_hvm_io_range_t;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.