direct-io.hg

changeset 8670:d8232e9f7988

Remove unneeded /proc/xen/grant and its libxc wrapper.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jan 26 00:17:06 2006 +0100 (2006-01-26)
parents 2cb434a12bba
children 5fcc346d6fe0
files linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c tools/libxc/Makefile tools/libxc/xenctrl.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Jan 26 00:10:03 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Jan 26 00:17:06 2006 +0100
     1.3 @@ -14,7 +14,6 @@
     1.4  #include <asm-xen/xen-public/xen.h>
     1.5  #include <asm/fixmap.h>
     1.6  #include <asm/uaccess.h>
     1.7 -#include <asm-xen/xen_proc.h>
     1.8  #include <asm-xen/linux-public/privcmd.h>
     1.9  #include <asm-xen/gnttab.h>
    1.10  #include <asm/synch_bitops.h>
    1.11 @@ -340,81 +339,6 @@ gnttab_request_free_callback(struct gntt
    1.12  	spin_unlock_irqrestore(&gnttab_list_lock, flags);
    1.13  }
    1.14  
    1.15 -/*
    1.16 - * ProcFS operations
    1.17 - */
    1.18 -
    1.19 -#ifdef CONFIG_PROC_FS
    1.20 -
    1.21 -static struct proc_dir_entry *grant_pde;
    1.22 -static struct file_operations grant_file_ops;
    1.23 -
    1.24 -static int
    1.25 -grant_read(char *page, char **start, off_t off, int count, int *eof,
    1.26 -	   void *data)
    1.27 -{
    1.28 -	int             len;
    1.29 -	unsigned int    i;
    1.30 -	grant_entry_t  *gt;
    1.31 -
    1.32 -	gt = (grant_entry_t *)shared;
    1.33 -	len = 0;
    1.34 -
    1.35 -	for (i = 0; i < NR_GRANT_ENTRIES; i++) {
    1.36 -		if (len > (PAGE_SIZE - 200)) {
    1.37 -			len += sprintf( page + len, "Truncated.\n");
    1.38 -			break;
    1.39 -		}
    1.40 -	}
    1.41 -
    1.42 -	if (gt[i].flags) {
    1.43 -		len += sprintf(page + len,
    1.44 -			       "Grant: ref (0x%x) flags (0x%hx) "
    1.45 -			       "dom (0x%hx) frame (0x%x)\n", 
    1.46 -			       i,
    1.47 -			       gt[i].flags,
    1.48 -			       gt[i].domid,
    1.49 -			       gt[i].frame );
    1.50 -	}
    1.51 -
    1.52 -	*eof = 1;
    1.53 -	return len;
    1.54 -}
    1.55 -
    1.56 -static int
    1.57 -grant_write(struct file *file, const char __user *buffer, unsigned long count,
    1.58 -	    void *data)
    1.59 -{
    1.60 -	/* TODO: implement this */
    1.61 -	return -ENOSYS;
    1.62 -}
    1.63 -
    1.64 -static int __init
    1.65 -gnttab_proc_init(void)
    1.66 -{
    1.67 -	/*
    1.68 -	 *  /proc/xen/grant : used by libxc to access grant tables
    1.69 -	 */
    1.70 -	if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
    1.71 -		WPRINTK("Unable to create grant xen proc entry\n");
    1.72 -		return -1;
    1.73 -	}
    1.74 -
    1.75 -	grant_file_ops.read   = grant_pde->proc_fops->read;
    1.76 -	grant_file_ops.write  = grant_pde->proc_fops->write;
    1.77 -
    1.78 -	grant_pde->proc_fops  = &grant_file_ops;
    1.79 -
    1.80 -	grant_pde->read_proc  = &grant_read;
    1.81 -	grant_pde->write_proc = &grant_write;
    1.82 -
    1.83 -	return 0;
    1.84 -}
    1.85 -
    1.86 -device_initcall(gnttab_proc_init);
    1.87 -
    1.88 -#endif /* CONFIG_PROC_FS */
    1.89 -
    1.90  int
    1.91  gnttab_resume(void)
    1.92  {
     2.1 --- a/tools/libxc/Makefile	Thu Jan 26 00:10:03 2006 +0100
     2.2 +++ b/tools/libxc/Makefile	Thu Jan 26 00:17:06 2006 +0100
     2.3 @@ -17,7 +17,6 @@ SRCS       += xc_bvtsched.c
     2.4  SRCS       += xc_core.c
     2.5  SRCS       += xc_domain.c
     2.6  SRCS       += xc_evtchn.c
     2.7 -SRCS       += xc_gnttab.c
     2.8  SRCS       += xc_misc.c
     2.9  SRCS       += xc_physdev.c
    2.10  SRCS       += xc_private.c
     3.1 --- a/tools/libxc/xc_gnttab.c	Thu Jan 26 00:10:03 2006 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,142 +0,0 @@
     3.4 -/******************************************************************************
     3.5 - * xc_gnttab.c
     3.6 - * 
     3.7 - * API for manipulating and accessing grant tables
     3.8 - * 
     3.9 - * Copyright (c) 2005 Christopher Clark
    3.10 - * based on xc_evtchn.c Copyright (c) 2004, K A Fraser.
    3.11 - */
    3.12 -
    3.13 -#include "xc_private.h"
    3.14 -#include "xen/grant_table.h"
    3.15 -
    3.16 -static int
    3.17 -do_gnttab_op(int xc_handle,
    3.18 -             unsigned long cmd,
    3.19 -             void *op,
    3.20 -             unsigned long count)
    3.21 -{
    3.22 -    int ret = -1;
    3.23 -    DECLARE_HYPERCALL;
    3.24 -
    3.25 -    hypercall.op     = __HYPERVISOR_grant_table_op;
    3.26 -    hypercall.arg[0] = cmd;
    3.27 -    hypercall.arg[1] = (unsigned long)op;
    3.28 -    hypercall.arg[2] = count;
    3.29 -
    3.30 -    if ( mlock(op, 64) )
    3.31 -    {
    3.32 -        PERROR("do_gnttab_op: op mlock failed");
    3.33 -        goto out;
    3.34 -    }
    3.35 -
    3.36 -    if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
    3.37 -        ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret);
    3.38 -
    3.39 -    safe_munlock(op, 64);
    3.40 - out:
    3.41 -    return ret;
    3.42 -}
    3.43 -
    3.44 -
    3.45 -int xc_gnttab_map_grant_ref(int         xc_handle,
    3.46 -                            uint64_t    host_virt_addr,
    3.47 -                            uint32_t    dom,
    3.48 -                            grant_ref_t ref,
    3.49 -                            uint16_t    flags,
    3.50 -                            int16_t    *status,
    3.51 -                            grant_handle_t *handle,
    3.52 -                            uint64_t   *dev_bus_addr)
    3.53 -{
    3.54 -    struct gnttab_map_grant_ref op;
    3.55 -    int rc;
    3.56 -
    3.57 -    op.host_addr      = host_virt_addr;
    3.58 -    op.dom            = (domid_t)dom;
    3.59 -    op.ref            = ref;
    3.60 -    op.flags          = flags;
    3.61 - 
    3.62 -    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_map_grant_ref,
    3.63 -                            &op, 1)) == 0 )
    3.64 -    {
    3.65 -        *status         = op.status;
    3.66 -        *handle         = op.handle;
    3.67 -        *dev_bus_addr   = op.dev_bus_addr;
    3.68 -    }
    3.69 -
    3.70 -    return rc;
    3.71 -}
    3.72 -
    3.73 -
    3.74 -int xc_gnttab_unmap_grant_ref(int       xc_handle,
    3.75 -                              uint64_t  host_virt_addr,
    3.76 -                              uint64_t  dev_bus_addr,
    3.77 -                              grant_handle_t handle,
    3.78 -                              int16_t  *status)
    3.79 -{
    3.80 -    struct gnttab_unmap_grant_ref op;
    3.81 -    int rc;
    3.82 -
    3.83 -    op.host_addr      = host_virt_addr;
    3.84 -    op.dev_bus_addr   = dev_bus_addr;
    3.85 -    op.handle         = handle;
    3.86 - 
    3.87 -    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_unmap_grant_ref,
    3.88 -                            &op, 1)) == 0 )
    3.89 -    {
    3.90 -        *status = op.status;
    3.91 -    }
    3.92 -
    3.93 -    return rc;
    3.94 -}
    3.95 -
    3.96 -int xc_gnttab_setup_table(int        xc_handle,
    3.97 -                          uint32_t   dom,
    3.98 -                          uint16_t   nr_frames,
    3.99 -                          int16_t   *status,
   3.100 -                          unsigned long **frame_list)
   3.101 -{
   3.102 -    struct gnttab_setup_table op;
   3.103 -    int rc, i;
   3.104 -
   3.105 -    op.dom       = (domid_t)dom;
   3.106 -    op.nr_frames = nr_frames;
   3.107 - 
   3.108 -    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_setup_table, &op, 1)) == 0 )
   3.109 -    {
   3.110 -        *status = op.status;
   3.111 -        for ( i = 0; i < nr_frames; i++ )
   3.112 -            (*frame_list)[i] = op.frame_list[i];
   3.113 -    }
   3.114 -
   3.115 -    return rc;
   3.116 -}
   3.117 -
   3.118 -int xc_gnttab_dump_table(int        xc_handle,
   3.119 -                         uint32_t   dom,
   3.120 -                         int16_t   *status)
   3.121 -{
   3.122 -    struct gnttab_dump_table op;
   3.123 -    int rc;
   3.124 -
   3.125 -    op.dom = (domid_t)dom;
   3.126 -
   3.127 -    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_dump_table, &op, 1)) == 0 )
   3.128 -        *status = op.status;
   3.129 -
   3.130 -    return rc;
   3.131 -}
   3.132 -
   3.133 -int xc_grant_interface_open(void)
   3.134 -{
   3.135 -    int fd = open("/proc/xen/grant", O_RDWR);
   3.136 -    if ( fd == -1 )
   3.137 -        PERROR("Could not obtain handle on grant command interface");
   3.138 -    return fd;
   3.139 -
   3.140 -}
   3.141 -
   3.142 -int xc_grant_interface_close(int xc_grant_handle)
   3.143 -{
   3.144 -    return close(xc_grant_handle);
   3.145 -}
     4.1 --- a/tools/libxc/xenctrl.h	Thu Jan 26 00:10:03 2006 +0100
     4.2 +++ b/tools/libxc/xenctrl.h	Thu Jan 26 00:17:06 2006 +0100
     4.3 @@ -13,7 +13,6 @@
     4.4  #include <sys/ptrace.h>
     4.5  #include <xen/xen.h>
     4.6  #include <xen/dom0_ops.h>
     4.7 -#include <xen/grant_table.h>
     4.8  #include <xen/version.h>
     4.9  #include <xen/event_channel.h>
    4.10  #include <xen/sched.h>
    4.11 @@ -467,63 +466,6 @@ int xc_get_pfn_type_batch(int xc_handle,
    4.12                            int num, unsigned long *arr);
    4.13  
    4.14  
    4.15 -/*\
    4.16 - *  GRANT TABLE FUNCTIONS
    4.17 -\*/ 
    4.18 -
    4.19 -/**
    4.20 - * This function opens a handle to the more restricted grant table hypervisor
    4.21 - * interface. This may be used where the standard interface is not
    4.22 - * available because the domain is not privileged.
    4.23 - * This function can  be called multiple times within a single process.
    4.24 - * Multiple processes can have an open hypervisor interface at the same time.
    4.25 - *
    4.26 - * Each call to this function should have a corresponding call to
    4.27 - * xc_grant_interface_close().
    4.28 - *
    4.29 - * This function can fail if a Xen-enabled kernel is not currently running.
    4.30 - *
    4.31 - * @return a handle to the hypervisor grant table interface or -1 on failure
    4.32 - */
    4.33 -int xc_grant_interface_open(void);
    4.34 -
    4.35 -/**
    4.36 - * This function closes an open grant table hypervisor interface.
    4.37 - *
    4.38 - * This function can fail if the handle does not represent an open interface or
    4.39 - * if there were problems closing the interface.
    4.40 - *
    4.41 - * @parm xc_handle a handle to an open grant table hypervisor interface
    4.42 - * @return 0 on success, -1 otherwise.
    4.43 - */
    4.44 -int xc_grant_interface_close(int xc_handle);
    4.45 -
    4.46 -int xc_gnttab_map_grant_ref(int      xc_handle,
    4.47 -                            uint64_t host_virt_addr,
    4.48 -                            uint32_t dom,
    4.49 -                            grant_ref_t ref,
    4.50 -                            uint16_t flags,
    4.51 -                            int16_t *status,
    4.52 -                            grant_handle_t *handle,
    4.53 -                            uint64_t *dev_bus_addr);
    4.54 -
    4.55 -int xc_gnttab_unmap_grant_ref(int  xc_handle,
    4.56 -                              uint64_t  host_virt_addr,
    4.57 -                              uint64_t  dev_bus_addr,
    4.58 -                              grant_handle_t handle,
    4.59 -                              int16_t *status);
    4.60 -
    4.61 -int xc_gnttab_setup_table(int        xc_handle,
    4.62 -                          uint32_t   dom,
    4.63 -                          uint16_t   nr_frames,
    4.64 -                          int16_t   *status,
    4.65 -                          unsigned long **frame_list);
    4.66 -
    4.67 -/* Grant debug builds only: */
    4.68 -int xc_gnttab_dump_table(int        xc_handle,
    4.69 -                         uint32_t   dom,
    4.70 -                         int16_t   *status);
    4.71 -
    4.72  /* Get current total pages allocated to a domain. */
    4.73  long xc_get_tot_pages(int xc_handle, uint32_t domid);
    4.74