ia64/xen-unstable

changeset 9232:90bac1d23a0c

Merged.
author emellor@leeni.uk.xensource.com
date Sat Mar 11 11:20:32 2006 +0100 (2006-03-11)
parents 9c2c55ba22e5 1f30a0ac3033
children ed1afb12106e 1ffd973d3d49
files
line diff
     1.1 --- a/Config.mk	Sat Mar 11 11:19:11 2006 +0100
     1.2 +++ b/Config.mk	Sat Mar 11 11:20:32 2006 +0100
     1.3 @@ -12,14 +12,6 @@ XEN_TARGET_X86_PAE  ?= n
     1.4  HOSTCC     = gcc
     1.5  HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
     1.6  
     1.7 -ifneq ($(debug),y)
     1.8 -# Optimisation flags are overridable
     1.9 -CFLAGS    ?= -O3 -fomit-frame-pointer
    1.10 -CFLAGS    += -DNDEBUG
    1.11 -else
    1.12 -CFLAGS    += -g
    1.13 -endif
    1.14 -
    1.15  AS         = $(CROSS_COMPILE)as
    1.16  LD         = $(CROSS_COMPILE)ld
    1.17  CC         = $(CROSS_COMPILE)gcc
    1.18 @@ -38,6 +30,22 @@ INSTALL_DIR  = $(INSTALL) -d -m0755
    1.19  INSTALL_DATA = $(INSTALL) -m0644
    1.20  INSTALL_PROG = $(INSTALL) -m0755
    1.21  
    1.22 +ifneq ($(debug),y)
    1.23 +# Optimisation flags are overridable
    1.24 +CFLAGS    ?= -O2 -fomit-frame-pointer
    1.25 +CFLAGS    += -DNDEBUG
    1.26 +else
    1.27 +CFLAGS    += -g
    1.28 +endif
    1.29 +
    1.30 +ifeq ($(XEN_TARGET_ARCH),x86_32)
    1.31 +CFLAGS  += -m32 -march=i686
    1.32 +endif
    1.33 +
    1.34 +ifeq ($(XEN_TARGET_ARCH),x86_64)
    1.35 +CFLAGS  += -m64
    1.36 +endif
    1.37 +
    1.38  ifeq ($(XEN_TARGET_ARCH),x86_64)
    1.39  LIBDIR = lib64
    1.40  else
    1.41 @@ -51,7 +59,7 @@ endif
    1.42  
    1.43  test-gcc-flag = $(shell $(1) -v --help 2>&1 | grep -q " $(2) " && echo $(2))
    1.44  
    1.45 -CFLAGS += -Wall
    1.46 +CFLAGS += -Wall -Wstrict-prototypes
    1.47  
    1.48  HOSTCFLAGS += $(call test-gcc-flag,$(HOSTCC),-Wdeclaration-after-statement)
    1.49  CFLAGS     += $(call test-gcc-flag,$(CC),-Wdeclaration-after-statement)
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c	Sat Mar 11 11:19:11 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c	Sat Mar 11 11:20:32 2006 +0100
     2.3 @@ -31,6 +31,8 @@
     2.4  #include <linux/config.h>
     2.5  #include <linux/module.h>
     2.6  #include <linux/sched.h>
     2.7 +#include <linux/mm.h>
     2.8 +#include <linux/vmalloc.h>
     2.9  #include <asm/pgtable.h>
    2.10  #include <xen/interface/xen.h>
    2.11  #include <asm/fixmap.h>
    2.12 @@ -77,7 +79,7 @@ static int gnttab_free_count;
    2.13  static grant_ref_t gnttab_free_head;
    2.14  static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
    2.15  
    2.16 -static grant_entry_t *shared;
    2.17 +static grant_entry_t *shared = NULL;
    2.18  
    2.19  static struct gnttab_free_callback *gnttab_free_callback_list = NULL;
    2.20  
    2.21 @@ -354,12 +356,35 @@ gnttab_request_free_callback(struct gntt
    2.22  	spin_unlock_irqrestore(&gnttab_list_lock, flags);
    2.23  }
    2.24  
    2.25 +#ifndef __ia64__
    2.26 +static int map_pte_fn(pte_t *pte, struct page *pte_page,
    2.27 +		      unsigned long addr, void *data)
    2.28 +{
    2.29 +	unsigned long **frames = (unsigned long **)data;
    2.30 +
    2.31 +	set_pte_at(&init_mm, addr, pte, pfn_pte_ma((*frames)[0], PAGE_KERNEL));
    2.32 +	(*frames)++;
    2.33 +	return 0;
    2.34 +}
    2.35 +
    2.36 +static int unmap_pte_fn(pte_t *pte, struct page *pte_page,
    2.37 +		      unsigned long addr, void *data)
    2.38 +{
    2.39 +
    2.40 +	set_pte_at(&init_mm, addr, pte, __pte(0));
    2.41 +	return 0;
    2.42 +}
    2.43 +#endif
    2.44 +
    2.45  int
    2.46  gnttab_resume(void)
    2.47  {
    2.48  	gnttab_setup_table_t setup;
    2.49 -	unsigned long        frames[NR_GRANT_FRAMES];
    2.50 -	int                  i;
    2.51 +	unsigned long frames[NR_GRANT_FRAMES];
    2.52 +#ifndef __ia64__
    2.53 +	void *pframes = frames;
    2.54 +	struct vm_struct *area;
    2.55 +#endif
    2.56  
    2.57  	setup.dom        = DOMID_SELF;
    2.58  	setup.nr_frames  = NR_GRANT_FRAMES;
    2.59 @@ -368,12 +393,18 @@ gnttab_resume(void)
    2.60  	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1));
    2.61  	BUG_ON(setup.status != 0);
    2.62  
    2.63 -#ifdef __ia64__
    2.64 +#ifndef __ia64__
    2.65 +	if (shared == NULL) {
    2.66 +		area = get_vm_area(PAGE_SIZE * NR_GRANT_FRAMES, VM_IOREMAP);
    2.67 +		BUG_ON(area == NULL);
    2.68 +		shared = area->addr;
    2.69 +	}
    2.70 +	BUG_ON(generic_page_range(&init_mm, (unsigned long)shared,
    2.71 +				  PAGE_SIZE * NR_GRANT_FRAMES,
    2.72 +				  map_pte_fn, &pframes));
    2.73 +#else
    2.74  	shared = __va(frames[0] << PAGE_SHIFT);
    2.75  	printk("grant table at %p\n", shared);
    2.76 -#else
    2.77 -	for (i = 0; i < NR_GRANT_FRAMES; i++)
    2.78 -		set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
    2.79  #endif
    2.80  
    2.81  	return 0;
    2.82 @@ -382,10 +413,12 @@ gnttab_resume(void)
    2.83  int
    2.84  gnttab_suspend(void)
    2.85  {
    2.86 -	int i;
    2.87  
    2.88 -	for (i = 0; i < NR_GRANT_FRAMES; i++)
    2.89 -		clear_fixmap(FIX_GNTTAB_END - i);
    2.90 +#ifndef __ia64__
    2.91 +	generic_page_range(&init_mm, (unsigned long)shared,
    2.92 +			   PAGE_SIZE * NR_GRANT_FRAMES,
    2.93 +			   unmap_pte_fn, NULL);
    2.94 +#endif
    2.95  
    2.96  	return 0;
    2.97  }
    2.98 @@ -400,10 +433,6 @@ gnttab_init(void)
    2.99  
   2.100  	BUG_ON(gnttab_resume());
   2.101  
   2.102 -#ifndef __ia64__
   2.103 -	shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
   2.104 -#endif
   2.105 -
   2.106  	for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
   2.107  		gnttab_list[i] = i + 1;
   2.108  	gnttab_free_count = NR_GRANT_ENTRIES - NR_RESERVED_ENTRIES;
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Sat Mar 11 11:19:11 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Sat Mar 11 11:20:32 2006 +0100
     3.3 @@ -310,7 +310,8 @@ again:
     3.4  		goto abort_transaction;
     3.5  	}
     3.6  
     3.7 -	err = xenbus_switch_state(dev, xbt, XenbusStateInitialised);
     3.8 +	err = xenbus_printf(xbt, dev->nodename,
     3.9 +	                    "state", "%d", XenbusStateInitialised);
    3.10  	if (err) {
    3.11  		goto abort_transaction;
    3.12  	}
     4.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/fixmap.h	Sat Mar 11 11:19:11 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/fixmap.h	Sat Mar 11 11:20:32 2006 +0100
     4.3 @@ -84,8 +84,6 @@ enum fixed_addresses {
     4.4  	FIX_PCIE_MCFG,
     4.5  #endif
     4.6  	FIX_SHARED_INFO,
     4.7 -	FIX_GNTTAB_BEGIN,
     4.8 -	FIX_GNTTAB_END = FIX_GNTTAB_BEGIN + NR_GRANT_FRAMES - 1,
     4.9  #define NR_FIX_ISAMAPS	256
    4.10  	FIX_ISAMAP_END,
    4.11  	FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
     5.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/fixmap.h	Sat Mar 11 11:19:11 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/fixmap.h	Sat Mar 11 11:20:32 2006 +0100
     5.3 @@ -52,8 +52,6 @@ enum fixed_addresses {
     5.4  	FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
     5.5  #endif
     5.6  	FIX_SHARED_INFO,
     5.7 -	FIX_GNTTAB_BEGIN,
     5.8 -	FIX_GNTTAB_END = FIX_GNTTAB_BEGIN + NR_GRANT_FRAMES - 1,
     5.9  #define NR_FIX_ISAMAPS	256
    5.10  	FIX_ISAMAP_END,
    5.11  	FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
     6.1 --- a/tools/Rules.mk	Sat Mar 11 11:19:11 2006 +0100
     6.2 +++ b/tools/Rules.mk	Sat Mar 11 11:20:32 2006 +0100
     6.3 @@ -10,16 +10,6 @@ XEN_LIBXC          = $(XEN_ROOT)/tools/l
     6.4  XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
     6.5  XEN_LIBXENSTAT     = $(XEN_ROOT)/tools/xenstat/libxenstat/src
     6.6  
     6.7 -ifeq ($(XEN_TARGET_ARCH),x86_32)
     6.8 -CFLAGS  += -m32 -march=i686
     6.9 -LDFLAGS += -m32
    6.10 -endif
    6.11 -
    6.12 -ifeq ($(XEN_TARGET_ARCH),x86_64)
    6.13 -CFLAGS  += -m64
    6.14 -LDFLAGS += -m64
    6.15 -endif
    6.16 -
    6.17  X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
    6.18  
    6.19  %.opic: %.c
     7.1 --- a/tools/ioemu/monitor.c	Sat Mar 11 11:19:11 2006 +0100
     7.2 +++ b/tools/ioemu/monitor.c	Sat Mar 11 11:20:32 2006 +0100
     7.3 @@ -407,6 +407,7 @@ static int eject_device(BlockDriverState
     7.4  
     7.5  static void do_eject(int force, const char *filename)
     7.6  {
     7.7 +    char cmd[1024];
     7.8      BlockDriverState *bs;
     7.9  
    7.10      bs = bdrv_find(filename);
    7.11 @@ -415,6 +416,9 @@ static void do_eject(int force, const ch
    7.12          return;
    7.13      }
    7.14      eject_device(bs, force);
    7.15 +    sprintf(cmd, "eject %s", filename);
    7.16 +    system(cmd);
    7.17 +
    7.18  }
    7.19  
    7.20  static void do_change(const char *device, const char *filename)
     8.1 --- a/tools/ioemu/target-i386-dm/Makefile	Sat Mar 11 11:19:11 2006 +0100
     8.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Sat Mar 11 11:20:32 2006 +0100
     8.3 @@ -235,7 +235,7 @@ endif
     8.4  all: $(PROGS)
     8.5  
     8.6  $(QEMU_USER): $(OBJS)
     8.7 -	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
     8.8 +	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^  $(LIBS)
     8.9  ifeq ($(ARCH),alpha)
    8.10  # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
    8.11  # the address space (31 bit so sign extending doesn't matter)
    8.12 @@ -311,7 +311,7 @@ endif
    8.13  endif
    8.14  
    8.15  $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
    8.16 -	$(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
    8.17 +	$(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
    8.18  
    8.19  vnc.o: vnc.c keyboard_rdesktop.c
    8.20  	$(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<
     9.1 --- a/tools/ioemu/vl.h	Sat Mar 11 11:19:11 2006 +0100
     9.2 +++ b/tools/ioemu/vl.h	Sat Mar 11 11:20:32 2006 +0100
     9.3 @@ -697,7 +697,7 @@ void lance_init(NetDriverState *nd, int 
     9.4  void tcx_init(DisplayState *ds, uint32_t addr);
     9.5  
     9.6  /* sched.c */
     9.7 -void sched_init();
     9.8 +void sched_init(uint32_t, uint32_t);
     9.9  
    9.10  /* magic-load.c */
    9.11  void magic_init(const char *kfn, int kloadaddr, uint32_t addr);
    9.12 @@ -799,7 +799,7 @@ void readline_start(const char *prompt, 
    9.13  
    9.14  int gdbserver_start(int port);
    9.15  void update_select_wakeup_events(void);
    9.16 -void tun_receive_handler();
    9.17 +void tun_receive_handler(fd_set *);
    9.18  
    9.19  extern char domain_name[];
    9.20  #endif /* VL_H */
    10.1 --- a/tools/libxc/xc_linux_build.c	Sat Mar 11 11:19:11 2006 +0100
    10.2 +++ b/tools/libxc/xc_linux_build.c	Sat Mar 11 11:20:32 2006 +0100
    10.3 @@ -863,8 +863,7 @@ static int setup_guest(int xc_handle,
    10.4  
    10.5      if ( shadow_mode_enabled )
    10.6      {
    10.7 -        struct xen_reserved_phys_area xrpa;
    10.8 -        struct xen_map_shared_info xmsi;
    10.9 +        struct xen_add_to_physmap xatp;
   10.10  
   10.11          /* Enable shadow translate mode */
   10.12          if ( xc_shadow_control(xc_handle, dom,
   10.13 @@ -875,26 +874,36 @@ static int setup_guest(int xc_handle,
   10.14              goto error_out;
   10.15          }
   10.16  
   10.17 -        /* Find the shared info frame.  It's guaranteed to be at the
   10.18 -           start of the PFN hole. */
   10.19 -        xrpa.domid = dom;
   10.20 -        xrpa.idx   = 0;
   10.21 -        rc = xc_memory_op(xc_handle, XENMEM_reserved_phys_area, &xrpa);
   10.22 -        if ( rc != 0 )
   10.23 -        {
   10.24 -            PERROR("Cannot find shared info pfn");
   10.25 -            goto error_out;
   10.26 -        }
   10.27 +        guest_shared_info_mfn = (vsharedinfo_start-dsi.v_start) >> PAGE_SHIFT;
   10.28  
   10.29 -        guest_shared_info_mfn = (vsharedinfo_start-dsi.v_start) >> PAGE_SHIFT;
   10.30 -        xmsi.domid = dom;
   10.31 -        xmsi.pfn = guest_shared_info_mfn;
   10.32 -        rc = xc_memory_op(xc_handle, XENMEM_map_shared_info, &xmsi);
   10.33 +        /* Map shared info frame into guest physmap. */
   10.34 +        xatp.domid = dom;
   10.35 +        xatp.space = XENMAPSPACE_shared_info;
   10.36 +        xatp.idx   = 0;
   10.37 +        xatp.gpfn  = guest_shared_info_mfn;
   10.38 +        rc = xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp);
   10.39          if ( rc != 0 )
   10.40          {
   10.41              PERROR("Cannot map shared info pfn");
   10.42              goto error_out;
   10.43          }
   10.44 +
   10.45 +        /* Map grant table frames into guest physmap. */
   10.46 +        for ( i = 0; ; i++ )
   10.47 +        {
   10.48 +            xatp.domid = dom;
   10.49 +            xatp.space = XENMAPSPACE_grant_table;
   10.50 +            xatp.idx   = i;
   10.51 +            xatp.gpfn  = nr_pages + i;
   10.52 +            rc = xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp);
   10.53 +            if ( rc != 0 )
   10.54 +            {
   10.55 +                if ( errno == EINVAL )
   10.56 +                    break; /* done all grant tables */
   10.57 +                PERROR("Cannot map grant table pfn");
   10.58 +                goto error_out;
   10.59 +            }
   10.60 +        }
   10.61      }
   10.62      else
   10.63      {
    11.1 --- a/tools/libxc/xc_private.c	Sat Mar 11 11:19:11 2006 +0100
    11.2 +++ b/tools/libxc/xc_private.c	Sat Mar 11 11:20:32 2006 +0100
    11.3 @@ -231,8 +231,8 @@ int xc_memory_op(int xc_handle,
    11.4              goto out1;
    11.5          }
    11.6          break;
    11.7 -    case XENMEM_reserved_phys_area:
    11.8 -        if ( mlock(arg, sizeof(struct xen_reserved_phys_area)) )
    11.9 +    case XENMEM_add_to_physmap:
   11.10 +        if ( mlock(arg, sizeof(struct xen_add_to_physmap)) )
   11.11          {
   11.12              PERROR("Could not mlock");
   11.13              goto out1;
   11.14 @@ -277,8 +277,8 @@ int xc_memory_op(int xc_handle,
   11.15          safe_munlock(xmml->extent_start,
   11.16                       xmml->max_extents * sizeof(unsigned long));
   11.17          break;
   11.18 -    case XENMEM_reserved_phys_area:
   11.19 -        safe_munlock(arg, sizeof(struct xen_reserved_phys_area));
   11.20 +    case XENMEM_add_to_physmap:
   11.21 +        safe_munlock(arg, sizeof(struct xen_add_to_physmap));
   11.22          break;
   11.23      case XENMEM_translate_gpfn_list:
   11.24              safe_munlock(trans->mfn_list, trans->nr_gpfns * sizeof(long));
    12.1 --- a/tools/misc/lomount/lomount.c	Sat Mar 11 11:19:11 2006 +0100
    12.2 +++ b/tools/misc/lomount/lomount.c	Sat Mar 11 11:20:32 2006 +0100
    12.3 @@ -195,7 +195,7 @@ done:
    12.4  	return fail;
    12.5  }
    12.6  
    12.7 -void usage()
    12.8 +void usage(void)
    12.9  {
   12.10  	fprintf(stderr, "You must specify at least -diskimage and -partition.\n");
   12.11  	fprintf(stderr, "All other arguments are passed through to 'mount'.\n");
    13.1 --- a/tools/misc/mbootpack/Makefile	Sat Mar 11 11:19:11 2006 +0100
    13.2 +++ b/tools/misc/mbootpack/Makefile	Sat Mar 11 11:20:32 2006 +0100
    13.3 @@ -31,7 +31,7 @@ DEPFLAGS = -Wp,-MD,.$(@F).d
    13.4  DEPS     = .*.d
    13.5  
    13.6  mbootpack: $(OBJS)
    13.7 -	$(HOSTCC) -o $@ $(filter-out %.a, $^) $(LDFLAGS)
    13.8 +	$(HOSTCC) -o $@ $(filter-out %.a, $^)
    13.9  
   13.10  clean:
   13.11  	$(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c
    14.1 --- a/tools/misc/xc_shadow.c	Sat Mar 11 11:19:11 2006 +0100
    14.2 +++ b/tools/misc/xc_shadow.c	Sat Mar 11 11:20:32 2006 +0100
    14.3 @@ -18,7 +18,7 @@
    14.4  #include <errno.h>
    14.5  #include <string.h>
    14.6  
    14.7 -void usage()
    14.8 +void usage(void)
    14.9  {
   14.10      printf("xc_shadow: -[0|1|2]\n");
   14.11      printf("    set shadow mode\n");
   14.12 @@ -28,7 +28,7 @@ void usage()
   14.13  int main(int argc, char *argv[])
   14.14  {
   14.15      int xc_handle;
   14.16 -    int mode;
   14.17 +    int mode = 0;
   14.18  
   14.19      if ( argc > 1 )
   14.20      {
    15.1 --- a/tools/vtpm_manager/manager/Makefile	Sat Mar 11 11:19:11 2006 +0100
    15.2 +++ b/tools/vtpm_manager/manager/Makefile	Sat Mar 11 11:20:32 2006 +0100
    15.3 @@ -20,7 +20,7 @@ mrproper: clean
    15.4  	rm -f $(BIN) *~
    15.5  
    15.6  $(BIN): $(OBJS)
    15.7 -	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
    15.8 +	$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
    15.9  
   15.10  # libraries
   15.11  LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
    16.1 --- a/tools/xenmon/xenbaked.c	Sat Mar 11 11:19:11 2006 +0100
    16.2 +++ b/tools/xenmon/xenbaked.c	Sat Mar 11 11:20:32 2006 +0100
    16.3 @@ -379,7 +379,7 @@ struct t_rec **init_rec_ptrs(struct t_bu
    16.4  /**
    16.5   * get_num_cpus - get the number of logical CPUs
    16.6   */
    16.7 -unsigned int get_num_cpus()
    16.8 +unsigned int get_num_cpus(void)
    16.9  {
   16.10      dom0_op_t op;
   16.11      int xc_handle = xc_interface_open();
   16.12 @@ -409,7 +409,7 @@ unsigned int get_num_cpus()
   16.13  /**
   16.14   * monitor_tbufs - monitor the contents of tbufs
   16.15   */
   16.16 -int monitor_tbufs()
   16.17 +int monitor_tbufs(void)
   16.18  {
   16.19      int i;
   16.20      extern void process_record(int, struct t_rec *);
    17.1 --- a/tools/xenstat/libxenstat/Makefile	Sat Mar 11 11:19:11 2006 +0100
    17.2 +++ b/tools/xenstat/libxenstat/Makefile	Sat Mar 11 11:20:32 2006 +0100
    17.3 @@ -48,7 +48,7 @@ all: $(LIB)
    17.4  	$(RANLIB) $@
    17.5  
    17.6  $(SHLIB): $(OBJECTS)
    17.7 -	$(CC) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS)
    17.8 +	$(CC) $(CFLAGS) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS)
    17.9  
   17.10  src/xenstat.o: src/xenstat.c src/xenstat.h src/xen-interface.h
   17.11  	$(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $<
    18.1 --- a/tools/xenstat/libxenstat/src/xen-interface.c	Sat Mar 11 11:19:11 2006 +0100
    18.2 +++ b/tools/xenstat/libxenstat/src/xen-interface.c	Sat Mar 11 11:20:32 2006 +0100
    18.3 @@ -31,7 +31,7 @@ struct xi_handle {
    18.4  
    18.5  /* Initialize for xen-interface.  Returns a handle to be used with subsequent
    18.6   * calls to the xen-interface functions or NULL if an error occurs. */
    18.7 -xi_handle *xi_init()
    18.8 +xi_handle *xi_init(void)
    18.9  {
   18.10  	xi_handle *handle;
   18.11  
    19.1 --- a/tools/xenstat/libxenstat/src/xen-interface.h	Sat Mar 11 11:19:11 2006 +0100
    19.2 +++ b/tools/xenstat/libxenstat/src/xen-interface.h	Sat Mar 11 11:20:32 2006 +0100
    19.3 @@ -26,7 +26,7 @@ typedef struct xi_handle xi_handle;
    19.4  
    19.5  /* Initialize for xen-interface.  Returns a handle to be used with subsequent
    19.6   * calls to the xen-interface functions or NULL if an error occurs. */
    19.7 -xi_handle *xi_init();
    19.8 +xi_handle *xi_init(void);
    19.9  
   19.10  /* Release the handle to libxc, free resources, etc. */
   19.11  void xi_uninit(xi_handle *handle);
    20.1 --- a/tools/xenstat/libxenstat/src/xenstat.c	Sat Mar 11 11:19:11 2006 +0100
    20.2 +++ b/tools/xenstat/libxenstat/src/xenstat.c	Sat Mar 11 11:20:32 2006 +0100
    20.3 @@ -129,7 +129,7 @@ static xenstat_collector collectors[] = 
    20.4  /*
    20.5   * libxenstat API
    20.6   */
    20.7 -xenstat_handle *xenstat_init()
    20.8 +xenstat_handle *xenstat_init(void)
    20.9  {
   20.10  	xenstat_handle *handle;
   20.11  
    21.1 --- a/tools/xenstat/libxenstat/src/xenstat.h	Sat Mar 11 11:19:11 2006 +0100
    21.2 +++ b/tools/xenstat/libxenstat/src/xenstat.h	Sat Mar 11 11:20:32 2006 +0100
    21.3 @@ -26,7 +26,7 @@ typedef struct xenstat_network xenstat_n
    21.4  
    21.5  /* Initialize the xenstat library.  Returns a handle to be used with
    21.6   * subsequent calls to the xenstat library, or NULL if an error occurs. */
    21.7 -xenstat_handle *xenstat_init();
    21.8 +xenstat_handle *xenstat_init(void);
    21.9  
   21.10  /* Release the handle to libxc, free resources, etc. */
   21.11  void xenstat_uninit(xenstat_handle * handle);
    22.1 --- a/tools/xenstore/xenstored_core.c	Sat Mar 11 11:19:11 2006 +0100
    22.2 +++ b/tools/xenstore/xenstored_core.c	Sat Mar 11 11:20:32 2006 +0100
    22.3 @@ -66,7 +66,7 @@ static char *tracefile = NULL;
    22.4  static TDB_CONTEXT *tdb_ctx;
    22.5  
    22.6  static void corrupt(struct connection *conn, const char *fmt, ...);
    22.7 -static void check_store();
    22.8 +static void check_store(void);
    22.9  
   22.10  #define log(...)							\
   22.11  	do {								\
   22.12 @@ -238,7 +238,7 @@ static void trigger_reopen_log(int signa
   22.13  }
   22.14  
   22.15  
   22.16 -static void reopen_log()
   22.17 +static void reopen_log(void)
   22.18  {
   22.19  	if (tracefile) {
   22.20  		if (tracefd > 0)
   22.21 @@ -1612,7 +1612,7 @@ static void clean_store(struct hashtable
   22.22  }
   22.23  
   22.24  
   22.25 -static void check_store()
   22.26 +static void check_store(void)
   22.27  {
   22.28  	char * root = talloc_strdup(NULL, "/");
   22.29  	struct hashtable * reachable =
    23.1 --- a/tools/xentrace/xentrace.c	Sat Mar 11 11:19:11 2006 +0100
    23.2 +++ b/tools/xentrace/xentrace.c	Sat Mar 11 11:20:32 2006 +0100
    23.3 @@ -258,7 +258,7 @@ struct t_rec **init_rec_ptrs(struct t_bu
    23.4  /**
    23.5   * get_num_cpus - get the number of logical CPUs
    23.6   */
    23.7 -unsigned int get_num_cpus()
    23.8 +unsigned int get_num_cpus(void)
    23.9  {
   23.10      dom0_op_t op;
   23.11      int xc_handle = xc_interface_open();
    24.1 --- a/xen/arch/x86/Rules.mk	Sat Mar 11 11:19:11 2006 +0100
    24.2 +++ b/xen/arch/x86/Rules.mk	Sat Mar 11 11:20:32 2006 +0100
    24.3 @@ -22,19 +22,20 @@ CFLAGS  += $(call test-gcc-flag,$(CC),-n
    24.4  CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector)
    24.5  CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
    24.6  
    24.7 -ifeq ($(TARGET_SUBARCH),x86_32)
    24.8 -CFLAGS  += -m32 -march=i686
    24.9 -LDFLAGS += -m elf_i386 
   24.10 -ifeq ($(pae),y)
   24.11 +ifeq ($(TARGET_SUBARCH)$(pae),x86_32y)
   24.12  CFLAGS  += -DCONFIG_X86_PAE=1
   24.13  endif
   24.14 -endif
   24.15 +
   24.16  ifeq ($(supervisor_mode_kernel),y)
   24.17  CFLAGS  += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1
   24.18  endif
   24.19  
   24.20 +ifeq ($(XEN_TARGET_ARCH),x86_32)
   24.21 +LDFLAGS += -m elf_i386 
   24.22 +endif
   24.23 +
   24.24  ifeq ($(TARGET_SUBARCH),x86_64)
   24.25 -CFLAGS  += -m64 -mno-red-zone -fpic -fno-reorder-blocks
   24.26 +CFLAGS  += -mno-red-zone -fpic -fno-reorder-blocks
   24.27  CFLAGS  += -fno-asynchronous-unwind-tables
   24.28  LDFLAGS += -m elf_x86_64
   24.29  endif
    25.1 --- a/xen/arch/x86/audit.c	Sat Mar 11 11:19:11 2006 +0100
    25.2 +++ b/xen/arch/x86/audit.c	Sat Mar 11 11:20:32 2006 +0100
    25.3 @@ -350,7 +350,7 @@ int audit_adjust_pgtables(struct domain 
    25.4          unmap_domain_page(pt);
    25.5      }
    25.6  
    25.7 -    void adjust_shadow_tables()
    25.8 +    void adjust_shadow_tables(void)
    25.9      {
   25.10          struct shadow_status *a;
   25.11          unsigned long smfn, gmfn;
   25.12 @@ -402,7 +402,7 @@ int audit_adjust_pgtables(struct domain 
   25.13          }
   25.14      }
   25.15  
   25.16 -    void adjust_oos_list()
   25.17 +    void adjust_oos_list(void)
   25.18      {
   25.19          struct out_of_sync_entry *oos;
   25.20  
   25.21 @@ -426,7 +426,7 @@ int audit_adjust_pgtables(struct domain 
   25.22          }
   25.23      }
   25.24  
   25.25 -    void adjust_for_pgtbase()
   25.26 +    void adjust_for_pgtbase(void)
   25.27      {
   25.28          struct vcpu *v;
   25.29  
   25.30 @@ -443,7 +443,7 @@ int audit_adjust_pgtables(struct domain 
   25.31          }
   25.32      }
   25.33  
   25.34 -    void adjust_guest_pages()
   25.35 +    void adjust_guest_pages(void)
   25.36      {
   25.37          struct list_head *list_ent = d->page_list.next;
   25.38          struct page_info *page;
    26.1 --- a/xen/arch/x86/hvm/hvm.c	Sat Mar 11 11:19:11 2006 +0100
    26.2 +++ b/xen/arch/x86/hvm/hvm.c	Sat Mar 11 11:20:32 2006 +0100
    26.3 @@ -205,12 +205,10 @@ void hvm_setup_platform(struct domain* d
    26.4      }
    26.5  }
    26.6  
    26.7 -void pic_irq_request(int *interrupt_request, int level)
    26.8 +void pic_irq_request(void *data, int level)
    26.9  {
   26.10 -    if (level)
   26.11 -        *interrupt_request = 1;
   26.12 -    else
   26.13 -        *interrupt_request = 0;
   26.14 +    int *interrupt_request = data;
   26.15 +    *interrupt_request = level;
   26.16  }
   26.17  
   26.18  void hvm_pic_assist(struct vcpu *v)
    27.1 --- a/xen/arch/x86/hvm/i8259.c	Sat Mar 11 11:19:11 2006 +0100
    27.2 +++ b/xen/arch/x86/hvm/i8259.c	Sat Mar 11 11:20:32 2006 +0100
    27.3 @@ -407,7 +407,7 @@ static void pic_init1(int io_addr, int e
    27.4      pic_reset(s);
    27.5  }
    27.6  
    27.7 -void pic_init(struct hvm_virpic *s, void (*irq_request)(), 
    27.8 +void pic_init(struct hvm_virpic *s, void (*irq_request)(void *, int),
    27.9                void *irq_request_opaque)
   27.10  {
   27.11      memset(s, 0, sizeof(*s));
   27.12 @@ -422,7 +422,8 @@ void pic_init(struct hvm_virpic *s, void
   27.13      return; 
   27.14  }
   27.15  
   27.16 -void pic_set_alt_irq_func(struct hvm_virpic *s, void (*alt_irq_func)(),
   27.17 +void pic_set_alt_irq_func(struct hvm_virpic *s,
   27.18 +                          void (*alt_irq_func)(void *, int, int),
   27.19                            void *alt_irq_opaque)
   27.20  {
   27.21      s->alt_irq_func = alt_irq_func;
    28.1 --- a/xen/arch/x86/hvm/svm/intr.c	Sat Mar 11 11:19:11 2006 +0100
    28.2 +++ b/xen/arch/x86/hvm/svm/intr.c	Sat Mar 11 11:20:32 2006 +0100
    28.3 @@ -187,7 +187,7 @@ asmlinkage void svm_intr_assist(void)
    28.4              }
    28.5              /* let's inject this interrupt */
    28.6              TRACE_3D(TRC_VMX_INT, v->domain->domain_id, intr_vector, 0);
    28.7 -            svm_inject_extint(v, intr_vector, VMX_INVALID_ERROR_CODE);
    28.8 +            svm_inject_extint(v, intr_vector, VMX_DELIVER_NO_ERROR_CODE);
    28.9              interrupt_post_injection(v, intr_vector, intr_type);
   28.10              break;
   28.11          case VLAPIC_DELIV_MODE_SMI:
    29.1 --- a/xen/arch/x86/hvm/vmx/io.c	Sat Mar 11 11:19:11 2006 +0100
    29.2 +++ b/xen/arch/x86/hvm/vmx/io.c	Sat Mar 11 11:20:32 2006 +0100
    29.3 @@ -165,7 +165,7 @@ asmlinkage void vmx_intr_assist(void)
    29.4      case VLAPIC_DELIV_MODE_EXT:
    29.5      case VLAPIC_DELIV_MODE_FIXED:
    29.6      case VLAPIC_DELIV_MODE_LPRI:
    29.7 -        vmx_inject_extint(v, highest_vector, VMX_INVALID_ERROR_CODE);
    29.8 +        vmx_inject_extint(v, highest_vector, VMX_DELIVER_NO_ERROR_CODE);
    29.9          TRACE_3D(TRC_VMX_INT, v->domain->domain_id, highest_vector, 0);
   29.10          break;
   29.11      case VLAPIC_DELIV_MODE_SMI:
    30.1 --- a/xen/arch/x86/hvm/vmx/vmcs.c	Sat Mar 11 11:19:11 2006 +0100
    30.2 +++ b/xen/arch/x86/hvm/vmx/vmcs.c	Sat Mar 11 11:20:32 2006 +0100
    30.3 @@ -363,7 +363,7 @@ static inline int construct_init_vmcs_gu
    30.4      return error;
    30.5  }
    30.6  
    30.7 -static inline int construct_vmcs_host()
    30.8 +static inline int construct_vmcs_host(void)
    30.9  {
   30.10      int error = 0;
   30.11  #ifdef __x86_64__
    31.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Sat Mar 11 11:19:11 2006 +0100
    31.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Sat Mar 11 11:20:32 2006 +0100
    31.3 @@ -479,12 +479,13 @@ void vmx_init_ap_context(struct vcpu_gue
    31.4  
    31.5  void do_nmi(struct cpu_user_regs *);
    31.6  
    31.7 -static int check_vmx_controls(ctrls, msr)
    31.8 +static int check_vmx_controls(u32 ctrls, u32 msr)
    31.9  {
   31.10      u32 vmx_msr_low, vmx_msr_high;
   31.11  
   31.12      rdmsr(msr, vmx_msr_low, vmx_msr_high);
   31.13 -    if (ctrls < vmx_msr_low || ctrls > vmx_msr_high) {
   31.14 +    if ( (ctrls < vmx_msr_low) || (ctrls > vmx_msr_high) )
   31.15 +    {
   31.16          printk("Insufficient VMX capability 0x%x, "
   31.17                 "msr=0x%x,low=0x%8x,high=0x%x\n",
   31.18                 ctrls, msr, vmx_msr_low, vmx_msr_high);
   31.19 @@ -1916,7 +1917,7 @@ asmlinkage void vmx_vmexit_handler(struc
   31.20      /* don't bother H/W interrutps */
   31.21      if (exit_reason != EXIT_REASON_EXTERNAL_INTERRUPT &&
   31.22          exit_reason != EXIT_REASON_VMCALL &&
   31.23 -        exit_reason != EXIT_REASON_IO_INSTRUCTION)
   31.24 +        exit_reason != EXIT_REASON_IO_INSTRUCTION) 
   31.25          HVM_DBG_LOG(DBG_LEVEL_0, "exit reason = %x", exit_reason);
   31.26  
   31.27      if (exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) {
   31.28 @@ -2051,6 +2052,7 @@ asmlinkage void vmx_vmexit_handler(struc
   31.29          __update_guest_eip(inst_len);
   31.30          break;
   31.31      }
   31.32 +#if 0 /* keep this for debugging */
   31.33      case EXIT_REASON_VMCALL:
   31.34          __get_instruction_length(inst_len);
   31.35          __vmread(GUEST_RIP, &eip);
   31.36 @@ -2059,6 +2061,7 @@ asmlinkage void vmx_vmexit_handler(struc
   31.37          hvm_print_line(v, regs.eax); /* provides the current domain */
   31.38          __update_guest_eip(inst_len);
   31.39          break;
   31.40 +#endif
   31.41      case EXIT_REASON_CR_ACCESS:
   31.42      {
   31.43          __vmread(GUEST_RIP, &eip);
   31.44 @@ -2099,6 +2102,21 @@ asmlinkage void vmx_vmexit_handler(struc
   31.45      case EXIT_REASON_MWAIT_INSTRUCTION:
   31.46          __hvm_bug(&regs);
   31.47          break;
   31.48 +    case EXIT_REASON_VMCALL:
   31.49 +    case EXIT_REASON_VMCLEAR:
   31.50 +    case EXIT_REASON_VMLAUNCH:
   31.51 +    case EXIT_REASON_VMPTRLD:
   31.52 +    case EXIT_REASON_VMPTRST:
   31.53 +    case EXIT_REASON_VMREAD:
   31.54 +    case EXIT_REASON_VMRESUME:
   31.55 +    case EXIT_REASON_VMWRITE:
   31.56 +    case EXIT_REASON_VMOFF:
   31.57 +    case EXIT_REASON_VMON:
   31.58 +        /* Report invalid opcode exception when a VMX guest tries to execute 
   31.59 +            any of the VMX instructions */
   31.60 +        vmx_inject_exception(v, TRAP_invalid_op, VMX_DELIVER_NO_ERROR_CODE);
   31.61 +        break;
   31.62 +
   31.63      default:
   31.64          __hvm_bug(&regs);       /* should not happen */
   31.65      }
    32.1 --- a/xen/arch/x86/mm.c	Sat Mar 11 11:19:11 2006 +0100
    32.2 +++ b/xen/arch/x86/mm.c	Sat Mar 11 11:20:32 2006 +0100
    32.3 @@ -234,6 +234,8 @@ void share_xen_page_with_guest(
    32.4      if ( page_get_owner(page) == d )
    32.5          return;
    32.6  
    32.7 +    set_gpfn_from_mfn(page_to_mfn(page), INVALID_M2P_ENTRY);
    32.8 +
    32.9      spin_lock(&d->page_alloc_lock);
   32.10  
   32.11      /* The incremented type count pins as writable or read-only. */
   32.12 @@ -2817,81 +2819,54 @@ long do_update_descriptor(u64 pa, u64 de
   32.13  
   32.14  long arch_memory_op(int op, GUEST_HANDLE(void) arg)
   32.15  {
   32.16 -    unsigned long pfn;
   32.17 -    struct domain *d;
   32.18 -    unsigned int i;
   32.19 -
   32.20      switch ( op )
   32.21      {
   32.22 -    case XENMEM_reserved_phys_area: {
   32.23 -        struct xen_reserved_phys_area xrpa;
   32.24 -
   32.25 -        if ( copy_from_guest(&xrpa, arg, 1) )
   32.26 +    case XENMEM_add_to_physmap:
   32.27 +    {
   32.28 +        struct xen_add_to_physmap xatp;
   32.29 +        unsigned long mfn = 0, gpfn;
   32.30 +        struct domain *d;
   32.31 +
   32.32 +        if ( copy_from_guest(&xatp, arg, 1) )
   32.33              return -EFAULT;
   32.34  
   32.35 -        /* No guest has more than one reserved area. */
   32.36 -        if ( xrpa.idx != 0 )
   32.37 -            return -ESRCH;
   32.38 -
   32.39 -        if ( (d = find_domain_by_id(xrpa.domid)) == NULL )
   32.40 +        if ( (d = find_domain_by_id(xatp.domid)) == NULL )
   32.41              return -ESRCH;
   32.42  
   32.43 -        /* Only initialised translated guests have a reserved area. */
   32.44 -        if ( !shadow_mode_translate(d) || (d->max_pages == 0) )
   32.45 +        switch ( xatp.space )
   32.46          {
   32.47 -            put_domain(d);
   32.48 -            return -ESRCH;
   32.49 -        }
   32.50 -
   32.51 -        LOCK_BIGLOCK(d);
   32.52 -        if ( d->arch.first_reserved_pfn == 0 )
   32.53 -        {
   32.54 -            d->arch.first_reserved_pfn = pfn = d->max_pages;
   32.55 -            for ( i = 0; i < NR_GRANT_FRAMES; i++ )
   32.56 -                guest_physmap_add_page(
   32.57 -                    d, pfn + i, gnttab_shared_mfn(d, d->grant_table, i));
   32.58 +        case XENMAPSPACE_shared_info:
   32.59 +            if ( xatp.idx == 0 )
   32.60 +                mfn = virt_to_mfn(d->shared_info);
   32.61 +            break;
   32.62 +        case XENMAPSPACE_grant_table:
   32.63 +            if ( xatp.idx < NR_GRANT_FRAMES )
   32.64 +                mfn = virt_to_mfn(d->grant_table->shared) + xatp.idx;
   32.65 +            break;
   32.66 +        default:
   32.67 +            break;
   32.68          }
   32.69 -        UNLOCK_BIGLOCK(d);
   32.70 -
   32.71 -        xrpa.first_gpfn = d->arch.first_reserved_pfn;
   32.72 -        xrpa.nr_gpfns   = NR_GRANT_FRAMES;
   32.73 -
   32.74 -        put_domain(d);
   32.75 -
   32.76 -        if ( copy_to_guest(arg, &xrpa, 1) )
   32.77 -            return -EFAULT;
   32.78 -
   32.79 -        break;
   32.80 -    }
   32.81 -
   32.82 -    case XENMEM_map_shared_info: {
   32.83 -        struct xen_map_shared_info xmsi;
   32.84 -
   32.85 -        if ( copy_from_guest(&xmsi, arg, 1) )
   32.86 -            return -EFAULT;
   32.87 -
   32.88 -        if ( (d = find_domain_by_id(xmsi.domid)) == NULL )
   32.89 -            return -ESRCH;
   32.90 -
   32.91 -        /* Only initialised translated guests can set the shared_info
   32.92 -         * mapping. */
   32.93 -        if ( !shadow_mode_translate(d) || (d->max_pages == 0) )
   32.94 +        
   32.95 +        if ( !shadow_mode_translate(d) || (mfn == 0) )
   32.96          {
   32.97              put_domain(d);
   32.98 -            return -ESRCH;
   32.99 -        }
  32.100 -
  32.101 -        if ( xmsi.pfn > d->max_pages ) {
  32.102 -            put_domain(d);
  32.103              return -EINVAL;
  32.104          }
  32.105  
  32.106          LOCK_BIGLOCK(d);
  32.107 +
  32.108          /* Remove previously mapped page if it was present. */
  32.109 -        if ( mfn_valid(gmfn_to_mfn(d, xmsi.pfn)) )
  32.110 -            guest_remove_page(d, xmsi.pfn);
  32.111 -        guest_physmap_add_page(d, xmsi.pfn,
  32.112 -                               virt_to_maddr(d->shared_info) >> PAGE_SHIFT);
  32.113 +        if ( mfn_valid(gmfn_to_mfn(d, xatp.gpfn)) )
  32.114 +            guest_remove_page(d, xatp.gpfn);
  32.115 +
  32.116 +        /* Unmap from old location, if any. */
  32.117 +        gpfn = get_gpfn_from_mfn(mfn);
  32.118 +        if ( gpfn != INVALID_M2P_ENTRY )
  32.119 +            guest_physmap_remove_page(d, gpfn, mfn);
  32.120 +
  32.121 +        /* Map at new location. */
  32.122 +        guest_physmap_add_page(d, xatp.gpfn, mfn);
  32.123 +
  32.124          UNLOCK_BIGLOCK(d);
  32.125  
  32.126          put_domain(d);
    33.1 --- a/xen/common/lib.c	Sat Mar 11 11:19:11 2006 +0100
    33.2 +++ b/xen/common/lib.c	Sat Mar 11 11:20:32 2006 +0100
    33.3 @@ -158,8 +158,7 @@ shl(register digit *p, register int len,
    33.4   * leading zeros).
    33.5   */
    33.6  u64
    33.7 -__qdivrem(uq, vq, arq)
    33.8 -	u64 uq, vq, *arq;
    33.9 +__qdivrem(u64 uq, u64 vq, u64 *arq)
   33.10  {
   33.11  	union uu tmp;
   33.12  	digit *u, *v, *q;
   33.13 @@ -382,8 +381,7 @@ s64
   33.14   * Divide two unsigned quads.
   33.15   */
   33.16  u64
   33.17 -__udivdi3(a, b)
   33.18 -        u64 a, b;
   33.19 +__udivdi3(u64 a, u64 b)
   33.20  {
   33.21  
   33.22          return (__qdivrem(a, b, (u64 *)0));
    34.1 --- a/xen/include/asm-x86/grant_table.h	Sat Mar 11 11:19:11 2006 +0100
    34.2 +++ b/xen/include/asm-x86/grant_table.h	Sat Mar 11 11:20:32 2006 +0100
    34.3 @@ -26,9 +26,6 @@ int steal_page_for_grant_transfer(
    34.4          share_xen_page_with_guest(                                       \
    34.5              virt_to_page((char *)(t)->shared + ((i) * PAGE_SIZE)),       \
    34.6              (d), XENSHARE_writable);                                     \
    34.7 -        set_gpfn_from_mfn(                                               \
    34.8 -            (virt_to_maddr((t)->shared) >> PAGE_SHIFT) + (i),            \
    34.9 -            INVALID_M2P_ENTRY);                                          \
   34.10      } while ( 0 )
   34.11  
   34.12  #define gnttab_shared_mfn(d, t, i)                      \
    35.1 --- a/xen/include/asm-x86/hvm/io.h	Sat Mar 11 11:19:11 2006 +0100
    35.2 +++ b/xen/include/asm-x86/hvm/io.h	Sat Mar 11 11:20:32 2006 +0100
    35.3 @@ -151,7 +151,7 @@ extern void handle_mmio(unsigned long, u
    35.4  extern void hvm_wait_io(void);
    35.5  extern void hvm_safe_block(void);
    35.6  extern void hvm_io_assist(struct vcpu *v);
    35.7 -extern void pic_irq_request(int *interrupt_request, int level);
    35.8 +extern void pic_irq_request(void *data, int level);
    35.9  extern void hvm_pic_assist(struct vcpu *v);
   35.10  extern int cpu_get_interrupt(struct vcpu *v, int *type);
   35.11  extern int cpu_has_pending_irq(struct vcpu *v);
    36.1 --- a/xen/include/asm-x86/hvm/support.h	Sat Mar 11 11:19:11 2006 +0100
    36.2 +++ b/xen/include/asm-x86/hvm/support.h	Sat Mar 11 11:20:32 2006 +0100
    36.3 @@ -99,7 +99,7 @@ enum hval_bitmaps {
    36.4  
    36.5  #define PC_DEBUG_PORT   0x80
    36.6  
    36.7 -#define VMX_INVALID_ERROR_CODE  -1
    36.8 +#define VMX_DELIVER_NO_ERROR_CODE  -1
    36.9  
   36.10  /*
   36.11   * This works for both 32bit & 64bit eflags filteration
    37.1 --- a/xen/include/asm-x86/hvm/vmx/vmx.h	Sat Mar 11 11:19:11 2006 +0100
    37.2 +++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Sat Mar 11 11:20:32 2006 +0100
    37.3 @@ -119,7 +119,15 @@ extern unsigned int cpu_rev;
    37.4  #define EXIT_REASON_RDPMC               15
    37.5  #define EXIT_REASON_RDTSC               16
    37.6  #define EXIT_REASON_VMCALL              18
    37.7 -
    37.8 +#define EXIT_REASON_VMCLEAR             19
    37.9 +#define EXIT_REASON_VMLAUNCH            20
   37.10 +#define EXIT_REASON_VMPTRLD             21
   37.11 +#define EXIT_REASON_VMPTRST             22
   37.12 +#define EXIT_REASON_VMREAD              23
   37.13 +#define EXIT_REASON_VMRESUME            24
   37.14 +#define EXIT_REASON_VMWRITE             25
   37.15 +#define EXIT_REASON_VMOFF               26
   37.16 +#define EXIT_REASON_VMON                27
   37.17  #define EXIT_REASON_CR_ACCESS           28
   37.18  #define EXIT_REASON_DR_ACCESS           29
   37.19  #define EXIT_REASON_IO_INSTRUCTION      30
   37.20 @@ -425,7 +433,7 @@ static inline int __vmx_inject_exception
   37.21  
   37.22      /* Reflect it back into the guest */
   37.23      intr_fields = (INTR_INFO_VALID_MASK | type | trap);
   37.24 -    if (error_code != VMX_INVALID_ERROR_CODE) {
   37.25 +    if (error_code != VMX_DELIVER_NO_ERROR_CODE) {
   37.26          __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
   37.27          intr_fields |= INTR_INFO_DELIEVER_CODE_MASK;
   37.28       }
   37.29 @@ -455,7 +463,7 @@ static inline int vmx_reflect_exception(
   37.30      if (vector & INTR_INFO_DELIEVER_CODE_MASK)
   37.31          __vmread(VM_EXIT_INTR_ERROR_CODE, &error_code);
   37.32      else
   37.33 -        error_code = VMX_INVALID_ERROR_CODE;
   37.34 +        error_code = VMX_DELIVER_NO_ERROR_CODE;
   37.35      vector &= 0xff;
   37.36  
   37.37  #ifndef NDEBUG
    38.1 --- a/xen/include/asm-x86/hvm/vpic.h	Sat Mar 11 11:19:11 2006 +0100
    38.2 +++ b/xen/include/asm-x86/hvm/vpic.h	Sat Mar 11 11:20:32 2006 +0100
    38.3 @@ -55,7 +55,7 @@ struct hvm_virpic {
    38.4      /* 0 is master pic, 1 is slave pic */
    38.5      /* XXX: better separation between the two pics */
    38.6      PicState pics[2];
    38.7 -    void (*irq_request)(int *opaque, int level);
    38.8 +    void (*irq_request)(void *opaque, int level);
    38.9      void *irq_request_opaque;
   38.10      /* IOAPIC callback support */
   38.11      void (*alt_irq_func)(void *opaque, int irq_num, int level);
   38.12 @@ -66,10 +66,10 @@ struct hvm_virpic {
   38.13  void pic_set_irq(struct hvm_virpic *s, int irq, int level);
   38.14  void pic_set_irq_new(void *opaque, int irq, int level);
   38.15  void pic_init(struct hvm_virpic *s, 
   38.16 -              void (*irq_request)(),
   38.17 +              void (*irq_request)(void *, int),
   38.18                void *irq_request_opaque);
   38.19  void pic_set_alt_irq_func(struct hvm_virpic *s, 
   38.20 -                          void(*alt_irq_func)(),
   38.21 +                          void (*alt_irq_func)(void *, int, int),
   38.22                            void *alt_irq_opaque);
   38.23  int pic_read_irq(struct hvm_virpic *s);
   38.24  void pic_update_irq(struct hvm_virpic *s);
    39.1 --- a/xen/include/asm-x86/page.h	Sat Mar 11 11:19:11 2006 +0100
    39.2 +++ b/xen/include/asm-x86/page.h	Sat Mar 11 11:20:32 2006 +0100
    39.3 @@ -191,6 +191,10 @@ typedef struct { u64 pfn; } pagetable_t;
    39.4  #define __pa(x)             (virt_to_maddr(x))
    39.5  #define __va(x)             (maddr_to_virt(x))
    39.6  
    39.7 +/* Convert between Xen-heap virtual addresses and machine frame numbers. */
    39.8 +#define virt_to_mfn(va)     (virt_to_maddr(va) >> PAGE_SHIFT)
    39.9 +#define mfn_to_virt(mfn)    (maddr_to_virt(mfn << PAGE_SHIFT))
   39.10 +
   39.11  /* Convert between machine frame numbers and page-info structures. */
   39.12  #define mfn_to_page(mfn)    (frame_table + (mfn))
   39.13  #define page_to_mfn(pg)     ((unsigned long)((pg) - frame_table))
    40.1 --- a/xen/include/public/memory.h	Sat Mar 11 11:19:11 2006 +0100
    40.2 +++ b/xen/include/public/memory.h	Sat Mar 11 11:20:32 2006 +0100
    40.3 @@ -97,25 +97,27 @@ typedef struct xen_machphys_mfn_list {
    40.4  DEFINE_GUEST_HANDLE(xen_machphys_mfn_list_t);
    40.5  
    40.6  /*
    40.7 - * Returns the base and size of the specified reserved 'RAM hole' in the
    40.8 - * specified guest's pseudophysical address space.
    40.9 - * arg == addr of xen_reserved_phys_area_t.
   40.10 + * Sets the GPFN at which a particular page appears in the specified guest's
   40.11 + * pseudophysical address space.
   40.12 + * arg == addr of xen_add_to_physmap_t.
   40.13   */
   40.14 -#define XENMEM_reserved_phys_area   7
   40.15 -typedef struct xen_reserved_phys_area {
   40.16 -    /* Which domain to report about? */
   40.17 +#define XENMEM_add_to_physmap      7
   40.18 +typedef struct xen_add_to_physmap {
   40.19 +    /* Which domain to change the mapping for. */
   40.20      domid_t domid;
   40.21  
   40.22 -    /*
   40.23 -     * Which reserved area to report? Out-of-range request reports
   40.24 -     * -ESRCH. Currently no architecture will have more than one reserved area.
   40.25 -     */
   40.26 -    unsigned int idx;
   40.27 +    /* Source mapping space. */
   40.28 +#define XENMAPSPACE_shared_info 0 /* shared info page */
   40.29 +#define XENMAPSPACE_grant_table 1 /* grant table page */
   40.30 +    unsigned int space;
   40.31  
   40.32 -    /* Base and size of the specified reserved area. */
   40.33 -    unsigned long first_gpfn, nr_gpfns;
   40.34 -} xen_reserved_phys_area_t;
   40.35 -DEFINE_GUEST_HANDLE(xen_reserved_phys_area_t);
   40.36 +    /* Index into source mapping space. */
   40.37 +    unsigned long idx;
   40.38 +
   40.39 +    /* GPFN where the source mapping page should appear. */
   40.40 +    unsigned long gpfn;
   40.41 +} xen_add_to_physmap_t;
   40.42 +DEFINE_GUEST_HANDLE(xen_add_to_physmap_t);
   40.43  
   40.44  /*
   40.45   * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
   40.46 @@ -140,21 +142,6 @@ typedef struct xen_translate_gpfn_list {
   40.47  } xen_translate_gpfn_list_t;
   40.48  DEFINE_GUEST_HANDLE(xen_translate_gpfn_list_t);
   40.49  
   40.50 -/*
   40.51 - * Sets the GPFN at which the shared_info_page appears in the specified
   40.52 - * guest's pseudophysical address space.
   40.53 - * arg == addr of xen_map_shared_info_t.
   40.54 - */
   40.55 -#define XENMEM_map_shared_info      9
   40.56 -typedef struct xen_map_shared_info {
   40.57 -    /* Which domain to change the mapping for. */
   40.58 -    domid_t domid;
   40.59 -
   40.60 -    /* GPFN where the shared_info_page should appear. */
   40.61 -    unsigned long pfn;
   40.62 -} xen_map_shared_info_t;
   40.63 -DEFINE_GUEST_HANDLE(xen_map_shared_info_t);
   40.64 -
   40.65  #endif /* __XEN_PUBLIC_MEMORY_H__ */
   40.66  
   40.67  /*
    41.1 --- a/xen/include/xen/sched.h	Sat Mar 11 11:19:11 2006 +0100
    41.2 +++ b/xen/include/xen/sched.h	Sat Mar 11 11:20:32 2006 +0100
    41.3 @@ -266,7 +266,7 @@ void sched_add_domain(struct vcpu *);
    41.4  void sched_rem_domain(struct vcpu *);
    41.5  long sched_ctl(struct sched_ctl_cmd *);
    41.6  long sched_adjdom(struct sched_adjdom_cmd *);
    41.7 -int  sched_id();
    41.8 +int  sched_id(void);
    41.9  void vcpu_wake(struct vcpu *d);
   41.10  void vcpu_sleep_nosync(struct vcpu *d);
   41.11  void vcpu_sleep_sync(struct vcpu *d);