ia64/linux-2.6.18-xen.hg

changeset 272:27b937c0095c

merge with linux-2.6.18-xen.hg
author Alex Williamson <alex.williamson@hp.com>
date Sun Oct 21 12:10:59 2007 -0600 (2007-10-21)
parents 6cac8ecd995d ba49878d8359
children 2791b054f1a9
files arch/ia64/xen/hypervisor.c arch/ia64/xen/xcom_privcmd.c scripts/Makefile.xen
line diff
     1.1 --- a/arch/i386/kernel/setup-xen.c	Wed Oct 17 10:27:10 2007 -0600
     1.2 +++ b/arch/i386/kernel/setup-xen.c	Sun Oct 21 12:10:59 2007 -0600
     1.3 @@ -1669,23 +1669,12 @@ void __init setup_arch(char **cmdline_p)
     1.4  	bootloader_type = LOADER_TYPE;
     1.5  
     1.6  	if (is_initial_xendomain()) {
     1.7 -		/* This is drawn from a dump from vgacon:startup in
     1.8 -		 * standard Linux. */
     1.9 -		screen_info.orig_video_mode = 3; 
    1.10 -		screen_info.orig_video_isVGA = 1;
    1.11 -		screen_info.orig_video_lines = 25;
    1.12 -		screen_info.orig_video_cols = 80;
    1.13 -		screen_info.orig_video_ega_bx = 3;
    1.14 -		screen_info.orig_video_points = 16;
    1.15 -		screen_info.orig_y = screen_info.orig_video_lines - 1;
    1.16 -		if (xen_start_info->console.dom0.info_size >=
    1.17 -		    sizeof(struct dom0_vga_console_info)) {
    1.18 -			const struct dom0_vga_console_info *info =
    1.19 -				(struct dom0_vga_console_info *)(
    1.20 -					(char *)xen_start_info +
    1.21 -					xen_start_info->console.dom0.info_off);
    1.22 -			dom0_init_screen_info(info);
    1.23 -		}
    1.24 +		const struct dom0_vga_console_info *info =
    1.25 +			(void *)((char *)xen_start_info +
    1.26 +			         xen_start_info->console.dom0.info_off);
    1.27 +
    1.28 +		dom0_init_screen_info(info,
    1.29 +		                      xen_start_info->console.dom0.info_size);
    1.30  		xen_start_info->console.domU.mfn = 0;
    1.31  		xen_start_info->console.domU.evtchn = 0;
    1.32  	} else
     2.1 --- a/arch/ia64/xen/hypervisor.c	Wed Oct 17 10:27:10 2007 -0600
     2.2 +++ b/arch/ia64/xen/hypervisor.c	Sun Oct 21 12:10:59 2007 -0600
     2.3 @@ -55,21 +55,19 @@ EXPORT_SYMBOL(__hypercall);
     2.4  void __init
     2.5  xen_setup(char **cmdline_p)
     2.6  {
     2.7 +	struct dom0_vga_console_info *info;
     2.8  	extern void dig_setup(char **cmdline_p);
     2.9 +
    2.10  	if (ia64_platform_is("xen"))
    2.11  		dig_setup(cmdline_p);
    2.12  	
    2.13  	if (!is_running_on_xen() || !is_initial_xendomain())
    2.14  		return;
    2.15  
    2.16 -	if (xen_start_info->console.dom0.info_size >=
    2.17 -	    sizeof(struct dom0_vga_console_info)) {
    2.18 -		const struct dom0_vga_console_info *info =
    2.19 -		        (struct dom0_vga_console_info *)(
    2.20 -		                (char *)xen_start_info +
    2.21 -		                xen_start_info->console.dom0.info_off);
    2.22 -		dom0_init_screen_info(info);
    2.23 -	}
    2.24 +	info = (void *)((char *)xen_start_info +
    2.25 +			xen_start_info->console.dom0.info_off);
    2.26 +	dom0_init_screen_info(info, xen_start_info->console.dom0.info_size);
    2.27 +
    2.28  	xen_start_info->console.domU.mfn = 0;
    2.29  	xen_start_info->console.domU.evtchn = 0;
    2.30  }
     3.1 --- a/arch/ia64/xen/xcom_hcall.c	Wed Oct 17 10:27:10 2007 -0600
     3.2 +++ b/arch/ia64/xen/xcom_hcall.c	Sun Oct 21 12:10:59 2007 -0600
     3.3 @@ -35,7 +35,7 @@
     3.4  #include <xen/interface/physdev.h>
     3.5  #include <xen/interface/grant_table.h>
     3.6  #include <xen/interface/callback.h>
     3.7 -#include <xen/interface/acm_ops.h>
     3.8 +#include <xen/interface/xsm/acm_ops.h>
     3.9  #include <xen/interface/hvm/params.h>
    3.10  #include <xen/interface/xenoprof.h>
    3.11  #include <xen/interface/vcpu.h>
     4.1 --- a/arch/ia64/xen/xcom_privcmd.c	Wed Oct 17 10:27:10 2007 -0600
     4.2 +++ b/arch/ia64/xen/xcom_privcmd.c	Sun Oct 21 12:10:59 2007 -0600
     4.3 @@ -29,7 +29,7 @@
     4.4  #include <xen/interface/memory.h>
     4.5  #include <xen/interface/version.h>
     4.6  #include <xen/interface/event_channel.h>
     4.7 -#include <xen/interface/acm_ops.h>
     4.8 +#include <xen/interface/xsm/acm_ops.h>
     4.9  #include <xen/interface/hvm/params.h>
    4.10  #include <xen/public/privcmd.h>
    4.11  #include <asm/hypercall.h>
    4.12 @@ -335,7 +335,7 @@ xencomm_privcmd_domctl(privcmd_hypercall
    4.13  }
    4.14  
    4.15  static int
    4.16 -xencomm_privcmd_acm_op(privcmd_hypercall_t *hypercall)
    4.17 +xencomm_privcmd_xsm_op(privcmd_hypercall_t *hypercall)
    4.18  {
    4.19  	void __user *arg = (void __user *)hypercall->arg[0];
    4.20  	xen_acmctl_t kern_arg;
    4.21 @@ -361,7 +361,7 @@ xencomm_privcmd_acm_op(privcmd_hypercall
    4.22  
    4.23  		set_xen_guest_handle(kern_arg.u.getssid.ssidbuf, (void *)desc);
    4.24  
    4.25 -		ret = xencomm_arch_hypercall_acm_op(op_desc);
    4.26 +		ret = xencomm_arch_hypercall_xsm_op(op_desc);
    4.27  
    4.28  		xencomm_free(desc);
    4.29  
    4.30 @@ -784,8 +784,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
    4.31  		return xencomm_privcmd_domctl(hypercall);
    4.32  	case __HYPERVISOR_sysctl:
    4.33  		return xencomm_privcmd_sysctl(hypercall);
    4.34 -        case __HYPERVISOR_acm_op:
    4.35 -		return xencomm_privcmd_acm_op(hypercall);
    4.36 +	case __HYPERVISOR_xsm_op:
    4.37 +		return xencomm_privcmd_xsm_op(hypercall);
    4.38  	case __HYPERVISOR_xen_version:
    4.39  		return xencomm_privcmd_xen_version(hypercall);
    4.40  	case __HYPERVISOR_memory_op:
     5.1 --- a/arch/powerpc/platforms/xen/hcall.c	Wed Oct 17 10:27:10 2007 -0600
     5.2 +++ b/arch/powerpc/platforms/xen/hcall.c	Sun Oct 21 12:10:59 2007 -0600
     5.3 @@ -34,7 +34,7 @@
     5.4  #include <xen/interface/event_channel.h>
     5.5  #include <xen/interface/physdev.h>
     5.6  #include <xen/interface/vcpu.h>
     5.7 -#include <xen/interface/acm_ops.h>
     5.8 +#include <xen/interface/xsm/acm_ops.h>
     5.9  #include <xen/interface/kexec.h>
    5.10  #include <xen/public/privcmd.h>
    5.11  #include <asm/hypercall.h>
     6.1 --- a/arch/x86_64/kernel/acpi/Makefile	Wed Oct 17 10:27:10 2007 -0600
     6.2 +++ b/arch/x86_64/kernel/acpi/Makefile	Sun Oct 21 12:10:59 2007 -0600
     6.3 @@ -6,9 +6,3 @@ ifneq ($(CONFIG_ACPI_PROCESSOR),)
     6.4  obj-y			+= processor.o
     6.5  processor-y		:= ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o
     6.6  endif
     6.7 -
     6.8 -boot-$(CONFIG_XEN)		:= ../../../i386/kernel/acpi/boot-xen.o
     6.9 -ifdef CONFIG_XEN
    6.10 -include $(srctree)/scripts/Makefile.xen
    6.11 -obj-y := $(call cherrypickxen, $(obj-y))
    6.12 -endif
     7.1 --- a/arch/x86_64/kernel/setup-xen.c	Wed Oct 17 10:27:10 2007 -0600
     7.2 +++ b/arch/x86_64/kernel/setup-xen.c	Sun Oct 21 12:10:59 2007 -0600
     7.3 @@ -594,23 +594,12 @@ void __init setup_arch(char **cmdline_p)
     7.4   	screen_info = SCREEN_INFO;
     7.5  
     7.6  	if (is_initial_xendomain()) {
     7.7 -		/* This is drawn from a dump from vgacon:startup in
     7.8 -		 * standard Linux. */
     7.9 -		screen_info.orig_video_mode = 3;
    7.10 -		screen_info.orig_video_isVGA = 1;
    7.11 -		screen_info.orig_video_lines = 25;
    7.12 -		screen_info.orig_video_cols = 80;
    7.13 -		screen_info.orig_video_ega_bx = 3;
    7.14 -		screen_info.orig_video_points = 16;
    7.15 -		screen_info.orig_y = screen_info.orig_video_lines - 1;
    7.16 -		if (xen_start_info->console.dom0.info_size >=
    7.17 -		    sizeof(struct dom0_vga_console_info)) {
    7.18 -			const struct dom0_vga_console_info *info =
    7.19 -				(struct dom0_vga_console_info *)(
    7.20 -					(char *)xen_start_info +
    7.21 -					xen_start_info->console.dom0.info_off);
    7.22 -			dom0_init_screen_info(info);
    7.23 -		}
    7.24 +		const struct dom0_vga_console_info *info =
    7.25 +			(void *)((char *)xen_start_info +
    7.26 +			         xen_start_info->console.dom0.info_off);
    7.27 +
    7.28 +		dom0_init_screen_info(info,
    7.29 +		                      xen_start_info->console.dom0.info_size);
    7.30  		xen_start_info->console.domU.mfn = 0;
    7.31  		xen_start_info->console.domU.evtchn = 0;
    7.32  	} else
     8.1 --- a/buildconfigs/linux-defconfig_xen0_x86_32	Wed Oct 17 10:27:10 2007 -0600
     8.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_32	Sun Oct 21 12:10:59 2007 -0600
     8.3 @@ -1,10 +1,9 @@
     8.4  #
     8.5  # Automatically generated make config: don't edit
     8.6 -# Linux kernel version: 2.6.18-xen0
     8.7 -# Wed Jan 17 18:35:52 2007
     8.8 +# Linux kernel version: 2.6.18.8
     8.9 +# Tue Oct 16 09:31:19 2007
    8.10  #
    8.11  CONFIG_X86_32=y
    8.12 -CONFIG_GENERIC_TIME=y
    8.13  CONFIG_LOCKDEP_SUPPORT=y
    8.14  CONFIG_STACKTRACE_SUPPORT=y
    8.15  CONFIG_SEMAPHORE_SLEEPERS=y
    8.16 @@ -142,7 +141,6 @@ CONFIG_X86_POPAD_OK=y
    8.17  CONFIG_X86_CMPXCHG64=y
    8.18  CONFIG_X86_GOOD_APIC=y
    8.19  CONFIG_X86_USE_PPRO_CHECKSUM=y
    8.20 -CONFIG_X86_TSC=y
    8.21  CONFIG_NR_CPUS=8
    8.22  CONFIG_PREEMPT_NONE=y
    8.23  # CONFIG_PREEMPT_VOLUNTARY is not set
    8.24 @@ -177,7 +175,7 @@ CONFIG_FLATMEM_MANUAL=y
    8.25  CONFIG_FLATMEM=y
    8.26  CONFIG_FLAT_NODE_MEM_MAP=y
    8.27  # CONFIG_SPARSEMEM_STATIC is not set
    8.28 -CONFIG_SPLIT_PTLOCK_CPUS=4096
    8.29 +CONFIG_SPLIT_PTLOCK_CPUS=4
    8.30  CONFIG_RESOURCES_64BIT=y
    8.31  # CONFIG_HIGHPTE is not set
    8.32  CONFIG_MTRR=y
    8.33 @@ -197,11 +195,18 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
    8.34  # Power management options (ACPI, APM)
    8.35  #
    8.36  CONFIG_PM=y
    8.37 +CONFIG_PM_LEGACY=y
    8.38 +# CONFIG_PM_DEBUG is not set
    8.39 +# CONFIG_SOFTWARE_SUSPEND is not set
    8.40 +CONFIG_SUSPEND_SMP=y
    8.41  
    8.42  #
    8.43  # ACPI (Advanced Configuration and Power Interface) Support
    8.44  #
    8.45  CONFIG_ACPI=y
    8.46 +CONFIG_ACPI_SLEEP=y
    8.47 +CONFIG_ACPI_SLEEP_PROC_FS=y
    8.48 +# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set
    8.49  CONFIG_ACPI_AC=m
    8.50  CONFIG_ACPI_BATTERY=m
    8.51  CONFIG_ACPI_BUTTON=m
    8.52 @@ -210,6 +215,7 @@ CONFIG_ACPI_HOTKEY=m
    8.53  CONFIG_ACPI_FAN=m
    8.54  CONFIG_ACPI_DOCK=m
    8.55  CONFIG_ACPI_PROCESSOR=m
    8.56 +CONFIG_ACPI_HOTPLUG_CPU=y
    8.57  CONFIG_ACPI_THERMAL=m
    8.58  CONFIG_ACPI_ASUS=m
    8.59  CONFIG_ACPI_IBM=m
    8.60 @@ -220,7 +226,8 @@ CONFIG_ACPI_BLACKLIST_YEAR=0
    8.61  CONFIG_ACPI_EC=y
    8.62  CONFIG_ACPI_POWER=y
    8.63  CONFIG_ACPI_SYSTEM=y
    8.64 -# CONFIG_ACPI_CONTAINER is not set
    8.65 +CONFIG_ACPI_CONTAINER=m
    8.66 +CONFIG_ACPI_PV_SLEEP=y
    8.67  
    8.68  #
    8.69  # CPU Frequency scaling
    8.70 @@ -394,7 +401,7 @@ CONFIG_LLC=y
    8.71  CONFIG_PREVENT_FIRMWARE_BUILD=y
    8.72  # CONFIG_FW_LOADER is not set
    8.73  # CONFIG_DEBUG_DRIVER is not set
    8.74 -# CONFIG_SYS_HYPERVISOR is not set
    8.75 +CONFIG_SYS_HYPERVISOR=y
    8.76  
    8.77  #
    8.78  # Connector - unified userspace <-> kernelspace linker
    8.79 @@ -934,7 +941,6 @@ CONFIG_DRM_SIS=m
    8.80  # Multimedia devices
    8.81  #
    8.82  # CONFIG_VIDEO_DEV is not set
    8.83 -CONFIG_VIDEO_V4L2=y
    8.84  
    8.85  #
    8.86  # Digital Video Broadcasting Devices
    8.87 @@ -1386,7 +1392,7 @@ CONFIG_CRYPTO_CRC32C=m
    8.88  #
    8.89  # CONFIG_CRYPTO_DEV_PADLOCK is not set
    8.90  CONFIG_XEN=y
    8.91 -CONFIG_XEN_INTERFACE_VERSION=0x00030205
    8.92 +CONFIG_XEN_INTERFACE_VERSION=0x00030206
    8.93  
    8.94  #
    8.95  # XEN
    8.96 @@ -1405,6 +1411,7 @@ CONFIG_XEN_PCIDEV_BACKEND=y
    8.97  # CONFIG_XEN_PCIDEV_BACKEND_VPCI is not set
    8.98  CONFIG_XEN_PCIDEV_BACKEND_PASS=y
    8.99  # CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
   8.100 +# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set
   8.101  # CONFIG_XEN_PCIDEV_BE_DEBUG is not set
   8.102  CONFIG_XEN_TPMDEV_BACKEND=m
   8.103  CONFIG_XEN_BLKDEV_FRONTEND=y
   8.104 @@ -1415,15 +1422,12 @@ CONFIG_XEN_SYSFS=y
   8.105  CONFIG_XEN_COMPAT_030002_AND_LATER=y
   8.106  # CONFIG_XEN_COMPAT_030004_AND_LATER is not set
   8.107  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
   8.108 -CONFIG_XEN_COMPAT_030002=y
   8.109 -CONFIG_XEN_COMPAT_030004=y
   8.110 +CONFIG_XEN_COMPAT=0x030002
   8.111  CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
   8.112  CONFIG_NO_IDLE_HZ=y
   8.113 -CONFIG_XEN_UTIL=y
   8.114 +CONFIG_XEN_SMPBOOT=y
   8.115  CONFIG_XEN_BALLOON=y
   8.116  CONFIG_XEN_DEVMEM=y
   8.117 -CONFIG_XEN_REBOOT=y
   8.118 -CONFIG_XEN_SMPBOOT=y
   8.119  
   8.120  #
   8.121  # Library routines
     9.1 --- a/buildconfigs/linux-defconfig_xen0_x86_64	Wed Oct 17 10:27:10 2007 -0600
     9.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_64	Sun Oct 21 12:10:59 2007 -0600
     9.3 @@ -1,7 +1,7 @@
     9.4  #
     9.5  # Automatically generated make config: don't edit
     9.6 -# Linux kernel version: 2.6.18
     9.7 -# Wed Jun 27 12:48:41 2007
     9.8 +# Linux kernel version: 2.6.18.8
     9.9 +# Tue Oct 16 09:32:39 2007
    9.10  #
    9.11  CONFIG_X86_64=y
    9.12  CONFIG_64BIT=y
    9.13 @@ -129,7 +129,7 @@ CONFIG_FLATMEM_MANUAL=y
    9.14  CONFIG_FLATMEM=y
    9.15  CONFIG_FLAT_NODE_MEM_MAP=y
    9.16  # CONFIG_SPARSEMEM_STATIC is not set
    9.17 -CONFIG_SPLIT_PTLOCK_CPUS=4096
    9.18 +CONFIG_SPLIT_PTLOCK_CPUS=4
    9.19  CONFIG_RESOURCES_64BIT=y
    9.20  CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
    9.21  CONFIG_SWIOTLB=y
    9.22 @@ -151,11 +151,17 @@ CONFIG_ISA_DMA_API=y
    9.23  # Power management options
    9.24  #
    9.25  CONFIG_PM=y
    9.26 +CONFIG_PM_LEGACY=y
    9.27 +# CONFIG_PM_DEBUG is not set
    9.28 +# CONFIG_SOFTWARE_SUSPEND is not set
    9.29  
    9.30  #
    9.31  # ACPI (Advanced Configuration and Power Interface) Support
    9.32  #
    9.33  CONFIG_ACPI=y
    9.34 +CONFIG_ACPI_SLEEP=y
    9.35 +CONFIG_ACPI_SLEEP_PROC_FS=y
    9.36 +# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set
    9.37  CONFIG_ACPI_AC=m
    9.38  CONFIG_ACPI_BATTERY=m
    9.39  CONFIG_ACPI_BUTTON=m
    9.40 @@ -174,6 +180,7 @@ CONFIG_ACPI_EC=y
    9.41  CONFIG_ACPI_POWER=y
    9.42  CONFIG_ACPI_SYSTEM=y
    9.43  # CONFIG_ACPI_CONTAINER is not set
    9.44 +CONFIG_ACPI_PV_SLEEP=y
    9.45  
    9.46  #
    9.47  # CPU Frequency scaling
    9.48 @@ -868,7 +875,6 @@ CONFIG_DRM_SIS=m
    9.49  # Multimedia devices
    9.50  #
    9.51  # CONFIG_VIDEO_DEV is not set
    9.52 -CONFIG_VIDEO_V4L2=y
    9.53  
    9.54  #
    9.55  # Digital Video Broadcasting Devices
    9.56 @@ -1334,7 +1340,7 @@ CONFIG_CRYPTO_CRC32C=m
    9.57  # Hardware crypto devices
    9.58  #
    9.59  CONFIG_XEN=y
    9.60 -CONFIG_XEN_INTERFACE_VERSION=0x00030205
    9.61 +CONFIG_XEN_INTERFACE_VERSION=0x00030206
    9.62  
    9.63  #
    9.64  # XEN
    9.65 @@ -1367,6 +1373,8 @@ CONFIG_XEN_COMPAT_030002_AND_LATER=y
    9.66  CONFIG_XEN_COMPAT=0x030002
    9.67  CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
    9.68  CONFIG_NO_IDLE_HZ=y
    9.69 +CONFIG_XEN_BALLOON=y
    9.70 +CONFIG_XEN_DEVMEM=y
    9.71  
    9.72  #
    9.73  # Library routines
    10.1 --- a/buildconfigs/linux-defconfig_xenU_x86_32	Wed Oct 17 10:27:10 2007 -0600
    10.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_32	Sun Oct 21 12:10:59 2007 -0600
    10.3 @@ -1,10 +1,9 @@
    10.4  #
    10.5  # Automatically generated make config: don't edit
    10.6 -# Linux kernel version: 2.6.18-xenU
    10.7 -# Wed Jan 17 18:36:21 2007
    10.8 +# Linux kernel version: 2.6.18.8
    10.9 +# Tue Oct 16 09:31:29 2007
   10.10  #
   10.11  CONFIG_X86_32=y
   10.12 -CONFIG_GENERIC_TIME=y
   10.13  CONFIG_LOCKDEP_SUPPORT=y
   10.14  CONFIG_STACKTRACE_SUPPORT=y
   10.15  CONFIG_SEMAPHORE_SLEEPERS=y
   10.16 @@ -142,7 +141,6 @@ CONFIG_X86_POPAD_OK=y
   10.17  CONFIG_X86_CMPXCHG64=y
   10.18  CONFIG_X86_GOOD_APIC=y
   10.19  CONFIG_X86_USE_PPRO_CHECKSUM=y
   10.20 -CONFIG_X86_TSC=y
   10.21  CONFIG_NR_CPUS=8
   10.22  CONFIG_PREEMPT_NONE=y
   10.23  # CONFIG_PREEMPT_VOLUNTARY is not set
   10.24 @@ -174,7 +172,7 @@ CONFIG_FLATMEM_MANUAL=y
   10.25  CONFIG_FLATMEM=y
   10.26  CONFIG_FLAT_NODE_MEM_MAP=y
   10.27  # CONFIG_SPARSEMEM_STATIC is not set
   10.28 -CONFIG_SPLIT_PTLOCK_CPUS=4096
   10.29 +CONFIG_SPLIT_PTLOCK_CPUS=4
   10.30  CONFIG_RESOURCES_64BIT=y
   10.31  # CONFIG_HIGHPTE is not set
   10.32  # CONFIG_REGPARM is not set
   10.33 @@ -305,7 +303,7 @@ CONFIG_STANDALONE=y
   10.34  CONFIG_PREVENT_FIRMWARE_BUILD=y
   10.35  # CONFIG_FW_LOADER is not set
   10.36  # CONFIG_DEBUG_DRIVER is not set
   10.37 -# CONFIG_SYS_HYPERVISOR is not set
   10.38 +CONFIG_SYS_HYPERVISOR=y
   10.39  
   10.40  #
   10.41  # Connector - unified userspace <-> kernelspace linker
   10.42 @@ -583,7 +581,6 @@ CONFIG_HW_RANDOM_VIA=y
   10.43  # Multimedia devices
   10.44  #
   10.45  # CONFIG_VIDEO_DEV is not set
   10.46 -CONFIG_VIDEO_V4L2=y
   10.47  
   10.48  #
   10.49  # Digital Video Broadcasting Devices
   10.50 @@ -906,7 +903,7 @@ CONFIG_CRYPTO_CRC32C=m
   10.51  #
   10.52  # CONFIG_CRYPTO_DEV_PADLOCK is not set
   10.53  CONFIG_XEN=y
   10.54 -CONFIG_XEN_INTERFACE_VERSION=0x00030205
   10.55 +CONFIG_XEN_INTERFACE_VERSION=0x00030206
   10.56  
   10.57  #
   10.58  # XEN
   10.59 @@ -924,15 +921,12 @@ CONFIG_XEN_SYSFS=y
   10.60  CONFIG_XEN_COMPAT_030002_AND_LATER=y
   10.61  # CONFIG_XEN_COMPAT_030004_AND_LATER is not set
   10.62  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
   10.63 -CONFIG_XEN_COMPAT_030002=y
   10.64 -CONFIG_XEN_COMPAT_030004=y
   10.65 +CONFIG_XEN_COMPAT=0x030002
   10.66  CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
   10.67  CONFIG_NO_IDLE_HZ=y
   10.68 -CONFIG_XEN_UTIL=y
   10.69 +CONFIG_XEN_SMPBOOT=y
   10.70  CONFIG_XEN_BALLOON=y
   10.71  CONFIG_XEN_DEVMEM=y
   10.72 -CONFIG_XEN_REBOOT=y
   10.73 -CONFIG_XEN_SMPBOOT=y
   10.74  
   10.75  #
   10.76  # Library routines
    11.1 --- a/buildconfigs/linux-defconfig_xenU_x86_64	Wed Oct 17 10:27:10 2007 -0600
    11.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_64	Sun Oct 21 12:10:59 2007 -0600
    11.3 @@ -1,7 +1,7 @@
    11.4  #
    11.5  # Automatically generated make config: don't edit
    11.6 -# Linux kernel version: 2.6.18
    11.7 -# Wed Jun 27 12:48:56 2007
    11.8 +# Linux kernel version: 2.6.18.8
    11.9 +# Tue Oct 16 09:32:52 2007
   11.10  #
   11.11  CONFIG_X86_64=y
   11.12  CONFIG_64BIT=y
   11.13 @@ -131,7 +131,7 @@ CONFIG_FLATMEM_MANUAL=y
   11.14  CONFIG_FLATMEM=y
   11.15  CONFIG_FLAT_NODE_MEM_MAP=y
   11.16  # CONFIG_SPARSEMEM_STATIC is not set
   11.17 -CONFIG_SPLIT_PTLOCK_CPUS=4096
   11.18 +CONFIG_SPLIT_PTLOCK_CPUS=4
   11.19  CONFIG_RESOURCES_64BIT=y
   11.20  CONFIG_NR_CPUS=16
   11.21  # CONFIG_HOTPLUG_CPU is not set
   11.22 @@ -823,7 +823,6 @@ CONFIG_HW_RANDOM=y
   11.23  # Multimedia devices
   11.24  #
   11.25  # CONFIG_VIDEO_DEV is not set
   11.26 -CONFIG_VIDEO_V4L2=y
   11.27  
   11.28  #
   11.29  # Digital Video Broadcasting Devices
   11.30 @@ -1201,7 +1200,7 @@ CONFIG_CRYPTO_CRC32C=m
   11.31  # Hardware crypto devices
   11.32  #
   11.33  CONFIG_XEN=y
   11.34 -CONFIG_XEN_INTERFACE_VERSION=0x00030205
   11.35 +CONFIG_XEN_INTERFACE_VERSION=0x00030206
   11.36  
   11.37  #
   11.38  # XEN
   11.39 @@ -1223,6 +1222,8 @@ CONFIG_XEN_COMPAT=0x030002
   11.40  CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
   11.41  CONFIG_NO_IDLE_HZ=y
   11.42  CONFIG_XEN_SMPBOOT=y
   11.43 +CONFIG_XEN_BALLOON=y
   11.44 +CONFIG_XEN_DEVMEM=y
   11.45  
   11.46  #
   11.47  # Library routines
    12.1 --- a/buildconfigs/linux-defconfig_xen_x86_32	Wed Oct 17 10:27:10 2007 -0600
    12.2 +++ b/buildconfigs/linux-defconfig_xen_x86_32	Sun Oct 21 12:10:59 2007 -0600
    12.3 @@ -1,10 +1,9 @@
    12.4  #
    12.5  # Automatically generated make config: don't edit
    12.6 -# Linux kernel version: 2.6.18-xen
    12.7 -# Wed Jan 17 18:39:50 2007
    12.8 +# Linux kernel version: 2.6.18.8
    12.9 +# Mon Oct 15 14:37:47 2007
   12.10  #
   12.11  CONFIG_X86_32=y
   12.12 -CONFIG_GENERIC_TIME=y
   12.13  CONFIG_LOCKDEP_SUPPORT=y
   12.14  CONFIG_STACKTRACE_SUPPORT=y
   12.15  CONFIG_SEMAPHORE_SLEEPERS=y
   12.16 @@ -147,7 +146,6 @@ CONFIG_X86_CMPXCHG64=y
   12.17  CONFIG_X86_GOOD_APIC=y
   12.18  CONFIG_X86_INTEL_USERCOPY=y
   12.19  CONFIG_X86_USE_PPRO_CHECKSUM=y
   12.20 -CONFIG_X86_TSC=y
   12.21  CONFIG_NR_CPUS=32
   12.22  # CONFIG_PREEMPT_NONE is not set
   12.23  CONFIG_PREEMPT_VOLUNTARY=y
   12.24 @@ -182,7 +180,7 @@ CONFIG_FLATMEM_MANUAL=y
   12.25  CONFIG_FLATMEM=y
   12.26  CONFIG_FLAT_NODE_MEM_MAP=y
   12.27  # CONFIG_SPARSEMEM_STATIC is not set
   12.28 -CONFIG_SPLIT_PTLOCK_CPUS=4096
   12.29 +CONFIG_SPLIT_PTLOCK_CPUS=4
   12.30  CONFIG_RESOURCES_64BIT=y
   12.31  # CONFIG_HIGHPTE is not set
   12.32  CONFIG_MTRR=y
   12.33 @@ -204,6 +202,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
   12.34  CONFIG_PM=y
   12.35  # CONFIG_PM_LEGACY is not set
   12.36  CONFIG_PM_DEBUG=y
   12.37 +# CONFIG_PM_TRACE is not set
   12.38  # CONFIG_SOFTWARE_SUSPEND is not set
   12.39  CONFIG_SUSPEND_SMP=y
   12.40  
   12.41 @@ -234,6 +233,7 @@ CONFIG_ACPI_POWER=y
   12.42  CONFIG_ACPI_SYSTEM=y
   12.43  CONFIG_ACPI_CONTAINER=m
   12.44  CONFIG_ACPI_SBS=m
   12.45 +CONFIG_ACPI_PV_SLEEP=y
   12.46  
   12.47  #
   12.48  # CPU Frequency scaling
   12.49 @@ -257,7 +257,6 @@ CONFIG_XEN_PCIDEV_FRONTEND=y
   12.50  # CONFIG_PCI_DEBUG is not set
   12.51  CONFIG_ISA_DMA_API=y
   12.52  CONFIG_SCx200=m
   12.53 -CONFIG_SCx200HR_TIMER=m
   12.54  CONFIG_K8_NB=y
   12.55  
   12.56  #
   12.57 @@ -804,7 +803,7 @@ CONFIG_STANDALONE=y
   12.58  CONFIG_PREVENT_FIRMWARE_BUILD=y
   12.59  CONFIG_FW_LOADER=m
   12.60  # CONFIG_DEBUG_DRIVER is not set
   12.61 -# CONFIG_SYS_HYPERVISOR is not set
   12.62 +CONFIG_SYS_HYPERVISOR=y
   12.63  
   12.64  #
   12.65  # Connector - unified userspace <-> kernelspace linker
   12.66 @@ -1277,7 +1276,6 @@ CONFIG_IEEE1394_RAWIO=m
   12.67  CONFIG_I2O=m
   12.68  CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
   12.69  CONFIG_I2O_EXT_ADAPTEC=y
   12.70 -CONFIG_I2O_EXT_ADAPTEC_DMA64=y
   12.71  CONFIG_I2O_CONFIG=m
   12.72  CONFIG_I2O_CONFIG_OLD_IOCTL=y
   12.73  CONFIG_I2O_BUS=m
   12.74 @@ -3251,7 +3249,7 @@ CONFIG_CRYPTO_TEST=m
   12.75  #
   12.76  # CONFIG_CRYPTO_DEV_PADLOCK is not set
   12.77  CONFIG_XEN=y
   12.78 -CONFIG_XEN_INTERFACE_VERSION=0x00030205
   12.79 +CONFIG_XEN_INTERFACE_VERSION=0x00030206
   12.80  
   12.81  #
   12.82  # XEN
   12.83 @@ -3270,6 +3268,7 @@ CONFIG_XEN_PCIDEV_BACKEND=m
   12.84  CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
   12.85  # CONFIG_XEN_PCIDEV_BACKEND_PASS is not set
   12.86  # CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
   12.87 +# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set
   12.88  # CONFIG_XEN_PCIDEV_BE_DEBUG is not set
   12.89  CONFIG_XEN_TPMDEV_BACKEND=m
   12.90  CONFIG_XEN_BLKDEV_FRONTEND=y
   12.91 @@ -3282,15 +3281,12 @@ CONFIG_XEN_SYSFS=y
   12.92  CONFIG_XEN_COMPAT_030002_AND_LATER=y
   12.93  # CONFIG_XEN_COMPAT_030004_AND_LATER is not set
   12.94  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
   12.95 -CONFIG_XEN_COMPAT_030002=y
   12.96 -CONFIG_XEN_COMPAT_030004=y
   12.97 +CONFIG_XEN_COMPAT=0x030002
   12.98  CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
   12.99  CONFIG_NO_IDLE_HZ=y
  12.100 -CONFIG_XEN_UTIL=y
  12.101 +CONFIG_XEN_SMPBOOT=y
  12.102  CONFIG_XEN_BALLOON=y
  12.103  CONFIG_XEN_DEVMEM=y
  12.104 -CONFIG_XEN_REBOOT=y
  12.105 -CONFIG_XEN_SMPBOOT=y
  12.106  
  12.107  #
  12.108  # Library routines
    13.1 --- a/buildconfigs/linux-defconfig_xen_x86_64	Wed Oct 17 10:27:10 2007 -0600
    13.2 +++ b/buildconfigs/linux-defconfig_xen_x86_64	Sun Oct 21 12:10:59 2007 -0600
    13.3 @@ -1,7 +1,7 @@
    13.4  #
    13.5  # Automatically generated make config: don't edit
    13.6 -# Linux kernel version: 2.6.18
    13.7 -# Wed Jun 27 12:49:06 2007
    13.8 +# Linux kernel version: 2.6.18.8
    13.9 +# Tue Oct 16 09:32:25 2007
   13.10  #
   13.11  CONFIG_X86_64=y
   13.12  CONFIG_64BIT=y
   13.13 @@ -136,7 +136,7 @@ CONFIG_FLATMEM_MANUAL=y
   13.14  CONFIG_FLATMEM=y
   13.15  CONFIG_FLAT_NODE_MEM_MAP=y
   13.16  # CONFIG_SPARSEMEM_STATIC is not set
   13.17 -CONFIG_SPLIT_PTLOCK_CPUS=4096
   13.18 +CONFIG_SPLIT_PTLOCK_CPUS=4
   13.19  CONFIG_RESOURCES_64BIT=y
   13.20  CONFIG_NR_CPUS=32
   13.21  CONFIG_HOTPLUG_CPU=y
   13.22 @@ -193,6 +193,7 @@ CONFIG_ACPI_POWER=y
   13.23  CONFIG_ACPI_SYSTEM=y
   13.24  CONFIG_ACPI_CONTAINER=m
   13.25  CONFIG_ACPI_SBS=m
   13.26 +CONFIG_ACPI_PV_SLEEP=y
   13.27  
   13.28  #
   13.29  # CPU Frequency scaling
   13.30 @@ -3079,7 +3080,7 @@ CONFIG_CRYPTO_TEST=m
   13.31  # Hardware crypto devices
   13.32  #
   13.33  CONFIG_XEN=y
   13.34 -CONFIG_XEN_INTERFACE_VERSION=0x00030205
   13.35 +CONFIG_XEN_INTERFACE_VERSION=0x00030206
   13.36  
   13.37  #
   13.38  # XEN
   13.39 @@ -3115,6 +3116,8 @@ CONFIG_XEN_COMPAT=0x030002
   13.40  CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
   13.41  CONFIG_NO_IDLE_HZ=y
   13.42  CONFIG_XEN_SMPBOOT=y
   13.43 +CONFIG_XEN_BALLOON=y
   13.44 +CONFIG_XEN_DEVMEM=y
   13.45  
   13.46  #
   13.47  # Library routines
    14.1 --- a/drivers/xen/Kconfig	Wed Oct 17 10:27:10 2007 -0600
    14.2 +++ b/drivers/xen/Kconfig	Sun Oct 21 12:10:59 2007 -0600
    14.3 @@ -13,7 +13,7 @@ config XEN
    14.4  if XEN
    14.5  config XEN_INTERFACE_VERSION
    14.6  	hex
    14.7 -	default 0x00030205
    14.8 +	default 0x00030206
    14.9  
   14.10  menu "XEN"
   14.11  
    15.1 --- a/drivers/xen/console/console.c	Wed Oct 17 10:27:10 2007 -0600
    15.2 +++ b/drivers/xen/console/console.c	Sun Oct 21 12:10:59 2007 -0600
    15.3 @@ -276,13 +276,23 @@ void xencons_force_flush(void)
    15.4  }
    15.5  
    15.6  
    15.7 -void dom0_init_screen_info(const struct dom0_vga_console_info *info)
    15.8 +void __init dom0_init_screen_info(const struct dom0_vga_console_info *info, size_t size)
    15.9  {
   15.10 +	/* This is drawn from a dump from vgacon:startup in
   15.11 +	 * standard Linux. */
   15.12 +	screen_info.orig_video_mode = 3;
   15.13 +	screen_info.orig_video_isVGA = 1;
   15.14 +	screen_info.orig_video_lines = 25;
   15.15 +	screen_info.orig_video_cols = 80;
   15.16 +	screen_info.orig_video_ega_bx = 3;
   15.17 +	screen_info.orig_video_points = 16;
   15.18 +	screen_info.orig_y = screen_info.orig_video_lines - 1;
   15.19 +
   15.20  	switch (info->video_type) {
   15.21  	case XEN_VGATYPE_TEXT_MODE_3:
   15.22 -		screen_info.orig_video_mode = 3;
   15.23 -		screen_info.orig_video_ega_bx = 3;
   15.24 -		screen_info.orig_video_isVGA = 1;
   15.25 +		if (size < offsetof(struct dom0_vga_console_info, u.text_mode_3)
   15.26 +		           + sizeof(info->u.text_mode_3))
   15.27 +			break;
   15.28  		screen_info.orig_video_lines = info->u.text_mode_3.rows;
   15.29  		screen_info.orig_video_cols = info->u.text_mode_3.columns;
   15.30  		screen_info.orig_x = info->u.text_mode_3.cursor_x;
   15.31 @@ -290,7 +300,11 @@ void dom0_init_screen_info(const struct 
   15.32  		screen_info.orig_video_points =
   15.33  			info->u.text_mode_3.font_height;
   15.34  		break;
   15.35 +
   15.36  	case XEN_VGATYPE_VESA_LFB:
   15.37 +		if (size < offsetof(struct dom0_vga_console_info,
   15.38 +		                    u.vesa_lfb.gbl_caps))
   15.39 +			break;
   15.40  		screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB;
   15.41  		screen_info.lfb_width = info->u.vesa_lfb.width;
   15.42  		screen_info.lfb_height = info->u.vesa_lfb.height;
   15.43 @@ -306,6 +320,14 @@ void dom0_init_screen_info(const struct 
   15.44  		screen_info.blue_pos = info->u.vesa_lfb.blue_pos;
   15.45  		screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size;
   15.46  		screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos;
   15.47 +		if (size >= offsetof(struct dom0_vga_console_info,
   15.48 +		                     u.vesa_lfb.gbl_caps)
   15.49 +		            + sizeof(info->u.vesa_lfb.gbl_caps))
   15.50 +			screen_info.capabilities = info->u.vesa_lfb.gbl_caps;
   15.51 +		if (size >= offsetof(struct dom0_vga_console_info,
   15.52 +		                     u.vesa_lfb.mode_attrs)
   15.53 +		            + sizeof(info->u.vesa_lfb.mode_attrs))
   15.54 +			screen_info.vesa_attributes = info->u.vesa_lfb.mode_attrs;
   15.55  		break;
   15.56  	}
   15.57  }
    16.1 --- a/fs/xfs/linux-2.6/xfs_buf.c	Wed Oct 17 10:27:10 2007 -0600
    16.2 +++ b/fs/xfs/linux-2.6/xfs_buf.c	Sun Oct 21 12:10:59 2007 -0600
    16.3 @@ -182,6 +182,19 @@ free_address(
    16.4  {
    16.5  	a_list_t	*aentry;
    16.6  
    16.7 +#ifdef CONFIG_XEN
    16.8 +	/*
    16.9 +	 * Xen needs to be able to make sure it can get an exclusive
   16.10 +	 * RO mapping of pages it wants to turn into a pagetable.  If
   16.11 +	 * a newly allocated page is also still being vmap()ed by xfs,
   16.12 +	 * it will cause pagetable construction to fail.  This is a
   16.13 +	 * quick workaround to always eagerly unmap pages so that Xen
   16.14 +	 * is happy.
   16.15 +	 */
   16.16 +	vunmap(addr);
   16.17 +	return;
   16.18 +#endif
   16.19 +
   16.20  	aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
   16.21  	if (likely(aentry)) {
   16.22  		spin_lock(&as_lock);
    17.1 --- a/include/asm-i386/mach-xen/asm/pgtable-2level.h	Wed Oct 17 10:27:10 2007 -0600
    17.2 +++ b/include/asm-i386/mach-xen/asm/pgtable-2level.h	Sun Oct 21 12:10:59 2007 -0600
    17.3 @@ -44,10 +44,9 @@ static inline pte_t ptep_get_and_clear(s
    17.4  {
    17.5  	pte_t pte = *ptep;
    17.6  	if (!pte_none(pte)) {
    17.7 -		if (mm != &init_mm)
    17.8 +		if ((mm != &init_mm) ||
    17.9 +		    HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
   17.10  			pte = __pte_ma(xchg(&ptep->pte_low, 0));
   17.11 -		else
   17.12 -			HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
   17.13  	}
   17.14  	return pte;
   17.15  }
    18.1 --- a/include/asm-i386/mach-xen/asm/pgtable-3level.h	Wed Oct 17 10:27:10 2007 -0600
    18.2 +++ b/include/asm-i386/mach-xen/asm/pgtable-3level.h	Sun Oct 21 12:10:59 2007 -0600
    18.3 @@ -128,7 +128,8 @@ static inline pte_t ptep_get_and_clear(s
    18.4  {
    18.5  	pte_t pte = *ptep;
    18.6  	if (!pte_none(pte)) {
    18.7 -		if (mm != &init_mm) {
    18.8 +		if ((mm != &init_mm) ||
    18.9 +		    HYPERVISOR_update_va_mapping(addr, __pte(0), 0)) {
   18.10  			uint64_t val = __pte_val(pte);
   18.11  			if (__cmpxchg64(ptep, val, 0) != val) {
   18.12  				/* xchg acts as a barrier before the setting of the high bits */
   18.13 @@ -136,8 +137,7 @@ static inline pte_t ptep_get_and_clear(s
   18.14  				pte.pte_high = ptep->pte_high;
   18.15  				ptep->pte_high = 0;
   18.16  			}
   18.17 -		} else
   18.18 -			HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
   18.19 +		}
   18.20  	}
   18.21  	return pte;
   18.22  }
    19.1 --- a/include/asm-ia64/hypercall.h	Wed Oct 17 10:27:10 2007 -0600
    19.2 +++ b/include/asm-ia64/hypercall.h	Sun Oct 21 12:10:59 2007 -0600
    19.3 @@ -157,9 +157,9 @@ xencomm_arch_hypercall_event_channel_op(
    19.4  }
    19.5  
    19.6  static inline int
    19.7 -xencomm_arch_hypercall_acm_op(struct xencomm_handle *arg)
    19.8 +xencomm_arch_hypercall_xsm_op(struct xencomm_handle *arg)
    19.9  {
   19.10 -	return _hypercall1(int, acm_op, arg);
   19.11 +	return _hypercall1(int, xsm_op, arg);
   19.12  }
   19.13  
   19.14  static inline int
    20.1 --- a/include/asm-x86_64/mach-xen/asm/pgtable.h	Wed Oct 17 10:27:10 2007 -0600
    20.2 +++ b/include/asm-x86_64/mach-xen/asm/pgtable.h	Sun Oct 21 12:10:59 2007 -0600
    20.3 @@ -285,10 +285,9 @@ static inline pte_t ptep_get_and_clear(s
    20.4  {
    20.5  	pte_t pte = *ptep;
    20.6  	if (!pte_none(pte)) {
    20.7 -		if (mm != &init_mm)
    20.8 +		if ((mm != &init_mm) ||
    20.9 +		    HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
   20.10  			pte = __pte_ma(xchg(&ptep->pte, 0));
   20.11 -		else
   20.12 -			HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
   20.13  	}
   20.14  	return pte;
   20.15  }
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/include/xen/interface/arch-x86/hvm/save.h	Sun Oct 21 12:10:59 2007 -0600
    21.3 @@ -0,0 +1,413 @@
    21.4 +/* 
    21.5 + * Structure definitions for HVM state that is held by Xen and must
    21.6 + * be saved along with the domain's memory and device-model state.
    21.7 + * 
    21.8 + * Copyright (c) 2007 XenSource Ltd.
    21.9 + *
   21.10 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   21.11 + * of this software and associated documentation files (the "Software"), to
   21.12 + * deal in the Software without restriction, including without limitation the
   21.13 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   21.14 + * sell copies of the Software, and to permit persons to whom the Software is
   21.15 + * furnished to do so, subject to the following conditions:
   21.16 + *
   21.17 + * The above copyright notice and this permission notice shall be included in
   21.18 + * all copies or substantial portions of the Software.
   21.19 + *
   21.20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   21.21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   21.22 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   21.23 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   21.24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   21.25 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   21.26 + * DEALINGS IN THE SOFTWARE.
   21.27 + */
   21.28 +
   21.29 +#ifndef __XEN_PUBLIC_HVM_SAVE_X86_H__
   21.30 +#define __XEN_PUBLIC_HVM_SAVE_X86_H__
   21.31 +
   21.32 +/* 
   21.33 + * Save/restore header: general info about the save file. 
   21.34 + */
   21.35 +
   21.36 +#define HVM_FILE_MAGIC   0x54381286
   21.37 +#define HVM_FILE_VERSION 0x00000001
   21.38 +
   21.39 +struct hvm_save_header {
   21.40 +    uint32_t magic;             /* Must be HVM_FILE_MAGIC */
   21.41 +    uint32_t version;           /* File format version */
   21.42 +    uint64_t changeset;         /* Version of Xen that saved this file */
   21.43 +    uint32_t cpuid;             /* CPUID[0x01][%eax] on the saving machine */
   21.44 +    uint32_t pad0;
   21.45 +};
   21.46 +
   21.47 +DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
   21.48 +
   21.49 +
   21.50 +/*
   21.51 + * Processor
   21.52 + */
   21.53 +
   21.54 +struct hvm_hw_cpu {
   21.55 +    uint8_t  fpu_regs[512];
   21.56 +
   21.57 +    uint64_t rax;
   21.58 +    uint64_t rbx;
   21.59 +    uint64_t rcx;
   21.60 +    uint64_t rdx;
   21.61 +    uint64_t rbp;
   21.62 +    uint64_t rsi;
   21.63 +    uint64_t rdi;
   21.64 +    uint64_t rsp;
   21.65 +    uint64_t r8;
   21.66 +    uint64_t r9;
   21.67 +    uint64_t r10;
   21.68 +    uint64_t r11;
   21.69 +    uint64_t r12;
   21.70 +    uint64_t r13;
   21.71 +    uint64_t r14;
   21.72 +    uint64_t r15;
   21.73 +
   21.74 +    uint64_t rip;
   21.75 +    uint64_t rflags;
   21.76 +
   21.77 +    uint64_t cr0;
   21.78 +    uint64_t cr2;
   21.79 +    uint64_t cr3;
   21.80 +    uint64_t cr4;
   21.81 +
   21.82 +    uint64_t dr0;
   21.83 +    uint64_t dr1;
   21.84 +    uint64_t dr2;
   21.85 +    uint64_t dr3;
   21.86 +    uint64_t dr6;
   21.87 +    uint64_t dr7;    
   21.88 +
   21.89 +    uint32_t cs_sel;
   21.90 +    uint32_t ds_sel;
   21.91 +    uint32_t es_sel;
   21.92 +    uint32_t fs_sel;
   21.93 +    uint32_t gs_sel;
   21.94 +    uint32_t ss_sel;
   21.95 +    uint32_t tr_sel;
   21.96 +    uint32_t ldtr_sel;
   21.97 +
   21.98 +    uint32_t cs_limit;
   21.99 +    uint32_t ds_limit;
  21.100 +    uint32_t es_limit;
  21.101 +    uint32_t fs_limit;
  21.102 +    uint32_t gs_limit;
  21.103 +    uint32_t ss_limit;
  21.104 +    uint32_t tr_limit;
  21.105 +    uint32_t ldtr_limit;
  21.106 +    uint32_t idtr_limit;
  21.107 +    uint32_t gdtr_limit;
  21.108 +
  21.109 +    uint64_t cs_base;
  21.110 +    uint64_t ds_base;
  21.111 +    uint64_t es_base;
  21.112 +    uint64_t fs_base;
  21.113 +    uint64_t gs_base;
  21.114 +    uint64_t ss_base;
  21.115 +    uint64_t tr_base;
  21.116 +    uint64_t ldtr_base;
  21.117 +    uint64_t idtr_base;
  21.118 +    uint64_t gdtr_base;
  21.119 +
  21.120 +    uint32_t cs_arbytes;
  21.121 +    uint32_t ds_arbytes;
  21.122 +    uint32_t es_arbytes;
  21.123 +    uint32_t fs_arbytes;
  21.124 +    uint32_t gs_arbytes;
  21.125 +    uint32_t ss_arbytes;
  21.126 +    uint32_t tr_arbytes;
  21.127 +    uint32_t ldtr_arbytes;
  21.128 +
  21.129 +    uint32_t sysenter_cs;
  21.130 +    uint32_t padding0;
  21.131 +
  21.132 +    uint64_t sysenter_esp;
  21.133 +    uint64_t sysenter_eip;
  21.134 +
  21.135 +    /* msr for em64t */
  21.136 +    uint64_t shadow_gs;
  21.137 +
  21.138 +    /* msr content saved/restored. */
  21.139 +    uint64_t msr_flags;
  21.140 +    uint64_t msr_lstar;
  21.141 +    uint64_t msr_star;
  21.142 +    uint64_t msr_cstar;
  21.143 +    uint64_t msr_syscall_mask;
  21.144 +    uint64_t msr_efer;
  21.145 +
  21.146 +    /* guest's idea of what rdtsc() would return */
  21.147 +    uint64_t tsc;
  21.148 +
  21.149 +    /* pending event, if any */
  21.150 +    union {
  21.151 +        uint32_t pending_event;
  21.152 +        struct {
  21.153 +            uint8_t  pending_vector:8;
  21.154 +            uint8_t  pending_type:3;
  21.155 +            uint8_t  pending_error_valid:1;
  21.156 +            uint32_t pending_reserved:19;
  21.157 +            uint8_t  pending_valid:1;
  21.158 +        };
  21.159 +    };
  21.160 +    /* error code for pending event */
  21.161 +    uint32_t error_code;
  21.162 +};
  21.163 +
  21.164 +DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_cpu);
  21.165 +
  21.166 +
  21.167 +/*
  21.168 + * PIC
  21.169 + */
  21.170 +
  21.171 +struct hvm_hw_vpic {
  21.172 +    /* IR line bitmasks. */
  21.173 +    uint8_t irr;
  21.174 +    uint8_t imr;
  21.175 +    uint8_t isr;
  21.176 +
  21.177 +    /* Line IRx maps to IRQ irq_base+x */
  21.178 +    uint8_t irq_base;
  21.179 +
  21.180 +    /*
  21.181 +     * Where are we in ICW2-4 initialisation (0 means no init in progress)?
  21.182 +     * Bits 0-1 (=x): Next write at A=1 sets ICW(x+1).
  21.183 +     * Bit 2: ICW1.IC4  (1 == ICW4 included in init sequence)
  21.184 +     * Bit 3: ICW1.SNGL (0 == ICW3 included in init sequence)
  21.185 +     */
  21.186 +    uint8_t init_state:4;
  21.187 +
  21.188 +    /* IR line with highest priority. */
  21.189 +    uint8_t priority_add:4;
  21.190 +
  21.191 +    /* Reads from A=0 obtain ISR or IRR? */
  21.192 +    uint8_t readsel_isr:1;
  21.193 +
  21.194 +    /* Reads perform a polling read? */
  21.195 +    uint8_t poll:1;
  21.196 +
  21.197 +    /* Automatically clear IRQs from the ISR during INTA? */
  21.198 +    uint8_t auto_eoi:1;
  21.199 +
  21.200 +    /* Automatically rotate IRQ priorities during AEOI? */
  21.201 +    uint8_t rotate_on_auto_eoi:1;
  21.202 +
  21.203 +    /* Exclude slave inputs when considering in-service IRQs? */
  21.204 +    uint8_t special_fully_nested_mode:1;
  21.205 +
  21.206 +    /* Special mask mode excludes masked IRs from AEOI and priority checks. */
  21.207 +    uint8_t special_mask_mode:1;
  21.208 +
  21.209 +    /* Is this a master PIC or slave PIC? (NB. This is not programmable.) */
  21.210 +    uint8_t is_master:1;
  21.211 +
  21.212 +    /* Edge/trigger selection. */
  21.213 +    uint8_t elcr;
  21.214 +
  21.215 +    /* Virtual INT output. */
  21.216 +    uint8_t int_output;
  21.217 +};
  21.218 +
  21.219 +DECLARE_HVM_SAVE_TYPE(PIC, 3, struct hvm_hw_vpic);
  21.220 +
  21.221 +
  21.222 +/*
  21.223 + * IO-APIC
  21.224 + */
  21.225 +
  21.226 +#ifdef __ia64__
  21.227 +#define VIOAPIC_IS_IOSAPIC 1
  21.228 +#define VIOAPIC_NUM_PINS  24
  21.229 +#else
  21.230 +#define VIOAPIC_NUM_PINS  48 /* 16 ISA IRQs, 32 non-legacy PCI IRQS. */
  21.231 +#endif
  21.232 +
  21.233 +struct hvm_hw_vioapic {
  21.234 +    uint64_t base_address;
  21.235 +    uint32_t ioregsel;
  21.236 +    uint32_t id;
  21.237 +    union vioapic_redir_entry
  21.238 +    {
  21.239 +        uint64_t bits;
  21.240 +        struct {
  21.241 +            uint8_t vector;
  21.242 +            uint8_t delivery_mode:3;
  21.243 +            uint8_t dest_mode:1;
  21.244 +            uint8_t delivery_status:1;
  21.245 +            uint8_t polarity:1;
  21.246 +            uint8_t remote_irr:1;
  21.247 +            uint8_t trig_mode:1;
  21.248 +            uint8_t mask:1;
  21.249 +            uint8_t reserve:7;
  21.250 +#if !VIOAPIC_IS_IOSAPIC
  21.251 +            uint8_t reserved[4];
  21.252 +            uint8_t dest_id;
  21.253 +#else
  21.254 +            uint8_t reserved[3];
  21.255 +            uint16_t dest_id;
  21.256 +#endif
  21.257 +        } fields;
  21.258 +    } redirtbl[VIOAPIC_NUM_PINS];
  21.259 +};
  21.260 +
  21.261 +DECLARE_HVM_SAVE_TYPE(IOAPIC, 4, struct hvm_hw_vioapic);
  21.262 +
  21.263 +
  21.264 +/*
  21.265 + * LAPIC
  21.266 + */
  21.267 +
  21.268 +struct hvm_hw_lapic {
  21.269 +    uint64_t             apic_base_msr;
  21.270 +    uint32_t             disabled; /* VLAPIC_xx_DISABLED */
  21.271 +    uint32_t             timer_divisor;
  21.272 +};
  21.273 +
  21.274 +DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic);
  21.275 +
  21.276 +struct hvm_hw_lapic_regs {
  21.277 +    /* A 4k page of register state */
  21.278 +    uint8_t  data[0x400];
  21.279 +};
  21.280 +
  21.281 +DECLARE_HVM_SAVE_TYPE(LAPIC_REGS, 6, struct hvm_hw_lapic_regs);
  21.282 +
  21.283 +
  21.284 +/*
  21.285 + * IRQs
  21.286 + */
  21.287 +
  21.288 +struct hvm_hw_pci_irqs {
  21.289 +    /*
  21.290 +     * Virtual interrupt wires for a single PCI bus.
  21.291 +     * Indexed by: device*4 + INTx#.
  21.292 +     */
  21.293 +    union {
  21.294 +        DECLARE_BITMAP(i, 32*4);
  21.295 +        uint64_t pad[2];
  21.296 +    };
  21.297 +};
  21.298 +
  21.299 +DECLARE_HVM_SAVE_TYPE(PCI_IRQ, 7, struct hvm_hw_pci_irqs);
  21.300 +
  21.301 +struct hvm_hw_isa_irqs {
  21.302 +    /*
  21.303 +     * Virtual interrupt wires for ISA devices.
  21.304 +     * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
  21.305 +     */
  21.306 +    union {
  21.307 +        DECLARE_BITMAP(i, 16);
  21.308 +        uint64_t pad[1];
  21.309 +    };
  21.310 +};
  21.311 +
  21.312 +DECLARE_HVM_SAVE_TYPE(ISA_IRQ, 8, struct hvm_hw_isa_irqs);
  21.313 +
  21.314 +struct hvm_hw_pci_link {
  21.315 +    /*
  21.316 +     * PCI-ISA interrupt router.
  21.317 +     * Each PCI <device:INTx#> is 'wire-ORed' into one of four links using
  21.318 +     * the traditional 'barber's pole' mapping ((device + INTx#) & 3).
  21.319 +     * The router provides a programmable mapping from each link to a GSI.
  21.320 +     */
  21.321 +    uint8_t route[4];
  21.322 +    uint8_t pad0[4];
  21.323 +};
  21.324 +
  21.325 +DECLARE_HVM_SAVE_TYPE(PCI_LINK, 9, struct hvm_hw_pci_link);
  21.326 +
  21.327 +/* 
  21.328 + *  PIT
  21.329 + */
  21.330 +
  21.331 +struct hvm_hw_pit {
  21.332 +    struct hvm_hw_pit_channel {
  21.333 +        uint32_t count; /* can be 65536 */
  21.334 +        uint16_t latched_count;
  21.335 +        uint8_t count_latched;
  21.336 +        uint8_t status_latched;
  21.337 +        uint8_t status;
  21.338 +        uint8_t read_state;
  21.339 +        uint8_t write_state;
  21.340 +        uint8_t write_latch;
  21.341 +        uint8_t rw_mode;
  21.342 +        uint8_t mode;
  21.343 +        uint8_t bcd; /* not supported */
  21.344 +        uint8_t gate; /* timer start */
  21.345 +    } channels[3];  /* 3 x 16 bytes */
  21.346 +    uint32_t speaker_data_on;
  21.347 +    uint32_t pad0;
  21.348 +};
  21.349 +
  21.350 +DECLARE_HVM_SAVE_TYPE(PIT, 10, struct hvm_hw_pit);
  21.351 +
  21.352 +
  21.353 +/* 
  21.354 + * RTC
  21.355 + */ 
  21.356 +
  21.357 +#define RTC_CMOS_SIZE 14
  21.358 +struct hvm_hw_rtc {
  21.359 +    /* CMOS bytes */
  21.360 +    uint8_t cmos_data[RTC_CMOS_SIZE];
  21.361 +    /* Index register for 2-part operations */
  21.362 +    uint8_t cmos_index;
  21.363 +    uint8_t pad0;
  21.364 +};
  21.365 +
  21.366 +DECLARE_HVM_SAVE_TYPE(RTC, 11, struct hvm_hw_rtc);
  21.367 +
  21.368 +
  21.369 +/*
  21.370 + * HPET
  21.371 + */
  21.372 +
  21.373 +#define HPET_TIMER_NUM     3    /* 3 timers supported now */
  21.374 +struct hvm_hw_hpet {
  21.375 +    /* Memory-mapped, software visible registers */
  21.376 +    uint64_t capability;        /* capabilities */
  21.377 +    uint64_t res0;              /* reserved */
  21.378 +    uint64_t config;            /* configuration */
  21.379 +    uint64_t res1;              /* reserved */
  21.380 +    uint64_t isr;               /* interrupt status reg */
  21.381 +    uint64_t res2[25];          /* reserved */
  21.382 +    uint64_t mc64;              /* main counter */
  21.383 +    uint64_t res3;              /* reserved */
  21.384 +    struct {                    /* timers */
  21.385 +        uint64_t config;        /* configuration/cap */
  21.386 +        uint64_t cmp;           /* comparator */
  21.387 +        uint64_t fsb;           /* FSB route, not supported now */
  21.388 +        uint64_t res4;          /* reserved */
  21.389 +    } timers[HPET_TIMER_NUM];
  21.390 +    uint64_t res5[4*(24-HPET_TIMER_NUM)];  /* reserved, up to 0x3ff */
  21.391 +
  21.392 +    /* Hidden register state */
  21.393 +    uint64_t period[HPET_TIMER_NUM]; /* Last value written to comparator */
  21.394 +};
  21.395 +
  21.396 +DECLARE_HVM_SAVE_TYPE(HPET, 12, struct hvm_hw_hpet);
  21.397 +
  21.398 +
  21.399 +/*
  21.400 + * PM timer
  21.401 + */
  21.402 +
  21.403 +struct hvm_hw_pmtimer {
  21.404 +    uint32_t tmr_val;   /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
  21.405 +    uint16_t pm1a_sts;  /* PM1a_EVT_BLK.PM1a_STS: status register */
  21.406 +    uint16_t pm1a_en;   /* PM1a_EVT_BLK.PM1a_EN: enable register */
  21.407 +};
  21.408 +
  21.409 +DECLARE_HVM_SAVE_TYPE(PMTIMER, 13, struct hvm_hw_pmtimer);
  21.410 +
  21.411 +/* 
  21.412 + * Largest type-code in use
  21.413 + */
  21.414 +#define HVM_SAVE_CODE_MAX 13
  21.415 +
  21.416 +#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
    22.1 --- a/include/xen/interface/arch-x86/xen-x86_32.h	Wed Oct 17 10:27:10 2007 -0600
    22.2 +++ b/include/xen/interface/arch-x86/xen-x86_32.h	Sun Oct 21 12:10:59 2007 -0600
    22.3 @@ -64,18 +64,34 @@
    22.4  #define FLAT_USER_DS    FLAT_RING3_DS
    22.5  #define FLAT_USER_SS    FLAT_RING3_SS
    22.6  
    22.7 -/*
    22.8 - * Virtual addresses beyond this are not modifiable by guest OSes. The 
    22.9 - * machine->physical mapping table starts at this address, read-only.
   22.10 - */
   22.11 +#define __HYPERVISOR_VIRT_START_PAE    0xF5800000
   22.12 +#define __MACH2PHYS_VIRT_START_PAE     0xF5800000
   22.13 +#define __MACH2PHYS_VIRT_END_PAE       0xF6800000
   22.14 +#define HYPERVISOR_VIRT_START_PAE      \
   22.15 +    mk_unsigned_long(__HYPERVISOR_VIRT_START_PAE)
   22.16 +#define MACH2PHYS_VIRT_START_PAE       \
   22.17 +    mk_unsigned_long(__MACH2PHYS_VIRT_START_PAE)
   22.18 +#define MACH2PHYS_VIRT_END_PAE         \
   22.19 +    mk_unsigned_long(__MACH2PHYS_VIRT_END_PAE)
   22.20 +
   22.21 +#define __HYPERVISOR_VIRT_START_NONPAE 0xFC000000
   22.22 +#define __MACH2PHYS_VIRT_START_NONPAE  0xFC000000
   22.23 +#define __MACH2PHYS_VIRT_END_NONPAE    0xFC400000
   22.24 +#define HYPERVISOR_VIRT_START_NONPAE   \
   22.25 +    mk_unsigned_long(__HYPERVISOR_VIRT_START_NONPAE)
   22.26 +#define MACH2PHYS_VIRT_START_NONPAE    \
   22.27 +    mk_unsigned_long(__MACH2PHYS_VIRT_START_NONPAE)
   22.28 +#define MACH2PHYS_VIRT_END_NONPAE      \
   22.29 +    mk_unsigned_long(__MACH2PHYS_VIRT_END_NONPAE)
   22.30 +
   22.31  #ifdef CONFIG_X86_PAE
   22.32 -#define __HYPERVISOR_VIRT_START 0xF5800000
   22.33 -#define __MACH2PHYS_VIRT_START  0xF5800000
   22.34 -#define __MACH2PHYS_VIRT_END    0xF6800000
   22.35 +#define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_PAE
   22.36 +#define __MACH2PHYS_VIRT_START  __MACH2PHYS_VIRT_START_PAE
   22.37 +#define __MACH2PHYS_VIRT_END    __MACH2PHYS_VIRT_END_PAE
   22.38  #else
   22.39 -#define __HYPERVISOR_VIRT_START 0xFC000000
   22.40 -#define __MACH2PHYS_VIRT_START  0xFC000000
   22.41 -#define __MACH2PHYS_VIRT_END    0xFC400000
   22.42 +#define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_NONPAE
   22.43 +#define __MACH2PHYS_VIRT_START  __MACH2PHYS_VIRT_START_NONPAE
   22.44 +#define __MACH2PHYS_VIRT_END    __MACH2PHYS_VIRT_END_NONPAE
   22.45  #endif
   22.46  
   22.47  #ifndef HYPERVISOR_VIRT_START
   22.48 @@ -103,7 +119,8 @@
   22.49           (hnd).p = val;                                     \
   22.50      } while ( 0 )
   22.51  #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
   22.52 -#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
   22.53 +#define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
   22.54 +#define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
   22.55  #endif
   22.56  
   22.57  #ifndef __ASSEMBLY__
    23.1 --- a/include/xen/interface/arch-x86/xen.h	Wed Oct 17 10:27:10 2007 -0600
    23.2 +++ b/include/xen/interface/arch-x86/xen.h	Sun Oct 21 12:10:59 2007 -0600
    23.3 @@ -37,7 +37,8 @@
    23.4  #endif
    23.5  
    23.6  #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
    23.7 -#define XEN_GUEST_HANDLE(name)          __guest_handle_ ## name
    23.8 +#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
    23.9 +#define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
   23.10  #define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
   23.11  #ifdef __XEN_TOOLS__
   23.12  #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    24.1 --- a/include/xen/interface/domctl.h	Wed Oct 17 10:27:10 2007 -0600
    24.2 +++ b/include/xen/interface/domctl.h	Sun Oct 21 12:10:59 2007 -0600
    24.3 @@ -85,6 +85,9 @@ struct xen_domctl_getdomaininfo {
    24.4   /* Domain is currently running.            */
    24.5  #define _XEN_DOMINF_running   5
    24.6  #define XEN_DOMINF_running    (1U<<_XEN_DOMINF_running)
    24.7 + /* Being debugged.  */
    24.8 +#define _XEN_DOMINF_debugged  6
    24.9 +#define XEN_DOMINF_debugged   (1U<<_XEN_DOMINF_debugged)
   24.10   /* CPU to which this domain is bound.      */
   24.11  #define XEN_DOMINF_cpumask      255
   24.12  #define XEN_DOMINF_cpushift       8
   24.13 @@ -377,6 +380,7 @@ typedef struct xen_domctl_arch_setup {
   24.14      uint64_aligned_t maxmem; /* Highest memory address for MDT.  */
   24.15      uint64_aligned_t xsi_va; /* Xen shared_info area virtual address.  */
   24.16      uint32_t hypercall_imm;  /* Break imm for Xen hypercalls.  */
   24.17 +    int8_t vhpt_size_log2;   /* Log2 of VHPT size. */
   24.18  #endif
   24.19  } xen_domctl_arch_setup_t;
   24.20  DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
   24.21 @@ -429,7 +433,69 @@ struct xen_domctl_sendtrigger {
   24.22  typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t;
   24.23  DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
   24.24  
   24.25 - 
   24.26 +
   24.27 +/* Assign PCI device to HVM guest. Sets up IOMMU structures. */
   24.28 +#define XEN_DOMCTL_assign_device     37
   24.29 +#define DPCI_ADD_MAPPING         1
   24.30 +#define DPCI_REMOVE_MAPPING      0 
   24.31 +struct xen_domctl_assign_device {
   24.32 +    uint32_t  machine_bdf;   /* machine PCI ID of assigned device */
   24.33 +};
   24.34 +typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
   24.35 +DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
   24.36 +
   24.37 +
   24.38 +/* Pass-through interrupts: bind real irq -> hvm devfn. */
   24.39 +#define XEN_DOMCTL_bind_pt_irq       38
   24.40 +typedef enum pt_irq_type_e {
   24.41 +    PT_IRQ_TYPE_PCI,
   24.42 +    PT_IRQ_TYPE_ISA
   24.43 +} pt_irq_type_t;
   24.44 +struct xen_domctl_bind_pt_irq {
   24.45 +    uint32_t machine_irq;
   24.46 +    pt_irq_type_t irq_type;
   24.47 +    uint32_t hvm_domid;
   24.48 +
   24.49 +    union {
   24.50 +        struct {
   24.51 +            uint8_t isa_irq;
   24.52 +        } isa;
   24.53 +        struct {
   24.54 +            uint8_t bus;
   24.55 +            uint8_t device;
   24.56 +            uint8_t intx;
   24.57 +        } pci;
   24.58 +    } u;
   24.59 +};
   24.60 +typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
   24.61 +DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t);
   24.62 +
   24.63 +
   24.64 +/* Bind machine I/O address range -> HVM address range. */
   24.65 +#define XEN_DOMCTL_memory_mapping    39
   24.66 +struct xen_domctl_memory_mapping {
   24.67 +    uint64_t first_gfn;       /* first page (hvm guest phys page) in range */
   24.68 +    uint64_t first_mfn;       /* first page (machine page) in range */
   24.69 +    uint64_t nr_mfns;         /* number of pages in range (>0) */
   24.70 +    uint32_t add_mapping;     /* add or remove mapping */
   24.71 +    uint32_t padding;         /* padding for 64-bit aligned structure */
   24.72 +};
   24.73 +typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t;
   24.74 +DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t);
   24.75 +
   24.76 +
   24.77 +/* Bind machine I/O port range -> HVM I/O port range. */
   24.78 +#define XEN_DOMCTL_ioport_mapping    40
   24.79 +struct xen_domctl_ioport_mapping {
   24.80 +    uint32_t first_gport;     /* first guest IO port*/
   24.81 +    uint32_t first_mport;     /* first machine IO port */
   24.82 +    uint32_t nr_ports;        /* size of port range */
   24.83 +    uint32_t add_mapping;     /* add or remove mapping */
   24.84 +};
   24.85 +typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t;
   24.86 +DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t);
   24.87 +
   24.88 +
   24.89  struct xen_domctl {
   24.90      uint32_t cmd;
   24.91      uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
   24.92 @@ -459,6 +525,10 @@ struct xen_domctl {
   24.93          struct xen_domctl_hvmcontext        hvmcontext;
   24.94          struct xen_domctl_address_size      address_size;
   24.95          struct xen_domctl_sendtrigger       sendtrigger;
   24.96 +        struct xen_domctl_assign_device     assign_device;
   24.97 +        struct xen_domctl_bind_pt_irq       bind_pt_irq;
   24.98 +        struct xen_domctl_memory_mapping    memory_mapping;
   24.99 +        struct xen_domctl_ioport_mapping    ioport_mapping;
  24.100          uint8_t                             pad[128];
  24.101      } u;
  24.102  };
    25.1 --- a/include/xen/interface/hvm/hvm_op.h	Wed Oct 17 10:27:10 2007 -0600
    25.2 +++ b/include/xen/interface/hvm/hvm_op.h	Sun Oct 21 12:10:59 2007 -0600
    25.3 @@ -70,4 +70,7 @@ struct xen_hvm_set_pci_link_route {
    25.4  typedef struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t;
    25.5  DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t);
    25.6  
    25.7 +/* Flushes all VCPU TLBs: @arg must be NULL. */
    25.8 +#define HVMOP_flush_tlbs          5
    25.9 +
   25.10  #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
    26.1 --- a/include/xen/interface/hvm/params.h	Wed Oct 17 10:27:10 2007 -0600
    26.2 +++ b/include/xen/interface/hvm/params.h	Sun Oct 21 12:10:59 2007 -0600
    26.3 @@ -52,7 +52,8 @@
    26.4  
    26.5  #ifdef __ia64__
    26.6  #define HVM_PARAM_NVRAM_FD     7
    26.7 -#define HVM_NR_PARAMS          8
    26.8 +#define HVM_PARAM_VHPT_SIZE    8
    26.9 +#define HVM_NR_PARAMS          9
   26.10  #else
   26.11  #define HVM_NR_PARAMS          7
   26.12  #endif
    27.1 --- a/include/xen/interface/hvm/save.h	Wed Oct 17 10:27:10 2007 -0600
    27.2 +++ b/include/xen/interface/hvm/save.h	Sun Oct 21 12:10:59 2007 -0600
    27.3 @@ -3,7 +3,6 @@
    27.4   *
    27.5   * Structure definitions for HVM state that is held by Xen and must
    27.6   * be saved along with the domain's memory and device-model state.
    27.7 - *
    27.8   * 
    27.9   * Copyright (c) 2007 XenSource Ltd.
   27.10   *
   27.11 @@ -67,391 +66,6 @@ struct hvm_save_descriptor {
   27.12  
   27.13  
   27.14  /* 
   27.15 - * Save/restore header: general info about the save file. 
   27.16 - */
   27.17 -
   27.18 -#define HVM_FILE_MAGIC   0x54381286
   27.19 -#define HVM_FILE_VERSION 0x00000001
   27.20 -
   27.21 -struct hvm_save_header {
   27.22 -    uint32_t magic;             /* Must be HVM_FILE_MAGIC */
   27.23 -    uint32_t version;           /* File format version */
   27.24 -    uint64_t changeset;         /* Version of Xen that saved this file */
   27.25 -    uint32_t cpuid;             /* CPUID[0x01][%eax] on the saving machine */
   27.26 -    uint32_t pad0;
   27.27 -};
   27.28 -
   27.29 -DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
   27.30 -
   27.31 -
   27.32 -/*
   27.33 - * Processor
   27.34 - */
   27.35 -
   27.36 -struct hvm_hw_cpu {
   27.37 -    uint8_t  fpu_regs[512];
   27.38 -
   27.39 -    uint64_t rax;
   27.40 -    uint64_t rbx;
   27.41 -    uint64_t rcx;
   27.42 -    uint64_t rdx;
   27.43 -    uint64_t rbp;
   27.44 -    uint64_t rsi;
   27.45 -    uint64_t rdi;
   27.46 -    uint64_t rsp;
   27.47 -    uint64_t r8;
   27.48 -    uint64_t r9;
   27.49 -    uint64_t r10;
   27.50 -    uint64_t r11;
   27.51 -    uint64_t r12;
   27.52 -    uint64_t r13;
   27.53 -    uint64_t r14;
   27.54 -    uint64_t r15;
   27.55 -
   27.56 -    uint64_t rip;
   27.57 -    uint64_t rflags;
   27.58 -
   27.59 -    uint64_t cr0;
   27.60 -    uint64_t cr2;
   27.61 -    uint64_t cr3;
   27.62 -    uint64_t cr4;
   27.63 -
   27.64 -    uint64_t dr0;
   27.65 -    uint64_t dr1;
   27.66 -    uint64_t dr2;
   27.67 -    uint64_t dr3;
   27.68 -    uint64_t dr6;
   27.69 -    uint64_t dr7;    
   27.70 -
   27.71 -    uint32_t cs_sel;
   27.72 -    uint32_t ds_sel;
   27.73 -    uint32_t es_sel;
   27.74 -    uint32_t fs_sel;
   27.75 -    uint32_t gs_sel;
   27.76 -    uint32_t ss_sel;
   27.77 -    uint32_t tr_sel;
   27.78 -    uint32_t ldtr_sel;
   27.79 -
   27.80 -    uint32_t cs_limit;
   27.81 -    uint32_t ds_limit;
   27.82 -    uint32_t es_limit;
   27.83 -    uint32_t fs_limit;
   27.84 -    uint32_t gs_limit;
   27.85 -    uint32_t ss_limit;
   27.86 -    uint32_t tr_limit;
   27.87 -    uint32_t ldtr_limit;
   27.88 -    uint32_t idtr_limit;
   27.89 -    uint32_t gdtr_limit;
   27.90 -
   27.91 -    uint64_t cs_base;
   27.92 -    uint64_t ds_base;
   27.93 -    uint64_t es_base;
   27.94 -    uint64_t fs_base;
   27.95 -    uint64_t gs_base;
   27.96 -    uint64_t ss_base;
   27.97 -    uint64_t tr_base;
   27.98 -    uint64_t ldtr_base;
   27.99 -    uint64_t idtr_base;
  27.100 -    uint64_t gdtr_base;
  27.101 -
  27.102 -    uint32_t cs_arbytes;
  27.103 -    uint32_t ds_arbytes;
  27.104 -    uint32_t es_arbytes;
  27.105 -    uint32_t fs_arbytes;
  27.106 -    uint32_t gs_arbytes;
  27.107 -    uint32_t ss_arbytes;
  27.108 -    uint32_t tr_arbytes;
  27.109 -    uint32_t ldtr_arbytes;
  27.110 -
  27.111 -    uint32_t sysenter_cs;
  27.112 -    uint32_t padding0;
  27.113 -
  27.114 -    uint64_t sysenter_esp;
  27.115 -    uint64_t sysenter_eip;
  27.116 -
  27.117 -    /* msr for em64t */
  27.118 -    uint64_t shadow_gs;
  27.119 -
  27.120 -    /* msr content saved/restored. */
  27.121 -    uint64_t msr_flags;
  27.122 -    uint64_t msr_lstar;
  27.123 -    uint64_t msr_star;
  27.124 -    uint64_t msr_cstar;
  27.125 -    uint64_t msr_syscall_mask;
  27.126 -    uint64_t msr_efer;
  27.127 -
  27.128 -    /* guest's idea of what rdtsc() would return */
  27.129 -    uint64_t tsc;
  27.130 -
  27.131 -    /* pending event, if any */
  27.132 -    union {
  27.133 -        uint32_t pending_event;
  27.134 -        struct {
  27.135 -            uint8_t  pending_vector:8;
  27.136 -            uint8_t  pending_type:3;
  27.137 -            uint8_t  pending_error_valid:1;
  27.138 -            uint32_t pending_reserved:19;
  27.139 -            uint8_t  pending_valid:1;
  27.140 -        };
  27.141 -    };
  27.142 -    /* error code for pending event */
  27.143 -    uint32_t error_code;
  27.144 -};
  27.145 -
  27.146 -DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_cpu);
  27.147 -
  27.148 -
  27.149 -/*
  27.150 - * PIC
  27.151 - */
  27.152 -
  27.153 -struct hvm_hw_vpic {
  27.154 -    /* IR line bitmasks. */
  27.155 -    uint8_t irr;
  27.156 -    uint8_t imr;
  27.157 -    uint8_t isr;
  27.158 -
  27.159 -    /* Line IRx maps to IRQ irq_base+x */
  27.160 -    uint8_t irq_base;
  27.161 -
  27.162 -    /*
  27.163 -     * Where are we in ICW2-4 initialisation (0 means no init in progress)?
  27.164 -     * Bits 0-1 (=x): Next write at A=1 sets ICW(x+1).
  27.165 -     * Bit 2: ICW1.IC4  (1 == ICW4 included in init sequence)
  27.166 -     * Bit 3: ICW1.SNGL (0 == ICW3 included in init sequence)
  27.167 -     */
  27.168 -    uint8_t init_state:4;
  27.169 -
  27.170 -    /* IR line with highest priority. */
  27.171 -    uint8_t priority_add:4;
  27.172 -
  27.173 -    /* Reads from A=0 obtain ISR or IRR? */
  27.174 -    uint8_t readsel_isr:1;
  27.175 -
  27.176 -    /* Reads perform a polling read? */
  27.177 -    uint8_t poll:1;
  27.178 -
  27.179 -    /* Automatically clear IRQs from the ISR during INTA? */
  27.180 -    uint8_t auto_eoi:1;
  27.181 -
  27.182 -    /* Automatically rotate IRQ priorities during AEOI? */
  27.183 -    uint8_t rotate_on_auto_eoi:1;
  27.184 -
  27.185 -    /* Exclude slave inputs when considering in-service IRQs? */
  27.186 -    uint8_t special_fully_nested_mode:1;
  27.187 -
  27.188 -    /* Special mask mode excludes masked IRs from AEOI and priority checks. */
  27.189 -    uint8_t special_mask_mode:1;
  27.190 -
  27.191 -    /* Is this a master PIC or slave PIC? (NB. This is not programmable.) */
  27.192 -    uint8_t is_master:1;
  27.193 -
  27.194 -    /* Edge/trigger selection. */
  27.195 -    uint8_t elcr;
  27.196 -
  27.197 -    /* Virtual INT output. */
  27.198 -    uint8_t int_output;
  27.199 -};
  27.200 -
  27.201 -DECLARE_HVM_SAVE_TYPE(PIC, 3, struct hvm_hw_vpic);
  27.202 -
  27.203 -
  27.204 -/*
  27.205 - * IO-APIC
  27.206 - */
  27.207 -
  27.208 -#ifdef __ia64__
  27.209 -#define VIOAPIC_IS_IOSAPIC 1
  27.210 -#define VIOAPIC_NUM_PINS  24
  27.211 -#else
  27.212 -#define VIOAPIC_NUM_PINS  48 /* 16 ISA IRQs, 32 non-legacy PCI IRQS. */
  27.213 -#endif
  27.214 -
  27.215 -struct hvm_hw_vioapic {
  27.216 -    uint64_t base_address;
  27.217 -    uint32_t ioregsel;
  27.218 -    uint32_t id;
  27.219 -    union vioapic_redir_entry
  27.220 -    {
  27.221 -        uint64_t bits;
  27.222 -        struct {
  27.223 -            uint8_t vector;
  27.224 -            uint8_t delivery_mode:3;
  27.225 -            uint8_t dest_mode:1;
  27.226 -            uint8_t delivery_status:1;
  27.227 -            uint8_t polarity:1;
  27.228 -            uint8_t remote_irr:1;
  27.229 -            uint8_t trig_mode:1;
  27.230 -            uint8_t mask:1;
  27.231 -            uint8_t reserve:7;
  27.232 -#if !VIOAPIC_IS_IOSAPIC
  27.233 -            uint8_t reserved[4];
  27.234 -            uint8_t dest_id;
  27.235 -#else
  27.236 -            uint8_t reserved[3];
  27.237 -            uint16_t dest_id;
  27.238 -#endif
  27.239 -        } fields;
  27.240 -    } redirtbl[VIOAPIC_NUM_PINS];
  27.241 -};
  27.242 -
  27.243 -DECLARE_HVM_SAVE_TYPE(IOAPIC, 4, struct hvm_hw_vioapic);
  27.244 -
  27.245 -
  27.246 -/*
  27.247 - * LAPIC
  27.248 - */
  27.249 -
  27.250 -struct hvm_hw_lapic {
  27.251 -    uint64_t             apic_base_msr;
  27.252 -    uint32_t             disabled; /* VLAPIC_xx_DISABLED */
  27.253 -    uint32_t             timer_divisor;
  27.254 -};
  27.255 -
  27.256 -DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic);
  27.257 -
  27.258 -struct hvm_hw_lapic_regs {
  27.259 -    /* A 4k page of register state */
  27.260 -    uint8_t  data[0x400];
  27.261 -};
  27.262 -
  27.263 -DECLARE_HVM_SAVE_TYPE(LAPIC_REGS, 6, struct hvm_hw_lapic_regs);
  27.264 -
  27.265 -
  27.266 -/*
  27.267 - * IRQs
  27.268 - */
  27.269 -
  27.270 -struct hvm_hw_pci_irqs {
  27.271 -    /*
  27.272 -     * Virtual interrupt wires for a single PCI bus.
  27.273 -     * Indexed by: device*4 + INTx#.
  27.274 -     */
  27.275 -    union {
  27.276 -        DECLARE_BITMAP(i, 32*4);
  27.277 -        uint64_t pad[2];
  27.278 -    };
  27.279 -};
  27.280 -
  27.281 -DECLARE_HVM_SAVE_TYPE(PCI_IRQ, 7, struct hvm_hw_pci_irqs);
  27.282 -
  27.283 -struct hvm_hw_isa_irqs {
  27.284 -    /*
  27.285 -     * Virtual interrupt wires for ISA devices.
  27.286 -     * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
  27.287 -     */
  27.288 -    union {
  27.289 -        DECLARE_BITMAP(i, 16);
  27.290 -        uint64_t pad[1];
  27.291 -    };
  27.292 -};
  27.293 -
  27.294 -DECLARE_HVM_SAVE_TYPE(ISA_IRQ, 8, struct hvm_hw_isa_irqs);
  27.295 -
  27.296 -struct hvm_hw_pci_link {
  27.297 -    /*
  27.298 -     * PCI-ISA interrupt router.
  27.299 -     * Each PCI <device:INTx#> is 'wire-ORed' into one of four links using
  27.300 -     * the traditional 'barber's pole' mapping ((device + INTx#) & 3).
  27.301 -     * The router provides a programmable mapping from each link to a GSI.
  27.302 -     */
  27.303 -    uint8_t route[4];
  27.304 -    uint8_t pad0[4];
  27.305 -};
  27.306 -
  27.307 -DECLARE_HVM_SAVE_TYPE(PCI_LINK, 9, struct hvm_hw_pci_link);
  27.308 -
  27.309 -/* 
  27.310 - *  PIT
  27.311 - */
  27.312 -
  27.313 -struct hvm_hw_pit {
  27.314 -    struct hvm_hw_pit_channel {
  27.315 -        uint32_t count; /* can be 65536 */
  27.316 -        uint16_t latched_count;
  27.317 -        uint8_t count_latched;
  27.318 -        uint8_t status_latched;
  27.319 -        uint8_t status;
  27.320 -        uint8_t read_state;
  27.321 -        uint8_t write_state;
  27.322 -        uint8_t write_latch;
  27.323 -        uint8_t rw_mode;
  27.324 -        uint8_t mode;
  27.325 -        uint8_t bcd; /* not supported */
  27.326 -        uint8_t gate; /* timer start */
  27.327 -    } channels[3];  /* 3 x 16 bytes */
  27.328 -    uint32_t speaker_data_on;
  27.329 -    uint32_t pad0;
  27.330 -};
  27.331 -
  27.332 -DECLARE_HVM_SAVE_TYPE(PIT, 10, struct hvm_hw_pit);
  27.333 -
  27.334 -
  27.335 -/* 
  27.336 - * RTC
  27.337 - */ 
  27.338 -
  27.339 -#define RTC_CMOS_SIZE 14
  27.340 -struct hvm_hw_rtc {
  27.341 -    /* CMOS bytes */
  27.342 -    uint8_t cmos_data[RTC_CMOS_SIZE];
  27.343 -    /* Index register for 2-part operations */
  27.344 -    uint8_t cmos_index;
  27.345 -    uint8_t pad0;
  27.346 -};
  27.347 -
  27.348 -DECLARE_HVM_SAVE_TYPE(RTC, 11, struct hvm_hw_rtc);
  27.349 -
  27.350 -
  27.351 -/*
  27.352 - * HPET
  27.353 - */
  27.354 -
  27.355 -#define HPET_TIMER_NUM     3    /* 3 timers supported now */
  27.356 -struct hvm_hw_hpet {
  27.357 -    /* Memory-mapped, software visible registers */
  27.358 -    uint64_t capability;        /* capabilities */
  27.359 -    uint64_t res0;              /* reserved */
  27.360 -    uint64_t config;            /* configuration */
  27.361 -    uint64_t res1;              /* reserved */
  27.362 -    uint64_t isr;               /* interrupt status reg */
  27.363 -    uint64_t res2[25];          /* reserved */
  27.364 -    uint64_t mc64;              /* main counter */
  27.365 -    uint64_t res3;              /* reserved */
  27.366 -    struct {                    /* timers */
  27.367 -        uint64_t config;        /* configuration/cap */
  27.368 -        uint64_t cmp;           /* comparator */
  27.369 -        uint64_t fsb;           /* FSB route, not supported now */
  27.370 -        uint64_t res4;          /* reserved */
  27.371 -    } timers[HPET_TIMER_NUM];
  27.372 -    uint64_t res5[4*(24-HPET_TIMER_NUM)];  /* reserved, up to 0x3ff */
  27.373 -
  27.374 -    /* Hidden register state */
  27.375 -    uint64_t period[HPET_TIMER_NUM]; /* Last value written to comparator */
  27.376 -};
  27.377 -
  27.378 -DECLARE_HVM_SAVE_TYPE(HPET, 12, struct hvm_hw_hpet);
  27.379 -
  27.380 -
  27.381 -/*
  27.382 - * PM timer
  27.383 - */
  27.384 -
  27.385 -struct hvm_hw_pmtimer {
  27.386 -    uint32_t tmr_val;   /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
  27.387 -    uint16_t pm1a_sts;  /* PM1a_EVT_BLK.PM1a_STS: status register */
  27.388 -    uint16_t pm1a_en;   /* PM1a_EVT_BLK.PM1a_EN: enable register */
  27.389 -};
  27.390 -
  27.391 -DECLARE_HVM_SAVE_TYPE(PMTIMER, 13, struct hvm_hw_pmtimer);
  27.392 -
  27.393 -/* 
  27.394 - * Largest type-code in use
  27.395 - */
  27.396 -#define HVM_SAVE_CODE_MAX 13
  27.397 -
  27.398 -
  27.399 -/* 
  27.400   * The series of save records is teminated by a zero-type, zero-length 
  27.401   * descriptor.
  27.402   */
  27.403 @@ -459,4 +73,10 @@ DECLARE_HVM_SAVE_TYPE(PMTIMER, 13, struc
  27.404  struct hvm_save_end {};
  27.405  DECLARE_HVM_SAVE_TYPE(END, 0, struct hvm_save_end);
  27.406  
  27.407 +#if defined(__i386__) || defined(__x86_64__)
  27.408 +#include "../arch-x86/hvm/save.h"
  27.409 +#else
  27.410 +#error "unsupported architecture"
  27.411 +#endif
  27.412 +
  27.413  #endif /* __XEN_PUBLIC_HVM_SAVE_H__ */
    28.1 --- a/include/xen/interface/libelf.h	Wed Oct 17 10:27:10 2007 -0600
    28.2 +++ b/include/xen/interface/libelf.h	Sun Oct 21 12:10:59 2007 -0600
    28.3 @@ -69,6 +69,9 @@ struct elf_binary {
    28.4      uint64_t pend;
    28.5      uint64_t reloc_offset;
    28.6  
    28.7 +    uint64_t bsd_symtab_pstart;
    28.8 +    uint64_t bsd_symtab_pend;
    28.9 +
   28.10  #ifndef __XEN__
   28.11      /* misc */
   28.12      FILE *log;
   28.13 @@ -91,33 +94,32 @@ struct elf_binary {
   28.14  #define elf_lsb(elf)   (ELFDATA2LSB == (elf)->data)
   28.15  #define elf_swap(elf)  (NATIVE_ELFDATA != (elf)->data)
   28.16  
   28.17 -#define elf_uval(elf, str, elem)			\
   28.18 -	((ELFCLASS64 == (elf)->class)			\
   28.19 -	? elf_access_unsigned((elf), (str),		\
   28.20 -		offsetof(typeof(*(str)),e64.elem),	\
   28.21 -		sizeof((str)->e64.elem))		\
   28.22 -	: elf_access_unsigned((elf), (str),		\
   28.23 -		offsetof(typeof(*(str)),e32.elem),	\
   28.24 -		sizeof((str)->e32.elem)))
   28.25 +#define elf_uval(elf, str, elem)                                        \
   28.26 +    ((ELFCLASS64 == (elf)->class)                                       \
   28.27 +     ? elf_access_unsigned((elf), (str),                                \
   28.28 +                           offsetof(typeof(*(str)),e64.elem),           \
   28.29 +                           sizeof((str)->e64.elem))                     \
   28.30 +     : elf_access_unsigned((elf), (str),                                \
   28.31 +                           offsetof(typeof(*(str)),e32.elem),           \
   28.32 +                           sizeof((str)->e32.elem)))
   28.33  
   28.34 -#define elf_sval(elf, str, elem)			\
   28.35 -	((ELFCLASS64 == (elf)->class)			\
   28.36 -	? elf_access_signed((elf), (str),		\
   28.37 -		offsetof(typeof(*(str)),e64.elem),	\
   28.38 -		sizeof((str)->e64.elem))		\
   28.39 -	: elf_access_signed((elf), (str),		\
   28.40 -		offsetof(typeof(*(str)),e32.elem),	\
   28.41 -		sizeof((str)->e32.elem)))
   28.42 +#define elf_sval(elf, str, elem)                                        \
   28.43 +    ((ELFCLASS64 == (elf)->class)                                       \
   28.44 +     ? elf_access_signed((elf), (str),                                  \
   28.45 +                         offsetof(typeof(*(str)),e64.elem),             \
   28.46 +                         sizeof((str)->e64.elem))                       \
   28.47 +     : elf_access_signed((elf), (str),                                  \
   28.48 +                         offsetof(typeof(*(str)),e32.elem),             \
   28.49 +                         sizeof((str)->e32.elem)))
   28.50  
   28.51 -#define elf_size(elf, str)		\
   28.52 -	((ELFCLASS64 == (elf)->class)	\
   28.53 -	? sizeof((str)->e64)		\
   28.54 -	: sizeof((str)->e32))
   28.55 +#define elf_size(elf, str)                              \
   28.56 +    ((ELFCLASS64 == (elf)->class)                       \
   28.57 +     ? sizeof((str)->e64) : sizeof((str)->e32))
   28.58  
   28.59  uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
   28.60 -			     uint64_t offset, size_t size);
   28.61 +                             uint64_t offset, size_t size);
   28.62  int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
   28.63 -			  uint64_t offset, size_t size);
   28.64 +                          uint64_t offset, size_t size);
   28.65  
   28.66  uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
   28.67  
   28.68 @@ -165,6 +167,8 @@ void elf_load_binary(struct elf_binary *
   28.69  void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
   28.70  uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
   28.71  
   28.72 +void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
   28.73 +
   28.74  /* ------------------------------------------------------------------------ */
   28.75  /* xc_libelf_relocate.c                                                     */
   28.76  
   28.77 @@ -185,8 +189,8 @@ struct xen_elfnote {
   28.78      enum xen_elfnote_type type;
   28.79      const char *name;
   28.80      union {
   28.81 -	const char *str;
   28.82 -	uint64_t num;
   28.83 +        const char *str;
   28.84 +        uint64_t num;
   28.85      } data;
   28.86  };
   28.87  
   28.88 @@ -228,14 +232,14 @@ static inline int elf_xen_feature_get(in
   28.89  }
   28.90  
   28.91  int elf_xen_parse_features(const char *features,
   28.92 -			   uint32_t *supported,
   28.93 -			   uint32_t *required);
   28.94 +                           uint32_t *supported,
   28.95 +                           uint32_t *required);
   28.96  int elf_xen_parse_note(struct elf_binary *elf,
   28.97 -		       struct elf_dom_parms *parms,
   28.98 -		       const elf_note *note);
   28.99 +                       struct elf_dom_parms *parms,
  28.100 +                       const elf_note *note);
  28.101  int elf_xen_parse_guest_info(struct elf_binary *elf,
  28.102 -			     struct elf_dom_parms *parms);
  28.103 +                             struct elf_dom_parms *parms);
  28.104  int elf_xen_parse(struct elf_binary *elf,
  28.105 -		  struct elf_dom_parms *parms);
  28.106 +                  struct elf_dom_parms *parms);
  28.107  
  28.108  #endif /* __XC_LIBELF__ */
    29.1 --- a/include/xen/interface/platform.h	Wed Oct 17 10:27:10 2007 -0600
    29.2 +++ b/include/xen/interface/platform.h	Sun Oct 21 12:10:59 2007 -0600
    29.3 @@ -164,7 +164,7 @@ struct xenpf_enter_acpi_sleep {
    29.4  typedef struct xenpf_enter_acpi_sleep xenpf_enter_acpi_sleep_t;
    29.5  DEFINE_XEN_GUEST_HANDLE(xenpf_enter_acpi_sleep_t);
    29.6  
    29.7 -#define XENPF_change_freq       52
    29.8 +#define XENPF_change_freq         52
    29.9  struct xenpf_change_freq {
   29.10      /* IN variables */
   29.11      uint32_t flags; /* Must be zero. */
   29.12 @@ -174,6 +174,17 @@ struct xenpf_change_freq {
   29.13  typedef struct xenpf_change_freq xenpf_change_freq_t;
   29.14  DEFINE_XEN_GUEST_HANDLE(xenpf_change_freq_t);
   29.15  
   29.16 +#define XENPF_getidletime         53
   29.17 +struct xenpf_getidletime {
   29.18 +    /* IN variables. */
   29.19 +    uint32_t max_cpus;
   29.20 +    XEN_GUEST_HANDLE(uint64_t) idletime;
   29.21 +    /* OUT variables. */
   29.22 +    uint32_t nr_cpus;
   29.23 +};
   29.24 +typedef struct xenpf_getidletime xenpf_getidletime_t;
   29.25 +DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t);
   29.26 +
   29.27  struct xen_platform_op {
   29.28      uint32_t cmd;
   29.29      uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
   29.30 @@ -187,6 +198,7 @@ struct xen_platform_op {
   29.31          struct xenpf_firmware_info     firmware_info;
   29.32          struct xenpf_enter_acpi_sleep  enter_acpi_sleep;
   29.33          struct xenpf_change_freq       change_freq;
   29.34 +        struct xenpf_getidletime       getidletime;
   29.35          uint8_t                        pad[128];
   29.36      } u;
   29.37  };
    30.1 --- a/include/xen/interface/sysctl.h	Wed Oct 17 10:27:10 2007 -0600
    30.2 +++ b/include/xen/interface/sysctl.h	Sun Oct 21 12:10:59 2007 -0600
    30.3 @@ -34,7 +34,7 @@
    30.4  #include "xen.h"
    30.5  #include "domctl.h"
    30.6  
    30.7 -#define XEN_SYSCTL_INTERFACE_VERSION 0x00000004
    30.8 +#define XEN_SYSCTL_INTERFACE_VERSION 0x00000005
    30.9  
   30.10  /*
   30.11   * Read console content from Xen buffer ring.
   30.12 @@ -79,7 +79,7 @@ struct xen_sysctl_physinfo {
   30.13      /* IN variables. */
   30.14      uint32_t threads_per_core;
   30.15      uint32_t cores_per_socket;
   30.16 -    uint32_t sockets_per_node;
   30.17 +    uint32_t nr_cpus;
   30.18      uint32_t nr_nodes;
   30.19      uint32_t cpu_khz;
   30.20      uint64_aligned_t total_pages;
   30.21 @@ -185,6 +185,18 @@ struct xen_sysctl_getcpuinfo {
   30.22  typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t;
   30.23  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t); 
   30.24  
   30.25 +#define XEN_SYSCTL_availheap         9
   30.26 +struct xen_sysctl_availheap {
   30.27 +    /* IN variables. */
   30.28 +    uint32_t min_bitwidth;  /* Smallest address width (zero if don't care). */
   30.29 +    uint32_t max_bitwidth;  /* Largest address width (zero if don't care). */
   30.30 +    int32_t  node;          /* NUMA node of interest (-1 for all nodes). */
   30.31 +    /* OUT variables. */
   30.32 +    uint64_t avail_bytes;   /* Bytes available in the specified region. */
   30.33 +};
   30.34 +typedef struct xen_sysctl_availheap xen_sysctl_availheap_t;
   30.35 +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_availheap_t);
   30.36 + 
   30.37  struct xen_sysctl {
   30.38      uint32_t cmd;
   30.39      uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
   30.40 @@ -197,6 +209,7 @@ struct xen_sysctl {
   30.41          struct xen_sysctl_getdomaininfolist getdomaininfolist;
   30.42          struct xen_sysctl_debug_keys        debug_keys;
   30.43          struct xen_sysctl_getcpuinfo        getcpuinfo;
   30.44 +        struct xen_sysctl_availheap         availheap;
   30.45          uint8_t                             pad[128];
   30.46      } u;
   30.47  };
    31.1 --- a/include/xen/interface/trace.h	Wed Oct 17 10:27:10 2007 -0600
    31.2 +++ b/include/xen/interface/trace.h	Sun Oct 21 12:10:59 2007 -0600
    31.3 @@ -26,14 +26,22 @@
    31.4  #ifndef __XEN_PUBLIC_TRACE_H__
    31.5  #define __XEN_PUBLIC_TRACE_H__
    31.6  
    31.7 +#define TRACE_EXTRA_MAX    7
    31.8 +#define TRACE_EXTRA_SHIFT 28
    31.9 +
   31.10  /* Trace classes */
   31.11  #define TRC_CLS_SHIFT 16
   31.12 -#define TRC_GEN     0x0001f000    /* General trace            */
   31.13 -#define TRC_SCHED   0x0002f000    /* Xen Scheduler trace      */
   31.14 -#define TRC_DOM0OP  0x0004f000    /* Xen DOM0 operation trace */
   31.15 -#define TRC_HVM     0x0008f000    /* Xen HVM trace            */
   31.16 -#define TRC_MEM     0x0010f000    /* Xen memory trace         */
   31.17 -#define TRC_ALL     0xfffff000
   31.18 +#define TRC_GEN      0x0001f000    /* General trace            */
   31.19 +#define TRC_SCHED    0x0002f000    /* Xen Scheduler trace      */
   31.20 +#define TRC_DOM0OP   0x0004f000    /* Xen DOM0 operation trace */
   31.21 +#define TRC_HVM      0x0008f000    /* Xen HVM trace            */
   31.22 +#define TRC_MEM      0x0010f000    /* Xen memory trace         */
   31.23 +#define TRC_PV       0x0020f000    /* Xen PV traces            */
   31.24 +#define TRC_ALL      0x0ffff000
   31.25 +#define TRC_HD_TO_EVENT(x) ((x)&0x0fffffff)
   31.26 +#define TRC_HD_CYCLE_FLAG (1UL<<31)
   31.27 +#define TRC_HD_INCLUDES_CYCLE_COUNT(x) ( !!( (x) & TRC_HD_CYCLE_FLAG ) )
   31.28 +#define TRC_HD_EXTRA(x)    (((x)>>TRACE_EXTRA_SHIFT)&TRACE_EXTRA_MAX)
   31.29  
   31.30  /* Trace subclasses */
   31.31  #define TRC_SUBCLS_SHIFT 12
   31.32 @@ -44,6 +52,8 @@
   31.33  
   31.34  /* Trace events per class */
   31.35  #define TRC_LOST_RECORDS        (TRC_GEN + 1)
   31.36 +#define TRC_TRACE_WRAP_BUFFER  (TRC_GEN + 2)
   31.37 +#define TRC_TRACE_CPU_CHANGE    (TRC_GEN + 3)
   31.38  
   31.39  #define TRC_SCHED_DOM_ADD       (TRC_SCHED +  1)
   31.40  #define TRC_SCHED_DOM_REM       (TRC_SCHED +  2)
   31.41 @@ -65,9 +75,24 @@
   31.42  #define TRC_MEM_PAGE_GRANT_UNMAP    (TRC_MEM + 2)
   31.43  #define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3)
   31.44  
   31.45 +#define TRC_PV_HYPERCALL             (TRC_PV +  1)
   31.46 +#define TRC_PV_TRAP                  (TRC_PV +  3)
   31.47 +#define TRC_PV_PAGE_FAULT            (TRC_PV +  4)
   31.48 +#define TRC_PV_FORCED_INVALID_OP     (TRC_PV +  5)
   31.49 +#define TRC_PV_EMULATE_PRIVOP        (TRC_PV +  6)
   31.50 +#define TRC_PV_EMULATE_4GB           (TRC_PV +  7)
   31.51 +#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV +  8)
   31.52 +#define TRC_PV_PAGING_FIXUP          (TRC_PV +  9)
   31.53 +#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10)
   31.54 +#define TRC_PV_PTWR_EMULATION        (TRC_PV + 11)
   31.55 +#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV + 12)
   31.56 +  /* Indicates that addresses in trace record are 64 bits */
   31.57 +#define TRC_PV_64_FLAG               (0x100) 
   31.58 +
   31.59  /* trace events per subclass */
   31.60  #define TRC_HVM_VMENTRY         (TRC_HVM_ENTRYEXIT + 0x01)
   31.61  #define TRC_HVM_VMEXIT          (TRC_HVM_ENTRYEXIT + 0x02)
   31.62 +#define TRC_HVM_VMEXIT64        (TRC_HVM_ENTRYEXIT + 0x03)
   31.63  #define TRC_HVM_PF_XEN          (TRC_HVM_HANDLER + 0x01)
   31.64  #define TRC_HVM_PF_INJECT       (TRC_HVM_HANDLER + 0x02)
   31.65  #define TRC_HVM_INJ_EXC         (TRC_HVM_HANDLER + 0x03)
   31.66 @@ -89,12 +114,26 @@
   31.67  #define TRC_HVM_HLT             (TRC_HVM_HANDLER + 0x13)
   31.68  #define TRC_HVM_INVLPG          (TRC_HVM_HANDLER + 0x14)
   31.69  #define TRC_HVM_MCE             (TRC_HVM_HANDLER + 0x15)
   31.70 +#define TRC_HVM_IO_ASSIST       (TRC_HVM_HANDLER + 0x16)
   31.71 +#define TRC_HVM_MMIO_ASSIST     (TRC_HVM_HANDLER + 0x17)
   31.72 +#define TRC_HVM_CLTS            (TRC_HVM_HANDLER + 0x18)
   31.73 +#define TRC_HVM_LMSW            (TRC_HVM_HANDLER + 0x19)
   31.74 +#define TRC_HVM_PF_XEN64        (TRC_HVM_HANDLER + 0x20)
   31.75  
   31.76  /* This structure represents a single trace buffer record. */
   31.77  struct t_rec {
   31.78 -    uint64_t cycles;          /* cycle counter timestamp */
   31.79 -    uint32_t event;           /* event ID                */
   31.80 -    unsigned long data[5];    /* event data items        */
   31.81 +    uint32_t event:28;
   31.82 +    uint32_t extra_u32:3;         /* # entries in trailing extra_u32[] array */
   31.83 +    uint32_t cycles_included:1;   /* u.cycles or u.no_cycles? */
   31.84 +    union {
   31.85 +        struct {
   31.86 +            uint32_t cycles_lo, cycles_hi; /* cycle counter timestamp */
   31.87 +            uint32_t extra_u32[7];         /* event data items */
   31.88 +        } cycles;
   31.89 +        struct {
   31.90 +            uint32_t extra_u32[7];         /* event data items */
   31.91 +        } nocycles;
   31.92 +    } u;
   31.93  };
   31.94  
   31.95  /*
   31.96 @@ -102,9 +141,9 @@ struct t_rec {
   31.97   * field, indexes into an array of struct t_rec's.
   31.98   */
   31.99  struct t_buf {
  31.100 -    uint32_t cons;      /* Next item to be consumed by control tools. */
  31.101 -    uint32_t prod;      /* Next item to be produced by Xen.           */
  31.102 -    /* 'nr_recs' records follow immediately after the meta-data header.    */
  31.103 +    uint32_t cons;   /* Offset of next item to be consumed by control tools. */
  31.104 +    uint32_t prod;   /* Offset of next item to be produced by Xen.           */
  31.105 +    /*  Records follow immediately after the meta-data header.    */
  31.106  };
  31.107  
  31.108  #endif /* __XEN_PUBLIC_TRACE_H__ */
    32.1 --- a/include/xen/interface/xen-compat.h	Wed Oct 17 10:27:10 2007 -0600
    32.2 +++ b/include/xen/interface/xen-compat.h	Sun Oct 21 12:10:59 2007 -0600
    32.3 @@ -27,7 +27,7 @@
    32.4  #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
    32.5  #define __XEN_PUBLIC_XEN_COMPAT_H__
    32.6  
    32.7 -#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030205
    32.8 +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030206
    32.9  
   32.10  #if defined(__XEN__) || defined(__XEN_TOOLS__)
   32.11  /* Xen is built with matching headers and implements the latest interface. */
    33.1 --- a/include/xen/interface/xen.h	Wed Oct 17 10:27:10 2007 -0600
    33.2 +++ b/include/xen/interface/xen.h	Sun Oct 21 12:10:59 2007 -0600
    33.3 @@ -69,7 +69,7 @@
    33.4  #define __HYPERVISOR_vcpu_op              24
    33.5  #define __HYPERVISOR_set_segment_base     25 /* x86/64 only */
    33.6  #define __HYPERVISOR_mmuext_op            26
    33.7 -#define __HYPERVISOR_acm_op               27
    33.8 +#define __HYPERVISOR_xsm_op               27
    33.9  #define __HYPERVISOR_nmi_op               28
   33.10  #define __HYPERVISOR_sched_op             29
   33.11  #define __HYPERVISOR_callback_op          30
   33.12 @@ -565,6 +565,12 @@ typedef struct dom0_vga_console_info {
   33.13              uint8_t  green_pos, green_size;
   33.14              uint8_t  blue_pos, blue_size;
   33.15              uint8_t  rsvd_pos, rsvd_size;
   33.16 +#if __XEN_INTERFACE_VERSION__ >= 0x00030206
   33.17 +            /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
   33.18 +            uint32_t gbl_caps;
   33.19 +            /* Mode attributes (offset 0x0, VESA command 0x4f01). */
   33.20 +            uint16_t mode_attrs;
   33.21 +#endif
   33.22          } vesa_lfb;
   33.23      } u;
   33.24  } dom0_vga_console_info_t;
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/include/xen/interface/xsm/acm.h	Sun Oct 21 12:10:59 2007 -0600
    34.3 @@ -0,0 +1,229 @@
    34.4 +/*
    34.5 + * acm.h: Xen access control module interface defintions
    34.6 + *
    34.7 + * Permission is hereby granted, free of charge, to any person obtaining a copy
    34.8 + * of this software and associated documentation files (the "Software"), to
    34.9 + * deal in the Software without restriction, including without limitation the
   34.10 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   34.11 + * sell copies of the Software, and to permit persons to whom the Software is
   34.12 + * furnished to do so, subject to the following conditions:
   34.13 + *
   34.14 + * The above copyright notice and this permission notice shall be included in
   34.15 + * all copies or substantial portions of the Software.
   34.16 + *
   34.17 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   34.18 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   34.19 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   34.20 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   34.21 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   34.22 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   34.23 + * DEALINGS IN THE SOFTWARE.
   34.24 + *
   34.25 + * Reiner Sailer <sailer@watson.ibm.com>
   34.26 + * Copyright (c) 2005, International Business Machines Corporation.
   34.27 + */
   34.28 +
   34.29 +#ifndef _XEN_PUBLIC_ACM_H
   34.30 +#define _XEN_PUBLIC_ACM_H
   34.31 +
   34.32 +#include "../xen.h"
   34.33 +
   34.34 +/* if ACM_DEBUG defined, all hooks should
   34.35 + * print a short trace message (comment it out
   34.36 + * when not in testing mode )
   34.37 + */
   34.38 +/* #define ACM_DEBUG */
   34.39 +
   34.40 +#ifdef ACM_DEBUG
   34.41 +#  define printkd(fmt, args...) printk(fmt,## args)
   34.42 +#else
   34.43 +#  define printkd(fmt, args...)
   34.44 +#endif
   34.45 +
   34.46 +/* default ssid reference value if not supplied */
   34.47 +#define ACM_DEFAULT_SSID  0x0
   34.48 +#define ACM_DEFAULT_LOCAL_SSID  0x0
   34.49 +
   34.50 +/* Internal ACM ERROR types */
   34.51 +#define ACM_OK     0
   34.52 +#define ACM_UNDEF   -1
   34.53 +#define ACM_INIT_SSID_ERROR  -2
   34.54 +#define ACM_INIT_SOID_ERROR  -3
   34.55 +#define ACM_ERROR          -4
   34.56 +
   34.57 +/* External ACCESS DECISIONS */
   34.58 +#define ACM_ACCESS_PERMITTED        0
   34.59 +#define ACM_ACCESS_DENIED           -111
   34.60 +#define ACM_NULL_POINTER_ERROR      -200
   34.61 +
   34.62 +/*
   34.63 +   Error codes reported in when trying to test for a new policy
   34.64 +   These error codes are reported in an array of tuples where
   34.65 +   each error code is followed by a parameter describing the error
   34.66 +   more closely, such as a domain id.
   34.67 +*/
   34.68 +#define ACM_EVTCHN_SHARING_VIOLATION       0x100
   34.69 +#define ACM_GNTTAB_SHARING_VIOLATION       0x101
   34.70 +#define ACM_DOMAIN_LOOKUP                  0x102
   34.71 +#define ACM_CHWALL_CONFLICT                0x103
   34.72 +#define ACM_SSIDREF_IN_USE                 0x104
   34.73 +
   34.74 +
   34.75 +/* primary policy in lower 4 bits */
   34.76 +#define ACM_NULL_POLICY 0
   34.77 +#define ACM_CHINESE_WALL_POLICY 1
   34.78 +#define ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY 2
   34.79 +#define ACM_POLICY_UNDEFINED 15
   34.80 +
   34.81 +/* combinations have secondary policy component in higher 4bit */
   34.82 +#define ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY \
   34.83 +    ((ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY << 4) | ACM_CHINESE_WALL_POLICY)
   34.84 +
   34.85 +/* policy: */
   34.86 +#define ACM_POLICY_NAME(X) \
   34.87 + ((X) == (ACM_NULL_POLICY)) ? "NULL" :                        \
   34.88 +    ((X) == (ACM_CHINESE_WALL_POLICY)) ? "CHINESE WALL" :        \
   34.89 +    ((X) == (ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "SIMPLE TYPE ENFORCEMENT" : \
   34.90 +    ((X) == (ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "CHINESE WALL AND SIMPLE TYPE ENFORCEMENT" : \
   34.91 +     "UNDEFINED"
   34.92 +
   34.93 +/* the following policy versions must be increased
   34.94 + * whenever the interpretation of the related
   34.95 + * policy's data structure changes
   34.96 + */
   34.97 +#define ACM_POLICY_VERSION 3
   34.98 +#define ACM_CHWALL_VERSION 1
   34.99 +#define ACM_STE_VERSION  1
  34.100 +
  34.101 +/* defines a ssid reference used by xen */
  34.102 +typedef uint32_t ssidref_t;
  34.103 +
  34.104 +/* hooks that are known to domains */
  34.105 +#define ACMHOOK_none          0
  34.106 +#define ACMHOOK_sharing       1
  34.107 +#define ACMHOOK_authorization 2
  34.108 +
  34.109 +/* -------security policy relevant type definitions-------- */
  34.110 +
  34.111 +/* type identifier; compares to "equal" or "not equal" */
  34.112 +typedef uint16_t domaintype_t;
  34.113 +
  34.114 +/* CHINESE WALL POLICY DATA STRUCTURES
  34.115 + *
  34.116 + * current accumulated conflict type set:
  34.117 + * When a domain is started and has a type that is in
  34.118 + * a conflict set, the conflicting types are incremented in
  34.119 + * the aggregate set. When a domain is destroyed, the 
  34.120 + * conflicting types to its type are decremented.
  34.121 + * If a domain has multiple types, this procedure works over
  34.122 + * all those types.
  34.123 + *
  34.124 + * conflict_aggregate_set[i] holds the number of
  34.125 + *   running domains that have a conflict with type i.
  34.126 + *
  34.127 + * running_types[i] holds the number of running domains
  34.128 + *        that include type i in their ssidref-referenced type set
  34.129 + *
  34.130 + * conflict_sets[i][j] is "0" if type j has no conflict
  34.131 + *    with type i and is "1" otherwise.
  34.132 + */
  34.133 +/* high-16 = version, low-16 = check magic */
  34.134 +#define ACM_MAGIC  0x0001debc
  34.135 +
  34.136 +/* each offset in bytes from start of the struct they
  34.137 + * are part of */
  34.138 +
  34.139 +/* V3 of the policy buffer aded a version structure */
  34.140 +struct acm_policy_version
  34.141 +{
  34.142 +    uint32_t major;
  34.143 +    uint32_t minor;
  34.144 +};
  34.145 +
  34.146 +
  34.147 +/* each buffer consists of all policy information for
  34.148 + * the respective policy given in the policy code
  34.149 + *
  34.150 + * acm_policy_buffer, acm_chwall_policy_buffer,
  34.151 + * and acm_ste_policy_buffer need to stay 32-bit aligned
  34.152 + * because we create binary policies also with external
  34.153 + * tools that assume packed representations (e.g. the java tool)
  34.154 + */
  34.155 +struct acm_policy_buffer {
  34.156 +    uint32_t magic;
  34.157 +    uint32_t policy_version; /* ACM_POLICY_VERSION */
  34.158 +    uint32_t len;
  34.159 +    uint32_t policy_reference_offset;
  34.160 +    uint32_t primary_policy_code;
  34.161 +    uint32_t primary_buffer_offset;
  34.162 +    uint32_t secondary_policy_code;
  34.163 +    uint32_t secondary_buffer_offset;
  34.164 +    struct acm_policy_version xml_pol_version; /* add in V3 */
  34.165 +};
  34.166 +
  34.167 +
  34.168 +struct acm_policy_reference_buffer {
  34.169 +    uint32_t len;
  34.170 +};
  34.171 +
  34.172 +struct acm_chwall_policy_buffer {
  34.173 +    uint32_t policy_version; /* ACM_CHWALL_VERSION */
  34.174 +    uint32_t policy_code;
  34.175 +    uint32_t chwall_max_types;
  34.176 +    uint32_t chwall_max_ssidrefs;
  34.177 +    uint32_t chwall_max_conflictsets;
  34.178 +    uint32_t chwall_ssid_offset;
  34.179 +    uint32_t chwall_conflict_sets_offset;
  34.180 +    uint32_t chwall_running_types_offset;
  34.181 +    uint32_t chwall_conflict_aggregate_offset;
  34.182 +};
  34.183 +
  34.184 +struct acm_ste_policy_buffer {
  34.185 +    uint32_t policy_version; /* ACM_STE_VERSION */
  34.186 +    uint32_t policy_code;
  34.187 +    uint32_t ste_max_types;
  34.188 +    uint32_t ste_max_ssidrefs;
  34.189 +    uint32_t ste_ssid_offset;
  34.190 +};
  34.191 +
  34.192 +struct acm_stats_buffer {
  34.193 +    uint32_t magic;
  34.194 +    uint32_t len;
  34.195 +    uint32_t primary_policy_code;
  34.196 +    uint32_t primary_stats_offset;
  34.197 +    uint32_t secondary_policy_code;
  34.198 +    uint32_t secondary_stats_offset;
  34.199 +};
  34.200 +
  34.201 +struct acm_ste_stats_buffer {
  34.202 +    uint32_t ec_eval_count;
  34.203 +    uint32_t gt_eval_count;
  34.204 +    uint32_t ec_denied_count;
  34.205 +    uint32_t gt_denied_count;
  34.206 +    uint32_t ec_cachehit_count;
  34.207 +    uint32_t gt_cachehit_count;
  34.208 +};
  34.209 +
  34.210 +struct acm_ssid_buffer {
  34.211 +    uint32_t len;
  34.212 +    ssidref_t ssidref;
  34.213 +    uint32_t policy_reference_offset;
  34.214 +    uint32_t primary_policy_code;
  34.215 +    uint32_t primary_max_types;
  34.216 +    uint32_t primary_types_offset;
  34.217 +    uint32_t secondary_policy_code;
  34.218 +    uint32_t secondary_max_types;
  34.219 +    uint32_t secondary_types_offset;
  34.220 +};
  34.221 +
  34.222 +#endif
  34.223 +
  34.224 +/*
  34.225 + * Local variables:
  34.226 + * mode: C
  34.227 + * c-set-style: "BSD"
  34.228 + * c-basic-offset: 4
  34.229 + * tab-width: 4
  34.230 + * indent-tabs-mode: nil
  34.231 + * End:
  34.232 + */
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/include/xen/interface/xsm/acm_ops.h	Sun Oct 21 12:10:59 2007 -0600
    35.3 @@ -0,0 +1,159 @@
    35.4 +/*
    35.5 + * acm_ops.h: Xen access control module hypervisor commands
    35.6 + *
    35.7 + * Permission is hereby granted, free of charge, to any person obtaining a copy
    35.8 + * of this software and associated documentation files (the "Software"), to
    35.9 + * deal in the Software without restriction, including without limitation the
   35.10 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   35.11 + * sell copies of the Software, and to permit persons to whom the Software is
   35.12 + * furnished to do so, subject to the following conditions:
   35.13 + *
   35.14 + * The above copyright notice and this permission notice shall be included in
   35.15 + * all copies or substantial portions of the Software.
   35.16 + *
   35.17 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   35.18 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   35.19 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   35.20 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   35.21 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   35.22 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   35.23 + * DEALINGS IN THE SOFTWARE.
   35.24 + *
   35.25 + * Reiner Sailer <sailer@watson.ibm.com>
   35.26 + * Copyright (c) 2005,2006 International Business Machines Corporation.
   35.27 + */
   35.28 +
   35.29 +#ifndef __XEN_PUBLIC_ACM_OPS_H__
   35.30 +#define __XEN_PUBLIC_ACM_OPS_H__
   35.31 +
   35.32 +#include "../xen.h"
   35.33 +#include "acm.h"
   35.34 +
   35.35 +/*
   35.36 + * Make sure you increment the interface version whenever you modify this file!
   35.37 + * This makes sure that old versions of acm tools will stop working in a
   35.38 + * well-defined way (rather than crashing the machine, for instance).
   35.39 + */
   35.40 +#define ACM_INTERFACE_VERSION   0xAAAA000A
   35.41 +
   35.42 +/************************************************************************/
   35.43 +
   35.44 +/*
   35.45 + * Prototype for this hypercall is:
   35.46 + *  int acm_op(int cmd, void *args)
   35.47 + * @cmd  == ACMOP_??? (access control module operation).
   35.48 + * @args == Operation-specific extra arguments (NULL if none).
   35.49 + */
   35.50 +
   35.51 +
   35.52 +#define ACMOP_setpolicy         1
   35.53 +struct acm_setpolicy {
   35.54 +    /* IN */
   35.55 +    XEN_GUEST_HANDLE_64(void) pushcache;
   35.56 +    uint32_t pushcache_size;
   35.57 +};
   35.58 +
   35.59 +
   35.60 +#define ACMOP_getpolicy         2
   35.61 +struct acm_getpolicy {
   35.62 +    /* IN */
   35.63 +    XEN_GUEST_HANDLE_64(void) pullcache;
   35.64 +    uint32_t pullcache_size;
   35.65 +};
   35.66 +
   35.67 +
   35.68 +#define ACMOP_dumpstats         3
   35.69 +struct acm_dumpstats {
   35.70 +    /* IN */
   35.71 +    XEN_GUEST_HANDLE_64(void) pullcache;
   35.72 +    uint32_t pullcache_size;
   35.73 +};
   35.74 +
   35.75 +
   35.76 +#define ACMOP_getssid           4
   35.77 +#define ACM_GETBY_ssidref  1
   35.78 +#define ACM_GETBY_domainid 2
   35.79 +struct acm_getssid {
   35.80 +    /* IN */
   35.81 +    uint32_t get_ssid_by; /* ACM_GETBY_* */
   35.82 +    union {
   35.83 +        domaintype_t domainid;
   35.84 +        ssidref_t    ssidref;
   35.85 +    } id;
   35.86 +    XEN_GUEST_HANDLE_64(void) ssidbuf;
   35.87 +    uint32_t ssidbuf_size;
   35.88 +};
   35.89 +
   35.90 +#define ACMOP_getdecision      5
   35.91 +struct acm_getdecision {
   35.92 +    /* IN */
   35.93 +    uint32_t get_decision_by1; /* ACM_GETBY_* */
   35.94 +    uint32_t get_decision_by2; /* ACM_GETBY_* */
   35.95 +    union {
   35.96 +        domaintype_t domainid;
   35.97 +        ssidref_t    ssidref;
   35.98 +    } id1;
   35.99 +    union {
  35.100 +        domaintype_t domainid;
  35.101 +        ssidref_t    ssidref;
  35.102 +    } id2;
  35.103 +    uint32_t hook;
  35.104 +    /* OUT */
  35.105 +    uint32_t acm_decision;
  35.106 +};
  35.107 +
  35.108 +
  35.109 +#define ACMOP_chgpolicy        6
  35.110 +struct acm_change_policy {
  35.111 +    /* IN */
  35.112 +    XEN_GUEST_HANDLE_64(void) policy_pushcache;
  35.113 +    uint32_t policy_pushcache_size;
  35.114 +    XEN_GUEST_HANDLE_64(void) del_array;
  35.115 +    uint32_t delarray_size;
  35.116 +    XEN_GUEST_HANDLE_64(void) chg_array;
  35.117 +    uint32_t chgarray_size;
  35.118 +    /* OUT */
  35.119 +    /* array with error code */
  35.120 +    XEN_GUEST_HANDLE_64(void) err_array;
  35.121 +    uint32_t errarray_size;
  35.122 +};
  35.123 +
  35.124 +#define ACMOP_relabeldoms       7
  35.125 +struct acm_relabel_doms {
  35.126 +    /* IN */
  35.127 +    XEN_GUEST_HANDLE_64(void) relabel_map;
  35.128 +    uint32_t relabel_map_size;
  35.129 +    /* OUT */
  35.130 +    XEN_GUEST_HANDLE_64(void) err_array;
  35.131 +    uint32_t errarray_size;
  35.132 +};
  35.133 +
  35.134 +/* future interface to Xen */
  35.135 +struct xen_acmctl {
  35.136 +    uint32_t cmd;
  35.137 +    uint32_t interface_version;
  35.138 +    union {
  35.139 +        struct acm_setpolicy     setpolicy;
  35.140 +        struct acm_getpolicy     getpolicy;
  35.141 +        struct acm_dumpstats     dumpstats;
  35.142 +        struct acm_getssid       getssid;
  35.143 +        struct acm_getdecision   getdecision;
  35.144 +        struct acm_change_policy change_policy;
  35.145 +        struct acm_relabel_doms  relabel_doms;
  35.146 +    } u;
  35.147 +};
  35.148 +
  35.149 +typedef struct xen_acmctl xen_acmctl_t;
  35.150 +DEFINE_XEN_GUEST_HANDLE(xen_acmctl_t);
  35.151 +
  35.152 +#endif /* __XEN_PUBLIC_ACM_OPS_H__ */
  35.153 +
  35.154 +/*
  35.155 + * Local variables:
  35.156 + * mode: C
  35.157 + * c-set-style: "BSD"
  35.158 + * c-basic-offset: 4
  35.159 + * tab-width: 4
  35.160 + * indent-tabs-mode: nil
  35.161 + * End:
  35.162 + */
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/include/xen/interface/xsm/flask_op.h	Sun Oct 21 12:10:59 2007 -0600
    36.3 @@ -0,0 +1,43 @@
    36.4 +/*
    36.5 + *  This file contains the flask_op hypercall commands and definitions.
    36.6 + *
    36.7 + *  Author:  George Coker, <gscoker@alpha.ncsc.mil>
    36.8 + *
    36.9 + *  This program is free software; you can redistribute it and/or modify
   36.10 + *  it under the terms of the GNU General Public License version 2,
   36.11 + *  as published by the Free Software Foundation.
   36.12 + */
   36.13 +
   36.14 +#ifndef __FLASK_OP_H__
   36.15 +#define __FLASK_OP_H__
   36.16 +
   36.17 +#define FLASK_LOAD              1
   36.18 +#define FLASK_GETENFORCE        2
   36.19 +#define FLASK_SETENFORCE        3
   36.20 +#define FLASK_CONTEXT_TO_SID    4
   36.21 +#define FLASK_SID_TO_CONTEXT    5
   36.22 +#define FLASK_ACCESS            6
   36.23 +#define FLASK_CREATE            7
   36.24 +#define FLASK_RELABEL           8
   36.25 +#define FLASK_USER              9
   36.26 +#define FLASK_POLICYVERS        10
   36.27 +#define FLASK_GETBOOL           11
   36.28 +#define FLASK_SETBOOL           12
   36.29 +#define FLASK_COMMITBOOLS       13
   36.30 +#define FLASK_MLS               14
   36.31 +#define FLASK_DISABLE           15
   36.32 +#define FLASK_GETAVC_THRESHOLD  16
   36.33 +#define FLASK_SETAVC_THRESHOLD  17
   36.34 +#define FLASK_AVC_HASHSTATS     18
   36.35 +#define FLASK_AVC_CACHESTATS    19
   36.36 +#define FLASK_MEMBER            20
   36.37 +
   36.38 +typedef struct flask_op {
   36.39 +    int   cmd;
   36.40 +    int   size;
   36.41 +    char *buf;
   36.42 +} flask_op_t;
   36.43 +
   36.44 +DEFINE_XEN_GUEST_HANDLE(flask_op_t);
   36.45 +
   36.46 +#endif
    37.1 --- a/include/xen/xencons.h	Wed Oct 17 10:27:10 2007 -0600
    37.2 +++ b/include/xen/xencons.h	Sun Oct 21 12:10:59 2007 -0600
    37.3 @@ -2,7 +2,7 @@
    37.4  #define __ASM_XENCONS_H__
    37.5  
    37.6  struct dom0_vga_console_info;
    37.7 -void dom0_init_screen_info(const struct dom0_vga_console_info *info);
    37.8 +void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t);
    37.9  
   37.10  void xencons_force_flush(void);
   37.11  void xencons_resume(void);
    38.1 --- a/scripts/Makefile.xen	Wed Oct 17 10:27:10 2007 -0600
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,14 +0,0 @@
    38.4 -
    38.5 -# cherrypickxen($1 = allobj)
    38.6 -cherrypickxen = $(foreach var, $(1), \
    38.7 -		$(shell o=$(var); \
    38.8 -			c=$${o%.o}-xen.c; \
    38.9 -			s=$${o%.o}-xen.S; \
   38.10 -			oxen=$${o%.o}-xen.o; \
   38.11 -			[ -f $(srctree)/$(src)/$${c} ] || \
   38.12 -			   [ -f $(srctree)/$(src)/$${s} ] \
   38.13 -				&& echo $$oxen \
   38.14 -				|| echo $(var) ) \
   38.15 -	  )
   38.16 -# filterxen($1 = allobj, $2 = noobjs)
   38.17 -filterxen = $(filter-out $(2), $(1))