ia64/xen-unstable

changeset 19041:2737293c761e

Remove unused XENMEM_translate_pfn_list.

Never used by a guest OS (except in IA64 hcall translation layer) and
obsoleted in the tools for ages. Recent usage by qemu-dm is now
removed.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jan 14 11:15:01 2009 +0000 (2009-01-14)
parents 3fb43f23f64c
children ee62aaafff46
files tools/libxc/xc_domain.c tools/libxc/xenctrl.h xen/arch/ia64/tools/p2m_foreign/Makefile xen/arch/ia64/tools/p2m_foreign/p2m_foreign.c xen/common/compat/memory.c xen/common/memory.c xen/include/public/memory.h xen/include/xlat.lst xen/include/xsm/xsm.h xen/xsm/dummy.c xen/xsm/flask/hooks.c
line diff
     1.1 --- a/tools/libxc/xc_domain.c	Wed Jan 14 10:56:18 2009 +0000
     1.2 +++ b/tools/libxc/xc_domain.c	Wed Jan 14 11:15:01 2009 +0000
     1.3 @@ -537,33 +537,6 @@ int xc_domain_memory_populate_physmap(in
     1.4      return err;
     1.5  }
     1.6  
     1.7 -int xc_domain_memory_translate_gpfn_list(int xc_handle,
     1.8 -                                         uint32_t domid,
     1.9 -                                         unsigned long nr_gpfns,
    1.10 -                                         xen_pfn_t *gpfn_list,
    1.11 -                                         xen_pfn_t *mfn_list)
    1.12 -{
    1.13 -    int err;
    1.14 -    struct xen_translate_gpfn_list translate_gpfn_list = {
    1.15 -        .domid    = domid,
    1.16 -        .nr_gpfns = nr_gpfns,
    1.17 -    };
    1.18 -    set_xen_guest_handle(translate_gpfn_list.gpfn_list, gpfn_list);
    1.19 -    set_xen_guest_handle(translate_gpfn_list.mfn_list, mfn_list);
    1.20 -
    1.21 -    err = xc_memory_op(xc_handle, XENMEM_translate_gpfn_list, &translate_gpfn_list);
    1.22 -
    1.23 -    if ( err != 0 )
    1.24 -    {
    1.25 -        DPRINTF("Failed translation for dom %d (%ld PFNs)\n",
    1.26 -                domid, nr_gpfns);
    1.27 -        errno = -err;
    1.28 -        err = -1;
    1.29 -    }
    1.30 -
    1.31 -    return err;
    1.32 -}
    1.33 -
    1.34  static int xc_domain_memory_pod_target(int xc_handle,
    1.35                                         int op,
    1.36                                         uint32_t domid,
     2.1 --- a/tools/libxc/xenctrl.h	Wed Jan 14 10:56:18 2009 +0000
     2.2 +++ b/tools/libxc/xenctrl.h	Wed Jan 14 11:15:01 2009 +0000
     2.3 @@ -628,12 +628,6 @@ int xc_domain_memory_populate_physmap(in
     2.4                                        unsigned int mem_flags,
     2.5                                        xen_pfn_t *extent_start);
     2.6  
     2.7 -int xc_domain_memory_translate_gpfn_list(int xc_handle,
     2.8 -                                         uint32_t domid,
     2.9 -                                         unsigned long nr_gpfns,
    2.10 -                                         xen_pfn_t *gpfn_list,
    2.11 -                                         xen_pfn_t *mfn_list);
    2.12 -
    2.13  int xc_domain_memory_set_pod_target(int xc_handle,
    2.14                                      uint32_t domid,
    2.15                                      uint64_t target_pages,
     3.1 --- a/xen/arch/ia64/tools/p2m_foreign/Makefile	Wed Jan 14 10:56:18 2009 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,48 +0,0 @@
     3.4 -#
     3.5 -# xen/arch/ia64/tools/p2m_foreign
     3.6 -#
     3.7 -# Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
     3.8 -#                    VA Linux Systems Japan K.K.
     3.9 -#
    3.10 -# This program is free software; you can redistribute it and/or modify
    3.11 -# it under the terms of the GNU General Public License as published by
    3.12 -# the Free Software Foundation; either version 2 of the License, or
    3.13 -# (at your option) any later version.
    3.14 -#
    3.15 -# This program is distributed in the hope that it will be useful,
    3.16 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.17 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.18 -# GNU General Public License for more details.
    3.19 -#
    3.20 -# You should have received a copy of the GNU General Public License
    3.21 -# along with this program; if not, write to the Free Software
    3.22 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    3.23 -
    3.24 -XEN_ROOT	= ../../../../..
    3.25 -include $(XEN_ROOT)/tools/Rules.mk
    3.26 -
    3.27 -CFLAGS += -Werror -ggdb3
    3.28 -CFLAGS += -I$(XEN_LIBXC) -I$(XEN_XENSTORE)
    3.29 -
    3.30 -PROGRAMS = p2m_foreign
    3.31 -LDLIBS   = -L$(XEN_LIBXC) -L$(XEN_XENSTORE) -lxenguest -lxenctrl
    3.32 -
    3.33 -.PHONY: all
    3.34 -all: build
    3.35 -
    3.36 -.PHONY: build
    3.37 -build: $(PROGRAMS)
    3.38 -
    3.39 -$(PROGRAMS): %: %.o
    3.40 -	$(CC) $(CFLAGS) $^ $(LDLIBS) -o $@
    3.41 -
    3.42 -
    3.43 -.PHONY: install
    3.44 -install:
    3.45 -
    3.46 -.PHONY: clean
    3.47 -clean:
    3.48 -	$(RM) *.o $(PROGRAMS)
    3.49 -	$(RM) $(DEPS)
    3.50 -
    3.51 --include $(DEPS)
     4.1 --- a/xen/arch/ia64/tools/p2m_foreign/p2m_foreign.c	Wed Jan 14 10:56:18 2009 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,233 +0,0 @@
     4.4 -/*
     4.5 - * Foreign p2m exposure test.
     4.6 - *
     4.7 - * This program is free software; you can redistribute it and/or modify
     4.8 - * it under the terms of the GNU General Public License as published by
     4.9 - * the Free Software Foundation; either version 2 of the License, or
    4.10 - * (at your option) any later version.
    4.11 - *
    4.12 - * This program is distributed in the hope that it will be useful,
    4.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.15 - * GNU General Public License for more details.
    4.16 - *
    4.17 - * You should have received a copy of the GNU General Public License
    4.18 - * along with this program; if not, write to the Free Software
    4.19 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    4.20 - *
    4.21 - * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
    4.22 - *                    VA Linux Systems Japan K.K.
    4.23 - *
    4.24 - */
    4.25 -
    4.26 -#include <sys/mman.h>
    4.27 -#include <err.h>
    4.28 -#include <errno.h>
    4.29 -#include <assert.h>
    4.30 -
    4.31 -#include <xc_private.h>
    4.32 -#include <xenctrl.h>
    4.33 -#include <xenguest.h>
    4.34 -#include <xc_efi.h>
    4.35 -#include <ia64/xc_ia64.h>
    4.36 -
    4.37 -#if 1
    4.38 -# define printd(fmt, args...)	printf(fmt, ##args)
    4.39 -#else
    4.40 -# define printd(fmt, args...)	((void)0)
    4.41 -#endif
    4.42 -
    4.43 -/* xc_memory_op() in xc_private.c doesn't support translate_gpfn_list */
    4.44 -static int
    4.45 -__xc_memory_op(int xc_handle, int cmd, void *arg)
    4.46 -{
    4.47 -	DECLARE_HYPERCALL;
    4.48 -	struct xen_translate_gpfn_list* translate = arg;
    4.49 -
    4.50 -	xen_ulong_t* gpfns;
    4.51 -	xen_ulong_t* mfns;
    4.52 -	size_t len;
    4.53 -
    4.54 -	long ret = -EINVAL;
    4.55 -
    4.56 -	hypercall.op     = __HYPERVISOR_memory_op;
    4.57 -	hypercall.arg[0] = (unsigned long)cmd;
    4.58 -	hypercall.arg[1] = (unsigned long)arg;
    4.59 -
    4.60 -	assert(cmd == XENMEM_translate_gpfn_list);
    4.61 -
    4.62 -	get_xen_guest_handle(gpfns, translate->gpfn_list);
    4.63 -	get_xen_guest_handle(mfns, translate->mfn_list);
    4.64 -	len = sizeof(gpfns[0]) * translate->nr_gpfns;
    4.65 -	if (lock_pages(translate, sizeof(*translate)) ||
    4.66 -	    lock_pages(gpfns, len) ||
    4.67 -	    lock_pages(mfns, len))
    4.68 -		goto out;
    4.69 -
    4.70 -	ret = do_xen_hypercall(xc_handle, &hypercall);
    4.71 -
    4.72 -out:
    4.73 -	unlock_pages(mfns, len);
    4.74 -	unlock_pages(gpfns, len);
    4.75 -	unlock_pages(translate, sizeof(*translate));
    4.76 -
    4.77 -	return ret;
    4.78 -}
    4.79 -
    4.80 -int
    4.81 -xc_translate_gpfn_list(int xc_handle, uint32_t domid, xen_ulong_t nr_gpfns,
    4.82 -		       xen_ulong_t* gpfns, xen_ulong_t* mfns)
    4.83 -{
    4.84 -	struct xen_translate_gpfn_list translate = {
    4.85 -		.domid = domid,
    4.86 -		.nr_gpfns = nr_gpfns,
    4.87 -	};
    4.88 -	set_xen_guest_handle(translate.gpfn_list, gpfns);
    4.89 -	set_xen_guest_handle(translate.mfn_list, mfns);
    4.90 -
    4.91 -	return __xc_memory_op(xc_handle,
    4.92 -			      XENMEM_translate_gpfn_list, &translate);
    4.93 -}
    4.94 -
    4.95 -int
    4.96 -main(int argc, char** argv)
    4.97 -{
    4.98 -	uint32_t domid;
    4.99 -	int xc_handle;
   4.100 -
   4.101 -	xc_dominfo_t info;
   4.102 -	shared_info_t* shinfo;
   4.103 -
   4.104 -	unsigned long map_size;
   4.105 -	xen_ia64_memmap_info_t* memmap_info;
   4.106 -	struct xen_ia64_p2m_table p2m_table;
   4.107 -
   4.108 -	char* p;
   4.109 -	char* start;
   4.110 -	char* end;
   4.111 -	xen_ulong_t nr_gpfns;
   4.112 -
   4.113 -	xen_ulong_t* gpfns;
   4.114 -	xen_ulong_t* mfns;
   4.115 -
   4.116 -	unsigned long i;
   4.117 -
   4.118 -	if (argc != 2)
   4.119 -		errx(EXIT_FAILURE, "usage: %s <domid>", argv[0]);
   4.120 -	domid = atol(argv[1]);
   4.121 -
   4.122 -	printd("xc_interface_open()\n");
   4.123 -	xc_handle = xc_interface_open();
   4.124 -	if (xc_handle < 0)
   4.125 -		errx(EXIT_FAILURE, "can't open control interface");
   4.126 -
   4.127 -	printd("xc_domain_getinfo\n");
   4.128 -	if (xc_domain_getinfo(xc_handle, domid, 1, &info) != 1)
   4.129 -		errx(EXIT_FAILURE, "Could not get info for domain");
   4.130 -
   4.131 -
   4.132 -	printd("shared info\n");
   4.133 -	shinfo = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
   4.134 -				      PROT_READ, info.shared_info_frame);
   4.135 -	if (shinfo == NULL)
   4.136 -		errx(EXIT_FAILURE, "can't map shared info");
   4.137 -
   4.138 -	printd("memmap_info\n");
   4.139 -	map_size = PAGE_SIZE * shinfo->arch.memmap_info_num_pages;
   4.140 -	memmap_info = xc_map_foreign_range(xc_handle, info.domid,
   4.141 -					   map_size, PROT_READ,
   4.142 -					   shinfo->arch.memmap_info_pfn);
   4.143 -	if (memmap_info == NULL)
   4.144 -		errx(EXIT_FAILURE, "can't map memmap_info");
   4.145 -
   4.146 -#if 1
   4.147 -	start = (char*)&memmap_info->memdesc;
   4.148 -	end = start + memmap_info->efi_memmap_size;
   4.149 -	i = 0;
   4.150 -	for (p = start; p < end; p += memmap_info->efi_memdesc_size) {
   4.151 -		efi_memory_desc_t* md = (efi_memory_desc_t*)p;
   4.152 -		printd("%ld [0x%lx, 0x%lx) 0x%lx pages\n",
   4.153 -		       i, md->phys_addr,
   4.154 -		       md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
   4.155 -		       md->num_pages >> (PAGE_SHIFT - EFI_PAGE_SHIFT));
   4.156 -		i++;
   4.157 -	}
   4.158 -#endif
   4.159 -
   4.160 -
   4.161 -	printd("p2m map\n");
   4.162 -	if (xc_ia64_p2m_map(&p2m_table, xc_handle, domid, memmap_info, 0) < 0)
   4.163 -		errx(EXIT_FAILURE, "can't map foreign p2m table");
   4.164 -	printd("p2m map done\n");
   4.165 -
   4.166 -	start = (char*)&memmap_info->memdesc;
   4.167 -	end = start + memmap_info->efi_memmap_size;
   4.168 -	nr_gpfns = 0;
   4.169 -	i = 0;
   4.170 -	for (p = start; p < end; p += memmap_info->efi_memdesc_size) {
   4.171 -		efi_memory_desc_t* md = (efi_memory_desc_t*)p;
   4.172 -		if ( md->type != EFI_CONVENTIONAL_MEMORY ||
   4.173 -		     md->attribute != EFI_MEMORY_WB ||
   4.174 -		     md->num_pages == 0 )
   4.175 -			continue;
   4.176 -
   4.177 -		printd("%ld [0x%lx, 0x%lx) 0x%lx pages\n",
   4.178 -		       i, md->phys_addr,
   4.179 -		       md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
   4.180 -		       md->num_pages >> (PAGE_SHIFT - EFI_PAGE_SHIFT));
   4.181 -		nr_gpfns += md->num_pages >> (PAGE_SHIFT - EFI_PAGE_SHIFT);
   4.182 -		i++;
   4.183 -	}
   4.184 -
   4.185 -	printd("total 0x%lx gpfns\n", nr_gpfns);
   4.186 -	gpfns = malloc(sizeof(gpfns[0]) * nr_gpfns);
   4.187 -	mfns = malloc(sizeof(mfns[0]) * nr_gpfns);
   4.188 -	if (gpfns == NULL || mfns == NULL)
   4.189 -		err(EXIT_FAILURE, "can't allocate memory for gpfns/mfns");
   4.190 -
   4.191 -	i = 0;
   4.192 -	for (p = start; p < end; p += memmap_info->efi_memdesc_size) {
   4.193 -		efi_memory_desc_t* md = (efi_memory_desc_t*)p;
   4.194 -		unsigned long j;
   4.195 -		if ( md->type != EFI_CONVENTIONAL_MEMORY ||
   4.196 -		     md->attribute != EFI_MEMORY_WB ||
   4.197 -		     md->num_pages == 0 )
   4.198 -			continue;
   4.199 -
   4.200 -		for (j = 0;
   4.201 -		     j < md->num_pages >> (PAGE_SHIFT - EFI_PAGE_SHIFT);
   4.202 -		     j++) {
   4.203 -			gpfns[i] = (md->phys_addr >> PAGE_SHIFT) + j;
   4.204 -			i++;
   4.205 -		}
   4.206 -	}
   4.207 -	for (i = 0; i < nr_gpfns; i++)
   4.208 -		mfns[i] = INVALID_MFN;
   4.209 -
   4.210 -	printd("issue translate gpfn list hypercall. "
   4.211 -	       "this may take a while\n");
   4.212 -	if (xc_translate_gpfn_list(xc_handle,
   4.213 -				   domid, nr_gpfns, gpfns, mfns) < 0)
   4.214 -		err(EXIT_FAILURE, "translate gpfn list hypercall failure");
   4.215 -	printd("translate gpfn list hypercall done\n");
   4.216 -
   4.217 -	printd("checking p2m table\n");
   4.218 -	for (i = 0; i < nr_gpfns; i++) {
   4.219 -		unsigned long mfn_by_translated = mfns[i];
   4.220 -		unsigned long mfn_by_p2m =
   4.221 -			xc_ia64_p2m_mfn(&p2m_table, gpfns[i]);
   4.222 -		if (mfn_by_translated != mfn_by_p2m &&
   4.223 -		    !(mfn_by_translated == 0 && mfn_by_p2m == INVALID_MFN)) {
   4.224 -			printf("ERROR! i 0x%lx gpfn "
   4.225 -			       "0x%lx trnslated 0x%lx p2m 0x%lx\n",
   4.226 -			       i, gpfns[i], mfn_by_translated, mfn_by_p2m);
   4.227 -		}
   4.228 -	}
   4.229 -	printd("checking p2m table done\n");
   4.230 -
   4.231 -	xc_ia64_p2m_unmap(&p2m_table);
   4.232 -	munmap(memmap_info, map_size);
   4.233 -	munmap(shinfo, PAGE_SIZE);
   4.234 -
   4.235 -	return EXIT_SUCCESS;
   4.236 -}
     5.1 --- a/xen/common/compat/memory.c	Wed Jan 14 10:56:18 2009 +0000
     5.2 +++ b/xen/common/compat/memory.c	Wed Jan 14 11:15:01 2009 +0000
     5.3 @@ -19,12 +19,10 @@ int compat_memory_op(unsigned int cmd, X
     5.4              XEN_GUEST_HANDLE(void) hnd;
     5.5              struct xen_memory_reservation *rsrv;
     5.6              struct xen_memory_exchange *xchg;
     5.7 -            struct xen_translate_gpfn_list *xlat;
     5.8          } nat;
     5.9          union {
    5.10              struct compat_memory_reservation rsrv;
    5.11              struct compat_memory_exchange xchg;
    5.12 -            struct compat_translate_gpfn_list xlat;
    5.13          } cmp;
    5.14  
    5.15          set_xen_guest_handle(nat.hnd, (void *)COMPAT_ARG_XLAT_VIRT_BASE);
    5.16 @@ -182,52 +180,6 @@ int compat_memory_op(unsigned int cmd, X
    5.17              nat.hnd = compat;
    5.18              break;
    5.19  
    5.20 -        case XENMEM_translate_gpfn_list:
    5.21 -            if ( copy_from_guest(&cmp.xlat, compat, 1) )
    5.22 -                return -EFAULT;
    5.23 -
    5.24 -            /* Is size too large for us to encode a continuation? */
    5.25 -            if ( cmp.xlat.nr_gpfns > (UINT_MAX >> MEMOP_EXTENT_SHIFT) )
    5.26 -                return -EINVAL;
    5.27 -
    5.28 -            if ( !compat_handle_okay(cmp.xlat.gpfn_list, cmp.xlat.nr_gpfns) ||
    5.29 -                 !compat_handle_okay(cmp.xlat.mfn_list,  cmp.xlat.nr_gpfns) )
    5.30 -                return -EFAULT;
    5.31 -
    5.32 -            end_extent = start_extent + (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xlat)) /
    5.33 -                                        sizeof(*space);
    5.34 -            if ( end_extent > cmp.xlat.nr_gpfns )
    5.35 -                end_extent = cmp.xlat.nr_gpfns;
    5.36 -
    5.37 -            space = (xen_pfn_t *)(nat.xlat + 1);
    5.38 -            /* Code below depends upon .gpfn_list preceding .mfn_list. */
    5.39 -            BUILD_BUG_ON(offsetof(xen_translate_gpfn_list_t, gpfn_list) > offsetof(xen_translate_gpfn_list_t, mfn_list));
    5.40 -#define XLAT_translate_gpfn_list_HNDL_gpfn_list(_d_, _s_) \
    5.41 -            do \
    5.42 -            { \
    5.43 -                set_xen_guest_handle((_d_)->gpfn_list, space - start_extent); \
    5.44 -                for ( i = start_extent; i < end_extent; ++i ) \
    5.45 -                { \
    5.46 -                    compat_pfn_t pfn; \
    5.47 -                    if ( __copy_from_compat_offset(&pfn, (_s_)->gpfn_list, i, 1) ) \
    5.48 -                        return -EFAULT; \
    5.49 -                    *space++ = pfn; \
    5.50 -                } \
    5.51 -            } while (0)
    5.52 -#define XLAT_translate_gpfn_list_HNDL_mfn_list(_d_, _s_) \
    5.53 -            (_d_)->mfn_list = (_d_)->gpfn_list
    5.54 -            XLAT_translate_gpfn_list(nat.xlat, &cmp.xlat);
    5.55 -#undef XLAT_translate_gpfn_list_HNDL_mfn_list
    5.56 -#undef XLAT_translate_gpfn_list_HNDL_gpfn_list
    5.57 -
    5.58 -            if ( end_extent < cmp.xlat.nr_gpfns )
    5.59 -            {
    5.60 -                nat.xlat->nr_gpfns = end_extent;
    5.61 -                ++split;
    5.62 -            }
    5.63 -
    5.64 -            break;
    5.65 -
    5.66          default:
    5.67              return compat_arch_memory_op(cmd, compat);
    5.68          }
    5.69 @@ -335,27 +287,6 @@ int compat_memory_op(unsigned int cmd, X
    5.70          case XENMEM_maximum_gpfn:
    5.71              break;
    5.72  
    5.73 -        case XENMEM_translate_gpfn_list:
    5.74 -            if ( split < 0 )
    5.75 -                end_extent = cmd >> MEMOP_EXTENT_SHIFT;
    5.76 -            else
    5.77 -                BUG_ON(rc);
    5.78 -
    5.79 -            for ( ; start_extent < end_extent; ++start_extent )
    5.80 -            {
    5.81 -                compat_pfn_t pfn = nat.xlat->mfn_list.p[start_extent];
    5.82 -
    5.83 -                BUG_ON(pfn != nat.xlat->mfn_list.p[start_extent]);
    5.84 -                if ( __copy_to_compat_offset(cmp.xlat.mfn_list, start_extent, &pfn, 1) )
    5.85 -                {
    5.86 -                    if ( split < 0 )
    5.87 -                        /* Cannot cancel the continuation... */
    5.88 -                        domain_crash(current->domain);
    5.89 -                    return -EFAULT;
    5.90 -                }
    5.91 -            }
    5.92 -            break;
    5.93 -
    5.94          default:
    5.95              domain_crash(current->domain);
    5.96              split = 0;
     6.1 --- a/xen/common/memory.c	Wed Jan 14 10:56:18 2009 +0000
     6.2 +++ b/xen/common/memory.c	Wed Jan 14 11:15:01 2009 +0000
     6.3 @@ -215,72 +215,6 @@ static void decrease_reservation(struct 
     6.4      a->nr_done = i;
     6.5  }
     6.6  
     6.7 -static long translate_gpfn_list(
     6.8 -    XEN_GUEST_HANDLE(xen_translate_gpfn_list_t) uop, unsigned long *progress)
     6.9 -{
    6.10 -    struct xen_translate_gpfn_list op;
    6.11 -    unsigned long i;
    6.12 -    xen_pfn_t gpfn;
    6.13 -    xen_pfn_t mfn;
    6.14 -    struct domain *d;
    6.15 -    int rc;
    6.16 -
    6.17 -    if ( copy_from_guest(&op, uop, 1) )
    6.18 -        return -EFAULT;
    6.19 -
    6.20 -    /* Is size too large for us to encode a continuation? */
    6.21 -    if ( op.nr_gpfns > (ULONG_MAX >> MEMOP_EXTENT_SHIFT) )
    6.22 -        return -EINVAL;
    6.23 -
    6.24 -    if ( !guest_handle_subrange_okay(op.gpfn_list, *progress, op.nr_gpfns-1) ||
    6.25 -         !guest_handle_subrange_okay(op.mfn_list, *progress, op.nr_gpfns-1) )
    6.26 -        return -EFAULT;
    6.27 -
    6.28 -    rc = rcu_lock_target_domain_by_id(op.domid, &d);
    6.29 -    if ( rc )
    6.30 -        return rc;
    6.31 -
    6.32 -    if ( !paging_mode_translate(d) )
    6.33 -    {
    6.34 -        rcu_unlock_domain(d);
    6.35 -        return -EINVAL;
    6.36 -    }
    6.37 -
    6.38 -    for ( i = *progress; i < op.nr_gpfns; i++ )
    6.39 -    {
    6.40 -        if ( hypercall_preempt_check() )
    6.41 -        {
    6.42 -            rcu_unlock_domain(d);
    6.43 -            *progress = i;
    6.44 -            return -EAGAIN;
    6.45 -        }
    6.46 -
    6.47 -        if ( unlikely(__copy_from_guest_offset(&gpfn, op.gpfn_list, i, 1)) )
    6.48 -        {
    6.49 -            rcu_unlock_domain(d);
    6.50 -            return -EFAULT;
    6.51 -        }
    6.52 -
    6.53 -        mfn = gmfn_to_mfn(d, gpfn);
    6.54 -
    6.55 -        rc = xsm_translate_gpfn_list(current->domain, mfn);
    6.56 -        if ( rc )
    6.57 -        {
    6.58 -            rcu_unlock_domain(d);
    6.59 -            return rc;
    6.60 -        }
    6.61 -
    6.62 -        if ( unlikely(__copy_to_guest_offset(op.mfn_list, i, &mfn, 1)) )
    6.63 -        {
    6.64 -            rcu_unlock_domain(d);
    6.65 -            return -EFAULT;
    6.66 -        }
    6.67 -    }
    6.68 -
    6.69 -    rcu_unlock_domain(d);
    6.70 -    return 0;
    6.71 -}
    6.72 -
    6.73  static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
    6.74  {
    6.75      struct xen_memory_exchange exch;
    6.76 @@ -494,7 +428,7 @@ long do_memory_op(unsigned long cmd, XEN
    6.77      struct domain *d;
    6.78      int rc, op;
    6.79      unsigned int address_bits;
    6.80 -    unsigned long start_extent, progress;
    6.81 +    unsigned long start_extent;
    6.82      struct xen_memory_reservation reservation;
    6.83      struct memop_args args;
    6.84      domid_t domid;
    6.85 @@ -630,17 +564,6 @@ long do_memory_op(unsigned long cmd, XEN
    6.86  
    6.87          break;
    6.88  
    6.89 -    case XENMEM_translate_gpfn_list:
    6.90 -        progress = cmd >> MEMOP_EXTENT_SHIFT;
    6.91 -        rc = translate_gpfn_list(
    6.92 -            guest_handle_cast(arg, xen_translate_gpfn_list_t),
    6.93 -            &progress);
    6.94 -        if ( rc == -EAGAIN )
    6.95 -            return hypercall_create_continuation(
    6.96 -                __HYPERVISOR_memory_op, "lh",
    6.97 -                op | (progress << MEMOP_EXTENT_SHIFT), arg);
    6.98 -        break;
    6.99 -
   6.100      default:
   6.101          rc = arch_memory_op(op, arg);
   6.102          break;
     7.1 --- a/xen/include/public/memory.h	Wed Jan 14 10:56:18 2009 +0000
     7.2 +++ b/xen/include/public/memory.h	Wed Jan 14 11:15:01 2009 +0000
     7.3 @@ -235,29 +235,8 @@ struct xen_remove_from_physmap {
     7.4  typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;
     7.5  DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t);
     7.6  
     7.7 -/*
     7.8 - * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
     7.9 - * code on failure. This call only works for auto-translated guests.
    7.10 - */
    7.11 -#define XENMEM_translate_gpfn_list  8
    7.12 -struct xen_translate_gpfn_list {
    7.13 -    /* Which domain to translate for? */
    7.14 -    domid_t domid;
    7.15 -
    7.16 -    /* Length of list. */
    7.17 -    xen_ulong_t nr_gpfns;
    7.18 -
    7.19 -    /* List of GPFNs to translate. */
    7.20 -    XEN_GUEST_HANDLE(xen_pfn_t) gpfn_list;
    7.21 -
    7.22 -    /*
    7.23 -     * Output list to contain MFN translations. May be the same as the input
    7.24 -     * list (in which case each input GPFN is overwritten with the output MFN).
    7.25 -     */
    7.26 -    XEN_GUEST_HANDLE(xen_pfn_t) mfn_list;
    7.27 -};
    7.28 -typedef struct xen_translate_gpfn_list xen_translate_gpfn_list_t;
    7.29 -DEFINE_XEN_GUEST_HANDLE(xen_translate_gpfn_list_t);
    7.30 +/*** REMOVED ***/
    7.31 +/*#define XENMEM_translate_gpfn_list  8*/
    7.32  
    7.33  /*
    7.34   * Returns the pseudo-physical memory map as it was when the domain
     8.1 --- a/xen/include/xlat.lst	Wed Jan 14 10:56:18 2009 +0000
     8.2 +++ b/xen/include/xlat.lst	Wed Jan 14 11:15:01 2009 +0000
     8.3 @@ -39,7 +39,6 @@
     8.4  !	memory_map			memory.h
     8.5  !	memory_reservation		memory.h
     8.6  !	pod_target			memory.h
     8.7 -!	translate_gpfn_list		memory.h
     8.8  !	sched_poll			sched.h
     8.9  ?	sched_remote_shutdown		sched.h
    8.10  ?	sched_shutdown			sched.h
     9.1 --- a/xen/include/xsm/xsm.h	Wed Jan 14 10:56:18 2009 +0000
     9.2 +++ b/xen/include/xsm/xsm.h	Wed Jan 14 11:15:01 2009 +0000
     9.3 @@ -96,7 +96,6 @@ struct xsm_operations {
     9.4      int (*alloc_security_evtchn) (struct evtchn *chn);
     9.5      void (*free_security_evtchn) (struct evtchn *chn);
     9.6  
     9.7 -    int (*translate_gpfn_list) (struct domain *d, unsigned long mfn);
     9.8      int (*memory_adjust_reservation) (struct domain *d1, struct domain *d2);
     9.9      int (*memory_stat_reservation) (struct domain *d1, struct domain *d2);
    9.10      int (*memory_pin_page) (struct domain *d, struct page_info *page);
    9.11 @@ -367,11 +366,6 @@ static inline void xsm_free_security_evt
    9.12      xsm_call(free_security_evtchn(chn));
    9.13  }
    9.14  
    9.15 -static inline int xsm_translate_gpfn_list (struct domain *d, unsigned long mfn)
    9.16 -{
    9.17 -    return xsm_call(translate_gpfn_list(d, mfn));
    9.18 -}
    9.19 -
    9.20  static inline int xsm_memory_adjust_reservation (struct domain *d1, struct
    9.21                                                                      domain *d2)
    9.22  {
    10.1 --- a/xen/xsm/dummy.c	Wed Jan 14 10:56:18 2009 +0000
    10.2 +++ b/xen/xsm/dummy.c	Wed Jan 14 11:15:01 2009 +0000
    10.3 @@ -180,11 +180,6 @@ static int dummy_grant_query_size (struc
    10.4      return 0;
    10.5  }
    10.6  
    10.7 -static int dummy_translate_gpfn_list (struct domain *d, unsigned long mfn)
    10.8 -{
    10.9 -    return 0;
   10.10 -}
   10.11 -
   10.12  static int dummy_memory_adjust_reservation (struct domain *d1,
   10.13                                                              struct domain *d2)
   10.14  {
   10.15 @@ -522,7 +517,6 @@ void xsm_fixup_ops (struct xsm_operation
   10.16      set_to_dummy_if_null(ops, alloc_security_evtchn);
   10.17      set_to_dummy_if_null(ops, free_security_evtchn);
   10.18  
   10.19 -    set_to_dummy_if_null(ops, translate_gpfn_list);
   10.20      set_to_dummy_if_null(ops, memory_adjust_reservation);
   10.21      set_to_dummy_if_null(ops, memory_stat_reservation);
   10.22      set_to_dummy_if_null(ops, memory_pin_page);
    11.1 --- a/xen/xsm/flask/hooks.c	Wed Jan 14 10:56:18 2009 +0000
    11.2 +++ b/xen/xsm/flask/hooks.c	Wed Jan 14 11:15:01 2009 +0000
    11.3 @@ -367,20 +367,6 @@ static int get_mfn_sid(unsigned long mfn
    11.4      return rc;    
    11.5  }
    11.6  
    11.7 -static int flask_translate_gpfn_list(struct domain *d, unsigned long mfn)
    11.8 -{
    11.9 -    int rc = 0;
   11.10 -    u32 sid;
   11.11 -    struct domain_security_struct *dsec;
   11.12 -    dsec = d->ssid;
   11.13 -
   11.14 -    rc = get_mfn_sid(mfn, &sid);
   11.15 -    if ( rc )
   11.16 -        return rc;
   11.17 -
   11.18 -    return avc_has_perm(dsec->sid, sid, SECCLASS_MMU, MMU__TRANSLATEGP, NULL);
   11.19 -}
   11.20 -
   11.21  static int flask_memory_adjust_reservation(struct domain *d1, struct domain *d2)
   11.22  {
   11.23      return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__ADJUST);
   11.24 @@ -1280,7 +1266,6 @@ static struct xsm_operations flask_ops =
   11.25      .alloc_security_evtchn = flask_alloc_security_evtchn,
   11.26      .free_security_evtchn = flask_free_security_evtchn,
   11.27  
   11.28 -    .translate_gpfn_list = flask_translate_gpfn_list,
   11.29      .memory_adjust_reservation = flask_memory_adjust_reservation,
   11.30      .memory_stat_reservation = flask_memory_stat_reservation,
   11.31      .memory_pin_page = flask_memory_pin_page,