Hollis Blanchard
2006-May-30 22:18 UTC
[Xen-devel] [PATCH 0 of 3] management tools portability
These three patches allow me to use 32-bit libxc (and xend and xm) with a 64-bit PPC hypervisor. This is a resend. I''ve updated to the latest xen-unstable tree, and changed the privcmd types from uint64_t to __u64 at Chris Wright''s request. Please apply. -- Hollis Blanchard IBM Linux Technology Center 37 files changed, 263 insertions(+), 255 deletions(-) Config.mk | 14 --- config/ia64.mk | 5 + config/x86_32.mk | 9 ++ config/x86_64.mk | 9 ++ extras/mini-os/Makefile | 3 linux-2.6-xen-sparse/include/xen/public/privcmd.h | 16 ++-- tools/Makefile | 45 ++++++------ tools/Rules.mk | 2 tools/debugger/libxendebug/xendebug.c | 2 tools/ioemu/hw/cirrus_vga.c | 12 +-- tools/ioemu/vl.c | 15 ++-- tools/libxc/Makefile | 75 ++++++++------------- tools/libxc/xc_core.c | 10 +- tools/libxc/xc_domain.c | 10 +- tools/libxc/xc_hvm_build.c | 6 - tools/libxc/xc_ia64_stubs.c | 12 +-- tools/libxc/xc_linux.c | 2 tools/libxc/xc_linux_build.c | 29 +++----- tools/libxc/xc_linux_restore.c | 14 +-- tools/libxc/xc_linux_save.c | 28 +++---- tools/libxc/xc_load_aout9.c | 4 - tools/libxc/xc_load_bin.c | 4 - tools/libxc/xc_load_elf.c | 16 +--- tools/libxc/xc_private.c | 39 +++++----- tools/libxc/xenctrl.h | 16 ++-- tools/libxc/xg_private.h | 4 - tools/libxc/xg_save_restore.h | 12 +-- tools/misc/Makefile | 2 tools/python/xen/lowlevel/xc/xc.c | 4 + xen/common/memory.c | 20 +++-- xen/include/public/arch-ia64.h | 3 xen/include/public/arch-x86_32.h | 3 xen/include/public/arch-x86_64.h | 3 xen/include/public/dom0_ops.h | 56 +++++++-------- xen/include/public/memory.h | 8 +- xen/tools/Makefile | 3 xen/tools/figlet/Makefile | 3 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-May-30 22:19 UTC
[Xen-devel] [PATCH 1 of 3] Use a global build configuration file, and rework libxc Makefile for PowerPC
15 files changed, 90 insertions(+), 102 deletions(-) Config.mk | 14 ------ config/ia64.mk | 5 ++ config/x86_32.mk | 9 ++++ config/x86_64.mk | 9 ++++ extras/mini-os/Makefile | 3 - tools/Makefile | 45 ++++++++++------------ tools/Rules.mk | 2 tools/libxc/Makefile | 75 +++++++++++++++---------------------- tools/libxc/xc_core.c | 2 tools/libxc/xc_linux_build.c | 8 --- tools/libxc/xc_load_elf.c | 8 --- tools/misc/Makefile | 2 tools/python/xen/lowlevel/xc/xc.c | 4 + xen/tools/Makefile | 3 - xen/tools/figlet/Makefile | 3 - # HG changeset patch # User Hollis Blanchard <hollisb@us.ibm.com> # Node ID 93e96a7b38df8b168c8ed0386abaf64fbc5f7ddb # Parent 22d92d7fa04ac6b9ef1028658b7128a8bb1cd056 Use a global build configuration file, and rework libxc Makefile for PowerPC. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> diff -r 22d92d7fa04a -r 93e96a7b38df Config.mk --- a/Config.mk Tue May 30 17:17:28 2006 -0500 +++ b/Config.mk Tue May 30 17:17:30 2006 -0500 @@ -38,19 +38,7 @@ CFLAGS += -g CFLAGS += -g endif -ifeq ($(XEN_TARGET_ARCH),x86_32) -CFLAGS += -m32 -march=i686 -endif - -ifeq ($(XEN_TARGET_ARCH),x86_64) -CFLAGS += -m64 -endif - -ifeq ($(XEN_TARGET_ARCH),x86_64) -LIBDIR = lib64 -else -LIBDIR = lib -endif +include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include diff -r 22d92d7fa04a -r 93e96a7b38df extras/mini-os/Makefile --- a/extras/mini-os/Makefile Tue May 30 17:17:28 2006 -0500 +++ b/extras/mini-os/Makefile Tue May 30 17:17:30 2006 -0500 @@ -1,7 +1,8 @@ debug ?= y debug ?= y pae ?= n -include $(CURDIR)/../../Config.mk +XEN_ROOT = ../.. +include $(XEN_ROOT)/Config.mk # Set TARGET_ARCH override TARGET_ARCH := $(XEN_TARGET_ARCH) diff -r 22d92d7fa04a -r 93e96a7b38df tools/Makefile --- a/tools/Makefile Tue May 30 17:17:28 2006 -0500 +++ b/tools/Makefile Tue May 30 17:17:30 2006 -0500 @@ -1,39 +1,38 @@ XEN_ROOT = ../ XEN_ROOT = ../ include $(XEN_ROOT)/tools/Rules.mk -SUBDIRS :-SUBDIRS += libxc -SUBDIRS += xenstore -SUBDIRS += misc -SUBDIRS += examples -SUBDIRS += xentrace -SUBDIRS += xcutils -SUBDIRS += firmware -SUBDIRS += security -SUBDIRS += console -SUBDIRS += xenmon -SUBDIRS += guest-headers -ifeq ($(VTPM_TOOLS),y) -SUBDIRS += vtpm_manager -SUBDIRS += vtpm -endif -SUBDIRS += xenstat +SUBDIRS-y :+SUBDIRS-y += libxc +SUBDIRS-y += xenstore +SUBDIRS-y += misc +SUBDIRS-y += examples +SUBDIRS-y += xentrace +SUBDIRS-$(CONFIG_X86) += xcutils +SUBDIRS-y += firmware +SUBDIRS-y += security +SUBDIRS-y += console +SUBDIRS-y += xenmon +SUBDIRS-y += guest-headers +SUBDIRS-$(VTPM_TOOLS) += vtpm_manager +SUBDIRS-$(VTPM_TOOLS) += vtpm +SUBDIRS-y += xenstat + # These don''t cross-compile ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) -SUBDIRS += python -SUBDIRS += pygrub +SUBDIRS-y += python +SUBDIRS-y += pygrub endif .PHONY: all all: check - @set -e; for subdir in $(SUBDIRS); do \ + @set -e; for subdir in $(SUBDIRS-y); do \ $(MAKE) -C $$subdir $@; \ done $(MAKE) ioemu .PHONY: install install: check - @set -e; for subdir in $(SUBDIRS); do \ + @set -e; for subdir in $(SUBDIRS-y); do \ $(MAKE) -C $$subdir $@; \ done $(MAKE) ioemuinstall @@ -41,7 +40,7 @@ install: check .PHONY: clean clean: check_clean - @set -e; for subdir in $(SUBDIRS); do \ + @set -e; for subdir in $(SUBDIRS-y); do \ $(MAKE) -C $$subdir $@; \ done $(MAKE) ioemuclean @@ -55,7 +54,7 @@ check_clean: $(MAKE) -C check clean .PHONY: ioemu ioemuinstall ioemuclean -ifndef XEN_NO_IOEMU +ifdef CONFIG_IOEMU ioemu ioemuinstall ioemuclean: [ -f ioemu/config-host.h ] || \ (cd ioemu; ./configure --prefix=usr) diff -r 22d92d7fa04a -r 93e96a7b38df tools/Rules.mk --- a/tools/Rules.mk Tue May 30 17:17:28 2006 -0500 +++ b/tools/Rules.mk Tue May 30 17:17:30 2006 -0500 @@ -4,6 +4,8 @@ all: all: include $(XEN_ROOT)/Config.mk + +CONFIG_$(shell uname -s) := y XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc XEN_LIBXC = $(XEN_ROOT)/tools/libxc diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/Makefile --- a/tools/libxc/Makefile Tue May 30 17:17:28 2006 -0500 +++ b/tools/libxc/Makefile Tue May 30 17:17:30 2006 -0500 @@ -10,43 +10,30 @@ XEN_ROOT = ../.. XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Rules.mk -SRCS :-SRCS += xc_bvtsched.c -SRCS += xc_core.c -SRCS += xc_domain.c -SRCS += xc_evtchn.c -SRCS += xc_misc.c -SRCS += xc_acm.c -SRCS += xc_physdev.c -SRCS += xc_private.c -SRCS += xc_sedf.c -SRCS += xc_csched.c -SRCS += xc_tbuf.c +CTRL_SRCS-y :+CTRL_SRCS-y += xc_bvtsched.c +CTRL_SRCS-y += xc_core.c +CTRL_SRCS-y += xc_domain.c +CTRL_SRCS-y += xc_evtchn.c +CTRL_SRCS-y += xc_misc.c +CTRL_SRCS-y += xc_acm.c +CTRL_SRCS-y += xc_physdev.c +CTRL_SRCS-y += xc_private.c +CTRL_SRCS-y += xc_sedf.c +CTRL_SRCS-y += xc_csched.c +CTRL_SRCS-y += xc_tbuf.c +CTRL_SRCS-$(CONFIG_X86) += xc_ptrace.c xc_ptrace_core.c xc_pagetab.c +CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c -ifeq ($(patsubst x86%,x86,$(XEN_TARGET_ARCH)),x86) -SRCS += xc_ptrace.c -SRCS += xc_ptrace_core.c -SRCS += xc_pagetab.c -endif - -SRCS_Linux += xc_linux.c - -SRCS += $(SRCS_Linux) - -BUILD_SRCS :-BUILD_SRCS += xc_linux_build.c -BUILD_SRCS += xc_load_bin.c -BUILD_SRCS += xc_load_elf.c -BUILD_SRCS += xg_private.c - -ifeq ($(XEN_TARGET_ARCH),ia64) -BUILD_SRCS += xc_ia64_stubs.c -else -BUILD_SRCS += xc_load_aout9.c -BUILD_SRCS += xc_linux_restore.c -BUILD_SRCS += xc_linux_save.c -BUILD_SRCS += xc_hvm_build.c -endif +GUEST_SRCS-y :+GUEST_SRCS-y += xc_linux_build.c +GUEST_SRCS-y += xc_load_bin.c +GUEST_SRCS-y += xc_load_elf.c +GUEST_SRCS-y += xg_private.c +GUEST_SRCS-$(CONFIG_IA64) += xc_ia64_stubs.c +GUEST_SRCS-$(CONFIG_PLAN9) += xc_load_aout9.c +GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c +GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c CFLAGS += -Werror CFLAGS += -fno-strict-aliasing @@ -61,11 +48,11 @@ LDFLAGS += -L. LDFLAGS += -L. DEPS = .*.d -LIB_OBJS := $(patsubst %.c,%.o,$(SRCS)) -PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS)) +CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y)) +CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y)) -LIB_BUILD_OBJS := $(patsubst %.c,%.o,$(BUILD_SRCS)) -PIC_BUILD_OBJS := $(patsubst %.c,%.opic,$(BUILD_SRCS)) +GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y)) +GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y)) LIB := libxenctrl.a LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR) @@ -125,7 +112,7 @@ rpm: build # libxenctrl -libxenctrl.a: $(LIB_OBJS) +libxenctrl.a: $(CTRL_LIB_OBJS) $(AR) rc $@ $^ libxenctrl.so: libxenctrl.so.$(MAJOR) @@ -133,12 +120,12 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$( libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR) ln -sf $< $@ -libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS) +libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) -shared -o $@ $^ # libxenguest -libxenguest.a: $(LIB_BUILD_OBJS) +libxenguest.a: $(GUEST_LIB_OBJS) $(AR) rc $@ $^ libxenguest.so: libxenguest.so.$(MAJOR) @@ -146,7 +133,7 @@ libxenguest.so.$(MAJOR): libxenguest.so. libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR) ln -sf $< $@ -libxenguest.so.$(MAJOR).$(MINOR): $(PIC_BUILD_OBJS) libxenctrl.so +libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenguest.so.$(MAJOR) -shared -o $@ $^ -lz -lxenctrl -include $(DEPS) diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/xc_core.c --- a/tools/libxc/xc_core.c Tue May 30 17:17:28 2006 -0500 +++ b/tools/libxc/xc_core.c Tue May 30 17:17:30 2006 -0500 @@ -1,6 +1,4 @@ #include "xg_private.h" -#define ELFSIZE 32 -#include "xc_elf.h" #include <stdlib.h> #include <unistd.h> diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/xc_linux_build.c --- a/tools/libxc/xc_linux_build.c Tue May 30 17:17:28 2006 -0500 +++ b/tools/libxc/xc_linux_build.c Tue May 30 17:17:30 2006 -0500 @@ -5,14 +5,6 @@ #include "xg_private.h" #include "xc_private.h" #include <xenctrl.h> - -#if defined(__i386__) -#define ELFSIZE 32 -#endif - -#if defined(__x86_64__) || defined(__ia64__) -#define ELFSIZE 64 -#endif #include "xc_elf.h" #include "xc_aout9.h" diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/xc_load_elf.c --- a/tools/libxc/xc_load_elf.c Tue May 30 17:17:28 2006 -0500 +++ b/tools/libxc/xc_load_elf.c Tue May 30 17:17:30 2006 -0500 @@ -3,14 +3,6 @@ */ #include "xg_private.h" - -#if defined(__i386__) -#define ELFSIZE 32 -#endif -#if defined(__x86_64__) || defined(__ia64__) -#define ELFSIZE 64 -#endif - #include "xc_elf.h" #include <stdlib.h> #include <endian.h> diff -r 22d92d7fa04a -r 93e96a7b38df tools/misc/Makefile --- a/tools/misc/Makefile Tue May 30 17:17:28 2006 -0500 +++ b/tools/misc/Makefile Tue May 30 17:17:30 2006 -0500 @@ -25,7 +25,7 @@ build: $(TARGETS) build: $(TARGETS) $(MAKE) -C miniterm $(MAKE) -C cpuperf -ifneq ($(XEN_TARGET_ARCH),ia64) +ifeq ($(CONFIG_MBOOTPACK),y) $(MAKE) -C mbootpack endif $(MAKE) -C lomount diff -r 22d92d7fa04a -r 93e96a7b38df tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Tue May 30 17:17:28 2006 -0500 +++ b/tools/python/xen/lowlevel/xc/xc.c Tue May 30 17:17:30 2006 -0500 @@ -359,6 +359,7 @@ static PyObject *pyxc_linux_build(XcObje "console_mfn", console_mfn); } +#ifdef CONFIG_HVM static PyObject *pyxc_hvm_build(XcObject *self, PyObject *args, PyObject *kwds) @@ -387,6 +388,7 @@ static PyObject *pyxc_hvm_build(XcObject return Py_BuildValue("{s:i}", "store_mfn", store_mfn); } +#endif static PyObject *pyxc_bvtsched_global_set(XcObject *self, PyObject *args) { @@ -1012,6 +1014,7 @@ static PyMethodDef pyxc_methods[] = { " vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, +#ifdef CONFIG_HVM { "hvm_build", (PyCFunction)pyxc_hvm_build, METH_VARARGS | METH_KEYWORDS, "\n" @@ -1020,6 +1023,7 @@ static PyMethodDef pyxc_methods[] = { " image [str]: Name of HVM loader image file.\n" " vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, +#endif { "bvtsched_global_set", (PyCFunction)pyxc_bvtsched_global_set, diff -r 22d92d7fa04a -r 93e96a7b38df xen/tools/Makefile --- a/xen/tools/Makefile Tue May 30 17:17:28 2006 -0500 +++ b/xen/tools/Makefile Tue May 30 17:17:30 2006 -0500 @@ -1,5 +1,6 @@ -include $(BASEDIR)/../Config.mk +XEN_ROOT = $(BASEDIR)/.. +include $(XEN_ROOT)/Config.mk .PHONY: default default: diff -r 22d92d7fa04a -r 93e96a7b38df xen/tools/figlet/Makefile --- a/xen/tools/figlet/Makefile Tue May 30 17:17:28 2006 -0500 +++ b/xen/tools/figlet/Makefile Tue May 30 17:17:30 2006 -0500 @@ -1,5 +1,6 @@ -include $(BASEDIR)/../Config.mk +XEN_ROOT = $(BASEDIR)/.. +include $(XEN_ROOT)/Config.mk figlet: figlet.c $(HOSTCC) -o $@ $< diff -r 22d92d7fa04a -r 93e96a7b38df config/ia64.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/ia64.mk Tue May 30 17:17:30 2006 -0500 @@ -0,0 +1,5 @@ +CONFIG_IA64 := y +CONFIG_IOEMU := y + +CFLAGS += -DELFSIZE=64 -DCONFIG_HVM +LIBDIR := lib diff -r 22d92d7fa04a -r 93e96a7b38df config/x86_32.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/x86_32.mk Tue May 30 17:17:30 2006 -0500 @@ -0,0 +1,9 @@ +CONFIG_X86 := y +CONFIG_PLAN9 := y +CONFIG_HVM := y +CONFIG_MIGRATE := y +CONFIG_IOEMU := y +CONFIG_MBOOTPACK := y + +CFLAGS += -m32 -march=i686 -DELFSIZE=32 -DCONFIG_HVM +LIBDIR := lib diff -r 22d92d7fa04a -r 93e96a7b38df config/x86_64.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/x86_64.mk Tue May 30 17:17:30 2006 -0500 @@ -0,0 +1,9 @@ +CONFIG_X86 := y +CONFIG_PLAN9 := y +CONFIG_HVM := y +CONFIG_MIGRATE := y +CONFIG_IOEMU := y +CONFIG_MBOOTPACK := y + +CFLAGS += -m64 -DELFSIZE=64 -DCONFIG_HVM +LIBDIR = lib64 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-May-30 22:19 UTC
[Xen-devel] [PATCH 2 of 3] Represent PFNs with their own type, rather than ''unsigned long''
25 files changed, 138 insertions(+), 120 deletions(-) linux-2.6-xen-sparse/include/xen/public/privcmd.h | 2 - tools/debugger/libxendebug/xendebug.c | 2 - tools/ioemu/hw/cirrus_vga.c | 12 +++--- tools/ioemu/vl.c | 15 ++++---- tools/libxc/xc_core.c | 8 ++-- tools/libxc/xc_domain.c | 10 ++--- tools/libxc/xc_hvm_build.c | 6 +-- tools/libxc/xc_ia64_stubs.c | 12 +++--- tools/libxc/xc_linux.c | 2 - tools/libxc/xc_linux_build.c | 21 +++++------ tools/libxc/xc_linux_restore.c | 14 +++---- tools/libxc/xc_linux_save.c | 28 +++++++-------- tools/libxc/xc_load_aout9.c | 4 +- tools/libxc/xc_load_bin.c | 4 +- tools/libxc/xc_load_elf.c | 8 ++-- tools/libxc/xc_private.c | 39 ++++++++++----------- tools/libxc/xenctrl.h | 16 ++++---- tools/libxc/xg_private.h | 4 +- tools/libxc/xg_save_restore.h | 12 +++--- xen/common/memory.c | 20 +++++++--- xen/include/public/arch-ia64.h | 3 + xen/include/public/arch-x86_32.h | 3 + xen/include/public/arch-x86_64.h | 3 + xen/include/public/dom0_ops.h | 2 - xen/include/public/memory.h | 8 ++-- # HG changeset patch # User Hollis Blanchard <hollisb@us.ibm.com> # Node ID f03f168a4e2d42e85b62ba4c4e7ef349f27476bc # Parent eee70cbfa20adcc8cdc1c9215fbea79d1386d9f9 Represent PFNs with their own type, rather than ''unsigned long''. (''long'' changes size and alignment between 32- and 64-bit ABIs.) Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> diff -r eee70cbfa20a -r f03f168a4e2d linux-2.6-xen-sparse/include/xen/public/privcmd.h --- a/linux-2.6-xen-sparse/include/xen/public/privcmd.h Tue May 30 17:17:54 2006 -0500 +++ b/linux-2.6-xen-sparse/include/xen/public/privcmd.h Tue May 30 17:17:55 2006 -0500 @@ -59,7 +59,7 @@ typedef struct privcmd_mmapbatch { int num; /* number of pages to populate */ domid_t dom; /* target domain */ unsigned long addr; /* virtual address */ - unsigned long __user *arr; /* array of mfns - top nibble set on err */ + xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */ } privcmd_mmapbatch_t; /* diff -r eee70cbfa20a -r f03f168a4e2d tools/debugger/libxendebug/xendebug.c --- a/tools/debugger/libxendebug/xendebug.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/debugger/libxendebug/xendebug.c Tue May 30 17:17:55 2006 -0500 @@ -57,7 +57,7 @@ typedef struct domain_context vcpu_guest_context_t context[MAX_VIRT_CPUS]; long total_pages; - unsigned long *page_array; + xen_pfn_t *page_array; unsigned long cr3_phys[MAX_VIRT_CPUS]; unsigned long *cr3_virt[MAX_VIRT_CPUS]; diff -r eee70cbfa20a -r f03f168a4e2d tools/ioemu/hw/cirrus_vga.c --- a/tools/ioemu/hw/cirrus_vga.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/ioemu/hw/cirrus_vga.c Tue May 30 17:17:55 2006 -0500 @@ -2463,7 +2463,7 @@ extern FILE *logfile; #if defined(__i386__) || defined (__x86_64__) static void * set_vram_mapping(unsigned long begin, unsigned long end) { - unsigned long * extent_start = NULL; + xen_pfn_t *extent_start = NULL; unsigned long nr_extents; void *vram_pointer = NULL; int i; @@ -2474,14 +2474,14 @@ static void * set_vram_mapping(unsigned end = (end + TARGET_PAGE_SIZE -1 ) & TARGET_PAGE_MASK; nr_extents = (end - begin) >> TARGET_PAGE_BITS; - extent_start = malloc(sizeof(unsigned long) * nr_extents ); + extent_start = malloc(sizeof(xen_pfn_t) * nr_extents ); if (extent_start == NULL) { fprintf(stderr, "Failed malloc on set_vram_mapping\n"); return NULL; } - memset(extent_start, 0, sizeof(unsigned long) * nr_extents); + memset(extent_start, 0, sizeof(xen_pfn_t) * nr_extents); for (i = 0; i < nr_extents; i++) { @@ -2509,7 +2509,7 @@ static void * set_vram_mapping(unsigned static int unset_vram_mapping(unsigned long begin, unsigned long end) { - unsigned long * extent_start = NULL; + xen_pfn_t *extent_start = NULL; unsigned long nr_extents; int i; @@ -2520,7 +2520,7 @@ static int unset_vram_mapping(unsigned l end = (end + TARGET_PAGE_SIZE -1 ) & TARGET_PAGE_MASK; nr_extents = (end - begin) >> TARGET_PAGE_BITS; - extent_start = malloc(sizeof(unsigned long) * nr_extents ); + extent_start = malloc(sizeof(xen_pfn_t) * nr_extents ); if (extent_start == NULL) { @@ -2528,7 +2528,7 @@ static int unset_vram_mapping(unsigned l return -1; } - memset(extent_start, 0, sizeof(unsigned long) * nr_extents); + memset(extent_start, 0, sizeof(xen_pfn_t) * nr_extents); for (i = 0; i < nr_extents; i++) extent_start[i] = (begin + (i * TARGET_PAGE_SIZE)) >> TARGET_PAGE_BITS; diff -r eee70cbfa20a -r f03f168a4e2d tools/ioemu/vl.c --- a/tools/ioemu/vl.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/ioemu/vl.c Tue May 30 17:17:55 2006 -0500 @@ -2457,7 +2457,7 @@ int unset_mm_mapping(int xc_handle, uint32_t domid, unsigned long nr_pages, unsigned int address_bits, - unsigned long *extent_start) + xen_pfn_t *extent_start) { int err = 0; xc_dominfo_t info; @@ -2490,7 +2490,7 @@ int set_mm_mapping(int xc_handle, uint32_t domid, unsigned long nr_pages, unsigned int address_bits, - unsigned long *extent_start) + xen_pfn_t *extent_start) { xc_dominfo_t info; int err = 0; @@ -2556,7 +2556,8 @@ int main(int argc, char **argv) int serial_device_index; char qemu_dm_logfilename[64]; const char *loadvm = NULL; - unsigned long nr_pages, *page_array; + unsigned long nr_pages; + xen_pfn_t *page_array; extern void *shared_page; #if !defined(CONFIG_SOFTMMU) @@ -3022,8 +3023,8 @@ int main(int argc, char **argv) xc_handle = xc_interface_open(); - if ( (page_array = (unsigned long *) - malloc(nr_pages * sizeof(unsigned long))) == NULL) + if ( (page_array = (xen_pfn_t *) + malloc(nr_pages * sizeof(xen_pfn_t))) == NULL) { fprintf(logfile, "malloc returned error %d\n", errno); exit(-1); @@ -3078,8 +3079,8 @@ int main(int argc, char **argv) page_array[0]); #endif - fprintf(logfile, "shared page at pfn:%lx, mfn: %lx\n", (nr_pages-1), - (page_array[nr_pages - 1])); + fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n", (nr_pages-1), + (uint64_t)(page_array[nr_pages - 1])); /* we always create the cdrom drive, even if no disk is there */ bdrv_init(); diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_core.c --- a/tools/libxc/xc_core.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_core.c Tue May 30 17:17:55 2006 -0500 @@ -28,7 +28,7 @@ xc_domain_dumpcore_via_callback(int xc_h dumpcore_rtn_t dump_rtn) { unsigned long nr_pages; - unsigned long *page_array = NULL; + xen_pfn_t *page_array = NULL; xc_dominfo_t info; int i, nr_vcpus = 0; char *dump_mem, *dump_mem_start = NULL; @@ -70,7 +70,7 @@ xc_domain_dumpcore_via_callback(int xc_h sizeof(vcpu_guest_context_t)*nr_vcpus; dummy_len = (sizeof(struct xc_core_header) + (sizeof(vcpu_guest_context_t) * nr_vcpus) + - (nr_pages * sizeof(unsigned long))); + (nr_pages * sizeof(xen_pfn_t))); header.xch_pages_offset = round_pgup(dummy_len); sts = dump_rtn(args, (char *)&header, sizeof(struct xc_core_header)); @@ -81,7 +81,7 @@ xc_domain_dumpcore_via_callback(int xc_h if ( sts != 0 ) goto error_out; - if ( (page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL ) + if ( (page_array = malloc(nr_pages * sizeof(xen_pfn_t))) == NULL ) { printf("Could not allocate memory\n"); goto error_out; @@ -91,7 +91,7 @@ xc_domain_dumpcore_via_callback(int xc_h printf("Could not get the page frame list\n"); goto error_out; } - sts = dump_rtn(args, (char *)page_array, nr_pages * sizeof(unsigned long)); + sts = dump_rtn(args, (char *)page_array, nr_pages * sizeof(xen_pfn_t)); if ( sts != 0 ) goto error_out; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_domain.c --- a/tools/libxc/xc_domain.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_domain.c Tue May 30 17:17:55 2006 -0500 @@ -291,7 +291,7 @@ int xc_domain_memory_increase_reservatio unsigned long nr_extents, unsigned int extent_order, unsigned int address_bits, - unsigned long *extent_start) + xen_pfn_t *extent_start) { int err; struct xen_memory_reservation reservation = { @@ -324,7 +324,7 @@ int xc_domain_memory_decrease_reservatio uint32_t domid, unsigned long nr_extents, unsigned int extent_order, - unsigned long *extent_start) + xen_pfn_t *extent_start) { int err; struct xen_memory_reservation reservation = { @@ -363,7 +363,7 @@ int xc_domain_memory_populate_physmap(in unsigned long nr_extents, unsigned int extent_order, unsigned int address_bits, - unsigned long *extent_start) + xen_pfn_t *extent_start) { int err; struct xen_memory_reservation reservation = { @@ -392,8 +392,8 @@ int xc_domain_translate_gpfn_list(int xc int xc_domain_translate_gpfn_list(int xc_handle, uint32_t domid, unsigned long nr_gpfns, - unsigned long *gpfn_list, - unsigned long *mfn_list) + xen_pfn_t *gpfn_list, + xen_pfn_t *mfn_list) { struct xen_translate_gpfn_list op = { .domid = domid, diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_hvm_build.c --- a/tools/libxc/xc_hvm_build.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_hvm_build.c Tue May 30 17:17:55 2006 -0500 @@ -135,7 +135,7 @@ static void set_hvm_info_checksum(struct * hvmloader will use this info to set BIOS accordingly */ static int set_hvm_info(int xc_handle, uint32_t dom, - unsigned long *pfn_list, unsigned int vcpus, + xen_pfn_t *pfn_list, unsigned int vcpus, unsigned int pae, unsigned int acpi, unsigned int apic) { char *va_map; @@ -178,7 +178,7 @@ static int setup_guest(int xc_handle, unsigned int store_evtchn, unsigned long *store_mfn) { - unsigned long *page_array = NULL; + xen_pfn_t *page_array = NULL; unsigned long count, i; unsigned long long ptr; xc_mmu_t *mmu = NULL; @@ -223,7 +223,7 @@ static int setup_guest(int xc_handle, goto error_out; } - if ( (page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL ) + if ( (page_array = malloc(nr_pages * sizeof(xen_pfn_t))) == NULL ) { PERROR("Could not allocate memory.\n"); goto error_out; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_ia64_stubs.c --- a/tools/libxc/xc_ia64_stubs.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_ia64_stubs.c Tue May 30 17:17:55 2006 -0500 @@ -57,7 +57,7 @@ xc_plan9_build(int xc_handle, int xc_ia64_get_pfn_list(int xc_handle, uint32_t domid, - unsigned long *pfn_buf, + xen_pfn_t *pfn_buf, unsigned int start_page, unsigned int nr_pages) { @@ -65,7 +65,7 @@ int xc_ia64_get_pfn_list(int xc_handle, int num_pfns,ret; unsigned int __start_page, __nr_pages; unsigned long max_pfns; - unsigned long *__pfn_buf; + xen_pfn_t *__pfn_buf; __start_page = start_page; __nr_pages = nr_pages; @@ -80,7 +80,7 @@ int xc_ia64_get_pfn_list(int xc_handle, set_xen_guest_handle(op.u.getmemlist.buffer, __pfn_buf); if ( (max_pfns != -1UL) - && mlock(__pfn_buf, __nr_pages * sizeof(unsigned long)) != 0 ) + && mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0 ) { PERROR("Could not lock pfn list buffer"); return -1; @@ -89,7 +89,7 @@ int xc_ia64_get_pfn_list(int xc_handle, ret = do_dom0_op(xc_handle, &op); if (max_pfns != -1UL) - (void)munlock(__pfn_buf, __nr_pages * sizeof(unsigned long)); + (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)); if (max_pfns == -1UL) return 0; @@ -122,10 +122,10 @@ int xc_ia64_copy_to_domain_pages(int xc_ { // N.B. gva should be page aligned - unsigned long *page_array = NULL; + xen_pfn_t *page_array = NULL; int i; - if ( (page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL ){ + if ( (page_array = malloc(nr_pages * sizeof(xen_pfn_t))) == NULL ){ PERROR("Could not allocate memory"); goto error_out; } diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_linux.c --- a/tools/libxc/xc_linux.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_linux.c Tue May 30 17:17:55 2006 -0500 @@ -28,7 +28,7 @@ int xc_interface_close(int xc_handle) } void *xc_map_foreign_batch(int xc_handle, uint32_t dom, int prot, - unsigned long *arr, int num) + xen_pfn_t *arr, int num) { privcmd_mmapbatch_t ioctlx; void *addr; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_linux_build.c --- a/tools/libxc/xc_linux_build.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_linux_build.c Tue May 30 17:17:55 2006 -0500 @@ -10,6 +10,7 @@ #include "xc_aout9.h" #include <stdlib.h> #include <unistd.h> +#include <inttypes.h> #include <zlib.h> #if defined(__i386__) @@ -136,7 +137,7 @@ int load_initrd(int xc_handle, domid_t d int load_initrd(int xc_handle, domid_t dom, struct initrd_info *initrd, unsigned long physbase, - unsigned long *phys_to_mach) + xen_pfn_t *phys_to_mach) { char page[PAGE_SIZE]; unsigned long pfn_start, pfn, nr_pages; @@ -189,7 +190,7 @@ static int setup_pg_tables(int xc_handle vcpu_guest_context_t *ctxt, unsigned long dsi_v_start, unsigned long v_end, - unsigned long *page_array, + xen_pfn_t *page_array, unsigned long vpt_start, unsigned long vpt_end, unsigned shadow_mode_enabled) @@ -251,7 +252,7 @@ static int setup_pg_tables_pae(int xc_ha vcpu_guest_context_t *ctxt, unsigned long dsi_v_start, unsigned long v_end, - unsigned long *page_array, + xen_pfn_t *page_array, unsigned long vpt_start, unsigned long vpt_end, unsigned shadow_mode_enabled) @@ -340,7 +341,7 @@ static int setup_pg_tables_64(int xc_han vcpu_guest_context_t *ctxt, unsigned long dsi_v_start, unsigned long v_end, - unsigned long *page_array, + xen_pfn_t *page_array, unsigned long vpt_start, unsigned long vpt_end, int shadow_mode_enabled) @@ -451,7 +452,7 @@ static int setup_guest(int xc_handle, unsigned int console_evtchn, unsigned long *console_mfn, uint32_t required_features[XENFEAT_NR_SUBMAPS]) { - unsigned long *page_array = NULL; + xen_pfn_t *page_array = NULL; struct load_funcs load_funcs; struct domain_setup_info dsi; unsigned long vinitrd_start; @@ -478,7 +479,7 @@ static int setup_guest(int xc_handle, start_page = dsi.v_start >> PAGE_SHIFT; pgnr = (v_end - dsi.v_start) >> PAGE_SHIFT; - if ( (page_array = malloc(pgnr * sizeof(unsigned long))) == NULL ) + if ( (page_array = malloc(pgnr * sizeof(xen_pfn_t))) == NULL ) { PERROR("Could not allocate memory"); goto error_out; @@ -606,7 +607,7 @@ static int setup_guest(int xc_handle, unsigned int console_evtchn, unsigned long *console_mfn, uint32_t required_features[XENFEAT_NR_SUBMAPS]) { - unsigned long *page_array = NULL; + xen_pfn_t *page_array = NULL; unsigned long count, i, hypercall_pfn; start_info_t *start_info; shared_info_t *shared_info; @@ -617,7 +618,7 @@ static int setup_guest(int xc_handle, unsigned long nr_pt_pages; unsigned long physmap_pfn; - unsigned long *physmap, *physmap_e; + xen_pfn_t *physmap, *physmap_e; struct load_funcs load_funcs; struct domain_setup_info dsi; @@ -865,8 +866,8 @@ static int setup_guest(int xc_handle, ((uint64_t)page_array[count] << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE, count) ) { - fprintf(stderr,"m2p update failure p=%lx m=%lx\n", - count, page_array[count]); + fprintf(stderr,"m2p update failure p=%lx m=%"PRIx64"\n", + count, (uint64_t)page_array[count]); munmap(physmap, PAGE_SIZE); goto error_out; } diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_linux_restore.c --- a/tools/libxc/xc_linux_restore.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_linux_restore.c Tue May 30 17:17:55 2006 -0500 @@ -25,10 +25,10 @@ static unsigned long max_pfn; static unsigned long max_pfn; /* Live mapping of the table mapping each PFN to its current MFN. */ -static unsigned long *live_p2m = NULL; +static xen_pfn_t *live_p2m = NULL; /* A table mapping each PFN to its new MFN. */ -static unsigned long *p2m = NULL; +static xen_pfn_t *p2m = NULL; static ssize_t @@ -126,7 +126,7 @@ int xc_linux_restore(int xc_handle, int unsigned long *pfn_type = NULL; /* A table of MFNs to map in the current region */ - unsigned long *region_mfn = NULL; + xen_pfn_t *region_mfn = NULL; /* Types of the pfns in the current region */ unsigned long region_pfn_type[MAX_BATCH_SIZE]; @@ -135,7 +135,7 @@ int xc_linux_restore(int xc_handle, int unsigned long *page = NULL; /* A copy of the pfn-to-mfn table frame list. */ - unsigned long *p2m_frame_list = NULL; + xen_pfn_t *p2m_frame_list = NULL; /* A temporary mapping of the guest''s start_info page. */ start_info_t *start_info; @@ -183,9 +183,9 @@ int xc_linux_restore(int xc_handle, int /* We want zeroed memory so use calloc rather than malloc. */ - p2m = calloc(max_pfn, sizeof(unsigned long)); + p2m = calloc(max_pfn, sizeof(xen_pfn_t)); pfn_type = calloc(max_pfn, sizeof(unsigned long)); - region_mfn = calloc(MAX_BATCH_SIZE, sizeof(unsigned long)); + region_mfn = calloc(MAX_BATCH_SIZE, sizeof(xen_pfn_t)); if ((p2m == NULL) || (pfn_type == NULL) || (region_mfn == NULL)) { ERR("memory alloc failed"); @@ -193,7 +193,7 @@ int xc_linux_restore(int xc_handle, int goto out; } - if (mlock(region_mfn, sizeof(unsigned long) * MAX_BATCH_SIZE)) { + if (mlock(region_mfn, sizeof(xen_pfn_t) * MAX_BATCH_SIZE)) { ERR("Could not mlock region_mfn"); goto out; } diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_linux_save.c --- a/tools/libxc/xc_linux_save.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_linux_save.c Tue May 30 17:17:55 2006 -0500 @@ -40,10 +40,10 @@ static unsigned long max_pfn; static unsigned long max_pfn; /* Live mapping of the table mapping each PFN to its current MFN. */ -static unsigned long *live_p2m = NULL; +static xen_pfn_t *live_p2m = NULL; /* Live mapping of system MFN to PFN table. */ -static unsigned long *live_m2p = NULL; +static xen_pfn_t *live_m2p = NULL; /* grep fodder: machine_to_phys */ @@ -501,22 +501,22 @@ void canonicalize_pagetable(unsigned lon -static unsigned long *xc_map_m2p(int xc_handle, +static xen_pfn_t *xc_map_m2p(int xc_handle, unsigned long max_mfn, int prot) { struct xen_machphys_mfn_list xmml; privcmd_mmap_entry_t *entries; unsigned long m2p_chunks, m2p_size; - unsigned long *m2p; - unsigned long *extent_start; + xen_pfn_t *m2p; + xen_pfn_t *extent_start; int i, rc; m2p_size = M2P_SIZE(max_mfn); m2p_chunks = M2P_CHUNKS(max_mfn); xmml.max_extents = m2p_chunks; - if (!(extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) { + if (!(extent_start = malloc(m2p_chunks * sizeof(xen_pfn_t)))) { ERR("failed to allocate space for m2p mfns"); return NULL; } @@ -583,11 +583,11 @@ int xc_linux_save(int xc_handle, int io_ char page[PAGE_SIZE]; /* Double and single indirect references to the live P2M table */ - unsigned long *live_p2m_frame_list_list = NULL; - unsigned long *live_p2m_frame_list = NULL; + xen_pfn_t *live_p2m_frame_list_list = NULL; + xen_pfn_t *live_p2m_frame_list = NULL; /* A copy of the pfn-to-mfn table frame list. */ - unsigned long *p2m_frame_list = NULL; + xen_pfn_t *p2m_frame_list = NULL; /* Live mapping of shared info structure */ shared_info_t *live_shinfo = NULL; @@ -712,11 +712,11 @@ int xc_linux_save(int xc_handle, int io_ memcpy(p2m_frame_list, live_p2m_frame_list, P2M_FL_SIZE); /* Canonicalise the pfn-to-mfn table frame-number list. */ - for (i = 0; i < max_pfn; i += ulpp) { - if (!translate_mfn_to_pfn(&p2m_frame_list[i/ulpp])) { + for (i = 0; i < max_pfn; i += fpp) { + if (!translate_mfn_to_pfn(&p2m_frame_list[i/fpp])) { ERR("Frame# in pfn-to-mfn frame list is not in pseudophys"); - ERR("entry %d: p2m_frame_list[%ld] is 0x%lx", i, i/ulpp, - p2m_frame_list[i/ulpp]); + ERR("entry %d: p2m_frame_list[%ld] is 0x%"PRIx64, i, i/fpp, + (uint64_t)p2m_frame_list[i/fpp]); goto out; } } @@ -818,7 +818,7 @@ int xc_linux_save(int xc_handle, int io_ /* Start writing out the saved-domain record. */ - if(!write_exact(io_fd, &max_pfn, sizeof(unsigned long))) { + if(!write_exact(io_fd, &max_pfn, sizeof(xen_pfn_t))) { ERR("write: max_pfn"); goto out; } diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_load_aout9.c --- a/tools/libxc/xc_load_aout9.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_load_aout9.c Tue May 30 17:17:55 2006 -0500 @@ -17,7 +17,7 @@ #define KOFFSET(_p) ((_p)&~KZERO) static int parseaout9image(const char *, unsigned long, struct domain_setup_info *); -static int loadaout9image(const char *, unsigned long, int, uint32_t, unsigned long *, struct domain_setup_info *); +static int loadaout9image(const char *, unsigned long, int, uint32_t, xen_pfn_t *, struct domain_setup_info *); static void copyout(int, uint32_t, unsigned long *, unsigned long, const char *, int); struct Exec *get_header(const char *, unsigned long, struct Exec *); @@ -79,7 +79,7 @@ loadaout9image( const char *image, unsigned long image_size, int xch, uint32_t dom, - unsigned long *parray, + xen_pfn_t *parray, struct domain_setup_info *dsi) { struct Exec ehdr; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_load_bin.c --- a/tools/libxc/xc_load_bin.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_load_bin.c Tue May 30 17:17:55 2006 -0500 @@ -107,7 +107,7 @@ static int static int loadbinimage( const char *image, unsigned long image_size, int xch, uint32_t dom, - unsigned long *parray, struct domain_setup_info *dsi); + xen_pfn_t *parray, struct domain_setup_info *dsi); int probe_bin(const char *image, unsigned long image_size, @@ -235,7 +235,7 @@ static int static int loadbinimage( const char *image, unsigned long image_size, int xch, uint32_t dom, - unsigned long *parray, struct domain_setup_info *dsi) + xen_pfn_t *parray, struct domain_setup_info *dsi) { unsigned long size; char *va; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_load_elf.c --- a/tools/libxc/xc_load_elf.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_load_elf.c Tue May 30 17:17:55 2006 -0500 @@ -17,10 +17,10 @@ static int static int loadelfimage( const char *image, unsigned long image_size, int xch, uint32_t dom, - unsigned long *parray, struct domain_setup_info *dsi); + xen_pfn_t *parray, struct domain_setup_info *dsi); static int loadelfsymtab( - const char *image, int xch, uint32_t dom, unsigned long *parray, + const char *image, int xch, uint32_t dom, xen_pfn_t *parray, struct domain_setup_info *dsi); int probe_elf(const char *image, @@ -220,7 +220,7 @@ static int static int loadelfimage( const char *image, unsigned long elfsize, int xch, uint32_t dom, - unsigned long *parray, struct domain_setup_info *dsi) + xen_pfn_t *parray, struct domain_setup_info *dsi) { Elf_Ehdr *ehdr = (Elf_Ehdr *)image; Elf_Phdr *phdr; @@ -274,7 +274,7 @@ loadelfimage( static int loadelfsymtab( - const char *image, int xch, uint32_t dom, unsigned long *parray, + const char *image, int xch, uint32_t dom, xen_pfn_t *parray, struct domain_setup_info *dsi) { Elf_Ehdr *ehdr = (Elf_Ehdr *)image, *sym_ehdr; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xc_private.c --- a/tools/libxc/xc_private.c Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xc_private.c Tue May 30 17:17:55 2006 -0500 @@ -4,6 +4,7 @@ * Helper functions for the rest of the library. */ +#include <inttypes.h> #include "xc_private.h" /* NB: arr must be mlock''ed */ @@ -134,9 +135,9 @@ int xc_memory_op(int xc_handle, struct xen_memory_reservation *reservation = arg; struct xen_machphys_mfn_list *xmml = arg; struct xen_translate_gpfn_list *trans = arg; - unsigned long *extent_start; - unsigned long *gpfn_list; - unsigned long *mfn_list; + xen_pfn_t *extent_start; + xen_pfn_t *gpfn_list; + xen_pfn_t *mfn_list; long ret = -EINVAL; hypercall.op = __HYPERVISOR_memory_op; @@ -156,7 +157,7 @@ int xc_memory_op(int xc_handle, get_xen_guest_handle(extent_start, reservation->extent_start); if ( (extent_start != NULL) && (mlock(extent_start, - reservation->nr_extents * sizeof(unsigned long)) != 0) ) + reservation->nr_extents * sizeof(xen_pfn_t)) != 0) ) { PERROR("Could not mlock"); safe_munlock(reservation, sizeof(*reservation)); @@ -171,7 +172,7 @@ int xc_memory_op(int xc_handle, } get_xen_guest_handle(extent_start, xmml->extent_start); if ( mlock(extent_start, - xmml->max_extents * sizeof(unsigned long)) != 0 ) + xmml->max_extents * sizeof(xen_pfn_t)) != 0 ) { PERROR("Could not mlock"); safe_munlock(xmml, sizeof(*xmml)); @@ -192,17 +193,17 @@ int xc_memory_op(int xc_handle, goto out1; } get_xen_guest_handle(gpfn_list, trans->gpfn_list); - if ( mlock(gpfn_list, trans->nr_gpfns * sizeof(long)) != 0 ) + if ( mlock(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)) != 0 ) { PERROR("Could not mlock"); safe_munlock(trans, sizeof(*trans)); goto out1; } get_xen_guest_handle(mfn_list, trans->mfn_list); - if ( mlock(mfn_list, trans->nr_gpfns * sizeof(long)) != 0 ) - { - PERROR("Could not mlock"); - safe_munlock(gpfn_list, trans->nr_gpfns * sizeof(long)); + if ( mlock(mfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)) != 0 ) + { + PERROR("Could not mlock"); + safe_munlock(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)); safe_munlock(trans, sizeof(*trans)); goto out1; } @@ -220,22 +221,22 @@ int xc_memory_op(int xc_handle, get_xen_guest_handle(extent_start, reservation->extent_start); if ( extent_start != NULL ) safe_munlock(extent_start, - reservation->nr_extents * sizeof(unsigned long)); + reservation->nr_extents * sizeof(xen_pfn_t)); break; case XENMEM_machphys_mfn_list: safe_munlock(xmml, sizeof(*xmml)); get_xen_guest_handle(extent_start, xmml->extent_start); safe_munlock(extent_start, - xmml->max_extents * sizeof(unsigned long)); + xmml->max_extents * sizeof(xen_pfn_t)); break; case XENMEM_add_to_physmap: safe_munlock(arg, sizeof(struct xen_add_to_physmap)); break; case XENMEM_translate_gpfn_list: get_xen_guest_handle(mfn_list, trans->mfn_list); - safe_munlock(mfn_list, trans->nr_gpfns * sizeof(long)); + safe_munlock(mfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)); get_xen_guest_handle(gpfn_list, trans->gpfn_list); - safe_munlock(gpfn_list, trans->nr_gpfns * sizeof(long)); + safe_munlock(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)); safe_munlock(trans, sizeof(*trans)); break; } @@ -263,7 +264,7 @@ long long xc_domain_get_cpu_usage( int x int xc_get_pfn_list(int xc_handle, uint32_t domid, - unsigned long *pfn_buf, + xen_pfn_t *pfn_buf, unsigned long max_pfns) { DECLARE_DOM0_OP; @@ -274,10 +275,10 @@ int xc_get_pfn_list(int xc_handle, set_xen_guest_handle(op.u.getmemlist.buffer, pfn_buf); #ifdef VALGRIND - memset(pfn_buf, 0, max_pfns * sizeof(unsigned long)); + memset(pfn_buf, 0, max_pfns * sizeof(xen_pfn_t)); #endif - if ( mlock(pfn_buf, max_pfns * sizeof(unsigned long)) != 0 ) + if ( mlock(pfn_buf, max_pfns * sizeof(xen_pfn_t)) != 0 ) { PERROR("xc_get_pfn_list: pfn_buf mlock failed"); return -1; @@ -285,7 +286,7 @@ int xc_get_pfn_list(int xc_handle, ret = do_dom0_op(xc_handle, &op); - safe_munlock(pfn_buf, max_pfns * sizeof(unsigned long)); + safe_munlock(pfn_buf, max_pfns * sizeof(xen_pfn_t)); #if 0 #ifdef DEBUG @@ -364,7 +365,7 @@ unsigned long xc_get_filesz(int fd) } void xc_map_memcpy(unsigned long dst, const char *src, unsigned long size, - int xch, uint32_t dom, unsigned long *parray, + int xch, uint32_t dom, xen_pfn_t *parray, unsigned long vstart) { char *va; diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xenctrl.h Tue May 30 17:17:55 2006 -0500 @@ -420,26 +420,26 @@ int xc_domain_memory_increase_reservatio unsigned long nr_extents, unsigned int extent_order, unsigned int address_bits, - unsigned long *extent_start); + xen_pfn_t *extent_start); int xc_domain_memory_decrease_reservation(int xc_handle, uint32_t domid, unsigned long nr_extents, unsigned int extent_order, - unsigned long *extent_start); + xen_pfn_t *extent_start); int xc_domain_memory_populate_physmap(int xc_handle, uint32_t domid, unsigned long nr_extents, unsigned int extent_order, unsigned int address_bits, - unsigned long *extent_start); + xen_pfn_t *extent_start); int xc_domain_translate_gpfn_list(int xc_handle, uint32_t domid, unsigned long nr_gpfns, - unsigned long *gpfn_list, - unsigned long *mfn_list); + xen_pfn_t *gpfn_list, + xen_pfn_t *mfn_list); int xc_domain_ioport_permission(int xc_handle, uint32_t domid, @@ -489,7 +489,7 @@ void *xc_map_foreign_range(int xc_handle unsigned long mfn ); void *xc_map_foreign_batch(int xc_handle, uint32_t dom, int prot, - unsigned long *arr, int num ); + xen_pfn_t *arr, int num ); /** * Translates a virtual address in the context of a given domain and @@ -504,11 +504,11 @@ unsigned long xc_translate_foreign_addre unsigned long xc_translate_foreign_address(int xc_handle, uint32_t dom, int vcpu, unsigned long long virt); -int xc_get_pfn_list(int xc_handle, uint32_t domid, unsigned long *pfn_buf, +int xc_get_pfn_list(int xc_handle, uint32_t domid, xen_pfn_t *pfn_buf, unsigned long max_pfns); int xc_ia64_get_pfn_list(int xc_handle, uint32_t domid, - unsigned long *pfn_buf, + xen_pfn_t *pfn_buf, unsigned int start_page, unsigned int nr_pages); int xc_copy_to_domain_page(int xc_handle, uint32_t domid, diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xg_private.h --- a/tools/libxc/xg_private.h Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xg_private.h Tue May 30 17:17:55 2006 -0500 @@ -162,7 +162,7 @@ typedef int (*parseimagefunc)(const char struct domain_setup_info *dsi); typedef int (*loadimagefunc)(const char *image, unsigned long image_size, int xch, - uint32_t dom, unsigned long *parray, + uint32_t dom, xen_pfn_t *parray, struct domain_setup_info *dsi); struct load_funcs @@ -190,7 +190,7 @@ unsigned long xc_get_filesz(int fd); unsigned long xc_get_filesz(int fd); void xc_map_memcpy(unsigned long dst, const char *src, unsigned long size, - int xch, uint32_t dom, unsigned long *parray, + int xch, uint32_t dom, xen_pfn_t *parray, unsigned long vstart); int pin_table(int xc_handle, unsigned int type, unsigned long mfn, diff -r eee70cbfa20a -r f03f168a4e2d tools/libxc/xg_save_restore.h --- a/tools/libxc/xg_save_restore.h Tue May 30 17:17:54 2006 -0500 +++ b/tools/libxc/xg_save_restore.h Tue May 30 17:17:55 2006 -0500 @@ -105,23 +105,23 @@ static int get_platform_info(int xc_hand */ #define M2P_SHIFT L2_PAGETABLE_SHIFT_PAE #define M2P_CHUNK_SIZE (1 << M2P_SHIFT) -#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(unsigned long)), M2P_SHIFT) +#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT) #define M2P_CHUNKS(_m) (M2P_SIZE((_m)) >> M2P_SHIFT) /* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */ -#define P2M_SIZE ROUNDUP((max_pfn * sizeof(unsigned long)), PAGE_SHIFT) +#define P2M_SIZE ROUNDUP((max_pfn * sizeof(xen_pfn_t)), PAGE_SHIFT) -/* Number of unsigned longs in a page */ -#define ulpp (PAGE_SIZE/sizeof(unsigned long)) +/* Number of xen_pfn_t in a page */ +#define fpp (PAGE_SIZE/sizeof(xen_pfn_t)) /* Number of entries in the pfn_to_mfn_frame_list */ -#define P2M_FL_ENTRIES (((max_pfn)+ulpp-1)/ulpp) +#define P2M_FL_ENTRIES (((max_pfn)+fpp-1)/fpp) /* Size in bytes of the pfn_to_mfn_frame_list */ #define P2M_FL_SIZE ((P2M_FL_ENTRIES)*sizeof(unsigned long)) /* Number of entries in the pfn_to_mfn_frame_list_list */ -#define P2M_FLL_ENTRIES (((max_pfn)+(ulpp*ulpp)-1)/(ulpp*ulpp)) +#define P2M_FLL_ENTRIES (((max_pfn)+(fpp*fpp)-1)/(fpp*fpp)) /* Current guests allow 8MB ''slack'' in their P2M */ #define NR_SLACK_ENTRIES ((8 * 1024 * 1024) / PAGE_SIZE) diff -r eee70cbfa20a -r f03f168a4e2d xen/common/memory.c --- a/xen/common/memory.c Tue May 30 17:17:54 2006 -0500 +++ b/xen/common/memory.c Tue May 30 17:17:55 2006 -0500 @@ -31,14 +31,15 @@ static long static long increase_reservation( struct domain *d, - XEN_GUEST_HANDLE(ulong) extent_list, + XEN_GUEST_HANDLE(xen_pfn_t) extent_list, unsigned int nr_extents, unsigned int extent_order, unsigned int flags, int *preempted) { struct page_info *page; - unsigned long i, mfn; + unsigned long i; + xen_pfn_t mfn; if ( !guest_handle_is_null(extent_list) && !guest_handle_okay(extent_list, nr_extents) ) @@ -80,14 +81,16 @@ static long static long populate_physmap( struct domain *d, - XEN_GUEST_HANDLE(ulong) extent_list, + XEN_GUEST_HANDLE(xen_pfn_t) extent_list, unsigned int nr_extents, unsigned int extent_order, unsigned int flags, int *preempted) { struct page_info *page; - unsigned long i, j, gpfn, mfn; + unsigned long i, j; + xen_pfn_t gpfn; + xen_pfn_t mfn; if ( !guest_handle_okay(extent_list, nr_extents) ) return 0; @@ -177,13 +180,14 @@ static long static long decrease_reservation( struct domain *d, - XEN_GUEST_HANDLE(ulong) extent_list, + XEN_GUEST_HANDLE(xen_pfn_t) extent_list, unsigned int nr_extents, unsigned int extent_order, unsigned int flags, int *preempted) { - unsigned long i, j, gmfn; + unsigned long i, j; + xen_pfn_t gmfn; if ( !guest_handle_okay(extent_list, nr_extents) ) return 0; @@ -214,7 +218,9 @@ translate_gpfn_list( XEN_GUEST_HANDLE(xen_translate_gpfn_list_t) uop, unsigned long *progress) { struct xen_translate_gpfn_list op; - unsigned long i, gpfn, mfn; + unsigned long i; + xen_pfn_t gpfn; + xen_pfn_t mfn; struct domain *d; if ( copy_from_guest(&op, uop, 1) ) diff -r eee70cbfa20a -r f03f168a4e2d xen/include/public/arch-ia64.h --- a/xen/include/public/arch-ia64.h Tue May 30 17:17:54 2006 -0500 +++ b/xen/include/public/arch-ia64.h Tue May 30 17:17:55 2006 -0500 @@ -26,6 +26,9 @@ DEFINE_XEN_GUEST_HANDLE(int); DEFINE_XEN_GUEST_HANDLE(int); DEFINE_XEN_GUEST_HANDLE(long); DEFINE_XEN_GUEST_HANDLE(void); + +typedef unsigned long xen_pfn_t; +DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); #endif /* Arch specific VIRQs definition */ diff -r eee70cbfa20a -r f03f168a4e2d xen/include/public/arch-x86_32.h --- a/xen/include/public/arch-x86_32.h Tue May 30 17:17:54 2006 -0500 +++ b/xen/include/public/arch-x86_32.h Tue May 30 17:17:55 2006 -0500 @@ -28,6 +28,9 @@ DEFINE_XEN_GUEST_HANDLE(int); DEFINE_XEN_GUEST_HANDLE(int); DEFINE_XEN_GUEST_HANDLE(long); DEFINE_XEN_GUEST_HANDLE(void); + +typedef unsigned long xen_pfn_t; +DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); #endif /* diff -r eee70cbfa20a -r f03f168a4e2d xen/include/public/arch-x86_64.h --- a/xen/include/public/arch-x86_64.h Tue May 30 17:17:54 2006 -0500 +++ b/xen/include/public/arch-x86_64.h Tue May 30 17:17:55 2006 -0500 @@ -28,6 +28,9 @@ DEFINE_XEN_GUEST_HANDLE(int); DEFINE_XEN_GUEST_HANDLE(int); DEFINE_XEN_GUEST_HANDLE(long); DEFINE_XEN_GUEST_HANDLE(void); + +typedef unsigned long xen_pfn_t; +DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); #endif /* diff -r eee70cbfa20a -r f03f168a4e2d xen/include/public/dom0_ops.h --- a/xen/include/public/dom0_ops.h Tue May 30 17:17:54 2006 -0500 +++ b/xen/include/public/dom0_ops.h Tue May 30 17:17:55 2006 -0500 @@ -28,7 +28,7 @@ struct dom0_getmemlist { /* IN variables. */ domid_t domain; unsigned long max_pfns; - XEN_GUEST_HANDLE(ulong) buffer; + XEN_GUEST_HANDLE(xen_pfn_t) buffer; /* OUT variables. */ unsigned long num_pfns; }; diff -r eee70cbfa20a -r f03f168a4e2d xen/include/public/memory.h --- a/xen/include/public/memory.h Tue May 30 17:17:54 2006 -0500 +++ b/xen/include/public/memory.h Tue May 30 17:17:55 2006 -0500 @@ -29,7 +29,7 @@ struct xen_memory_reservation { * OUT: GMFN bases of extents that were allocated * (NB. This command also updates the mach_to_phys translation table) */ - XEN_GUEST_HANDLE(ulong) extent_start; + XEN_GUEST_HANDLE(xen_pfn_t) extent_start; /* Number of extents, and size/alignment of each (2^extent_order pages). */ unsigned long nr_extents; @@ -87,7 +87,7 @@ struct xen_machphys_mfn_list { * any large discontiguities in the machine address space, 2MB gaps in * the machphys table will be represented by an MFN base of zero. */ - XEN_GUEST_HANDLE(ulong) extent_start; + XEN_GUEST_HANDLE(xen_pfn_t) extent_start; /* * Number of extents written to the above array. This will be smaller @@ -135,13 +135,13 @@ struct xen_translate_gpfn_list { unsigned long nr_gpfns; /* List of GPFNs to translate. */ - XEN_GUEST_HANDLE(ulong) gpfn_list; + XEN_GUEST_HANDLE(xen_pfn_t) gpfn_list; /* * Output list to contain MFN translations. May be the same as the input * list (in which case each input GPFN is overwritten with the output MFN). */ - XEN_GUEST_HANDLE(ulong) mfn_list; + XEN_GUEST_HANDLE(xen_pfn_t) mfn_list; }; typedef struct xen_translate_gpfn_list xen_translate_gpfn_list_t; DEFINE_XEN_GUEST_HANDLE(xen_translate_gpfn_list_t); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-May-30 22:19 UTC
[Xen-devel] [PATCH 3 of 3] Use explicitly-sized types in the dom0_ops and privcmd structures
2 files changed, 35 insertions(+), 33 deletions(-) linux-2.6-xen-sparse/include/xen/public/privcmd.h | 14 +++-- xen/include/public/dom0_ops.h | 54 ++++++++++----------- # HG changeset patch # User Hollis Blanchard <hollisb@us.ibm.com> # Node ID 84a066cea84cb24c62d1cc5f66ebd0130fb2f180 # Parent 5e77ab7d66927f82e03f54128a0c19ce71db1552 Use explicitly-sized types in the dom0_ops and privcmd structures. As discussed previously, the these operations are not performance-sensitive, so the additional cache footprint shouldn''t be an issue. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> diff -r 5e77ab7d6692 -r 84a066cea84c linux-2.6-xen-sparse/include/xen/public/privcmd.h --- a/linux-2.6-xen-sparse/include/xen/public/privcmd.h Tue May 30 17:17:55 2006 -0500 +++ b/linux-2.6-xen-sparse/include/xen/public/privcmd.h Tue May 30 17:17:55 2006 -0500 @@ -33,20 +33,22 @@ #ifndef __LINUX_PUBLIC_PRIVCMD_H__ #define __LINUX_PUBLIC_PRIVCMD_H__ +#include <linux/types.h> + #ifndef __user #define __user #endif typedef struct privcmd_hypercall { - unsigned long op; - unsigned long arg[5]; + __u64 op; + __u64 arg[5]; } privcmd_hypercall_t; typedef struct privcmd_mmap_entry { - unsigned long va; - unsigned long mfn; - unsigned long npages; + __u64 va; + __u64 mfn; + __u64 npages; } privcmd_mmap_entry_t; typedef struct privcmd_mmap { @@ -58,7 +60,7 @@ typedef struct privcmd_mmapbatch { typedef struct privcmd_mmapbatch { int num; /* number of pages to populate */ domid_t dom; /* target domain */ - unsigned long addr; /* virtual address */ + __u64 addr; /* virtual address */ xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */ } privcmd_mmapbatch_t; diff -r 5e77ab7d6692 -r 84a066cea84c xen/include/public/dom0_ops.h --- a/xen/include/public/dom0_ops.h Tue May 30 17:17:55 2006 -0500 +++ b/xen/include/public/dom0_ops.h Tue May 30 17:17:55 2006 -0500 @@ -19,7 +19,7 @@ * This makes sure that old versions of dom0 tools will stop working in a * well-defined way (rather than crashing the machine, for instance). */ -#define DOM0_INTERFACE_VERSION 0x03000000 +#define DOM0_INTERFACE_VERSION 0x03000001 /************************************************************************/ @@ -27,10 +27,10 @@ struct dom0_getmemlist { struct dom0_getmemlist { /* IN variables. */ domid_t domain; - unsigned long max_pfns; + uint64_t max_pfns; XEN_GUEST_HANDLE(xen_pfn_t) buffer; /* OUT variables. */ - unsigned long num_pfns; + uint64_t num_pfns; }; typedef struct dom0_getmemlist dom0_getmemlist_t; DEFINE_XEN_GUEST_HANDLE(dom0_getmemlist_t); @@ -96,9 +96,9 @@ struct dom0_getdomaininfo { #define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code. */ #define DOMFLAGS_SHUTDOWNSHIFT 16 uint32_t flags; - unsigned long tot_pages; - unsigned long max_pages; - unsigned long shared_info_frame; /* MFN of shared_info struct */ + uint64_t tot_pages; + uint64_t max_pages; + uint64_t shared_info_frame; /* MFN of shared_info struct */ uint64_t cpu_time; uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */ uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */ @@ -162,7 +162,7 @@ DEFINE_XEN_GUEST_HANDLE(dom0_settime_t); struct dom0_getpageframeinfo { /* IN variables. */ - unsigned long mfn; /* Machine page frame number to query. */ + uint64_t mfn; /* Machine page frame number to query. */ domid_t domain; /* To which domain does the frame belong? */ /* OUT variables. */ /* Is the page PINNED to a type? */ @@ -213,7 +213,7 @@ struct dom0_tbufcontrol { cpumap_t cpu_mask; uint32_t evt_mask; /* OUT variables */ - unsigned long buffer_mfn; + uint64_t buffer_mfn; uint32_t size; }; typedef struct dom0_tbufcontrol dom0_tbufcontrol_t; @@ -229,8 +229,8 @@ struct dom0_physinfo { uint32_t sockets_per_node; uint32_t nr_nodes; uint32_t cpu_khz; - unsigned long total_pages; - unsigned long free_pages; + uint64_t total_pages; + uint64_t free_pages; uint32_t hw_cap[8]; }; typedef struct dom0_physinfo dom0_physinfo_t; @@ -276,7 +276,7 @@ struct dom0_shadow_control { uint32_t op; XEN_GUEST_HANDLE(ulong) dirty_bitmap; /* IN/OUT variables. */ - unsigned long pages; /* size of buffer, updated with actual size */ + uint64_t pages; /* size of buffer, updated with actual size */ /* OUT variables. */ struct dom0_shadow_control_stats stats; }; @@ -286,8 +286,8 @@ DEFINE_XEN_GUEST_HANDLE(dom0_shadow_cont #define DOM0_SETDOMAINMAXMEM 28 struct dom0_setdomainmaxmem { /* IN variables. */ - domid_t domain; - unsigned long max_memkb; + domid_t domain; + uint64_t max_memkb; }; typedef struct dom0_setdomainmaxmem dom0_setdomainmaxmem_t; DEFINE_XEN_GUEST_HANDLE(dom0_setdomainmaxmem_t); @@ -295,8 +295,8 @@ DEFINE_XEN_GUEST_HANDLE(dom0_setdomainma #define DOM0_GETPAGEFRAMEINFO2 29 /* batched interface */ struct dom0_getpageframeinfo2 { /* IN variables. */ - domid_t domain; - unsigned long num; + domid_t domain; + uint64_t num; /* IN/OUT variables. */ XEN_GUEST_HANDLE(ulong) array; }; @@ -313,12 +313,12 @@ DEFINE_XEN_GUEST_HANDLE(dom0_getpagefram #define DOM0_ADD_MEMTYPE 31 struct dom0_add_memtype { /* IN variables. */ - unsigned long mfn; - unsigned long nr_mfns; - uint32_t type; - /* OUT variables. */ - uint32_t handle; - uint32_t reg; + uint64_t mfn; + uint64_t nr_mfns; + uint32_t type; + /* OUT variables. */ + uint32_t handle; + uint32_t reg; }; typedef struct dom0_add_memtype dom0_add_memtype_t; DEFINE_XEN_GUEST_HANDLE(dom0_add_memtype_t); @@ -345,8 +345,8 @@ struct dom0_read_memtype { /* IN variables. */ uint32_t reg; /* OUT variables. */ - unsigned long mfn; - unsigned long nr_mfns; + uint64_t mfn; + uint64_t nr_mfns; uint32_t type; }; typedef struct dom0_read_memtype dom0_read_memtype_t; @@ -499,9 +499,9 @@ DEFINE_XEN_GUEST_HANDLE(dom0_irq_permiss #define DOM0_IOMEM_PERMISSION 47 struct dom0_iomem_permission { domid_t domain; /* domain to be affected */ - unsigned long first_mfn; /* first page (physical page number) in range */ - unsigned long nr_mfns; /* number of pages in range (>0) */ - uint8_t allow_access; /* allow (!0) or deny (0) access to range? */ + uint64_t first_mfn; /* first page (physical page number) in range */ + uint64_t nr_mfns; /* number of pages in range (>0) */ + uint8_t allow_access; /* allow (!0) or deny (0) access to range? */ }; typedef struct dom0_iomem_permission dom0_iomem_permission_t; DEFINE_XEN_GUEST_HANDLE(dom0_iomem_permission_t); @@ -509,7 +509,7 @@ DEFINE_XEN_GUEST_HANDLE(dom0_iomem_permi #define DOM0_HYPERCALL_INIT 48 struct dom0_hypercall_init { domid_t domain; /* domain to be affected */ - unsigned long mfn; /* machine frame to be initialised */ + uint64_t mfn; /* machine frame to be initialised */ }; typedef struct dom0_hypercall_init dom0_hypercall_init_t; DEFINE_XEN_GUEST_HANDLE(dom0_hypercall_init_t); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-Jun-05 15:00 UTC
Re: [Xen-devel] [PATCH 0 of 3] management tools portability
On Tue, 2006-05-30 at 17:18 -0500, Hollis Blanchard wrote:> These three patches allow me to use 32-bit libxc (and xend and xm) > with a 64-bit PPC hypervisor. > > This is a resend. I''ve updated to the latest xen-unstable tree, and > changed the privcmd types from uint64_t to __u64 at Chris Wright''s > request.Hi guys, I''ve heard that you''re discussing patches 2 and 3 in this series (I saw that patch 1 went in; thanks). However, I haven''t seen any thoughts from you on the subject. Could you summarize some of the issues you''re discussing? What are the different approaches that are being advocated? Since the patches touch a lot of code, it''s easy for other checkins to cause conflicts and so it''s difficult to maintain the patches out of tree. -- Hollis Blanchard IBM Linux Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jun-05 15:32 UTC
Re: [Xen-devel] [PATCH 0 of 3] management tools portability
On 5 Jun 2006, at 16:00, Hollis Blanchard wrote:> Since the patches touch a lot of code, it''s easy for other checkins to > cause conflicts and so it''s difficult to maintain the patches out of > tree.Is this the last set of interface munging we need to do for ppc, or is there more in the pipeline? If these two patches are all that is now required, I''m inclined just to take them. Apart from that, patch 3/3 changes lots of mfn fields to u64. Shouldn''t they properly use your new xen_pfn_t type? There are a few other frame numbers dotted around the public headers that perhaps ought also to be converted? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-Jun-05 15:50 UTC
Re: [Xen-devel] [PATCH 0 of 3] management tools portability
On Mon, 2006-06-05 at 16:32 +0100, Keir Fraser wrote:> On 5 Jun 2006, at 16:00, Hollis Blanchard wrote: > > > Since the patches touch a lot of code, it''s easy for other checkins to > > cause conflicts and so it''s difficult to maintain the patches out of > > tree. > > Is this the last set of interface munging we need to do for ppc, or is > there more in the pipeline? If these two patches are all that is now > required, I''m inclined just to take them.These are the only patches I know of. I think it''s likely there''s a corner or two I missed, but these patches alone get things working for me.> Apart from that, patch 3/3 changes lots of mfn fields to u64. Shouldn''t > they properly use your new xen_pfn_t type? There are a few other frame > numbers dotted around the public headers that perhaps ought also to be > converted?I believe the agreement we reached earlier was that *internally* (on any side of any interface), passing around a single PFN can be type ''unsigned long'', since on 32-bit systems that still lets you manage 42 bits of physical memory, and that "should be good enough for anybody." Unrelated to that, I converted all ''unsigned long'' in the *interface* to be u64. The one exception is that PFN arrays (not single PFNs) became ''xen_pfn_t''. Does that make sense? -- Hollis Blanchard IBM Linux Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jun-05 15:59 UTC
Re: [Xen-devel] [PATCH 0 of 3] management tools portability
> I believe the agreement we reached earlier was that *internally* (on > any > side of any interface), passing around a single PFN can be type > ''unsigned long'', since on 32-bit systems that still lets you manage 42 > bits of physical memory, and that "should be good enough for anybody."Yes. It''s only the interface we want to change.> Unrelated to that, I converted all ''unsigned long'' in the *interface* > to > be u64. The one exception is that PFN arrays (not single PFNs) became > ''xen_pfn_t''. > > Does that make sense?It seems weird/arbitrary to me to change the type only of PFNs that are array elements. -- Keir> -- > Hollis Blanchard > IBM Linux Technology Center >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-Jun-05 16:26 UTC
Re: [Xen-devel] [PATCH 0 of 3] management tools portability
On Mon, 2006-06-05 at 16:59 +0100, Keir Fraser wrote:> > > Unrelated to that, I converted all ''unsigned long'' in the > *interface* > > to > > be u64. The one exception is that PFN arrays (not single PFNs) > became > > ''xen_pfn_t''. > It seems weird/arbitrary to me to change the type only of PFNs that > are array elements.I agree, but I thought that was the preference at the time. Would you like me to regenerate the patch and resubmit, or will you do that? -- Hollis Blanchard IBM Linux Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jun-05 16:28 UTC
Re: [Xen-devel] [PATCH 0 of 3] management tools portability
On 5 Jun 2006, at 17:26, Hollis Blanchard wrote:> I agree, but I thought that was the preference at the time. Would you > like me to regenerate the patch and resubmit, or will you do that?Since it interacts with the dom0_ops patch (making some of it redundant) please resubmit both. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel