# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1192990259 21600
# Node ID 27b937c0095cf48a8d982272a4df4eef4f67eec0
# Parent 6cac8ecd995d185fddd469034218edaf46b8a586
# Parent ba49878d835958bd464a5853b4a8bddaf10101fb
merge with linux-2.6.18-xen.hg
---
scripts/Makefile.xen | 14
arch/i386/kernel/setup-xen.c | 23 -
arch/ia64/xen/hypervisor.c | 14
arch/ia64/xen/xcom_hcall.c | 2
arch/ia64/xen/xcom_privcmd.c | 10
arch/powerpc/platforms/xen/hcall.c | 2
arch/x86_64/kernel/acpi/Makefile | 6
arch/x86_64/kernel/setup-xen.c | 23 -
buildconfigs/linux-defconfig_xen0_x86_32 | 32 +
buildconfigs/linux-defconfig_xen0_x86_64 | 18 -
buildconfigs/linux-defconfig_xenU_x86_32 | 20 -
buildconfigs/linux-defconfig_xenU_x86_64 | 11
buildconfigs/linux-defconfig_xen_x86_32 | 24 -
buildconfigs/linux-defconfig_xen_x86_64 | 11
drivers/xen/Kconfig | 2
drivers/xen/console/console.c | 32 +
fs/xfs/linux-2.6/xfs_buf.c | 13
include/asm-i386/mach-xen/asm/pgtable-2level.h | 5
include/asm-i386/mach-xen/asm/pgtable-3level.h | 6
include/asm-ia64/hypercall.h | 6
include/asm-x86_64/mach-xen/asm/pgtable.h | 5
include/xen/interface/arch-x86/hvm/save.h | 413 +++++++++++++++++++++++++
include/xen/interface/arch-x86/xen-x86_32.h | 39 +-
include/xen/interface/arch-x86/xen.h | 3
include/xen/interface/domctl.h | 72 ++++
include/xen/interface/hvm/hvm_op.h | 3
include/xen/interface/hvm/params.h | 3
include/xen/interface/hvm/save.h | 392 -----------------------
include/xen/interface/libelf.h | 68 ++--
include/xen/interface/platform.h | 14
include/xen/interface/sysctl.h | 17 -
include/xen/interface/trace.h | 63 +++
include/xen/interface/xen-compat.h | 2
include/xen/interface/xen.h | 8
include/xen/interface/xsm/acm.h | 229 +++++++++++++
include/xen/interface/xsm/acm_ops.h | 159 +++++++++
include/xen/interface/xsm/flask_op.h | 43 ++
include/xen/xencons.h | 2
38 files changed, 1217 insertions(+), 592 deletions(-)
diff -r 6cac8ecd995d -r 27b937c0095c arch/i386/kernel/setup-xen.c
--- a/arch/i386/kernel/setup-xen.c Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/i386/kernel/setup-xen.c Sun Oct 21 12:10:59 2007 -0600
@@ -1669,23 +1669,12 @@ void __init setup_arch(char **cmdline_p)
bootloader_type = LOADER_TYPE;
if (is_initial_xendomain()) {
- /* This is drawn from a dump from vgacon:startup in
- * standard Linux. */
- screen_info.orig_video_mode = 3;
- screen_info.orig_video_isVGA = 1;
- screen_info.orig_video_lines = 25;
- screen_info.orig_video_cols = 80;
- screen_info.orig_video_ega_bx = 3;
- screen_info.orig_video_points = 16;
- screen_info.orig_y = screen_info.orig_video_lines - 1;
- if (xen_start_info->console.dom0.info_size >=
- sizeof(struct dom0_vga_console_info)) {
- const struct dom0_vga_console_info *info =
- (struct dom0_vga_console_info *)(
- (char *)xen_start_info +
- xen_start_info->console.dom0.info_off);
- dom0_init_screen_info(info);
- }
+ const struct dom0_vga_console_info *info =
+ (void *)((char *)xen_start_info +
+ xen_start_info->console.dom0.info_off);
+
+ dom0_init_screen_info(info,
+ xen_start_info->console.dom0.info_size);
xen_start_info->console.domU.mfn = 0;
xen_start_info->console.domU.evtchn = 0;
} else
diff -r 6cac8ecd995d -r 27b937c0095c arch/ia64/xen/hypervisor.c
--- a/arch/ia64/xen/hypervisor.c Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/ia64/xen/hypervisor.c Sun Oct 21 12:10:59 2007 -0600
@@ -55,21 +55,19 @@ void __init
void __init
xen_setup(char **cmdline_p)
{
+ struct dom0_vga_console_info *info;
extern void dig_setup(char **cmdline_p);
+
if (ia64_platform_is("xen"))
dig_setup(cmdline_p);
if (!is_running_on_xen() || !is_initial_xendomain())
return;
- if (xen_start_info->console.dom0.info_size >=
- sizeof(struct dom0_vga_console_info)) {
- const struct dom0_vga_console_info *info =
- (struct dom0_vga_console_info *)(
- (char *)xen_start_info +
- xen_start_info->console.dom0.info_off);
- dom0_init_screen_info(info);
- }
+ info = (void *)((char *)xen_start_info +
+ xen_start_info->console.dom0.info_off);
+ dom0_init_screen_info(info, xen_start_info->console.dom0.info_size);
+
xen_start_info->console.domU.mfn = 0;
xen_start_info->console.domU.evtchn = 0;
}
diff -r 6cac8ecd995d -r 27b937c0095c arch/ia64/xen/xcom_hcall.c
--- a/arch/ia64/xen/xcom_hcall.c Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/ia64/xen/xcom_hcall.c Sun Oct 21 12:10:59 2007 -0600
@@ -35,7 +35,7 @@
#include <xen/interface/physdev.h>
#include <xen/interface/grant_table.h>
#include <xen/interface/callback.h>
-#include <xen/interface/acm_ops.h>
+#include <xen/interface/xsm/acm_ops.h>
#include <xen/interface/hvm/params.h>
#include <xen/interface/xenoprof.h>
#include <xen/interface/vcpu.h>
diff -r 6cac8ecd995d -r 27b937c0095c arch/ia64/xen/xcom_privcmd.c
--- a/arch/ia64/xen/xcom_privcmd.c Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/ia64/xen/xcom_privcmd.c Sun Oct 21 12:10:59 2007 -0600
@@ -29,7 +29,7 @@
#include <xen/interface/memory.h>
#include <xen/interface/version.h>
#include <xen/interface/event_channel.h>
-#include <xen/interface/acm_ops.h>
+#include <xen/interface/xsm/acm_ops.h>
#include <xen/interface/hvm/params.h>
#include <xen/public/privcmd.h>
#include <asm/hypercall.h>
@@ -335,7 +335,7 @@ xencomm_privcmd_domctl(privcmd_hypercall
}
static int
-xencomm_privcmd_acm_op(privcmd_hypercall_t *hypercall)
+xencomm_privcmd_xsm_op(privcmd_hypercall_t *hypercall)
{
void __user *arg = (void __user *)hypercall->arg[0];
xen_acmctl_t kern_arg;
@@ -361,7 +361,7 @@ xencomm_privcmd_acm_op(privcmd_hypercall
set_xen_guest_handle(kern_arg.u.getssid.ssidbuf, (void *)desc);
- ret = xencomm_arch_hypercall_acm_op(op_desc);
+ ret = xencomm_arch_hypercall_xsm_op(op_desc);
xencomm_free(desc);
@@ -784,8 +784,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
return xencomm_privcmd_domctl(hypercall);
case __HYPERVISOR_sysctl:
return xencomm_privcmd_sysctl(hypercall);
- case __HYPERVISOR_acm_op:
- return xencomm_privcmd_acm_op(hypercall);
+ case __HYPERVISOR_xsm_op:
+ return xencomm_privcmd_xsm_op(hypercall);
case __HYPERVISOR_xen_version:
return xencomm_privcmd_xen_version(hypercall);
case __HYPERVISOR_memory_op:
diff -r 6cac8ecd995d -r 27b937c0095c arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/powerpc/platforms/xen/hcall.c Sun Oct 21 12:10:59 2007 -0600
@@ -34,7 +34,7 @@
#include <xen/interface/event_channel.h>
#include <xen/interface/physdev.h>
#include <xen/interface/vcpu.h>
-#include <xen/interface/acm_ops.h>
+#include <xen/interface/xsm/acm_ops.h>
#include <xen/interface/kexec.h>
#include <xen/public/privcmd.h>
#include <asm/hypercall.h>
diff -r 6cac8ecd995d -r 27b937c0095c arch/x86_64/kernel/acpi/Makefile
--- a/arch/x86_64/kernel/acpi/Makefile Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/x86_64/kernel/acpi/Makefile Sun Oct 21 12:10:59 2007 -0600
@@ -6,9 +6,3 @@ obj-y += processor.o
obj-y += processor.o
processor-y := ../../../i386/kernel/acpi/processor.o
../../../i386/kernel/acpi/cstate.o
endif
-
-boot-$(CONFIG_XEN) := ../../../i386/kernel/acpi/boot-xen.o
-ifdef CONFIG_XEN
-include $(srctree)/scripts/Makefile.xen
-obj-y := $(call cherrypickxen, $(obj-y))
-endif
diff -r 6cac8ecd995d -r 27b937c0095c arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c Wed Oct 17 10:27:10 2007 -0600
+++ b/arch/x86_64/kernel/setup-xen.c Sun Oct 21 12:10:59 2007 -0600
@@ -594,23 +594,12 @@ void __init setup_arch(char **cmdline_p)
screen_info = SCREEN_INFO;
if (is_initial_xendomain()) {
- /* This is drawn from a dump from vgacon:startup in
- * standard Linux. */
- screen_info.orig_video_mode = 3;
- screen_info.orig_video_isVGA = 1;
- screen_info.orig_video_lines = 25;
- screen_info.orig_video_cols = 80;
- screen_info.orig_video_ega_bx = 3;
- screen_info.orig_video_points = 16;
- screen_info.orig_y = screen_info.orig_video_lines - 1;
- if (xen_start_info->console.dom0.info_size >=
- sizeof(struct dom0_vga_console_info)) {
- const struct dom0_vga_console_info *info =
- (struct dom0_vga_console_info *)(
- (char *)xen_start_info +
- xen_start_info->console.dom0.info_off);
- dom0_init_screen_info(info);
- }
+ const struct dom0_vga_console_info *info =
+ (void *)((char *)xen_start_info +
+ xen_start_info->console.dom0.info_off);
+
+ dom0_init_screen_info(info,
+ xen_start_info->console.dom0.info_size);
xen_start_info->console.domU.mfn = 0;
xen_start_info->console.domU.evtchn = 0;
} else
diff -r 6cac8ecd995d -r 27b937c0095c buildconfigs/linux-defconfig_xen0_x86_32
--- a/buildconfigs/linux-defconfig_xen0_x86_32 Wed Oct 17 10:27:10 2007 -0600
+++ b/buildconfigs/linux-defconfig_xen0_x86_32 Sun Oct 21 12:10:59 2007 -0600
@@ -1,10 +1,9 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-xen0
-# Wed Jan 17 18:35:52 2007
+# Linux kernel version: 2.6.18.8
+# Tue Oct 16 09:31:19 2007
#
CONFIG_X86_32=y
-CONFIG_GENERIC_TIME=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
@@ -142,7 +141,6 @@ CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_GOOD_APIC=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
-CONFIG_X86_TSC=y
CONFIG_NR_CPUS=8
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
@@ -177,7 +175,7 @@ CONFIG_FLATMEM=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
# CONFIG_HIGHPTE is not set
CONFIG_MTRR=y
@@ -197,11 +195,18 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
# Power management options (ACPI, APM)
#
CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+CONFIG_SUSPEND_SMP=y
#
# ACPI (Advanced Configuration and Power Interface) Support
#
CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
@@ -210,6 +215,7 @@ CONFIG_ACPI_FAN=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=m
CONFIG_ACPI_PROCESSOR=m
+CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_THERMAL=m
CONFIG_ACPI_ASUS=m
CONFIG_ACPI_IBM=m
@@ -220,7 +226,8 @@ CONFIG_ACPI_EC=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
-# CONFIG_ACPI_CONTAINER is not set
+CONFIG_ACPI_CONTAINER=m
+CONFIG_ACPI_PV_SLEEP=y
#
# CPU Frequency scaling
@@ -394,7 +401,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
-# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_SYS_HYPERVISOR=y
#
# Connector - unified userspace <-> kernelspace linker
@@ -934,7 +941,6 @@ CONFIG_DRM_SIS=m
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
#
# Digital Video Broadcasting Devices
@@ -1386,7 +1392,7 @@ CONFIG_CRYPTO_CRC32C=m
#
# CONFIG_CRYPTO_DEV_PADLOCK is not set
CONFIG_XEN=y
-CONFIG_XEN_INTERFACE_VERSION=0x00030205
+CONFIG_XEN_INTERFACE_VERSION=0x00030206
#
# XEN
@@ -1405,6 +1411,7 @@ CONFIG_XEN_PCIDEV_BACKEND=y
# CONFIG_XEN_PCIDEV_BACKEND_VPCI is not set
CONFIG_XEN_PCIDEV_BACKEND_PASS=y
# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
+# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set
# CONFIG_XEN_PCIDEV_BE_DEBUG is not set
CONFIG_XEN_TPMDEV_BACKEND=m
CONFIG_XEN_BLKDEV_FRONTEND=y
@@ -1415,15 +1422,12 @@ CONFIG_XEN_COMPAT_030002_AND_LATER=y
CONFIG_XEN_COMPAT_030002_AND_LATER=y
# CONFIG_XEN_COMPAT_030004_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
-CONFIG_XEN_COMPAT_030002=y
-CONFIG_XEN_COMPAT_030004=y
+CONFIG_XEN_COMPAT=0x030002
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_NO_IDLE_HZ=y
-CONFIG_XEN_UTIL=y
+CONFIG_XEN_SMPBOOT=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_DEVMEM=y
-CONFIG_XEN_REBOOT=y
-CONFIG_XEN_SMPBOOT=y
#
# Library routines
diff -r 6cac8ecd995d -r 27b937c0095c buildconfigs/linux-defconfig_xen0_x86_64
--- a/buildconfigs/linux-defconfig_xen0_x86_64 Wed Oct 17 10:27:10 2007 -0600
+++ b/buildconfigs/linux-defconfig_xen0_x86_64 Sun Oct 21 12:10:59 2007 -0600
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Wed Jun 27 12:48:41 2007
+# Linux kernel version: 2.6.18.8
+# Tue Oct 16 09:32:39 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
@@ -129,7 +129,7 @@ CONFIG_FLATMEM=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_SWIOTLB=y
@@ -151,11 +151,17 @@ CONFIG_ISA_DMA_API=y
# Power management options
#
CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
#
# ACPI (Advanced Configuration and Power Interface) Support
#
CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
@@ -174,6 +180,7 @@ CONFIG_ACPI_POWER=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_ACPI_CONTAINER is not set
+CONFIG_ACPI_PV_SLEEP=y
#
# CPU Frequency scaling
@@ -868,7 +875,6 @@ CONFIG_DRM_SIS=m
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
#
# Digital Video Broadcasting Devices
@@ -1334,7 +1340,7 @@ CONFIG_CRYPTO_CRC32C=m
# Hardware crypto devices
#
CONFIG_XEN=y
-CONFIG_XEN_INTERFACE_VERSION=0x00030205
+CONFIG_XEN_INTERFACE_VERSION=0x00030206
#
# XEN
@@ -1367,6 +1373,8 @@ CONFIG_XEN_COMPAT=0x030002
CONFIG_XEN_COMPAT=0x030002
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_NO_IDLE_HZ=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_DEVMEM=y
#
# Library routines
diff -r 6cac8ecd995d -r 27b937c0095c buildconfigs/linux-defconfig_xenU_x86_32
--- a/buildconfigs/linux-defconfig_xenU_x86_32 Wed Oct 17 10:27:10 2007 -0600
+++ b/buildconfigs/linux-defconfig_xenU_x86_32 Sun Oct 21 12:10:59 2007 -0600
@@ -1,10 +1,9 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-xenU
-# Wed Jan 17 18:36:21 2007
+# Linux kernel version: 2.6.18.8
+# Tue Oct 16 09:31:29 2007
#
CONFIG_X86_32=y
-CONFIG_GENERIC_TIME=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
@@ -142,7 +141,6 @@ CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_GOOD_APIC=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
-CONFIG_X86_TSC=y
CONFIG_NR_CPUS=8
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
@@ -174,7 +172,7 @@ CONFIG_FLATMEM=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
# CONFIG_HIGHPTE is not set
# CONFIG_REGPARM is not set
@@ -305,7 +303,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
-# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_SYS_HYPERVISOR=y
#
# Connector - unified userspace <-> kernelspace linker
@@ -583,7 +581,6 @@ CONFIG_HW_RANDOM_VIA=y
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
#
# Digital Video Broadcasting Devices
@@ -906,7 +903,7 @@ CONFIG_CRYPTO_CRC32C=m
#
# CONFIG_CRYPTO_DEV_PADLOCK is not set
CONFIG_XEN=y
-CONFIG_XEN_INTERFACE_VERSION=0x00030205
+CONFIG_XEN_INTERFACE_VERSION=0x00030206
#
# XEN
@@ -924,15 +921,12 @@ CONFIG_XEN_COMPAT_030002_AND_LATER=y
CONFIG_XEN_COMPAT_030002_AND_LATER=y
# CONFIG_XEN_COMPAT_030004_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
-CONFIG_XEN_COMPAT_030002=y
-CONFIG_XEN_COMPAT_030004=y
+CONFIG_XEN_COMPAT=0x030002
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_NO_IDLE_HZ=y
-CONFIG_XEN_UTIL=y
+CONFIG_XEN_SMPBOOT=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_DEVMEM=y
-CONFIG_XEN_REBOOT=y
-CONFIG_XEN_SMPBOOT=y
#
# Library routines
diff -r 6cac8ecd995d -r 27b937c0095c buildconfigs/linux-defconfig_xenU_x86_64
--- a/buildconfigs/linux-defconfig_xenU_x86_64 Wed Oct 17 10:27:10 2007 -0600
+++ b/buildconfigs/linux-defconfig_xenU_x86_64 Sun Oct 21 12:10:59 2007 -0600
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Wed Jun 27 12:48:56 2007
+# Linux kernel version: 2.6.18.8
+# Tue Oct 16 09:32:52 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
@@ -131,7 +131,7 @@ CONFIG_FLATMEM=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_NR_CPUS=16
# CONFIG_HOTPLUG_CPU is not set
@@ -823,7 +823,6 @@ CONFIG_HW_RANDOM=y
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
#
# Digital Video Broadcasting Devices
@@ -1201,7 +1200,7 @@ CONFIG_CRYPTO_CRC32C=m
# Hardware crypto devices
#
CONFIG_XEN=y
-CONFIG_XEN_INTERFACE_VERSION=0x00030205
+CONFIG_XEN_INTERFACE_VERSION=0x00030206
#
# XEN
@@ -1223,6 +1222,8 @@ CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_NO_IDLE_HZ=y
CONFIG_XEN_SMPBOOT=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_DEVMEM=y
#
# Library routines
diff -r 6cac8ecd995d -r 27b937c0095c buildconfigs/linux-defconfig_xen_x86_32
--- a/buildconfigs/linux-defconfig_xen_x86_32 Wed Oct 17 10:27:10 2007 -0600
+++ b/buildconfigs/linux-defconfig_xen_x86_32 Sun Oct 21 12:10:59 2007 -0600
@@ -1,10 +1,9 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-xen
-# Wed Jan 17 18:39:50 2007
+# Linux kernel version: 2.6.18.8
+# Mon Oct 15 14:37:47 2007
#
CONFIG_X86_32=y
-CONFIG_GENERIC_TIME=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
@@ -147,7 +146,6 @@ CONFIG_X86_GOOD_APIC=y
CONFIG_X86_GOOD_APIC=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
-CONFIG_X86_TSC=y
CONFIG_NR_CPUS=32
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
@@ -182,7 +180,7 @@ CONFIG_FLATMEM=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
# CONFIG_HIGHPTE is not set
CONFIG_MTRR=y
@@ -204,6 +202,7 @@ CONFIG_PM=y
CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
CONFIG_PM_DEBUG=y
+# CONFIG_PM_TRACE is not set
# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SUSPEND_SMP=y
@@ -234,6 +233,7 @@ CONFIG_ACPI_SYSTEM=y
CONFIG_ACPI_SYSTEM=y
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_SBS=m
+CONFIG_ACPI_PV_SLEEP=y
#
# CPU Frequency scaling
@@ -257,7 +257,6 @@ CONFIG_XEN_PCIDEV_FRONTEND=y
# CONFIG_PCI_DEBUG is not set
CONFIG_ISA_DMA_API=y
CONFIG_SCx200=m
-CONFIG_SCx200HR_TIMER=m
CONFIG_K8_NB=y
#
@@ -804,7 +803,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=m
# CONFIG_DEBUG_DRIVER is not set
-# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_SYS_HYPERVISOR=y
#
# Connector - unified userspace <-> kernelspace linker
@@ -1277,7 +1276,6 @@ CONFIG_I2O=m
CONFIG_I2O=m
CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
CONFIG_I2O_EXT_ADAPTEC=y
-CONFIG_I2O_EXT_ADAPTEC_DMA64=y
CONFIG_I2O_CONFIG=m
CONFIG_I2O_CONFIG_OLD_IOCTL=y
CONFIG_I2O_BUS=m
@@ -3251,7 +3249,7 @@ CONFIG_CRYPTO_TEST=m
#
# CONFIG_CRYPTO_DEV_PADLOCK is not set
CONFIG_XEN=y
-CONFIG_XEN_INTERFACE_VERSION=0x00030205
+CONFIG_XEN_INTERFACE_VERSION=0x00030206
#
# XEN
@@ -3270,6 +3268,7 @@ CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
# CONFIG_XEN_PCIDEV_BACKEND_PASS is not set
# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
+# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set
# CONFIG_XEN_PCIDEV_BE_DEBUG is not set
CONFIG_XEN_TPMDEV_BACKEND=m
CONFIG_XEN_BLKDEV_FRONTEND=y
@@ -3282,15 +3281,12 @@ CONFIG_XEN_COMPAT_030002_AND_LATER=y
CONFIG_XEN_COMPAT_030002_AND_LATER=y
# CONFIG_XEN_COMPAT_030004_AND_LATER is not set
# CONFIG_XEN_COMPAT_LATEST_ONLY is not set
-CONFIG_XEN_COMPAT_030002=y
-CONFIG_XEN_COMPAT_030004=y
+CONFIG_XEN_COMPAT=0x030002
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_NO_IDLE_HZ=y
-CONFIG_XEN_UTIL=y
+CONFIG_XEN_SMPBOOT=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_DEVMEM=y
-CONFIG_XEN_REBOOT=y
-CONFIG_XEN_SMPBOOT=y
#
# Library routines
diff -r 6cac8ecd995d -r 27b937c0095c buildconfigs/linux-defconfig_xen_x86_64
--- a/buildconfigs/linux-defconfig_xen_x86_64 Wed Oct 17 10:27:10 2007 -0600
+++ b/buildconfigs/linux-defconfig_xen_x86_64 Sun Oct 21 12:10:59 2007 -0600
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Wed Jun 27 12:49:06 2007
+# Linux kernel version: 2.6.18.8
+# Tue Oct 16 09:32:25 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
@@ -136,7 +136,7 @@ CONFIG_FLATMEM=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_NR_CPUS=32
CONFIG_HOTPLUG_CPU=y
@@ -193,6 +193,7 @@ CONFIG_ACPI_SYSTEM=y
CONFIG_ACPI_SYSTEM=y
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_SBS=m
+CONFIG_ACPI_PV_SLEEP=y
#
# CPU Frequency scaling
@@ -3079,7 +3080,7 @@ CONFIG_CRYPTO_TEST=m
# Hardware crypto devices
#
CONFIG_XEN=y
-CONFIG_XEN_INTERFACE_VERSION=0x00030205
+CONFIG_XEN_INTERFACE_VERSION=0x00030206
#
# XEN
@@ -3115,6 +3116,8 @@ CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
CONFIG_NO_IDLE_HZ=y
CONFIG_XEN_SMPBOOT=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_DEVMEM=y
#
# Library routines
diff -r 6cac8ecd995d -r 27b937c0095c drivers/xen/Kconfig
--- a/drivers/xen/Kconfig Wed Oct 17 10:27:10 2007 -0600
+++ b/drivers/xen/Kconfig Sun Oct 21 12:10:59 2007 -0600
@@ -13,7 +13,7 @@ if XEN
if XEN
config XEN_INTERFACE_VERSION
hex
- default 0x00030205
+ default 0x00030206
menu "XEN"
diff -r 6cac8ecd995d -r 27b937c0095c drivers/xen/console/console.c
--- a/drivers/xen/console/console.c Wed Oct 17 10:27:10 2007 -0600
+++ b/drivers/xen/console/console.c Sun Oct 21 12:10:59 2007 -0600
@@ -276,13 +276,23 @@ void xencons_force_flush(void)
}
-void dom0_init_screen_info(const struct dom0_vga_console_info *info)
-{
+void __init dom0_init_screen_info(const struct dom0_vga_console_info *info,
size_t size)
+{
+ /* This is drawn from a dump from vgacon:startup in
+ * standard Linux. */
+ screen_info.orig_video_mode = 3;
+ screen_info.orig_video_isVGA = 1;
+ screen_info.orig_video_lines = 25;
+ screen_info.orig_video_cols = 80;
+ screen_info.orig_video_ega_bx = 3;
+ screen_info.orig_video_points = 16;
+ screen_info.orig_y = screen_info.orig_video_lines - 1;
+
switch (info->video_type) {
case XEN_VGATYPE_TEXT_MODE_3:
- screen_info.orig_video_mode = 3;
- screen_info.orig_video_ega_bx = 3;
- screen_info.orig_video_isVGA = 1;
+ if (size < offsetof(struct dom0_vga_console_info, u.text_mode_3)
+ + sizeof(info->u.text_mode_3))
+ break;
screen_info.orig_video_lines = info->u.text_mode_3.rows;
screen_info.orig_video_cols = info->u.text_mode_3.columns;
screen_info.orig_x = info->u.text_mode_3.cursor_x;
@@ -290,7 +300,11 @@ void dom0_init_screen_info(const struct
screen_info.orig_video_points =
info->u.text_mode_3.font_height;
break;
+
case XEN_VGATYPE_VESA_LFB:
+ if (size < offsetof(struct dom0_vga_console_info,
+ u.vesa_lfb.gbl_caps))
+ break;
screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB;
screen_info.lfb_width = info->u.vesa_lfb.width;
screen_info.lfb_height = info->u.vesa_lfb.height;
@@ -306,6 +320,14 @@ void dom0_init_screen_info(const struct
screen_info.blue_pos = info->u.vesa_lfb.blue_pos;
screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size;
screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos;
+ if (size >= offsetof(struct dom0_vga_console_info,
+ u.vesa_lfb.gbl_caps)
+ + sizeof(info->u.vesa_lfb.gbl_caps))
+ screen_info.capabilities = info->u.vesa_lfb.gbl_caps;
+ if (size >= offsetof(struct dom0_vga_console_info,
+ u.vesa_lfb.mode_attrs)
+ + sizeof(info->u.vesa_lfb.mode_attrs))
+ screen_info.vesa_attributes =
info->u.vesa_lfb.mode_attrs;
break;
}
}
diff -r 6cac8ecd995d -r 27b937c0095c fs/xfs/linux-2.6/xfs_buf.c
--- a/fs/xfs/linux-2.6/xfs_buf.c Wed Oct 17 10:27:10 2007 -0600
+++ b/fs/xfs/linux-2.6/xfs_buf.c Sun Oct 21 12:10:59 2007 -0600
@@ -181,6 +181,19 @@ free_address(
void *addr)
{
a_list_t *aentry;
+
+#ifdef CONFIG_XEN
+ /*
+ * Xen needs to be able to make sure it can get an exclusive
+ * RO mapping of pages it wants to turn into a pagetable. If
+ * a newly allocated page is also still being vmap()ed by xfs,
+ * it will cause pagetable construction to fail. This is a
+ * quick workaround to always eagerly unmap pages so that Xen
+ * is happy.
+ */
+ vunmap(addr);
+ return;
+#endif
aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
if (likely(aentry)) {
diff -r 6cac8ecd995d -r 27b937c0095c
include/asm-i386/mach-xen/asm/pgtable-2level.h
--- a/include/asm-i386/mach-xen/asm/pgtable-2level.h Wed Oct 17 10:27:10
2007 -0600
+++ b/include/asm-i386/mach-xen/asm/pgtable-2level.h Sun Oct 21 12:10:59
2007 -0600
@@ -44,10 +44,9 @@ static inline pte_t ptep_get_and_clear(s
{
pte_t pte = *ptep;
if (!pte_none(pte)) {
- if (mm != &init_mm)
+ if ((mm != &init_mm) ||
+ HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
pte = __pte_ma(xchg(&ptep->pte_low, 0));
- else
- HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
}
return pte;
}
diff -r 6cac8ecd995d -r 27b937c0095c
include/asm-i386/mach-xen/asm/pgtable-3level.h
--- a/include/asm-i386/mach-xen/asm/pgtable-3level.h Wed Oct 17 10:27:10
2007 -0600
+++ b/include/asm-i386/mach-xen/asm/pgtable-3level.h Sun Oct 21 12:10:59
2007 -0600
@@ -128,7 +128,8 @@ static inline pte_t ptep_get_and_clear(s
{
pte_t pte = *ptep;
if (!pte_none(pte)) {
- if (mm != &init_mm) {
+ if ((mm != &init_mm) ||
+ HYPERVISOR_update_va_mapping(addr, __pte(0), 0)) {
uint64_t val = __pte_val(pte);
if (__cmpxchg64(ptep, val, 0) != val) {
/* xchg acts as a barrier before the setting of
the high bits */
@@ -136,8 +137,7 @@ static inline pte_t ptep_get_and_clear(s
pte.pte_high = ptep->pte_high;
ptep->pte_high = 0;
}
- } else
- HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
+ }
}
return pte;
}
diff -r 6cac8ecd995d -r 27b937c0095c include/asm-ia64/hypercall.h
--- a/include/asm-ia64/hypercall.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/asm-ia64/hypercall.h Sun Oct 21 12:10:59 2007 -0600
@@ -157,9 +157,9 @@ xencomm_arch_hypercall_event_channel_op(
}
static inline int
-xencomm_arch_hypercall_acm_op(struct xencomm_handle *arg)
-{
- return _hypercall1(int, acm_op, arg);
+xencomm_arch_hypercall_xsm_op(struct xencomm_handle *arg)
+{
+ return _hypercall1(int, xsm_op, arg);
}
static inline int
diff -r 6cac8ecd995d -r 27b937c0095c include/asm-x86_64/mach-xen/asm/pgtable.h
--- a/include/asm-x86_64/mach-xen/asm/pgtable.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/asm-x86_64/mach-xen/asm/pgtable.h Sun Oct 21 12:10:59 2007 -0600
@@ -285,10 +285,9 @@ static inline pte_t ptep_get_and_clear(s
{
pte_t pte = *ptep;
if (!pte_none(pte)) {
- if (mm != &init_mm)
+ if ((mm != &init_mm) ||
+ HYPERVISOR_update_va_mapping(addr, __pte(0), 0))
pte = __pte_ma(xchg(&ptep->pte, 0));
- else
- HYPERVISOR_update_va_mapping(addr, __pte(0), 0);
}
return pte;
}
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/arch-x86/hvm/save.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/arch-x86/hvm/save.h Sun Oct 21 12:10:59 2007 -0600
@@ -0,0 +1,413 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
+ *
+ * Copyright (c) 2007 XenSource Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_PUBLIC_HVM_SAVE_X86_H__
+#define __XEN_PUBLIC_HVM_SAVE_X86_H__
+
+/*
+ * Save/restore header: general info about the save file.
+ */
+
+#define HVM_FILE_MAGIC 0x54381286
+#define HVM_FILE_VERSION 0x00000001
+
+struct hvm_save_header {
+ uint32_t magic; /* Must be HVM_FILE_MAGIC */
+ uint32_t version; /* File format version */
+ uint64_t changeset; /* Version of Xen that saved this file */
+ uint32_t cpuid; /* CPUID[0x01][%eax] on the saving machine */
+ uint32_t pad0;
+};
+
+DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
+
+
+/*
+ * Processor
+ */
+
+struct hvm_hw_cpu {
+ uint8_t fpu_regs[512];
+
+ uint64_t rax;
+ uint64_t rbx;
+ uint64_t rcx;
+ uint64_t rdx;
+ uint64_t rbp;
+ uint64_t rsi;
+ uint64_t rdi;
+ uint64_t rsp;
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+
+ uint64_t rip;
+ uint64_t rflags;
+
+ uint64_t cr0;
+ uint64_t cr2;
+ uint64_t cr3;
+ uint64_t cr4;
+
+ uint64_t dr0;
+ uint64_t dr1;
+ uint64_t dr2;
+ uint64_t dr3;
+ uint64_t dr6;
+ uint64_t dr7;
+
+ uint32_t cs_sel;
+ uint32_t ds_sel;
+ uint32_t es_sel;
+ uint32_t fs_sel;
+ uint32_t gs_sel;
+ uint32_t ss_sel;
+ uint32_t tr_sel;
+ uint32_t ldtr_sel;
+
+ uint32_t cs_limit;
+ uint32_t ds_limit;
+ uint32_t es_limit;
+ uint32_t fs_limit;
+ uint32_t gs_limit;
+ uint32_t ss_limit;
+ uint32_t tr_limit;
+ uint32_t ldtr_limit;
+ uint32_t idtr_limit;
+ uint32_t gdtr_limit;
+
+ uint64_t cs_base;
+ uint64_t ds_base;
+ uint64_t es_base;
+ uint64_t fs_base;
+ uint64_t gs_base;
+ uint64_t ss_base;
+ uint64_t tr_base;
+ uint64_t ldtr_base;
+ uint64_t idtr_base;
+ uint64_t gdtr_base;
+
+ uint32_t cs_arbytes;
+ uint32_t ds_arbytes;
+ uint32_t es_arbytes;
+ uint32_t fs_arbytes;
+ uint32_t gs_arbytes;
+ uint32_t ss_arbytes;
+ uint32_t tr_arbytes;
+ uint32_t ldtr_arbytes;
+
+ uint32_t sysenter_cs;
+ uint32_t padding0;
+
+ uint64_t sysenter_esp;
+ uint64_t sysenter_eip;
+
+ /* msr for em64t */
+ uint64_t shadow_gs;
+
+ /* msr content saved/restored. */
+ uint64_t msr_flags;
+ uint64_t msr_lstar;
+ uint64_t msr_star;
+ uint64_t msr_cstar;
+ uint64_t msr_syscall_mask;
+ uint64_t msr_efer;
+
+ /* guest's idea of what rdtsc() would return */
+ uint64_t tsc;
+
+ /* pending event, if any */
+ union {
+ uint32_t pending_event;
+ struct {
+ uint8_t pending_vector:8;
+ uint8_t pending_type:3;
+ uint8_t pending_error_valid:1;
+ uint32_t pending_reserved:19;
+ uint8_t pending_valid:1;
+ };
+ };
+ /* error code for pending event */
+ uint32_t error_code;
+};
+
+DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_cpu);
+
+
+/*
+ * PIC
+ */
+
+struct hvm_hw_vpic {
+ /* IR line bitmasks. */
+ uint8_t irr;
+ uint8_t imr;
+ uint8_t isr;
+
+ /* Line IRx maps to IRQ irq_base+x */
+ uint8_t irq_base;
+
+ /*
+ * Where are we in ICW2-4 initialisation (0 means no init in progress)?
+ * Bits 0-1 (=x): Next write at A=1 sets ICW(x+1).
+ * Bit 2: ICW1.IC4 (1 == ICW4 included in init sequence)
+ * Bit 3: ICW1.SNGL (0 == ICW3 included in init sequence)
+ */
+ uint8_t init_state:4;
+
+ /* IR line with highest priority. */
+ uint8_t priority_add:4;
+
+ /* Reads from A=0 obtain ISR or IRR? */
+ uint8_t readsel_isr:1;
+
+ /* Reads perform a polling read? */
+ uint8_t poll:1;
+
+ /* Automatically clear IRQs from the ISR during INTA? */
+ uint8_t auto_eoi:1;
+
+ /* Automatically rotate IRQ priorities during AEOI? */
+ uint8_t rotate_on_auto_eoi:1;
+
+ /* Exclude slave inputs when considering in-service IRQs? */
+ uint8_t special_fully_nested_mode:1;
+
+ /* Special mask mode excludes masked IRs from AEOI and priority checks. */
+ uint8_t special_mask_mode:1;
+
+ /* Is this a master PIC or slave PIC? (NB. This is not programmable.) */
+ uint8_t is_master:1;
+
+ /* Edge/trigger selection. */
+ uint8_t elcr;
+
+ /* Virtual INT output. */
+ uint8_t int_output;
+};
+
+DECLARE_HVM_SAVE_TYPE(PIC, 3, struct hvm_hw_vpic);
+
+
+/*
+ * IO-APIC
+ */
+
+#ifdef __ia64__
+#define VIOAPIC_IS_IOSAPIC 1
+#define VIOAPIC_NUM_PINS 24
+#else
+#define VIOAPIC_NUM_PINS 48 /* 16 ISA IRQs, 32 non-legacy PCI IRQS. */
+#endif
+
+struct hvm_hw_vioapic {
+ uint64_t base_address;
+ uint32_t ioregsel;
+ uint32_t id;
+ union vioapic_redir_entry
+ {
+ uint64_t bits;
+ struct {
+ uint8_t vector;
+ uint8_t delivery_mode:3;
+ uint8_t dest_mode:1;
+ uint8_t delivery_status:1;
+ uint8_t polarity:1;
+ uint8_t remote_irr:1;
+ uint8_t trig_mode:1;
+ uint8_t mask:1;
+ uint8_t reserve:7;
+#if !VIOAPIC_IS_IOSAPIC
+ uint8_t reserved[4];
+ uint8_t dest_id;
+#else
+ uint8_t reserved[3];
+ uint16_t dest_id;
+#endif
+ } fields;
+ } redirtbl[VIOAPIC_NUM_PINS];
+};
+
+DECLARE_HVM_SAVE_TYPE(IOAPIC, 4, struct hvm_hw_vioapic);
+
+
+/*
+ * LAPIC
+ */
+
+struct hvm_hw_lapic {
+ uint64_t apic_base_msr;
+ uint32_t disabled; /* VLAPIC_xx_DISABLED */
+ uint32_t timer_divisor;
+};
+
+DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic);
+
+struct hvm_hw_lapic_regs {
+ /* A 4k page of register state */
+ uint8_t data[0x400];
+};
+
+DECLARE_HVM_SAVE_TYPE(LAPIC_REGS, 6, struct hvm_hw_lapic_regs);
+
+
+/*
+ * IRQs
+ */
+
+struct hvm_hw_pci_irqs {
+ /*
+ * Virtual interrupt wires for a single PCI bus.
+ * Indexed by: device*4 + INTx#.
+ */
+ union {
+ DECLARE_BITMAP(i, 32*4);
+ uint64_t pad[2];
+ };
+};
+
+DECLARE_HVM_SAVE_TYPE(PCI_IRQ, 7, struct hvm_hw_pci_irqs);
+
+struct hvm_hw_isa_irqs {
+ /*
+ * Virtual interrupt wires for ISA devices.
+ * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
+ */
+ union {
+ DECLARE_BITMAP(i, 16);
+ uint64_t pad[1];
+ };
+};
+
+DECLARE_HVM_SAVE_TYPE(ISA_IRQ, 8, struct hvm_hw_isa_irqs);
+
+struct hvm_hw_pci_link {
+ /*
+ * PCI-ISA interrupt router.
+ * Each PCI <device:INTx#> is 'wire-ORed' into one of four links using
+ * the traditional 'barber's pole' mapping ((device + INTx#) & 3).
+ * The router provides a programmable mapping from each link to a GSI.
+ */
+ uint8_t route[4];
+ uint8_t pad0[4];
+};
+
+DECLARE_HVM_SAVE_TYPE(PCI_LINK, 9, struct hvm_hw_pci_link);
+
+/*
+ * PIT
+ */
+
+struct hvm_hw_pit {
+ struct hvm_hw_pit_channel {
+ uint32_t count; /* can be 65536 */
+ uint16_t latched_count;
+ uint8_t count_latched;
+ uint8_t status_latched;
+ uint8_t status;
+ uint8_t read_state;
+ uint8_t write_state;
+ uint8_t write_latch;
+ uint8_t rw_mode;
+ uint8_t mode;
+ uint8_t bcd; /* not supported */
+ uint8_t gate; /* timer start */
+ } channels[3]; /* 3 x 16 bytes */
+ uint32_t speaker_data_on;
+ uint32_t pad0;
+};
+
+DECLARE_HVM_SAVE_TYPE(PIT, 10, struct hvm_hw_pit);
+
+
+/*
+ * RTC
+ */
+
+#define RTC_CMOS_SIZE 14
+struct hvm_hw_rtc {
+ /* CMOS bytes */
+ uint8_t cmos_data[RTC_CMOS_SIZE];
+ /* Index register for 2-part operations */
+ uint8_t cmos_index;
+ uint8_t pad0;
+};
+
+DECLARE_HVM_SAVE_TYPE(RTC, 11, struct hvm_hw_rtc);
+
+
+/*
+ * HPET
+ */
+
+#define HPET_TIMER_NUM 3 /* 3 timers supported now */
+struct hvm_hw_hpet {
+ /* Memory-mapped, software visible registers */
+ uint64_t capability; /* capabilities */
+ uint64_t res0; /* reserved */
+ uint64_t config; /* configuration */
+ uint64_t res1; /* reserved */
+ uint64_t isr; /* interrupt status reg */
+ uint64_t res2[25]; /* reserved */
+ uint64_t mc64; /* main counter */
+ uint64_t res3; /* reserved */
+ struct { /* timers */
+ uint64_t config; /* configuration/cap */
+ uint64_t cmp; /* comparator */
+ uint64_t fsb; /* FSB route, not supported now */
+ uint64_t res4; /* reserved */
+ } timers[HPET_TIMER_NUM];
+ uint64_t res5[4*(24-HPET_TIMER_NUM)]; /* reserved, up to 0x3ff */
+
+ /* Hidden register state */
+ uint64_t period[HPET_TIMER_NUM]; /* Last value written to comparator */
+};
+
+DECLARE_HVM_SAVE_TYPE(HPET, 12, struct hvm_hw_hpet);
+
+
+/*
+ * PM timer
+ */
+
+struct hvm_hw_pmtimer {
+ uint32_t tmr_val; /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
+ uint16_t pm1a_sts; /* PM1a_EVT_BLK.PM1a_STS: status register */
+ uint16_t pm1a_en; /* PM1a_EVT_BLK.PM1a_EN: enable register */
+};
+
+DECLARE_HVM_SAVE_TYPE(PMTIMER, 13, struct hvm_hw_pmtimer);
+
+/*
+ * Largest type-code in use
+ */
+#define HVM_SAVE_CODE_MAX 13
+
+#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/arch-x86/xen-x86_32.h
--- a/include/xen/interface/arch-x86/xen-x86_32.h Wed Oct 17 10:27:10
2007 -0600
+++ b/include/xen/interface/arch-x86/xen-x86_32.h Sun Oct 21 12:10:59
2007 -0600
@@ -64,18 +64,34 @@
#define FLAT_USER_DS FLAT_RING3_DS
#define FLAT_USER_SS FLAT_RING3_SS
-/*
- * Virtual addresses beyond this are not modifiable by guest OSes. The
- * machine->physical mapping table starts at this address, read-only.
- */
+#define __HYPERVISOR_VIRT_START_PAE 0xF5800000
+#define __MACH2PHYS_VIRT_START_PAE 0xF5800000
+#define __MACH2PHYS_VIRT_END_PAE 0xF6800000
+#define HYPERVISOR_VIRT_START_PAE \
+ mk_unsigned_long(__HYPERVISOR_VIRT_START_PAE)
+#define MACH2PHYS_VIRT_START_PAE \
+ mk_unsigned_long(__MACH2PHYS_VIRT_START_PAE)
+#define MACH2PHYS_VIRT_END_PAE \
+ mk_unsigned_long(__MACH2PHYS_VIRT_END_PAE)
+
+#define __HYPERVISOR_VIRT_START_NONPAE 0xFC000000
+#define __MACH2PHYS_VIRT_START_NONPAE 0xFC000000
+#define __MACH2PHYS_VIRT_END_NONPAE 0xFC400000
+#define HYPERVISOR_VIRT_START_NONPAE \
+ mk_unsigned_long(__HYPERVISOR_VIRT_START_NONPAE)
+#define MACH2PHYS_VIRT_START_NONPAE \
+ mk_unsigned_long(__MACH2PHYS_VIRT_START_NONPAE)
+#define MACH2PHYS_VIRT_END_NONPAE \
+ mk_unsigned_long(__MACH2PHYS_VIRT_END_NONPAE)
+
#ifdef CONFIG_X86_PAE
-#define __HYPERVISOR_VIRT_START 0xF5800000
-#define __MACH2PHYS_VIRT_START 0xF5800000
-#define __MACH2PHYS_VIRT_END 0xF6800000
+#define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_PAE
+#define __MACH2PHYS_VIRT_START __MACH2PHYS_VIRT_START_PAE
+#define __MACH2PHYS_VIRT_END __MACH2PHYS_VIRT_END_PAE
#else
-#define __HYPERVISOR_VIRT_START 0xFC000000
-#define __MACH2PHYS_VIRT_START 0xFC000000
-#define __MACH2PHYS_VIRT_END 0xFC400000
+#define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_NONPAE
+#define __MACH2PHYS_VIRT_START __MACH2PHYS_VIRT_START_NONPAE
+#define __MACH2PHYS_VIRT_END __MACH2PHYS_VIRT_END_NONPAE
#endif
#ifndef HYPERVISOR_VIRT_START
@@ -103,7 +119,8 @@
(hnd).p = val; \
} while ( 0 )
#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
-#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
+#define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
+#define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
#endif
#ifndef __ASSEMBLY__
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/arch-x86/xen.h Sun Oct 21 12:10:59 2007 -0600
@@ -37,7 +37,8 @@
#endif
#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
-#define XEN_GUEST_HANDLE(name) __guest_handle_ ## name
+#define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name
+#define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)
#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0)
#ifdef __XEN_TOOLS__
#define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/domctl.h Sun Oct 21 12:10:59 2007 -0600
@@ -85,6 +85,9 @@ struct xen_domctl_getdomaininfo {
/* Domain is currently running. */
#define _XEN_DOMINF_running 5
#define XEN_DOMINF_running (1U<<_XEN_DOMINF_running)
+ /* Being debugged. */
+#define _XEN_DOMINF_debugged 6
+#define XEN_DOMINF_debugged (1U<<_XEN_DOMINF_debugged)
/* CPU to which this domain is bound. */
#define XEN_DOMINF_cpumask 255
#define XEN_DOMINF_cpushift 8
@@ -377,6 +380,7 @@ typedef struct xen_domctl_arch_setup {
uint64_aligned_t maxmem; /* Highest memory address for MDT. */
uint64_aligned_t xsi_va; /* Xen shared_info area virtual address. */
uint32_t hypercall_imm; /* Break imm for Xen hypercalls. */
+ int8_t vhpt_size_log2; /* Log2 of VHPT size. */
#endif
} xen_domctl_arch_setup_t;
DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
@@ -429,7 +433,69 @@ typedef struct xen_domctl_sendtrigger xe
typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t;
DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
-
+
+/* Assign PCI device to HVM guest. Sets up IOMMU structures. */
+#define XEN_DOMCTL_assign_device 37
+#define DPCI_ADD_MAPPING 1
+#define DPCI_REMOVE_MAPPING 0
+struct xen_domctl_assign_device {
+ uint32_t machine_bdf; /* machine PCI ID of assigned device */
+};
+typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
+
+
+/* Pass-through interrupts: bind real irq -> hvm devfn. */
+#define XEN_DOMCTL_bind_pt_irq 38
+typedef enum pt_irq_type_e {
+ PT_IRQ_TYPE_PCI,
+ PT_IRQ_TYPE_ISA
+} pt_irq_type_t;
+struct xen_domctl_bind_pt_irq {
+ uint32_t machine_irq;
+ pt_irq_type_t irq_type;
+ uint32_t hvm_domid;
+
+ union {
+ struct {
+ uint8_t isa_irq;
+ } isa;
+ struct {
+ uint8_t bus;
+ uint8_t device;
+ uint8_t intx;
+ } pci;
+ } u;
+};
+typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_pt_irq_t);
+
+
+/* Bind machine I/O address range -> HVM address range. */
+#define XEN_DOMCTL_memory_mapping 39
+struct xen_domctl_memory_mapping {
+ uint64_t first_gfn; /* first page (hvm guest phys page) in range */
+ uint64_t first_mfn; /* first page (machine page) in range */
+ uint64_t nr_mfns; /* number of pages in range (>0) */
+ uint32_t add_mapping; /* add or remove mapping */
+ uint32_t padding; /* padding for 64-bit aligned structure */
+};
+typedef struct xen_domctl_memory_mapping xen_domctl_memory_mapping_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_memory_mapping_t);
+
+
+/* Bind machine I/O port range -> HVM I/O port range. */
+#define XEN_DOMCTL_ioport_mapping 40
+struct xen_domctl_ioport_mapping {
+ uint32_t first_gport; /* first guest IO port*/
+ uint32_t first_mport; /* first machine IO port */
+ uint32_t nr_ports; /* size of port range */
+ uint32_t add_mapping; /* add or remove mapping */
+};
+typedef struct xen_domctl_ioport_mapping xen_domctl_ioport_mapping_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_mapping_t);
+
+
struct xen_domctl {
uint32_t cmd;
uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
@@ -459,6 +525,10 @@ struct xen_domctl {
struct xen_domctl_hvmcontext hvmcontext;
struct xen_domctl_address_size address_size;
struct xen_domctl_sendtrigger sendtrigger;
+ struct xen_domctl_assign_device assign_device;
+ struct xen_domctl_bind_pt_irq bind_pt_irq;
+ struct xen_domctl_memory_mapping memory_mapping;
+ struct xen_domctl_ioport_mapping ioport_mapping;
uint8_t pad[128];
} u;
};
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/hvm/hvm_op.h
--- a/include/xen/interface/hvm/hvm_op.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/hvm/hvm_op.h Sun Oct 21 12:10:59 2007 -0600
@@ -70,4 +70,7 @@ typedef struct xen_hvm_set_pci_link_rout
typedef struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t;
DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t);
+/* Flushes all VCPU TLBs: @arg must be NULL. */
+#define HVMOP_flush_tlbs 5
+
#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/hvm/params.h
--- a/include/xen/interface/hvm/params.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/hvm/params.h Sun Oct 21 12:10:59 2007 -0600
@@ -52,7 +52,8 @@
#ifdef __ia64__
#define HVM_PARAM_NVRAM_FD 7
-#define HVM_NR_PARAMS 8
+#define HVM_PARAM_VHPT_SIZE 8
+#define HVM_NR_PARAMS 9
#else
#define HVM_NR_PARAMS 7
#endif
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/hvm/save.h
--- a/include/xen/interface/hvm/save.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/hvm/save.h Sun Oct 21 12:10:59 2007 -0600
@@ -3,7 +3,6 @@
*
* Structure definitions for HVM state that is held by Xen and must
* be saved along with the domain's memory and device-model state.
- *
*
* Copyright (c) 2007 XenSource Ltd.
*
@@ -67,391 +66,6 @@ struct hvm_save_descriptor {
/*
- * Save/restore header: general info about the save file.
- */
-
-#define HVM_FILE_MAGIC 0x54381286
-#define HVM_FILE_VERSION 0x00000001
-
-struct hvm_save_header {
- uint32_t magic; /* Must be HVM_FILE_MAGIC */
- uint32_t version; /* File format version */
- uint64_t changeset; /* Version of Xen that saved this file */
- uint32_t cpuid; /* CPUID[0x01][%eax] on the saving machine */
- uint32_t pad0;
-};
-
-DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
-
-
-/*
- * Processor
- */
-
-struct hvm_hw_cpu {
- uint8_t fpu_regs[512];
-
- uint64_t rax;
- uint64_t rbx;
- uint64_t rcx;
- uint64_t rdx;
- uint64_t rbp;
- uint64_t rsi;
- uint64_t rdi;
- uint64_t rsp;
- uint64_t r8;
- uint64_t r9;
- uint64_t r10;
- uint64_t r11;
- uint64_t r12;
- uint64_t r13;
- uint64_t r14;
- uint64_t r15;
-
- uint64_t rip;
- uint64_t rflags;
-
- uint64_t cr0;
- uint64_t cr2;
- uint64_t cr3;
- uint64_t cr4;
-
- uint64_t dr0;
- uint64_t dr1;
- uint64_t dr2;
- uint64_t dr3;
- uint64_t dr6;
- uint64_t dr7;
-
- uint32_t cs_sel;
- uint32_t ds_sel;
- uint32_t es_sel;
- uint32_t fs_sel;
- uint32_t gs_sel;
- uint32_t ss_sel;
- uint32_t tr_sel;
- uint32_t ldtr_sel;
-
- uint32_t cs_limit;
- uint32_t ds_limit;
- uint32_t es_limit;
- uint32_t fs_limit;
- uint32_t gs_limit;
- uint32_t ss_limit;
- uint32_t tr_limit;
- uint32_t ldtr_limit;
- uint32_t idtr_limit;
- uint32_t gdtr_limit;
-
- uint64_t cs_base;
- uint64_t ds_base;
- uint64_t es_base;
- uint64_t fs_base;
- uint64_t gs_base;
- uint64_t ss_base;
- uint64_t tr_base;
- uint64_t ldtr_base;
- uint64_t idtr_base;
- uint64_t gdtr_base;
-
- uint32_t cs_arbytes;
- uint32_t ds_arbytes;
- uint32_t es_arbytes;
- uint32_t fs_arbytes;
- uint32_t gs_arbytes;
- uint32_t ss_arbytes;
- uint32_t tr_arbytes;
- uint32_t ldtr_arbytes;
-
- uint32_t sysenter_cs;
- uint32_t padding0;
-
- uint64_t sysenter_esp;
- uint64_t sysenter_eip;
-
- /* msr for em64t */
- uint64_t shadow_gs;
-
- /* msr content saved/restored. */
- uint64_t msr_flags;
- uint64_t msr_lstar;
- uint64_t msr_star;
- uint64_t msr_cstar;
- uint64_t msr_syscall_mask;
- uint64_t msr_efer;
-
- /* guest's idea of what rdtsc() would return */
- uint64_t tsc;
-
- /* pending event, if any */
- union {
- uint32_t pending_event;
- struct {
- uint8_t pending_vector:8;
- uint8_t pending_type:3;
- uint8_t pending_error_valid:1;
- uint32_t pending_reserved:19;
- uint8_t pending_valid:1;
- };
- };
- /* error code for pending event */
- uint32_t error_code;
-};
-
-DECLARE_HVM_SAVE_TYPE(CPU, 2, struct hvm_hw_cpu);
-
-
-/*
- * PIC
- */
-
-struct hvm_hw_vpic {
- /* IR line bitmasks. */
- uint8_t irr;
- uint8_t imr;
- uint8_t isr;
-
- /* Line IRx maps to IRQ irq_base+x */
- uint8_t irq_base;
-
- /*
- * Where are we in ICW2-4 initialisation (0 means no init in progress)?
- * Bits 0-1 (=x): Next write at A=1 sets ICW(x+1).
- * Bit 2: ICW1.IC4 (1 == ICW4 included in init sequence)
- * Bit 3: ICW1.SNGL (0 == ICW3 included in init sequence)
- */
- uint8_t init_state:4;
-
- /* IR line with highest priority. */
- uint8_t priority_add:4;
-
- /* Reads from A=0 obtain ISR or IRR? */
- uint8_t readsel_isr:1;
-
- /* Reads perform a polling read? */
- uint8_t poll:1;
-
- /* Automatically clear IRQs from the ISR during INTA? */
- uint8_t auto_eoi:1;
-
- /* Automatically rotate IRQ priorities during AEOI? */
- uint8_t rotate_on_auto_eoi:1;
-
- /* Exclude slave inputs when considering in-service IRQs? */
- uint8_t special_fully_nested_mode:1;
-
- /* Special mask mode excludes masked IRs from AEOI and priority checks. */
- uint8_t special_mask_mode:1;
-
- /* Is this a master PIC or slave PIC? (NB. This is not programmable.) */
- uint8_t is_master:1;
-
- /* Edge/trigger selection. */
- uint8_t elcr;
-
- /* Virtual INT output. */
- uint8_t int_output;
-};
-
-DECLARE_HVM_SAVE_TYPE(PIC, 3, struct hvm_hw_vpic);
-
-
-/*
- * IO-APIC
- */
-
-#ifdef __ia64__
-#define VIOAPIC_IS_IOSAPIC 1
-#define VIOAPIC_NUM_PINS 24
-#else
-#define VIOAPIC_NUM_PINS 48 /* 16 ISA IRQs, 32 non-legacy PCI IRQS. */
-#endif
-
-struct hvm_hw_vioapic {
- uint64_t base_address;
- uint32_t ioregsel;
- uint32_t id;
- union vioapic_redir_entry
- {
- uint64_t bits;
- struct {
- uint8_t vector;
- uint8_t delivery_mode:3;
- uint8_t dest_mode:1;
- uint8_t delivery_status:1;
- uint8_t polarity:1;
- uint8_t remote_irr:1;
- uint8_t trig_mode:1;
- uint8_t mask:1;
- uint8_t reserve:7;
-#if !VIOAPIC_IS_IOSAPIC
- uint8_t reserved[4];
- uint8_t dest_id;
-#else
- uint8_t reserved[3];
- uint16_t dest_id;
-#endif
- } fields;
- } redirtbl[VIOAPIC_NUM_PINS];
-};
-
-DECLARE_HVM_SAVE_TYPE(IOAPIC, 4, struct hvm_hw_vioapic);
-
-
-/*
- * LAPIC
- */
-
-struct hvm_hw_lapic {
- uint64_t apic_base_msr;
- uint32_t disabled; /* VLAPIC_xx_DISABLED */
- uint32_t timer_divisor;
-};
-
-DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic);
-
-struct hvm_hw_lapic_regs {
- /* A 4k page of register state */
- uint8_t data[0x400];
-};
-
-DECLARE_HVM_SAVE_TYPE(LAPIC_REGS, 6, struct hvm_hw_lapic_regs);
-
-
-/*
- * IRQs
- */
-
-struct hvm_hw_pci_irqs {
- /*
- * Virtual interrupt wires for a single PCI bus.
- * Indexed by: device*4 + INTx#.
- */
- union {
- DECLARE_BITMAP(i, 32*4);
- uint64_t pad[2];
- };
-};
-
-DECLARE_HVM_SAVE_TYPE(PCI_IRQ, 7, struct hvm_hw_pci_irqs);
-
-struct hvm_hw_isa_irqs {
- /*
- * Virtual interrupt wires for ISA devices.
- * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
- */
- union {
- DECLARE_BITMAP(i, 16);
- uint64_t pad[1];
- };
-};
-
-DECLARE_HVM_SAVE_TYPE(ISA_IRQ, 8, struct hvm_hw_isa_irqs);
-
-struct hvm_hw_pci_link {
- /*
- * PCI-ISA interrupt router.
- * Each PCI <device:INTx#> is 'wire-ORed' into one of four links using
- * the traditional 'barber's pole' mapping ((device + INTx#) & 3).
- * The router provides a programmable mapping from each link to a GSI.
- */
- uint8_t route[4];
- uint8_t pad0[4];
-};
-
-DECLARE_HVM_SAVE_TYPE(PCI_LINK, 9, struct hvm_hw_pci_link);
-
-/*
- * PIT
- */
-
-struct hvm_hw_pit {
- struct hvm_hw_pit_channel {
- uint32_t count; /* can be 65536 */
- uint16_t latched_count;
- uint8_t count_latched;
- uint8_t status_latched;
- uint8_t status;
- uint8_t read_state;
- uint8_t write_state;
- uint8_t write_latch;
- uint8_t rw_mode;
- uint8_t mode;
- uint8_t bcd; /* not supported */
- uint8_t gate; /* timer start */
- } channels[3]; /* 3 x 16 bytes */
- uint32_t speaker_data_on;
- uint32_t pad0;
-};
-
-DECLARE_HVM_SAVE_TYPE(PIT, 10, struct hvm_hw_pit);
-
-
-/*
- * RTC
- */
-
-#define RTC_CMOS_SIZE 14
-struct hvm_hw_rtc {
- /* CMOS bytes */
- uint8_t cmos_data[RTC_CMOS_SIZE];
- /* Index register for 2-part operations */
- uint8_t cmos_index;
- uint8_t pad0;
-};
-
-DECLARE_HVM_SAVE_TYPE(RTC, 11, struct hvm_hw_rtc);
-
-
-/*
- * HPET
- */
-
-#define HPET_TIMER_NUM 3 /* 3 timers supported now */
-struct hvm_hw_hpet {
- /* Memory-mapped, software visible registers */
- uint64_t capability; /* capabilities */
- uint64_t res0; /* reserved */
- uint64_t config; /* configuration */
- uint64_t res1; /* reserved */
- uint64_t isr; /* interrupt status reg */
- uint64_t res2[25]; /* reserved */
- uint64_t mc64; /* main counter */
- uint64_t res3; /* reserved */
- struct { /* timers */
- uint64_t config; /* configuration/cap */
- uint64_t cmp; /* comparator */
- uint64_t fsb; /* FSB route, not supported now */
- uint64_t res4; /* reserved */
- } timers[HPET_TIMER_NUM];
- uint64_t res5[4*(24-HPET_TIMER_NUM)]; /* reserved, up to 0x3ff */
-
- /* Hidden register state */
- uint64_t period[HPET_TIMER_NUM]; /* Last value written to comparator */
-};
-
-DECLARE_HVM_SAVE_TYPE(HPET, 12, struct hvm_hw_hpet);
-
-
-/*
- * PM timer
- */
-
-struct hvm_hw_pmtimer {
- uint32_t tmr_val; /* PM_TMR_BLK.TMR_VAL: 32bit free-running counter */
- uint16_t pm1a_sts; /* PM1a_EVT_BLK.PM1a_STS: status register */
- uint16_t pm1a_en; /* PM1a_EVT_BLK.PM1a_EN: enable register */
-};
-
-DECLARE_HVM_SAVE_TYPE(PMTIMER, 13, struct hvm_hw_pmtimer);
-
-/*
- * Largest type-code in use
- */
-#define HVM_SAVE_CODE_MAX 13
-
-
-/*
* The series of save records is teminated by a zero-type, zero-length
* descriptor.
*/
@@ -459,4 +73,10 @@ struct hvm_save_end {};
struct hvm_save_end {};
DECLARE_HVM_SAVE_TYPE(END, 0, struct hvm_save_end);
+#if defined(__i386__) || defined(__x86_64__)
+#include "../arch-x86/hvm/save.h"
+#else
+#error "unsupported architecture"
+#endif
+
#endif /* __XEN_PUBLIC_HVM_SAVE_H__ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/libelf.h
--- a/include/xen/interface/libelf.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/libelf.h Sun Oct 21 12:10:59 2007 -0600
@@ -69,6 +69,9 @@ struct elf_binary {
uint64_t pend;
uint64_t reloc_offset;
+ uint64_t bsd_symtab_pstart;
+ uint64_t bsd_symtab_pend;
+
#ifndef __XEN__
/* misc */
FILE *log;
@@ -91,33 +94,32 @@ struct elf_binary {
#define elf_lsb(elf) (ELFDATA2LSB == (elf)->data)
#define elf_swap(elf) (NATIVE_ELFDATA != (elf)->data)
-#define elf_uval(elf, str, elem) \
- ((ELFCLASS64 == (elf)->class) \
- ? elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e64.elem), \
- sizeof((str)->e64.elem)) \
- : elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e32.elem), \
- sizeof((str)->e32.elem)))
-
-#define elf_sval(elf, str, elem) \
- ((ELFCLASS64 == (elf)->class) \
- ? elf_access_signed((elf), (str), \
- offsetof(typeof(*(str)),e64.elem), \
- sizeof((str)->e64.elem)) \
- : elf_access_signed((elf), (str), \
- offsetof(typeof(*(str)),e32.elem), \
- sizeof((str)->e32.elem)))
-
-#define elf_size(elf, str) \
- ((ELFCLASS64 == (elf)->class) \
- ? sizeof((str)->e64) \
- : sizeof((str)->e32))
+#define elf_uval(elf, str, elem) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? elf_access_unsigned((elf), (str), \
+ offsetof(typeof(*(str)),e64.elem), \
+ sizeof((str)->e64.elem)) \
+ : elf_access_unsigned((elf), (str), \
+ offsetof(typeof(*(str)),e32.elem), \
+ sizeof((str)->e32.elem)))
+
+#define elf_sval(elf, str, elem) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? elf_access_signed((elf), (str), \
+ offsetof(typeof(*(str)),e64.elem), \
+ sizeof((str)->e64.elem)) \
+ : elf_access_signed((elf), (str), \
+ offsetof(typeof(*(str)),e32.elem), \
+ sizeof((str)->e32.elem)))
+
+#define elf_size(elf, str) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? sizeof((str)->e64) : sizeof((str)->e32))
uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
- uint64_t offset, size_t size);
+ uint64_t offset, size_t size);
int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
- uint64_t offset, size_t size);
+ uint64_t offset, size_t size);
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
@@ -165,6 +167,8 @@ void *elf_get_ptr(struct elf_binary *elf
void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
+void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
+
/* ------------------------------------------------------------------------ */
/* xc_libelf_relocate.c */
@@ -185,8 +189,8 @@ struct xen_elfnote {
enum xen_elfnote_type type;
const char *name;
union {
- const char *str;
- uint64_t num;
+ const char *str;
+ uint64_t num;
} data;
};
@@ -228,14 +232,14 @@ static inline int elf_xen_feature_get(in
}
int elf_xen_parse_features(const char *features,
- uint32_t *supported,
- uint32_t *required);
+ uint32_t *supported,
+ uint32_t *required);
int elf_xen_parse_note(struct elf_binary *elf,
- struct elf_dom_parms *parms,
- const elf_note *note);
+ struct elf_dom_parms *parms,
+ const elf_note *note);
int elf_xen_parse_guest_info(struct elf_binary *elf,
- struct elf_dom_parms *parms);
+ struct elf_dom_parms *parms);
int elf_xen_parse(struct elf_binary *elf,
- struct elf_dom_parms *parms);
+ struct elf_dom_parms *parms);
#endif /* __XC_LIBELF__ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/platform.h
--- a/include/xen/interface/platform.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/platform.h Sun Oct 21 12:10:59 2007 -0600
@@ -164,7 +164,7 @@ typedef struct xenpf_enter_acpi_sleep xe
typedef struct xenpf_enter_acpi_sleep xenpf_enter_acpi_sleep_t;
DEFINE_XEN_GUEST_HANDLE(xenpf_enter_acpi_sleep_t);
-#define XENPF_change_freq 52
+#define XENPF_change_freq 52
struct xenpf_change_freq {
/* IN variables */
uint32_t flags; /* Must be zero. */
@@ -173,6 +173,17 @@ struct xenpf_change_freq {
};
typedef struct xenpf_change_freq xenpf_change_freq_t;
DEFINE_XEN_GUEST_HANDLE(xenpf_change_freq_t);
+
+#define XENPF_getidletime 53
+struct xenpf_getidletime {
+ /* IN variables. */
+ uint32_t max_cpus;
+ XEN_GUEST_HANDLE(uint64_t) idletime;
+ /* OUT variables. */
+ uint32_t nr_cpus;
+};
+typedef struct xenpf_getidletime xenpf_getidletime_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t);
struct xen_platform_op {
uint32_t cmd;
@@ -187,6 +198,7 @@ struct xen_platform_op {
struct xenpf_firmware_info firmware_info;
struct xenpf_enter_acpi_sleep enter_acpi_sleep;
struct xenpf_change_freq change_freq;
+ struct xenpf_getidletime getidletime;
uint8_t pad[128];
} u;
};
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/sysctl.h Sun Oct 21 12:10:59 2007 -0600
@@ -34,7 +34,7 @@
#include "xen.h"
#include "domctl.h"
-#define XEN_SYSCTL_INTERFACE_VERSION 0x00000004
+#define XEN_SYSCTL_INTERFACE_VERSION 0x00000005
/*
* Read console content from Xen buffer ring.
@@ -79,7 +79,7 @@ struct xen_sysctl_physinfo {
/* IN variables. */
uint32_t threads_per_core;
uint32_t cores_per_socket;
- uint32_t sockets_per_node;
+ uint32_t nr_cpus;
uint32_t nr_nodes;
uint32_t cpu_khz;
uint64_aligned_t total_pages;
@@ -185,6 +185,18 @@ typedef struct xen_sysctl_getcpuinfo xen
typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t;
DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t);
+#define XEN_SYSCTL_availheap 9
+struct xen_sysctl_availheap {
+ /* IN variables. */
+ uint32_t min_bitwidth; /* Smallest address width (zero if don't care). */
+ uint32_t max_bitwidth; /* Largest address width (zero if don't care). */
+ int32_t node; /* NUMA node of interest (-1 for all nodes). */
+ /* OUT variables. */
+ uint64_t avail_bytes; /* Bytes available in the specified region. */
+};
+typedef struct xen_sysctl_availheap xen_sysctl_availheap_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_availheap_t);
+
struct xen_sysctl {
uint32_t cmd;
uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
@@ -197,6 +209,7 @@ struct xen_sysctl {
struct xen_sysctl_getdomaininfolist getdomaininfolist;
struct xen_sysctl_debug_keys debug_keys;
struct xen_sysctl_getcpuinfo getcpuinfo;
+ struct xen_sysctl_availheap availheap;
uint8_t pad[128];
} u;
};
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/trace.h
--- a/include/xen/interface/trace.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/trace.h Sun Oct 21 12:10:59 2007 -0600
@@ -26,14 +26,22 @@
#ifndef __XEN_PUBLIC_TRACE_H__
#define __XEN_PUBLIC_TRACE_H__
+#define TRACE_EXTRA_MAX 7
+#define TRACE_EXTRA_SHIFT 28
+
/* Trace classes */
#define TRC_CLS_SHIFT 16
-#define TRC_GEN 0x0001f000 /* General trace */
-#define TRC_SCHED 0x0002f000 /* Xen Scheduler trace */
-#define TRC_DOM0OP 0x0004f000 /* Xen DOM0 operation trace */
-#define TRC_HVM 0x0008f000 /* Xen HVM trace */
-#define TRC_MEM 0x0010f000 /* Xen memory trace */
-#define TRC_ALL 0xfffff000
+#define TRC_GEN 0x0001f000 /* General trace */
+#define TRC_SCHED 0x0002f000 /* Xen Scheduler trace */
+#define TRC_DOM0OP 0x0004f000 /* Xen DOM0 operation trace */
+#define TRC_HVM 0x0008f000 /* Xen HVM trace */
+#define TRC_MEM 0x0010f000 /* Xen memory trace */
+#define TRC_PV 0x0020f000 /* Xen PV traces */
+#define TRC_ALL 0x0ffff000
+#define TRC_HD_TO_EVENT(x) ((x)&0x0fffffff)
+#define TRC_HD_CYCLE_FLAG (1UL<<31)
+#define TRC_HD_INCLUDES_CYCLE_COUNT(x) ( !!( (x) & TRC_HD_CYCLE_FLAG ) )
+#define TRC_HD_EXTRA(x) (((x)>>TRACE_EXTRA_SHIFT)&TRACE_EXTRA_MAX)
/* Trace subclasses */
#define TRC_SUBCLS_SHIFT 12
@@ -44,6 +52,8 @@
/* Trace events per class */
#define TRC_LOST_RECORDS (TRC_GEN + 1)
+#define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2)
+#define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3)
#define TRC_SCHED_DOM_ADD (TRC_SCHED + 1)
#define TRC_SCHED_DOM_REM (TRC_SCHED + 2)
@@ -65,9 +75,24 @@
#define TRC_MEM_PAGE_GRANT_UNMAP (TRC_MEM + 2)
#define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3)
+#define TRC_PV_HYPERCALL (TRC_PV + 1)
+#define TRC_PV_TRAP (TRC_PV + 3)
+#define TRC_PV_PAGE_FAULT (TRC_PV + 4)
+#define TRC_PV_FORCED_INVALID_OP (TRC_PV + 5)
+#define TRC_PV_EMULATE_PRIVOP (TRC_PV + 6)
+#define TRC_PV_EMULATE_4GB (TRC_PV + 7)
+#define TRC_PV_MATH_STATE_RESTORE (TRC_PV + 8)
+#define TRC_PV_PAGING_FIXUP (TRC_PV + 9)
+#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10)
+#define TRC_PV_PTWR_EMULATION (TRC_PV + 11)
+#define TRC_PV_PTWR_EMULATION_PAE (TRC_PV + 12)
+ /* Indicates that addresses in trace record are 64 bits */
+#define TRC_PV_64_FLAG (0x100)
+
/* trace events per subclass */
#define TRC_HVM_VMENTRY (TRC_HVM_ENTRYEXIT + 0x01)
#define TRC_HVM_VMEXIT (TRC_HVM_ENTRYEXIT + 0x02)
+#define TRC_HVM_VMEXIT64 (TRC_HVM_ENTRYEXIT + 0x03)
#define TRC_HVM_PF_XEN (TRC_HVM_HANDLER + 0x01)
#define TRC_HVM_PF_INJECT (TRC_HVM_HANDLER + 0x02)
#define TRC_HVM_INJ_EXC (TRC_HVM_HANDLER + 0x03)
@@ -89,12 +114,26 @@
#define TRC_HVM_HLT (TRC_HVM_HANDLER + 0x13)
#define TRC_HVM_INVLPG (TRC_HVM_HANDLER + 0x14)
#define TRC_HVM_MCE (TRC_HVM_HANDLER + 0x15)
+#define TRC_HVM_IO_ASSIST (TRC_HVM_HANDLER + 0x16)
+#define TRC_HVM_MMIO_ASSIST (TRC_HVM_HANDLER + 0x17)
+#define TRC_HVM_CLTS (TRC_HVM_HANDLER + 0x18)
+#define TRC_HVM_LMSW (TRC_HVM_HANDLER + 0x19)
+#define TRC_HVM_PF_XEN64 (TRC_HVM_HANDLER + 0x20)
/* This structure represents a single trace buffer record. */
struct t_rec {
- uint64_t cycles; /* cycle counter timestamp */
- uint32_t event; /* event ID */
- unsigned long data[5]; /* event data items */
+ uint32_t event:28;
+ uint32_t extra_u32:3; /* # entries in trailing extra_u32[] array */
+ uint32_t cycles_included:1; /* u.cycles or u.no_cycles? */
+ union {
+ struct {
+ uint32_t cycles_lo, cycles_hi; /* cycle counter timestamp */
+ uint32_t extra_u32[7]; /* event data items */
+ } cycles;
+ struct {
+ uint32_t extra_u32[7]; /* event data items */
+ } nocycles;
+ } u;
};
/*
@@ -102,9 +141,9 @@ struct t_rec {
* field, indexes into an array of struct t_rec's.
*/
struct t_buf {
- uint32_t cons; /* Next item to be consumed by control tools. */
- uint32_t prod; /* Next item to be produced by Xen. */
- /* 'nr_recs' records follow immediately after the meta-data header. */
+ uint32_t cons; /* Offset of next item to be consumed by control tools. */
+ uint32_t prod; /* Offset of next item to be produced by Xen. */
+ /* Records follow immediately after the meta-data header. */
};
#endif /* __XEN_PUBLIC_TRACE_H__ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/xen-compat.h Sun Oct 21 12:10:59 2007 -0600
@@ -27,7 +27,7 @@
#ifndef __XEN_PUBLIC_XEN_COMPAT_H__
#define __XEN_PUBLIC_XEN_COMPAT_H__
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030205
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030206
#if defined(__XEN__) || defined(__XEN_TOOLS__)
/* Xen is built with matching headers and implements the latest interface. */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/xen.h
--- a/include/xen/interface/xen.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/interface/xen.h Sun Oct 21 12:10:59 2007 -0600
@@ -69,7 +69,7 @@
#define __HYPERVISOR_vcpu_op 24
#define __HYPERVISOR_set_segment_base 25 /* x86/64 only */
#define __HYPERVISOR_mmuext_op 26
-#define __HYPERVISOR_acm_op 27
+#define __HYPERVISOR_xsm_op 27
#define __HYPERVISOR_nmi_op 28
#define __HYPERVISOR_sched_op 29
#define __HYPERVISOR_callback_op 30
@@ -565,6 +565,12 @@ typedef struct dom0_vga_console_info {
uint8_t green_pos, green_size;
uint8_t blue_pos, blue_size;
uint8_t rsvd_pos, rsvd_size;
+#if __XEN_INTERFACE_VERSION__ >= 0x00030206
+ /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
+ uint32_t gbl_caps;
+ /* Mode attributes (offset 0x0, VESA command 0x4f01). */
+ uint16_t mode_attrs;
+#endif
} vesa_lfb;
} u;
} dom0_vga_console_info_t;
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/xsm/acm.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/xsm/acm.h Sun Oct 21 12:10:59 2007 -0600
@@ -0,0 +1,229 @@
+/*
+ * acm.h: Xen access control module interface defintions
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Reiner Sailer <sailer@xxxxxxxxxxxxxx>
+ * Copyright (c) 2005, International Business Machines Corporation.
+ */
+
+#ifndef _XEN_PUBLIC_ACM_H
+#define _XEN_PUBLIC_ACM_H
+
+#include "../xen.h"
+
+/* if ACM_DEBUG defined, all hooks should
+ * print a short trace message (comment it out
+ * when not in testing mode )
+ */
+/* #define ACM_DEBUG */
+
+#ifdef ACM_DEBUG
+# define printkd(fmt, args...) printk(fmt,## args)
+#else
+# define printkd(fmt, args...)
+#endif
+
+/* default ssid reference value if not supplied */
+#define ACM_DEFAULT_SSID 0x0
+#define ACM_DEFAULT_LOCAL_SSID 0x0
+
+/* Internal ACM ERROR types */
+#define ACM_OK 0
+#define ACM_UNDEF -1
+#define ACM_INIT_SSID_ERROR -2
+#define ACM_INIT_SOID_ERROR -3
+#define ACM_ERROR -4
+
+/* External ACCESS DECISIONS */
+#define ACM_ACCESS_PERMITTED 0
+#define ACM_ACCESS_DENIED -111
+#define ACM_NULL_POINTER_ERROR -200
+
+/*
+ Error codes reported in when trying to test for a new policy
+ These error codes are reported in an array of tuples where
+ each error code is followed by a parameter describing the error
+ more closely, such as a domain id.
+*/
+#define ACM_EVTCHN_SHARING_VIOLATION 0x100
+#define ACM_GNTTAB_SHARING_VIOLATION 0x101
+#define ACM_DOMAIN_LOOKUP 0x102
+#define ACM_CHWALL_CONFLICT 0x103
+#define ACM_SSIDREF_IN_USE 0x104
+
+
+/* primary policy in lower 4 bits */
+#define ACM_NULL_POLICY 0
+#define ACM_CHINESE_WALL_POLICY 1
+#define ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY 2
+#define ACM_POLICY_UNDEFINED 15
+
+/* combinations have secondary policy component in higher 4bit */
+#define ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY \
+ ((ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY << 4) | ACM_CHINESE_WALL_POLICY)
+
+/* policy: */
+#define ACM_POLICY_NAME(X) \
+ ((X) == (ACM_NULL_POLICY)) ? "NULL" : \
+ ((X) == (ACM_CHINESE_WALL_POLICY)) ? "CHINESE WALL" : \
+ ((X) == (ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "SIMPLE TYPE ENFORCEMENT"
: \
+ ((X) == (ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "CHINESE
WALL AND SIMPLE TYPE ENFORCEMENT" : \
+ "UNDEFINED"
+
+/* the following policy versions must be increased
+ * whenever the interpretation of the related
+ * policy's data structure changes
+ */
+#define ACM_POLICY_VERSION 3
+#define ACM_CHWALL_VERSION 1
+#define ACM_STE_VERSION 1
+
+/* defines a ssid reference used by xen */
+typedef uint32_t ssidref_t;
+
+/* hooks that are known to domains */
+#define ACMHOOK_none 0
+#define ACMHOOK_sharing 1
+#define ACMHOOK_authorization 2
+
+/* -------security policy relevant type definitions-------- */
+
+/* type identifier; compares to "equal" or "not equal" */
+typedef uint16_t domaintype_t;
+
+/* CHINESE WALL POLICY DATA STRUCTURES
+ *
+ * current accumulated conflict type set:
+ * When a domain is started and has a type that is in
+ * a conflict set, the conflicting types are incremented in
+ * the aggregate set. When a domain is destroyed, the
+ * conflicting types to its type are decremented.
+ * If a domain has multiple types, this procedure works over
+ * all those types.
+ *
+ * conflict_aggregate_set[i] holds the number of
+ * running domains that have a conflict with type i.
+ *
+ * running_types[i] holds the number of running domains
+ * that include type i in their ssidref-referenced type set
+ *
+ * conflict_sets[i][j] is "0" if type j has no conflict
+ * with type i and is "1" otherwise.
+ */
+/* high-16 = version, low-16 = check magic */
+#define ACM_MAGIC 0x0001debc
+
+/* each offset in bytes from start of the struct they
+ * are part of */
+
+/* V3 of the policy buffer aded a version structure */
+struct acm_policy_version
+{
+ uint32_t major;
+ uint32_t minor;
+};
+
+
+/* each buffer consists of all policy information for
+ * the respective policy given in the policy code
+ *
+ * acm_policy_buffer, acm_chwall_policy_buffer,
+ * and acm_ste_policy_buffer need to stay 32-bit aligned
+ * because we create binary policies also with external
+ * tools that assume packed representations (e.g. the java tool)
+ */
+struct acm_policy_buffer {
+ uint32_t magic;
+ uint32_t policy_version; /* ACM_POLICY_VERSION */
+ uint32_t len;
+ uint32_t policy_reference_offset;
+ uint32_t primary_policy_code;
+ uint32_t primary_buffer_offset;
+ uint32_t secondary_policy_code;
+ uint32_t secondary_buffer_offset;
+ struct acm_policy_version xml_pol_version; /* add in V3 */
+};
+
+
+struct acm_policy_reference_buffer {
+ uint32_t len;
+};
+
+struct acm_chwall_policy_buffer {
+ uint32_t policy_version; /* ACM_CHWALL_VERSION */
+ uint32_t policy_code;
+ uint32_t chwall_max_types;
+ uint32_t chwall_max_ssidrefs;
+ uint32_t chwall_max_conflictsets;
+ uint32_t chwall_ssid_offset;
+ uint32_t chwall_conflict_sets_offset;
+ uint32_t chwall_running_types_offset;
+ uint32_t chwall_conflict_aggregate_offset;
+};
+
+struct acm_ste_policy_buffer {
+ uint32_t policy_version; /* ACM_STE_VERSION */
+ uint32_t policy_code;
+ uint32_t ste_max_types;
+ uint32_t ste_max_ssidrefs;
+ uint32_t ste_ssid_offset;
+};
+
+struct acm_stats_buffer {
+ uint32_t magic;
+ uint32_t len;
+ uint32_t primary_policy_code;
+ uint32_t primary_stats_offset;
+ uint32_t secondary_policy_code;
+ uint32_t secondary_stats_offset;
+};
+
+struct acm_ste_stats_buffer {
+ uint32_t ec_eval_count;
+ uint32_t gt_eval_count;
+ uint32_t ec_denied_count;
+ uint32_t gt_denied_count;
+ uint32_t ec_cachehit_count;
+ uint32_t gt_cachehit_count;
+};
+
+struct acm_ssid_buffer {
+ uint32_t len;
+ ssidref_t ssidref;
+ uint32_t policy_reference_offset;
+ uint32_t primary_policy_code;
+ uint32_t primary_max_types;
+ uint32_t primary_types_offset;
+ uint32_t secondary_policy_code;
+ uint32_t secondary_max_types;
+ uint32_t secondary_types_offset;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/xsm/acm_ops.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/xsm/acm_ops.h Sun Oct 21 12:10:59 2007 -0600
@@ -0,0 +1,159 @@
+/*
+ * acm_ops.h: Xen access control module hypervisor commands
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Reiner Sailer <sailer@xxxxxxxxxxxxxx>
+ * Copyright (c) 2005,2006 International Business Machines Corporation.
+ */
+
+#ifndef __XEN_PUBLIC_ACM_OPS_H__
+#define __XEN_PUBLIC_ACM_OPS_H__
+
+#include "../xen.h"
+#include "acm.h"
+
+/*
+ * Make sure you increment the interface version whenever you modify this file!
+ * This makes sure that old versions of acm tools will stop working in a
+ * well-defined way (rather than crashing the machine, for instance).
+ */
+#define ACM_INTERFACE_VERSION 0xAAAA000A
+
+/************************************************************************/
+
+/*
+ * Prototype for this hypercall is:
+ * int acm_op(int cmd, void *args)
+ * @cmd == ACMOP_??? (access control module operation).
+ * @args == Operation-specific extra arguments (NULL if none).
+ */
+
+
+#define ACMOP_setpolicy 1
+struct acm_setpolicy {
+ /* IN */
+ XEN_GUEST_HANDLE_64(void) pushcache;
+ uint32_t pushcache_size;
+};
+
+
+#define ACMOP_getpolicy 2
+struct acm_getpolicy {
+ /* IN */
+ XEN_GUEST_HANDLE_64(void) pullcache;
+ uint32_t pullcache_size;
+};
+
+
+#define ACMOP_dumpstats 3
+struct acm_dumpstats {
+ /* IN */
+ XEN_GUEST_HANDLE_64(void) pullcache;
+ uint32_t pullcache_size;
+};
+
+
+#define ACMOP_getssid 4
+#define ACM_GETBY_ssidref 1
+#define ACM_GETBY_domainid 2
+struct acm_getssid {
+ /* IN */
+ uint32_t get_ssid_by; /* ACM_GETBY_* */
+ union {
+ domaintype_t domainid;
+ ssidref_t ssidref;
+ } id;
+ XEN_GUEST_HANDLE_64(void) ssidbuf;
+ uint32_t ssidbuf_size;
+};
+
+#define ACMOP_getdecision 5
+struct acm_getdecision {
+ /* IN */
+ uint32_t get_decision_by1; /* ACM_GETBY_* */
+ uint32_t get_decision_by2; /* ACM_GETBY_* */
+ union {
+ domaintype_t domainid;
+ ssidref_t ssidref;
+ } id1;
+ union {
+ domaintype_t domainid;
+ ssidref_t ssidref;
+ } id2;
+ uint32_t hook;
+ /* OUT */
+ uint32_t acm_decision;
+};
+
+
+#define ACMOP_chgpolicy 6
+struct acm_change_policy {
+ /* IN */
+ XEN_GUEST_HANDLE_64(void) policy_pushcache;
+ uint32_t policy_pushcache_size;
+ XEN_GUEST_HANDLE_64(void) del_array;
+ uint32_t delarray_size;
+ XEN_GUEST_HANDLE_64(void) chg_array;
+ uint32_t chgarray_size;
+ /* OUT */
+ /* array with error code */
+ XEN_GUEST_HANDLE_64(void) err_array;
+ uint32_t errarray_size;
+};
+
+#define ACMOP_relabeldoms 7
+struct acm_relabel_doms {
+ /* IN */
+ XEN_GUEST_HANDLE_64(void) relabel_map;
+ uint32_t relabel_map_size;
+ /* OUT */
+ XEN_GUEST_HANDLE_64(void) err_array;
+ uint32_t errarray_size;
+};
+
+/* future interface to Xen */
+struct xen_acmctl {
+ uint32_t cmd;
+ uint32_t interface_version;
+ union {
+ struct acm_setpolicy setpolicy;
+ struct acm_getpolicy getpolicy;
+ struct acm_dumpstats dumpstats;
+ struct acm_getssid getssid;
+ struct acm_getdecision getdecision;
+ struct acm_change_policy change_policy;
+ struct acm_relabel_doms relabel_doms;
+ } u;
+};
+
+typedef struct xen_acmctl xen_acmctl_t;
+DEFINE_XEN_GUEST_HANDLE(xen_acmctl_t);
+
+#endif /* __XEN_PUBLIC_ACM_OPS_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/interface/xsm/flask_op.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/xsm/flask_op.h Sun Oct 21 12:10:59 2007 -0600
@@ -0,0 +1,43 @@
+/*
+ * This file contains the flask_op hypercall commands and definitions.
+ *
+ * Author: George Coker, <gscoker@xxxxxxxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ */
+
+#ifndef __FLASK_OP_H__
+#define __FLASK_OP_H__
+
+#define FLASK_LOAD 1
+#define FLASK_GETENFORCE 2
+#define FLASK_SETENFORCE 3
+#define FLASK_CONTEXT_TO_SID 4
+#define FLASK_SID_TO_CONTEXT 5
+#define FLASK_ACCESS 6
+#define FLASK_CREATE 7
+#define FLASK_RELABEL 8
+#define FLASK_USER 9
+#define FLASK_POLICYVERS 10
+#define FLASK_GETBOOL 11
+#define FLASK_SETBOOL 12
+#define FLASK_COMMITBOOLS 13
+#define FLASK_MLS 14
+#define FLASK_DISABLE 15
+#define FLASK_GETAVC_THRESHOLD 16
+#define FLASK_SETAVC_THRESHOLD 17
+#define FLASK_AVC_HASHSTATS 18
+#define FLASK_AVC_CACHESTATS 19
+#define FLASK_MEMBER 20
+
+typedef struct flask_op {
+ int cmd;
+ int size;
+ char *buf;
+} flask_op_t;
+
+DEFINE_XEN_GUEST_HANDLE(flask_op_t);
+
+#endif
diff -r 6cac8ecd995d -r 27b937c0095c include/xen/xencons.h
--- a/include/xen/xencons.h Wed Oct 17 10:27:10 2007 -0600
+++ b/include/xen/xencons.h Sun Oct 21 12:10:59 2007 -0600
@@ -2,7 +2,7 @@
#define __ASM_XENCONS_H__
struct dom0_vga_console_info;
-void dom0_init_screen_info(const struct dom0_vga_console_info *info);
+void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t);
void xencons_force_flush(void);
void xencons_resume(void);
diff -r 6cac8ecd995d -r 27b937c0095c scripts/Makefile.xen
--- a/scripts/Makefile.xen Wed Oct 17 10:27:10 2007 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-# cherrypickxen($1 = allobj)
-cherrypickxen = $(foreach var, $(1), \
- $(shell o=$(var); \
- c=$${o%.o}-xen.c; \
- s=$${o%.o}-xen.S; \
- oxen=$${o%.o}-xen.o; \
- [ -f $(srctree)/$(src)/$${c} ] || \
- [ -f $(srctree)/$(src)/$${s} ] \
- && echo $$oxen \
- || echo $(var) ) \
- )
-# filterxen($1 = allobj, $2 = noobjs)
-filterxen = $(filter-out $(2), $(1))
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|