[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] Sync Xen public headers.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1237391037 0
# Node ID 4839e34e67952b540fa258811324a85ace7feb79
# Parent  ddb6d2257ec495261ef1f76d2d15a3c73ea82179
Sync Xen public headers.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 include/xen/interface/acm.h                  |  228 -----------
 include/xen/interface/acm_ops.h              |  159 --------
 include/xen/interface/arch-powerpc.h         |  120 ------
 include/xen/interface/elfstructs.h           |  527 ---------------------------
 include/xen/interface/foreign/Makefile       |   37 -
 include/xen/interface/foreign/mkchecker.py   |   58 --
 include/xen/interface/foreign/mkheader.py    |  167 --------
 include/xen/interface/foreign/reference.size |   18 
 include/xen/interface/foreign/structs.py     |   58 --
 include/xen/interface/hvm/vmx_assist.h       |  122 ------
 include/xen/interface/libelf.h               |  265 -------------
 include/xen/interface/arch-ia64.h            |   10 
 include/xen/interface/arch-ia64/hvm/save.h   |    4 
 include/xen/interface/arch-x86/hvm/save.h    |    4 
 include/xen/interface/arch-x86/xen-mca.h     |  129 +++++-
 include/xen/interface/domctl.h               |   37 +
 include/xen/interface/elfnote.h              |   13 
 include/xen/interface/hvm/hvm_info_table.h   |   28 +
 include/xen/interface/hvm/params.h           |    8 
 include/xen/interface/io/fsif.h              |    3 
 include/xen/interface/io/pciif.h             |    2 
 include/xen/interface/physdev.h              |    9 
 include/xen/interface/sysctl.h               |  166 ++++++++
 include/xen/interface/trace.h                |    4 
 include/xen/interface/xen.h                  |    7 
 25 files changed, 389 insertions(+), 1794 deletions(-)

diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/acm.h
--- a/include/xen/interface/acm.h       Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +0,0 @@
-/*
- * 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
-
-/* -------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 policy_version; /* ACM_POLICY_VERSION */
-    uint32_t magic;
-    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 ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/acm_ops.h
--- a/include/xen/interface/acm_ops.h   Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * 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 ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/arch-ia64.h
--- a/include/xen/interface/arch-ia64.h Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/arch-ia64.h Wed Mar 18 15:43:57 2009 +0000
@@ -198,6 +198,15 @@ struct mapped_regs {
             unsigned long rrs[8]; // region registers
             unsigned long krs[8]; // kernel registers
             unsigned long tmp[16]; // temp registers (e.g. for hyperprivops)
+
+            /* itc paravirtualization
+             * vAR.ITC = mAR.ITC + itc_offset
+             * itc_last is one which was lastly passed to
+             * the guest OS in order to prevent it from
+             * going backwords.
+             */
+            unsigned long itc_offset;
+            unsigned long itc_last;
         };
     };
 };
@@ -392,6 +401,7 @@ struct vcpu_guest_context {
 #define VGCF_EXTRA_REGS (1UL << 1)     /* Set extra regs.  */
 #define VGCF_SET_CR_IRR (1UL << 2)     /* Set cr_irr[0:3]. */
 #define VGCF_online     (1UL << 3)  /* make this vcpu online */
+#define VGCF_SET_AR_ITC (1UL << 4)  /* set pv ar.itc. itc_offset, itc_last */
     unsigned long flags;       /* VGCF_* flags */
 
     struct vcpu_guest_context_regs regs;
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/arch-ia64/hvm/save.h
--- a/include/xen/interface/arch-ia64/hvm/save.h        Wed Mar 18 15:28:03 
2009 +0000
+++ b/include/xen/interface/arch-ia64/hvm/save.h        Wed Mar 18 15:43:57 
2009 +0000
@@ -23,8 +23,8 @@
 #ifndef __XEN_PUBLIC_HVM_SAVE_IA64_H__
 #define __XEN_PUBLIC_HVM_SAVE_IA64_H__
 
-#include <public/hvm/save.h>
-#include <public/arch-ia64.h>
+#include "../../hvm/save.h"
+#include "../../arch-ia64.h"
 
 /* 
  * Save/restore header: general info about the save file. 
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/arch-powerpc.h
--- a/include/xen/interface/arch-powerpc.h      Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * 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.
- *
- * Copyright (C) IBM Corp. 2005, 2006
- *
- * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx>
- */
-
-#include "xen.h"
-
-#ifndef __XEN_PUBLIC_ARCH_PPC_64_H__
-#define __XEN_PUBLIC_ARCH_PPC_64_H__
-
-#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
-    typedef struct { \
-        int __pad[(sizeof (long long) - sizeof (void *)) / sizeof (int)]; \
-        type *p; \
-    } __attribute__((__aligned__(8))) __guest_handle_ ## name
-
-#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
-    ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
-    ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
-#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
-#define XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
-#define set_xen_guest_handle(hnd, val) \
-    do { \
-        if (sizeof ((hnd).__pad)) \
-            (hnd).__pad[0] = 0; \
-        (hnd).p = val; \
-    } while (0)
-
-#ifdef __XEN_TOOLS__
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-#endif
-
-#ifndef __ASSEMBLY__
-typedef unsigned long long xen_pfn_t;
-#define PRI_xen_pfn "llx"
-#endif
-
-/*
- * Pointers and other address fields inside interface structures are padded to
- * 64 bits. This means that field alignments aren't different between 32- and
- * 64-bit architectures. 
- */
-/* NB. Multi-level macro ensures __LINE__ is expanded before concatenation. */
-#define __MEMORY_PADDING(_X)
-#define _MEMORY_PADDING(_X)  __MEMORY_PADDING(_X)
-#define MEMORY_PADDING       _MEMORY_PADDING(__LINE__)
-
-/* And the trap vector is... */
-#define TRAP_INSTR "li 0,-1; sc" /* XXX just "sc"? */
-
-#ifndef __ASSEMBLY__
-
-#define XENCOMM_INLINE_FLAG (1UL << 63)
-
-typedef uint64_t xen_ulong_t;
-
-/* User-accessible registers: nost of these need to be saved/restored
- * for every nested Xen invocation. */
-struct cpu_user_regs
-{
-    uint64_t gprs[32];
-    uint64_t lr;
-    uint64_t ctr;
-    uint64_t srr0;
-    uint64_t srr1;
-    uint64_t pc;
-    uint64_t msr;
-    uint64_t fpscr;             /* XXX Is this necessary */
-    uint64_t xer;
-    uint64_t hid4;              /* debug only */
-    uint64_t dar;               /* debug only */
-    uint32_t dsisr;             /* debug only */
-    uint32_t cr;
-    uint32_t __pad;             /* good spot for another 32bit reg */
-    uint32_t entry_vector;
-};
-typedef struct cpu_user_regs cpu_user_regs_t;
-
-typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */ /* XXX timebase */
-
-/* ONLY used to communicate with dom0! See also struct exec_domain. */
-struct vcpu_guest_context {
-    cpu_user_regs_t user_regs;         /* User-level CPU registers     */
-    uint64_t sdr1;                     /* Pagetable base               */
-    /* XXX etc */
-};
-typedef struct vcpu_guest_context vcpu_guest_context_t;
-DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
-
-struct arch_shared_info {
-    uint64_t boot_timebase;
-};
-
-struct arch_vcpu_info {
-};
-
-/* Support for multi-processor guests. */
-#define MAX_VIRT_CPUS 32
-#endif
-
-#endif
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/arch-x86/hvm/save.h Wed Mar 18 15:43:57 2009 +0000
@@ -287,7 +287,7 @@ struct hvm_hw_pci_irqs {
      * Indexed by: device*4 + INTx#.
      */
     union {
-        DECLARE_BITMAP(i, 32*4);
+        unsigned long i[16 / sizeof (unsigned long)]; /* DECLARE_BITMAP(i, 
32*4); */
         uint64_t pad[2];
     };
 };
@@ -300,7 +300,7 @@ struct hvm_hw_isa_irqs {
      * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
      */
     union {
-        DECLARE_BITMAP(i, 16);
+        unsigned long i[1];  /* DECLARE_BITMAP(i, 16); */
         uint64_t pad[1];
     };
 };
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/arch-x86/xen-mca.h
--- a/include/xen/interface/arch-x86/xen-mca.h  Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/arch-x86/xen-mca.h  Wed Mar 18 15:43:57 2009 +0000
@@ -56,13 +56,20 @@
 /* Hypercall */
 #define __HYPERVISOR_mca __HYPERVISOR_arch_0
 
-#define XEN_MCA_INTERFACE_VERSION 0x03000001
-
-/* IN: Dom0 calls hypercall from MC event handler. */
-#define XEN_MC_CORRECTABLE  0x0
-/* IN: Dom0/DomU calls hypercall from MC trap handler. */
-#define XEN_MC_TRAP         0x1
-/* XEN_MC_CORRECTABLE and XEN_MC_TRAP are mutually exclusive. */
+/*
+ * The xen-unstable repo has interface version 0x03000001; out interface
+ * is incompatible with that and any future minor revisions, so we
+ * choose a different version number range that is numerically less
+ * than that used in xen-unstable.
+ */
+#define XEN_MCA_INTERFACE_VERSION 0x01ecc002
+
+/* IN: Dom0 calls hypercall to retrieve nonurgent telemetry */
+#define XEN_MC_NONURGENT  0x0001
+/* IN: Dom0/DomU calls hypercall to retrieve urgent telemetry */
+#define XEN_MC_URGENT     0x0002
+/* IN: Dom0 acknowledges previosly-fetched telemetry */
+#define XEN_MC_ACK        0x0004
 
 /* OUT: All is ok */
 #define XEN_MC_OK           0x0
@@ -106,7 +113,11 @@ struct mcinfo_common {
 
 #define MC_FLAG_CORRECTABLE     (1 << 0)
 #define MC_FLAG_UNCORRECTABLE   (1 << 1)
-
+#define MC_FLAG_RECOVERABLE    (1 << 2)
+#define MC_FLAG_POLLED         (1 << 3)
+#define MC_FLAG_RESET          (1 << 4)
+#define MC_FLAG_CMCI           (1 << 5)
+#define MC_FLAG_MCE            (1 << 6)
 /* contains global x86 mc information */
 struct mcinfo_global {
     struct mcinfo_common common;
@@ -115,6 +126,7 @@ struct mcinfo_global {
     uint16_t mc_domid;
     uint32_t mc_socketid; /* physical socket of the physical core */
     uint16_t mc_coreid; /* physical impacted core */
+    uint32_t mc_apicid;
     uint16_t mc_core_threadid; /* core thread of physical core */
     uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */
     uint64_t mc_gstatus; /* global status */
@@ -132,6 +144,8 @@ struct mcinfo_bank {
     uint64_t mc_addr;   /* bank address, only valid
                          * if addr bit is set in mc_status */
     uint64_t mc_misc;
+    uint64_t mc_ctrl2;
+    uint64_t mc_tsc;
 };
 
 
@@ -150,7 +164,12 @@ struct mcinfo_extended {
      * multiple times. */
 
     uint32_t mc_msrs; /* Number of msr with valid values. */
-    struct mcinfo_msr mc_msr[5];
+    /*
+     * Currently Intel extended MSR (32/64) including all gp registers
+     * and E(R)DI, E(R)BP, E(R)SP, E(R)FLAGS, E(R)IP, E(R)MISC, only 10
+     * of them might be useful. So expend this array to 10.
+    */
+    struct mcinfo_msr mc_msr[10];
 };
 
 #define MCINFO_HYPERCALLSIZE   1024
@@ -163,7 +182,43 @@ struct mc_info {
     uint8_t mi_data[MCINFO_MAXSIZE - sizeof(uint32_t)];
 };
 typedef struct mc_info mc_info_t;
-
+DEFINE_XEN_GUEST_HANDLE(mc_info_t);
+
+#define __MC_MSR_ARRAYSIZE 8
+#define __MC_NMSRS 1
+#define MC_NCAPS       7       /* 7 CPU feature flag words */
+#define MC_CAPS_STD_EDX        0       /* cpuid level 0x00000001 (%edx) */
+#define MC_CAPS_AMD_EDX        1       /* cpuid level 0x80000001 (%edx) */
+#define MC_CAPS_TM     2       /* cpuid level 0x80860001 (TransMeta) */
+#define MC_CAPS_LINUX  3       /* Linux-defined */
+#define MC_CAPS_STD_ECX        4       /* cpuid level 0x00000001 (%ecx) */
+#define MC_CAPS_VIA    5       /* cpuid level 0xc0000001 */
+#define MC_CAPS_AMD_ECX        6       /* cpuid level 0x80000001 (%ecx) */
+
+typedef struct mcinfo_logical_cpu {
+    uint32_t mc_cpunr;          
+    uint32_t mc_chipid; 
+    uint16_t mc_coreid;
+    uint16_t mc_threadid;
+    uint32_t mc_apicid;
+    uint32_t mc_clusterid;
+    uint32_t mc_ncores;
+    uint32_t mc_ncores_active;
+    uint32_t mc_nthreads;
+    int32_t mc_cpuid_level;
+    uint32_t mc_family;
+    uint32_t mc_vendor;
+    uint32_t mc_model;
+    uint32_t mc_step;
+    char mc_vendorid[16];
+    char mc_brandid[64];
+    uint32_t mc_cpu_caps[MC_NCAPS];
+    uint32_t mc_cache_size;
+    uint32_t mc_cache_alignment;
+    int32_t mc_nmsrvals;
+    struct mcinfo_msr mc_msrvalues[__MC_MSR_ARRAYSIZE];
+} xen_mc_logical_cpu_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mc_logical_cpu_t);
 
 
 /* 
@@ -228,14 +283,14 @@ typedef struct mc_info mc_info_t;
 #define XEN_MC_fetch            1
 struct xen_mc_fetch {
     /* IN/OUT variables. */
-    uint32_t flags;
-
-/* IN: XEN_MC_CORRECTABLE, XEN_MC_TRAP */
-/* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED, XEN_MC_NODATA, XEN_MC_NOMATCH */
+    uint32_t flags;    /* IN: XEN_MC_NONURGENT, XEN_MC_URGENT,
+                           XEN_MC_ACK if ack'ing an earlier fetch */
+                       /* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED,
+                          XEN_MC_NODATA, XEN_MC_NOMATCH */
+    uint64_t fetch_id; /* OUT: id for ack, IN: id we are ack'ing */
 
     /* OUT variables. */
-    uint32_t fetch_idx;  /* only useful for Dom0 for the notify hypercall */
-    struct mc_info mc_info;
+    XEN_GUEST_HANDLE(mc_info_t) data;
 };
 typedef struct xen_mc_fetch xen_mc_fetch_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mc_fetch_t);
@@ -250,7 +305,6 @@ struct xen_mc_notifydomain {
     uint16_t mc_domid;    /* The unprivileged domain to notify. */
     uint16_t mc_vcpuid;   /* The vcpu in mc_domid to notify.
                            * Usually echo'd value from the fetch hypercall. */
-    uint32_t fetch_idx;   /* echo'd value from the fetch hypercall. */
 
     /* IN/OUT variables. */
     uint32_t flags;
@@ -261,15 +315,46 @@ typedef struct xen_mc_notifydomain xen_m
 typedef struct xen_mc_notifydomain xen_mc_notifydomain_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mc_notifydomain_t);
 
+#define XEN_MC_physcpuinfo 3
+struct xen_mc_physcpuinfo {
+       /* IN/OUT */
+       uint32_t ncpus;
+       uint32_t pad0;
+       /* OUT */
+       XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info;
+};
+
+#define XEN_MC_msrinject    4
+#define MC_MSRINJ_MAXMSRS       8
+struct xen_mc_msrinject {
+       /* IN */
+       unsigned int mcinj_cpunr;       /* target processor id */
+       uint32_t mcinj_flags;           /* see MC_MSRINJ_F_* below */
+       uint32_t mcinj_count;           /* 0 .. count-1 in array are valid */
+       uint32_t mcinj_pad0;
+       struct mcinfo_msr mcinj_msr[MC_MSRINJ_MAXMSRS];
+};
+
+/* Flags for mcinj_flags above; bits 16-31 are reserved */
+#define MC_MSRINJ_F_INTERPOSE   0x1
+
+#define XEN_MC_mceinject    5
+struct xen_mc_mceinject {
+       unsigned int mceinj_cpunr;      /* target processor id */
+};
+
+typedef union {
+    struct xen_mc_fetch        mc_fetch;
+    struct xen_mc_notifydomain mc_notifydomain;
+    struct xen_mc_physcpuinfo  mc_physcpuinfo;
+    struct xen_mc_msrinject    mc_msrinject;
+    struct xen_mc_mceinject    mc_mceinject;
+} xen_mc_arg_t;
 
 struct xen_mc {
     uint32_t cmd;
     uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */
-    union {
-        struct xen_mc_fetch        mc_fetch;
-        struct xen_mc_notifydomain mc_notifydomain;
-        uint8_t pad[MCINFO_HYPERCALLSIZE];
-    } u;
+    xen_mc_arg_t u;
 };
 typedef struct xen_mc xen_mc_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mc_t);
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h    Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/domctl.h    Wed Mar 18 15:43:57 2009 +0000
@@ -51,11 +51,14 @@ struct xen_domctl_createdomain {
     uint32_t ssidref;
     xen_domain_handle_t handle;
  /* Is this an HVM guest (as opposed to a PV guest)? */
-#define _XEN_DOMCTL_CDF_hvm_guest 0
-#define XEN_DOMCTL_CDF_hvm_guest  (1U<<_XEN_DOMCTL_CDF_hvm_guest)
+#define _XEN_DOMCTL_CDF_hvm_guest     0
+#define XEN_DOMCTL_CDF_hvm_guest      (1U<<_XEN_DOMCTL_CDF_hvm_guest)
  /* Use hardware-assisted paging if available? */
-#define _XEN_DOMCTL_CDF_hap       1
-#define XEN_DOMCTL_CDF_hap        (1U<<_XEN_DOMCTL_CDF_hap)
+#define _XEN_DOMCTL_CDF_hap           1
+#define XEN_DOMCTL_CDF_hap            (1U<<_XEN_DOMCTL_CDF_hap)
+ /* Should domain memory integrity be verifed by tboot during Sx? */
+#define _XEN_DOMCTL_CDF_s3_integrity  2
+#define XEN_DOMCTL_CDF_s3_integrity   (1U<<_XEN_DOMCTL_CDF_s3_integrity)
     uint32_t flags;
 };
 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
@@ -466,6 +469,7 @@ typedef enum pt_irq_type_e {
     PT_IRQ_TYPE_PCI,
     PT_IRQ_TYPE_ISA,
     PT_IRQ_TYPE_MSI,
+    PT_IRQ_TYPE_MSI_TRANSLATE,
 } pt_irq_type_t;
 struct xen_domctl_bind_pt_irq {
     uint32_t machine_irq;
@@ -484,6 +488,7 @@ struct xen_domctl_bind_pt_irq {
         struct {
             uint8_t gvec;
             uint32_t gflags;
+            uint64_aligned_t gtable;
         } msi;
     } u;
 };
@@ -618,6 +623,28 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_subsc
  * Do not inject spurious page faults into this domain.
  */
 #define XEN_DOMCTL_suppress_spurious_page_faults 53
+
+#define XEN_DOMCTL_debug_op    54
+#define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF         0
+#define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON          1
+struct xen_domctl_debug_op {
+    uint32_t op;   /* IN */
+    uint32_t vcpu; /* IN */
+};
+typedef struct xen_domctl_debug_op xen_domctl_debug_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_debug_op_t);
+
+/*
+ * Request a particular record from the HVM context
+ */
+#define XEN_DOMCTL_gethvmcontext_partial   55
+typedef struct xen_domctl_hvmcontext_partial {
+    uint32_t type;                      /* IN: Type of record required */
+    uint32_t instance;                  /* IN: Instance of that type */
+    XEN_GUEST_HANDLE_64(uint8) buffer;  /* OUT: buffer to write record into */
+} xen_domctl_hvmcontext_partial_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_partial_t);
+
 
 struct xen_domctl {
     uint32_t cmd;
@@ -646,6 +673,7 @@ struct xen_domctl {
         struct xen_domctl_settimeoffset     settimeoffset;
         struct xen_domctl_real_mode_area    real_mode_area;
         struct xen_domctl_hvmcontext        hvmcontext;
+        struct xen_domctl_hvmcontext_partial hvmcontext_partial;
         struct xen_domctl_address_size      address_size;
         struct xen_domctl_sendtrigger       sendtrigger;
         struct xen_domctl_get_device_group  get_device_group;
@@ -658,6 +686,7 @@ struct xen_domctl {
         struct xen_domctl_set_opt_feature   set_opt_feature;
         struct xen_domctl_set_target        set_target;
         struct xen_domctl_subscribe         subscribe;
+        struct xen_domctl_debug_op          debug_op;
 #if defined(__i386__) || defined(__x86_64__)
         struct xen_domctl_cpuid             cpuid;
 #endif
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/elfnote.h
--- a/include/xen/interface/elfnote.h   Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/elfnote.h   Wed Mar 18 15:43:57 2009 +0000
@@ -162,9 +162,20 @@
 #define XEN_ELFNOTE_SUSPEND_CANCEL 14
 
 /*
+ * The (non-default) location the initial phys-to-machine map should be
+ * placed at by the hypervisor (Dom0) or the tools (DomU).
+ * The kernel must be prepared for this mapping to be established using
+ * large pages, despite such otherwise not being available to guests.
+ * The kernel must also be able to handle the page table pages used for
+ * this mapping not being accessible through the initial mapping.
+ * (Only x86-64 supports this at present.)
+ */
+#define XEN_ELFNOTE_INIT_P2M      15
+
+/*
  * The number of the highest elfnote defined.
  */
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M
 
 /*
  * System information exported through crash notes.
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/elfstructs.h
--- a/include/xen/interface/elfstructs.h        Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,527 +0,0 @@
-#ifndef __XEN_PUBLIC_ELFSTRUCTS_H__
-#define __XEN_PUBLIC_ELFSTRUCTS_H__ 1
-/*
- * Copyright (c) 1995, 1996 Erik Theisen.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-typedef uint8_t                Elf_Byte;
-
-typedef uint32_t       Elf32_Addr;     /* Unsigned program address */
-typedef uint32_t       Elf32_Off;      /* Unsigned file offset */
-typedef int32_t                Elf32_Sword;    /* Signed large integer */
-typedef uint32_t       Elf32_Word;     /* Unsigned large integer */
-typedef uint16_t       Elf32_Half;     /* Unsigned medium integer */
-
-typedef uint64_t       Elf64_Addr;
-typedef uint64_t       Elf64_Off;
-typedef int32_t                Elf64_Shalf;
-
-typedef int32_t                Elf64_Sword;
-typedef uint32_t       Elf64_Word;
-
-typedef int64_t                Elf64_Sxword;
-typedef uint64_t       Elf64_Xword;
-
-typedef uint32_t       Elf64_Half;
-typedef uint16_t       Elf64_Quarter;
-
-/*
- * e_ident[] identification indexes
- * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html
- */
-#define EI_MAG0                0               /* file ID */
-#define EI_MAG1                1               /* file ID */
-#define EI_MAG2                2               /* file ID */
-#define EI_MAG3                3               /* file ID */
-#define EI_CLASS       4               /* file class */
-#define EI_DATA                5               /* data encoding */
-#define EI_VERSION     6               /* ELF header version */
-#define EI_OSABI       7               /* OS/ABI ID */
-#define EI_ABIVERSION  8               /* ABI version */
-#define EI_PAD         9               /* start of pad bytes */
-#define EI_NIDENT      16              /* Size of e_ident[] */
-
-/* e_ident[] magic number */
-#define        ELFMAG0         0x7f            /* e_ident[EI_MAG0] */
-#define        ELFMAG1         'E'             /* e_ident[EI_MAG1] */
-#define        ELFMAG2         'L'             /* e_ident[EI_MAG2] */
-#define        ELFMAG3         'F'             /* e_ident[EI_MAG3] */
-#define        ELFMAG          "\177ELF"       /* magic */
-#define        SELFMAG         4               /* size of magic */
-
-/* e_ident[] file class */
-#define        ELFCLASSNONE    0               /* invalid */
-#define        ELFCLASS32      1               /* 32-bit objs */
-#define        ELFCLASS64      2               /* 64-bit objs */
-#define        ELFCLASSNUM     3               /* number of classes */
-
-/* e_ident[] data encoding */
-#define ELFDATANONE    0               /* invalid */
-#define ELFDATA2LSB    1               /* Little-Endian */
-#define ELFDATA2MSB    2               /* Big-Endian */
-#define ELFDATANUM     3               /* number of data encode defines */
-
-/* e_ident[] Operating System/ABI */
-#define ELFOSABI_SYSV          0       /* UNIX System V ABI */
-#define ELFOSABI_HPUX          1       /* HP-UX operating system */
-#define ELFOSABI_NETBSD                2       /* NetBSD */
-#define ELFOSABI_LINUX         3       /* GNU/Linux */
-#define ELFOSABI_HURD          4       /* GNU/Hurd */
-#define ELFOSABI_86OPEN                5       /* 86Open common IA32 ABI */
-#define ELFOSABI_SOLARIS       6       /* Solaris */
-#define ELFOSABI_MONTEREY      7       /* Monterey */
-#define ELFOSABI_IRIX          8       /* IRIX */
-#define ELFOSABI_FREEBSD       9       /* FreeBSD */
-#define ELFOSABI_TRU64         10      /* TRU64 UNIX */
-#define ELFOSABI_MODESTO       11      /* Novell Modesto */
-#define ELFOSABI_OPENBSD       12      /* OpenBSD */
-#define ELFOSABI_ARM           97      /* ARM */
-#define ELFOSABI_STANDALONE    255     /* Standalone (embedded) application */
-
-/* e_ident */
-#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
-                      (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
-                      (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
-                      (ehdr).e_ident[EI_MAG3] == ELFMAG3)
-
-/* ELF Header */
-typedef struct elfhdr {
-       unsigned char   e_ident[EI_NIDENT]; /* ELF Identification */
-       Elf32_Half      e_type;         /* object file type */
-       Elf32_Half      e_machine;      /* machine */
-       Elf32_Word      e_version;      /* object file version */
-       Elf32_Addr      e_entry;        /* virtual entry point */
-       Elf32_Off       e_phoff;        /* program header table offset */
-       Elf32_Off       e_shoff;        /* section header table offset */
-       Elf32_Word      e_flags;        /* processor-specific flags */
-       Elf32_Half      e_ehsize;       /* ELF header size */
-       Elf32_Half      e_phentsize;    /* program header entry size */
-       Elf32_Half      e_phnum;        /* number of program header entries */
-       Elf32_Half      e_shentsize;    /* section header entry size */
-       Elf32_Half      e_shnum;        /* number of section header entries */
-       Elf32_Half      e_shstrndx;     /* section header table's "section
-                                          header string table" entry offset */
-} Elf32_Ehdr;
-
-typedef struct {
-       unsigned char   e_ident[EI_NIDENT];     /* Id bytes */
-       Elf64_Quarter   e_type;                 /* file type */
-       Elf64_Quarter   e_machine;              /* machine type */
-       Elf64_Half      e_version;              /* version number */
-       Elf64_Addr      e_entry;                /* entry point */
-       Elf64_Off       e_phoff;                /* Program hdr offset */
-       Elf64_Off       e_shoff;                /* Section hdr offset */
-       Elf64_Half      e_flags;                /* Processor flags */
-       Elf64_Quarter   e_ehsize;               /* sizeof ehdr */
-       Elf64_Quarter   e_phentsize;            /* Program header entry size */
-       Elf64_Quarter   e_phnum;                /* Number of program headers */
-       Elf64_Quarter   e_shentsize;            /* Section header entry size */
-       Elf64_Quarter   e_shnum;                /* Number of section headers */
-       Elf64_Quarter   e_shstrndx;             /* String table index */
-} Elf64_Ehdr;
-
-/* e_type */
-#define ET_NONE                0               /* No file type */
-#define ET_REL         1               /* relocatable file */
-#define ET_EXEC                2               /* executable file */
-#define ET_DYN         3               /* shared object file */
-#define ET_CORE                4               /* core file */
-#define ET_NUM         5               /* number of types */
-#define ET_LOPROC      0xff00          /* reserved range for processor */
-#define ET_HIPROC      0xffff          /*  specific e_type */
-
-/* e_machine */
-#define EM_NONE                0               /* No Machine */
-#define EM_M32         1               /* AT&T WE 32100 */
-#define EM_SPARC       2               /* SPARC */
-#define EM_386         3               /* Intel 80386 */
-#define EM_68K         4               /* Motorola 68000 */
-#define EM_88K         5               /* Motorola 88000 */
-#define EM_486         6               /* Intel 80486 - unused? */
-#define EM_860         7               /* Intel 80860 */
-#define EM_MIPS                8               /* MIPS R3000 Big-Endian only */
-/*
- * Don't know if EM_MIPS_RS4_BE,
- * EM_SPARC64, EM_PARISC,
- * or EM_PPC are ABI compliant
- */
-#define EM_MIPS_RS4_BE 10              /* MIPS R4000 Big-Endian */
-#define EM_SPARC64     11              /* SPARC v9 64-bit unoffical */
-#define EM_PARISC      15              /* HPPA */
-#define EM_SPARC32PLUS 18              /* Enhanced instruction set SPARC */
-#define EM_PPC         20              /* PowerPC */
-#define EM_PPC64       21              /* PowerPC 64-bit */
-#define EM_ARM         40              /* Advanced RISC Machines ARM */
-#define EM_ALPHA       41              /* DEC ALPHA */
-#define EM_SPARCV9     43              /* SPARC version 9 */
-#define EM_ALPHA_EXP   0x9026          /* DEC ALPHA */
-#define EM_IA_64       50              /* Intel Merced */
-#define EM_X86_64      62              /* AMD x86-64 architecture */
-#define EM_VAX         75              /* DEC VAX */
-
-/* Version */
-#define EV_NONE                0               /* Invalid */
-#define EV_CURRENT     1               /* Current */
-#define EV_NUM         2               /* number of versions */
-
-/* Section Header */
-typedef struct {
-       Elf32_Word      sh_name;        /* name - index into section header
-                                          string table section */
-       Elf32_Word      sh_type;        /* type */
-       Elf32_Word      sh_flags;       /* flags */
-       Elf32_Addr      sh_addr;        /* address */
-       Elf32_Off       sh_offset;      /* file offset */
-       Elf32_Word      sh_size;        /* section size */
-       Elf32_Word      sh_link;        /* section header table index link */
-       Elf32_Word      sh_info;        /* extra information */
-       Elf32_Word      sh_addralign;   /* address alignment */
-       Elf32_Word      sh_entsize;     /* section entry size */
-} Elf32_Shdr;
-
-typedef struct {
-       Elf64_Half      sh_name;        /* section name */
-       Elf64_Half      sh_type;        /* section type */
-       Elf64_Xword     sh_flags;       /* section flags */
-       Elf64_Addr      sh_addr;        /* virtual address */
-       Elf64_Off       sh_offset;      /* file offset */
-       Elf64_Xword     sh_size;        /* section size */
-       Elf64_Half      sh_link;        /* link to another */
-       Elf64_Half      sh_info;        /* misc info */
-       Elf64_Xword     sh_addralign;   /* memory alignment */
-       Elf64_Xword     sh_entsize;     /* table entry size */
-} Elf64_Shdr;
-
-/* Special Section Indexes */
-#define SHN_UNDEF      0               /* undefined */
-#define SHN_LORESERVE  0xff00          /* lower bounds of reserved indexes */
-#define SHN_LOPROC     0xff00          /* reserved range for processor */
-#define SHN_HIPROC     0xff1f          /*   specific section indexes */
-#define SHN_ABS                0xfff1          /* absolute value */
-#define SHN_COMMON     0xfff2          /* common symbol */
-#define SHN_HIRESERVE  0xffff          /* upper bounds of reserved indexes */
-
-/* sh_type */
-#define SHT_NULL       0               /* inactive */
-#define SHT_PROGBITS   1               /* program defined information */
-#define SHT_SYMTAB     2               /* symbol table section */
-#define SHT_STRTAB     3               /* string table section */
-#define SHT_RELA       4               /* relocation section with addends*/
-#define SHT_HASH       5               /* symbol hash table section */
-#define SHT_DYNAMIC    6               /* dynamic section */
-#define SHT_NOTE       7               /* note section */
-#define SHT_NOBITS     8               /* no space section */
-#define SHT_REL                9               /* relation section without 
addends */
-#define SHT_SHLIB      10              /* reserved - purpose unknown */
-#define SHT_DYNSYM     11              /* dynamic symbol table section */
-#define SHT_NUM                12              /* number of section types */
-#define SHT_LOPROC     0x70000000      /* reserved range for processor */
-#define SHT_HIPROC     0x7fffffff      /*  specific section header types */
-#define SHT_LOUSER     0x80000000      /* reserved range for application */
-#define SHT_HIUSER     0xffffffff      /*  specific indexes */
-
-/* Section names */
-#define ELF_BSS         ".bss"         /* uninitialized data */
-#define ELF_DATA        ".data"                /* initialized data */
-#define ELF_DEBUG       ".debug"       /* debug */
-#define ELF_DYNAMIC     ".dynamic"     /* dynamic linking information */
-#define ELF_DYNSTR      ".dynstr"      /* dynamic string table */
-#define ELF_DYNSYM      ".dynsym"      /* dynamic symbol table */
-#define ELF_FINI        ".fini"                /* termination code */
-#define ELF_GOT         ".got"         /* global offset table */
-#define ELF_HASH        ".hash"                /* symbol hash table */
-#define ELF_INIT        ".init"                /* initialization code */
-#define ELF_REL_DATA    ".rel.data"    /* relocation data */
-#define ELF_REL_FINI    ".rel.fini"    /* relocation termination code */
-#define ELF_REL_INIT    ".rel.init"    /* relocation initialization code */
-#define ELF_REL_DYN     ".rel.dyn"     /* relocaltion dynamic link info */
-#define ELF_REL_RODATA  ".rel.rodata"  /* relocation read-only data */
-#define ELF_REL_TEXT    ".rel.text"    /* relocation code */
-#define ELF_RODATA      ".rodata"      /* read-only data */
-#define ELF_SHSTRTAB    ".shstrtab"    /* section header string table */
-#define ELF_STRTAB      ".strtab"      /* string table */
-#define ELF_SYMTAB      ".symtab"      /* symbol table */
-#define ELF_TEXT        ".text"                /* code */
-
-
-/* Section Attribute Flags - sh_flags */
-#define SHF_WRITE      0x1             /* Writable */
-#define SHF_ALLOC      0x2             /* occupies memory */
-#define SHF_EXECINSTR  0x4             /* executable */
-#define SHF_MASKPROC   0xf0000000      /* reserved bits for processor */
-                                       /*  specific section attributes */
-
-/* Symbol Table Entry */
-typedef struct elf32_sym {
-       Elf32_Word      st_name;        /* name - index into string table */
-       Elf32_Addr      st_value;       /* symbol value */
-       Elf32_Word      st_size;        /* symbol size */
-       unsigned char   st_info;        /* type and binding */
-       unsigned char   st_other;       /* 0 - no defined meaning */
-       Elf32_Half      st_shndx;       /* section header index */
-} Elf32_Sym;
-
-typedef struct {
-       Elf64_Half      st_name;        /* Symbol name index in str table */
-       Elf_Byte        st_info;        /* type / binding attrs */
-       Elf_Byte        st_other;       /* unused */
-       Elf64_Quarter   st_shndx;       /* section index of symbol */
-       Elf64_Xword     st_value;       /* value of symbol */
-       Elf64_Xword     st_size;        /* size of symbol */
-} Elf64_Sym;
-
-/* Symbol table index */
-#define STN_UNDEF      0               /* undefined */
-
-/* Extract symbol info - st_info */
-#define ELF32_ST_BIND(x)       ((x) >> 4)
-#define ELF32_ST_TYPE(x)       (((unsigned int) x) & 0xf)
-#define ELF32_ST_INFO(b,t)     (((b) << 4) + ((t) & 0xf))
-
-#define ELF64_ST_BIND(x)       ((x) >> 4)
-#define ELF64_ST_TYPE(x)       (((unsigned int) x) & 0xf)
-#define ELF64_ST_INFO(b,t)     (((b) << 4) + ((t) & 0xf))
-
-/* Symbol Binding - ELF32_ST_BIND - st_info */
-#define STB_LOCAL      0               /* Local symbol */
-#define STB_GLOBAL     1               /* Global symbol */
-#define STB_WEAK       2               /* like global - lower precedence */
-#define STB_NUM                3               /* number of symbol bindings */
-#define STB_LOPROC     13              /* reserved range for processor */
-#define STB_HIPROC     15              /*  specific symbol bindings */
-
-/* Symbol type - ELF32_ST_TYPE - st_info */
-#define STT_NOTYPE     0               /* not specified */
-#define STT_OBJECT     1               /* data object */
-#define STT_FUNC       2               /* function */
-#define STT_SECTION    3               /* section */
-#define STT_FILE       4               /* file */
-#define STT_NUM                5               /* number of symbol types */
-#define STT_LOPROC     13              /* reserved range for processor */
-#define STT_HIPROC     15              /*  specific symbol types */
-
-/* Relocation entry with implicit addend */
-typedef struct {
-       Elf32_Addr      r_offset;       /* offset of relocation */
-       Elf32_Word      r_info;         /* symbol table index and type */
-} Elf32_Rel;
-
-/* Relocation entry with explicit addend */
-typedef struct {
-       Elf32_Addr      r_offset;       /* offset of relocation */
-       Elf32_Word      r_info;         /* symbol table index and type */
-       Elf32_Sword     r_addend;
-} Elf32_Rela;
-
-/* Extract relocation info - r_info */
-#define ELF32_R_SYM(i)         ((i) >> 8)
-#define ELF32_R_TYPE(i)                ((unsigned char) (i))
-#define ELF32_R_INFO(s,t)      (((s) << 8) + (unsigned char)(t))
-
-typedef struct {
-       Elf64_Xword     r_offset;       /* where to do it */
-       Elf64_Xword     r_info;         /* index & type of relocation */
-} Elf64_Rel;
-
-typedef struct {
-       Elf64_Xword     r_offset;       /* where to do it */
-       Elf64_Xword     r_info;         /* index & type of relocation */
-       Elf64_Sxword    r_addend;       /* adjustment value */
-} Elf64_Rela;
-
-#define        ELF64_R_SYM(info)       ((info) >> 32)
-#define        ELF64_R_TYPE(info)      ((info) & 0xFFFFFFFF)
-#define ELF64_R_INFO(s,t)      (((s) << 32) + (u_int32_t)(t))
-
-/* Program Header */
-typedef struct {
-       Elf32_Word      p_type;         /* segment type */
-       Elf32_Off       p_offset;       /* segment offset */
-       Elf32_Addr      p_vaddr;        /* virtual address of segment */
-       Elf32_Addr      p_paddr;        /* physical address - ignored? */
-       Elf32_Word      p_filesz;       /* number of bytes in file for seg. */
-       Elf32_Word      p_memsz;        /* number of bytes in mem. for seg. */
-       Elf32_Word      p_flags;        /* flags */
-       Elf32_Word      p_align;        /* memory alignment */
-} Elf32_Phdr;
-
-typedef struct {
-       Elf64_Half      p_type;         /* entry type */
-       Elf64_Half      p_flags;        /* flags */
-       Elf64_Off       p_offset;       /* offset */
-       Elf64_Addr      p_vaddr;        /* virtual address */
-       Elf64_Addr      p_paddr;        /* physical address */
-       Elf64_Xword     p_filesz;       /* file size */
-       Elf64_Xword     p_memsz;        /* memory size */
-       Elf64_Xword     p_align;        /* memory & file alignment */
-} Elf64_Phdr;
-
-/* Segment types - p_type */
-#define PT_NULL                0               /* unused */
-#define PT_LOAD                1               /* loadable segment */
-#define PT_DYNAMIC     2               /* dynamic linking section */
-#define PT_INTERP      3               /* the RTLD */
-#define PT_NOTE                4               /* auxiliary information */
-#define PT_SHLIB       5               /* reserved - purpose undefined */
-#define PT_PHDR                6               /* program header */
-#define PT_NUM         7               /* Number of segment types */
-#define PT_LOPROC      0x70000000      /* reserved range for processor */
-#define PT_HIPROC      0x7fffffff      /*  specific segment types */
-
-/* Segment flags - p_flags */
-#define PF_X           0x1             /* Executable */
-#define PF_W           0x2             /* Writable */
-#define PF_R           0x4             /* Readable */
-#define PF_MASKPROC    0xf0000000      /* reserved bits for processor */
-                                       /*  specific segment flags */
-
-/* Dynamic structure */
-typedef struct {
-       Elf32_Sword     d_tag;          /* controls meaning of d_val */
-       union {
-               Elf32_Word      d_val;  /* Multiple meanings - see d_tag */
-               Elf32_Addr      d_ptr;  /* program virtual address */
-       } d_un;
-} Elf32_Dyn;
-
-typedef struct {
-       Elf64_Xword     d_tag;          /* controls meaning of d_val */
-       union {
-               Elf64_Addr      d_ptr;
-               Elf64_Xword     d_val;
-       } d_un;
-} Elf64_Dyn;
-
-/* Dynamic Array Tags - d_tag */
-#define DT_NULL                0               /* marks end of _DYNAMIC array 
*/
-#define DT_NEEDED      1               /* string table offset of needed lib */
-#define DT_PLTRELSZ    2               /* size of relocation entries in PLT */
-#define DT_PLTGOT      3               /* address PLT/GOT */
-#define DT_HASH                4               /* address of symbol hash table 
*/
-#define DT_STRTAB      5               /* address of string table */
-#define DT_SYMTAB      6               /* address of symbol table */
-#define DT_RELA                7               /* address of relocation table 
*/
-#define DT_RELASZ      8               /* size of relocation table */
-#define DT_RELAENT     9               /* size of relocation entry */
-#define DT_STRSZ       10              /* size of string table */
-#define DT_SYMENT      11              /* size of symbol table entry */
-#define DT_INIT                12              /* address of initialization 
func. */
-#define DT_FINI                13              /* address of termination 
function */
-#define DT_SONAME      14              /* string table offset of shared obj */
-#define DT_RPATH       15              /* string table offset of library
-                                          search path */
-#define DT_SYMBOLIC    16              /* start sym search in shared obj. */
-#define DT_REL         17              /* address of rel. tbl. w addends */
-#define DT_RELSZ       18              /* size of DT_REL relocation table */
-#define DT_RELENT      19              /* size of DT_REL relocation entry */
-#define DT_PLTREL      20              /* PLT referenced relocation entry */
-#define DT_DEBUG       21              /* bugger */
-#define DT_TEXTREL     22              /* Allow rel. mod. to unwritable seg */
-#define DT_JMPREL      23              /* add. of PLT's relocation entries */
-#define DT_BIND_NOW    24              /* Bind now regardless of env setting */
-#define DT_NUM         25              /* Number used. */
-#define DT_LOPROC      0x70000000      /* reserved range for processor */
-#define DT_HIPROC      0x7fffffff      /*  specific dynamic array tags */
-
-/* Standard ELF hashing function */
-unsigned int elf_hash(const unsigned char *name);
-
-/*
- * Note Definitions
- */
-typedef struct {
-       Elf32_Word namesz;
-       Elf32_Word descsz;
-       Elf32_Word type;
-} Elf32_Note;
-
-typedef struct {
-       Elf64_Half namesz;
-       Elf64_Half descsz;
-       Elf64_Half type;
-} Elf64_Note;
-
-
-#if defined(ELFSIZE)
-#define CONCAT(x,y)    __CONCAT(x,y)
-#define ELFNAME(x)     CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
-#define ELFNAME2(x,y)  CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
-#define ELFNAMEEND(x)  CONCAT(x,CONCAT(_elf,ELFSIZE))
-#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
-#endif
-
-#if defined(ELFSIZE) && (ELFSIZE == 32)
-#define Elf_Ehdr       Elf32_Ehdr
-#define Elf_Phdr       Elf32_Phdr
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Rel                Elf32_Rel
-#define Elf_RelA       Elf32_Rela
-#define Elf_Dyn                Elf32_Dyn
-#define Elf_Word       Elf32_Word
-#define Elf_Sword      Elf32_Sword
-#define Elf_Addr       Elf32_Addr
-#define Elf_Off                Elf32_Off
-#define Elf_Nhdr       Elf32_Nhdr
-#define Elf_Note       Elf32_Note
-
-#define ELF_R_SYM      ELF32_R_SYM
-#define ELF_R_TYPE     ELF32_R_TYPE
-#define ELF_R_INFO     ELF32_R_INFO
-#define ELFCLASS       ELFCLASS32
-
-#define ELF_ST_BIND    ELF32_ST_BIND
-#define ELF_ST_TYPE    ELF32_ST_TYPE
-#define ELF_ST_INFO    ELF32_ST_INFO
-
-#define AuxInfo                Aux32Info
-#elif defined(ELFSIZE) && (ELFSIZE == 64)
-#define Elf_Ehdr       Elf64_Ehdr
-#define Elf_Phdr       Elf64_Phdr
-#define Elf_Shdr       Elf64_Shdr
-#define Elf_Sym                Elf64_Sym
-#define Elf_Rel                Elf64_Rel
-#define Elf_RelA       Elf64_Rela
-#define Elf_Dyn                Elf64_Dyn
-#define Elf_Word       Elf64_Word
-#define Elf_Sword      Elf64_Sword
-#define Elf_Addr       Elf64_Addr
-#define Elf_Off                Elf64_Off
-#define Elf_Nhdr       Elf64_Nhdr
-#define Elf_Note       Elf64_Note
-
-#define ELF_R_SYM      ELF64_R_SYM
-#define ELF_R_TYPE     ELF64_R_TYPE
-#define ELF_R_INFO     ELF64_R_INFO
-#define ELFCLASS       ELFCLASS64
-
-#define ELF_ST_BIND    ELF64_ST_BIND
-#define ELF_ST_TYPE    ELF64_ST_TYPE
-#define ELF_ST_INFO    ELF64_ST_INFO
-
-#define AuxInfo                Aux64Info
-#endif
-
-#endif /* __XEN_PUBLIC_ELFSTRUCTS_H__ */
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/foreign/Makefile
--- a/include/xen/interface/foreign/Makefile    Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-XEN_ROOT=../../../..
-include $(XEN_ROOT)/Config.mk
-
-architectures := x86_32 x86_64 ia64
-headers := $(patsubst %, %.h, $(architectures))
-scripts := $(wildcard *.py)
-
-.PHONY: all clean check-headers
-all: $(headers) check-headers
-
-clean:
-       rm -f $(headers)
-       rm -f checker checker.c $(XEN_TARGET_ARCH).size
-       rm -f *.pyc *.o *~
-
-ifeq ($(CROSS_COMPILE)$(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
-check-headers: checker
-       ./checker > $(XEN_TARGET_ARCH).size
-       diff -u reference.size $(XEN_TARGET_ARCH).size
-checker: checker.c $(headers)
-       $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
-else
-check-headers:
-       @echo "cross build: skipping check"
-endif
-
-x86_32.h: ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h $(scripts)
-       python mkheader.py $* $@ $(filter %.h,$^)
-
-x86_64.h: ../arch-x86/xen-x86_64.h ../arch-x86/xen.h ../xen.h $(scripts)
-       python mkheader.py $* $@ $(filter %.h,$^)
-
-ia64.h: ../arch-ia64.h ../xen.h $(scripts)
-       python mkheader.py $* $@ $(filter %.h,$^)
-
-checker.c: $(scripts)
-       python mkchecker.py $(XEN_TARGET_ARCH) $@ $(architectures)
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/foreign/mkchecker.py
--- a/include/xen/interface/foreign/mkchecker.py        Wed Mar 18 15:28:03 
2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/usr/bin/python
-
-import sys;
-from structs import structs;
-
-# command line arguments
-arch    = sys.argv[1];
-outfile = sys.argv[2];
-archs   = sys.argv[3:];
-
-f = open(outfile, "w");
-f.write('''
-/*
- * sanity checks for generated foreign headers:
- *  - verify struct sizes
- *
- * generated by %s -- DO NOT EDIT
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <inttypes.h>
-#include "../xen.h"
-''');
-
-for a in archs:
-    f.write('#include "%s.h"\n' % a);
-
-f.write('int main(int argc, char *argv[])\n{\n');
-
-f.write('\tprintf("\\n");');
-f.write('printf("%-25s |", "structs");\n');
-for a in archs:
-    f.write('\tprintf("%%8s", "%s");\n' % a);
-f.write('\tprintf("\\n");');
-
-f.write('\tprintf("\\n");');
-for struct in structs:
-    f.write('\tprintf("%%-25s |", "%s");\n' % struct);
-    for a in archs:
-        if a == arch:
-            s = struct; # native
-        else:
-            s = struct + "_" + a;
-        f.write('#ifdef %s_has_no_%s\n' % (a, struct));
-        f.write('\tprintf("%8s", "-");\n');
-        f.write("#else\n");
-        f.write('\tprintf("%%8zd", sizeof(struct %s));\n' % s);
-        f.write("#endif\n");
-
-    f.write('\tprintf("\\n");\n\n');
-
-f.write('\tprintf("\\n");\n');
-f.write('\texit(0);\n');
-f.write('}\n');
-
-f.close();
-
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/foreign/mkheader.py
--- a/include/xen/interface/foreign/mkheader.py Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-#!/usr/bin/python
-
-import sys, re;
-from structs import unions, structs, defines;
-
-# command line arguments
-arch    = sys.argv[1];
-outfile = sys.argv[2];
-infiles = sys.argv[3:];
-
-
-###########################################################################
-# configuration #2: architecture information
-
-inttypes = {};
-header = {};
-footer = {};
-
-# x86_32
-inttypes["x86_32"] = {
-    "unsigned long" : "uint32_t",
-    "long"          : "uint32_t",
-    "xen_pfn_t"     : "uint32_t",
-};
-header["x86_32"] = """
-#define __i386___X86_32 1
-#pragma pack(4)
-""";
-footer["x86_32"] = """
-#pragma pack()
-""";
-
-# x86_64
-inttypes["x86_64"] = {
-    "unsigned long" : "__align8__ uint64_t",
-    "long"          : "__align8__ uint64_t",
-    "xen_pfn_t"     : "__align8__ uint64_t",
-};
-header["x86_64"] = """
-#ifdef __GNUC__
-# define __DECL_REG(name) union { uint64_t r ## name, e ## name; }
-# define __align8__ __attribute__((aligned (8)))
-#else
-# define __DECL_REG(name) uint64_t r ## name
-# define __align8__ FIXME
-#endif
-#define __x86_64___X86_64 1
-""";
-
-# ia64
-inttypes["ia64"] = {
-    "unsigned long" : "__align8__ uint64_t",
-    "long"          : "__align8__ uint64_t",
-    "xen_pfn_t"     : "__align8__ uint64_t",
-    "long double"   : "__align16__ ldouble_t",
-};
-header["ia64"] = """
-#define __align8__ __attribute__((aligned (8)))
-#define __align16__ __attribute__((aligned (16)))
-typedef unsigned char ldouble_t[16];
-""";
-
-
-###########################################################################
-# main
-
-input  = "";
-output = "";
-fileid = re.sub("[-.]", "_", "__FOREIGN_%s__" % outfile.upper());
-
-# read input header files
-for name in infiles:
-    f = open(name, "r");
-    input += f.read();
-    f.close();
-
-# add header
-output += """
-/*
- * public xen defines and struct for %s
- * generated by %s -- DO NOT EDIT
- */
-
-#ifndef %s
-#define %s 1
-
-""" % (arch, sys.argv[0], fileid, fileid)
-
-if arch in header:
-    output += header[arch];
-    output += "\n";
-
-# add defines to output
-for line in re.findall("#define[^\n]+", input):
-    for define in defines:
-        regex = "#define\s+%s\\b" % define;
-        match = re.search(regex, line);
-        if None == match:
-            continue;
-        if define.upper()[0] == define[0]:
-            replace = define + "_" + arch.upper();
-        else:
-            replace = define + "_" + arch;
-        regex = "\\b%s\\b" % define;
-        output += re.sub(regex, replace, line) + "\n";
-output += "\n";
-
-# delete defines, comments, empty lines
-input = re.sub("#define[^\n]+\n", "", input);
-input = re.compile("/\*(.*?)\*/", re.S).sub("", input)
-input = re.compile("\n\s*\n", re.S).sub("\n", input);
-
-# add unions to output
-for union in unions:
-    regex = "union\s+%s\s*\{(.*?)\n\};" % union;
-    match = re.search(regex, input, re.S)
-    if None == match:
-        output += "#define %s_has_no_%s 1\n" % (arch, union);
-    else:
-        output += "union %s_%s {%s\n};\n" % (union, arch, match.group(1));
-    output += "\n";
-
-# add structs to output
-for struct in structs:
-    regex = "struct\s+%s\s*\{(.*?)\n\};" % struct;
-    match = re.search(regex, input, re.S)
-    if None == match:
-        output += "#define %s_has_no_%s 1\n" % (arch, struct);
-    else:
-        output += "struct %s_%s {%s\n};\n" % (struct, arch, match.group(1));
-        output += "typedef struct %s_%s %s_%s_t;\n" % (struct, arch, struct, 
arch);
-    output += "\n";
-
-# add footer
-if arch in footer:
-    output += footer[arch];
-    output += "\n";
-output += "#endif /* %s */\n" % fileid;
-
-# replace: defines
-for define in defines:
-    if define.upper()[0] == define[0]:
-        replace = define + "_" + arch.upper();
-    else:
-        replace = define + "_" + arch;
-    output = re.sub("\\b%s\\b" % define, replace, output);
-
-# replace: unions
-for union in unions:
-    output = re.sub("\\b(union\s+%s)\\b" % union, "\\1_%s" % arch, output);
-
-# replace: structs + struct typedefs
-for struct in structs:
-    output = re.sub("\\b(struct\s+%s)\\b" % struct, "\\1_%s" % arch, output);
-    output = re.sub("\\b(%s)_t\\b" % struct, "\\1_%s_t" % arch, output);
-
-# replace: integer types
-integers = inttypes[arch].keys();
-integers.sort(lambda a, b: cmp(len(b),len(a)));
-for type in integers:
-    output = re.sub("\\b%s\\b" % type, inttypes[arch][type], output);
-
-# print results
-f = open(outfile, "w");
-f.write(output);
-f.close;
-
diff -r ddb6d2257ec4 -r 4839e34e6795 
include/xen/interface/foreign/reference.size
--- a/include/xen/interface/foreign/reference.size      Wed Mar 18 15:28:03 
2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-
-structs                   |  x86_32  x86_64    ia64
-
-start_info                |    1104    1152    1152
-trap_info                 |       8      16       -
-pt_fpreg                  |       -       -      16
-cpu_user_regs             |      68     200       -
-xen_ia64_boot_param       |       -       -      96
-ia64_tr_entry             |       -       -      32
-vcpu_tr_regs              |       -       -     768
-vcpu_guest_context_regs   |       -       -   22176
-vcpu_guest_context        |    2800    5168   22208
-arch_vcpu_info            |      24      16       0
-vcpu_time_info            |      32      32      32
-vcpu_info                 |      64      64      48
-arch_shared_info          |     268     280     272
-shared_info               |    2584    3368    4384
-
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/foreign/structs.py
--- a/include/xen/interface/foreign/structs.py  Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-# configuration: what needs translation
-
-unions  = [ "vcpu_cr_regs",
-            "vcpu_ar_regs" ];
-
-structs = [ "start_info",
-            "trap_info",
-            "pt_fpreg",
-            "cpu_user_regs",
-            "xen_ia64_boot_param",
-            "ia64_tr_entry",
-            "vcpu_tr_regs",
-            "vcpu_guest_context_regs",
-            "vcpu_guest_context",
-            "arch_vcpu_info",
-            "vcpu_time_info",
-            "vcpu_info",
-            "arch_shared_info",
-            "shared_info" ];
-
-defines = [ "__i386__",
-            "__x86_64__",
-
-            "FLAT_RING1_CS",
-            "FLAT_RING1_DS",
-            "FLAT_RING1_SS",
-
-            "FLAT_RING3_CS64",
-            "FLAT_RING3_DS64",
-            "FLAT_RING3_SS64",
-            "FLAT_KERNEL_CS64",
-            "FLAT_KERNEL_DS64",
-            "FLAT_KERNEL_SS64",
-
-            "FLAT_KERNEL_CS",
-            "FLAT_KERNEL_DS",
-            "FLAT_KERNEL_SS",
-
-            # x86_{32,64}
-            "_VGCF_i387_valid",
-            "VGCF_i387_valid",
-            "_VGCF_in_kernel",
-            "VGCF_in_kernel",
-            "_VGCF_failsafe_disables_events",
-            "VGCF_failsafe_disables_events",
-            "_VGCF_syscall_disables_events",
-            "VGCF_syscall_disables_events",
-            "_VGCF_online",
-            "VGCF_online",
-
-            # ia64
-            "VGCF_EXTRA_REGS",
-
-            # all archs
-            "xen_pfn_to_cr3",
-            "MAX_VIRT_CPUS",
-            "MAX_GUEST_CMDLINE" ];
-
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/hvm/hvm_info_table.h
--- a/include/xen/interface/hvm/hvm_info_table.h        Wed Mar 18 15:28:03 
2009 +0000
+++ b/include/xen/interface/hvm/hvm_info_table.h        Wed Mar 18 15:43:57 
2009 +0000
@@ -33,9 +33,37 @@ struct hvm_info_table {
     char        signature[8]; /* "HVM INFO" */
     uint32_t    length;
     uint8_t     checksum;
+
+    /* Should firmware build ACPI tables? */
     uint8_t     acpi_enabled;
+
+    /* Should firmware build APIC descriptors (APIC MADT / MP BIOS)? */
     uint8_t     apic_mode;
+
+    /* How many CPUs does this domain have? */
     uint32_t    nr_vcpus;
+
+    /*
+     * MEMORY MAP provided by HVM domain builder.
+     * Notes:
+     *  1. page_to_phys(x) = x << 12
+     *  2. If a field is zero, the corresponding range does not exist.
+     */
+    /*
+     *  0x0 to page_to_phys(low_mem_pgend)-1:
+     *    RAM below 4GB (except for VGA hole 0xA0000-0xBFFFF)
+     */
+    uint32_t    low_mem_pgend;
+    /*
+     *  page_to_phys(reserved_mem_pgstart) to 0xFFFFFFFF:
+     *    Reserved for special memory mappings
+     */
+    uint32_t    reserved_mem_pgstart;
+    /*
+     *  0x100000000 to page_to_phys(high_mem_pgend)-1:
+     *    RAM above 4GB
+     */
+    uint32_t    high_mem_pgend;
 };
 
 #endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/hvm/params.h
--- a/include/xen/interface/hvm/params.h        Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/hvm/params.h        Wed Mar 18 15:43:57 2009 +0000
@@ -100,6 +100,12 @@
 /* ACPI S state: currently support S0 and S3 on x86. */
 #define HVM_PARAM_ACPI_S_STATE 14
 
-#define HVM_NR_PARAMS          15
+/* TSS used on Intel when CR0.PE=0. */
+#define HVM_PARAM_VM86_TSS     15
+
+/* Boolean: Enable aligning all periodic vpts to reduce interrupts */
+#define HVM_PARAM_VPT_ALIGN    16
+
+#define HVM_NR_PARAMS          17
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/hvm/vmx_assist.h
--- a/include/xen/interface/hvm/vmx_assist.h    Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * vmx_assist.h: Context definitions for the VMXASSIST world switch.
- *
- * 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.
- *
- * Leendert van Doorn, leendert@xxxxxxxxxxxxxx
- * Copyright (c) 2005, International Business Machines Corporation.
- */
-
-#ifndef _VMX_ASSIST_H_
-#define _VMX_ASSIST_H_
-
-#define VMXASSIST_BASE         0xD0000
-#define VMXASSIST_MAGIC        0x17101966
-#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
-
-#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
-#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
-
-#ifndef __ASSEMBLY__
-
-#define NR_EXCEPTION_HANDLER    32
-#define NR_INTERRUPT_HANDLERS   16
-#define NR_TRAPS        (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
-
-union vmcs_arbytes {
-    struct arbyte_fields {
-        unsigned int seg_type : 4,
-            s         : 1,
-            dpl       : 2,
-            p         : 1,
-            reserved0 : 4,
-            avl       : 1,
-            reserved1 : 1,
-            default_ops_size: 1,
-            g         : 1,
-            null_bit  : 1,
-            reserved2 : 15;
-    } fields;
-    unsigned int bytes;
-};
-
-/*
- * World switch state
- */
-struct vmx_assist_context {
-    uint32_t  eip;        /* execution pointer */
-    uint32_t  esp;        /* stack pointer */
-    uint32_t  eflags;     /* flags register */
-    uint32_t  cr0;
-    uint32_t  cr3;        /* page table directory */
-    uint32_t  cr4;
-    uint32_t  idtr_limit; /* idt */
-    uint32_t  idtr_base;
-    uint32_t  gdtr_limit; /* gdt */
-    uint32_t  gdtr_base;
-    uint32_t  cs_sel;     /* cs selector */
-    uint32_t  cs_limit;
-    uint32_t  cs_base;
-    union vmcs_arbytes cs_arbytes;
-    uint32_t  ds_sel;     /* ds selector */
-    uint32_t  ds_limit;
-    uint32_t  ds_base;
-    union vmcs_arbytes ds_arbytes;
-    uint32_t  es_sel;     /* es selector */
-    uint32_t  es_limit;
-    uint32_t  es_base;
-    union vmcs_arbytes es_arbytes;
-    uint32_t  ss_sel;     /* ss selector */
-    uint32_t  ss_limit;
-    uint32_t  ss_base;
-    union vmcs_arbytes ss_arbytes;
-    uint32_t  fs_sel;     /* fs selector */
-    uint32_t  fs_limit;
-    uint32_t  fs_base;
-    union vmcs_arbytes fs_arbytes;
-    uint32_t  gs_sel;     /* gs selector */
-    uint32_t  gs_limit;
-    uint32_t  gs_base;
-    union vmcs_arbytes gs_arbytes;
-    uint32_t  tr_sel;     /* task selector */
-    uint32_t  tr_limit;
-    uint32_t  tr_base;
-    union vmcs_arbytes tr_arbytes;
-    uint32_t  ldtr_sel;   /* ldtr selector */
-    uint32_t  ldtr_limit;
-    uint32_t  ldtr_base;
-    union vmcs_arbytes ldtr_arbytes;
-
-    unsigned char rm_irqbase[2];
-};
-typedef struct vmx_assist_context vmx_assist_context_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* _VMX_ASSIST_H_ */
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/io/fsif.h
--- a/include/xen/interface/io/fsif.h   Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/io/fsif.h   Wed Mar 18 15:43:57 2009 +0000
@@ -185,7 +185,8 @@ DEFINE_RING_TYPES(fsif, struct fsif_requ
 
 #define STATE_INITIALISED     "init"
 #define STATE_READY           "ready"
-
+#define STATE_CLOSING         "closing"
+#define STATE_CLOSED          "closed"
 
 
 #endif
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/io/pciif.h
--- a/include/xen/interface/io/pciif.h  Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/io/pciif.h  Wed Mar 18 15:43:57 2009 +0000
@@ -29,7 +29,7 @@
 
 /* xen_pci_sharedinfo flags */
 #define _XEN_PCIF_active     (0)
-#define XEN_PCIF_active      (1<<_XEN_PCI_active)
+#define XEN_PCIF_active      (1<<_XEN_PCIF_active)
 #define _XEN_PCIB_AERHANDLER (1)
 #define XEN_PCIB_AERHANDLER  (1<<_XEN_PCIB_AERHANDLER)
 #define _XEN_PCIB_active     (2)
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/libelf.h
--- a/include/xen/interface/libelf.h    Wed Mar 18 15:28:03 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/******************************************************************************
- * libelf.h
- * 
- * 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 __XC_LIBELF__
-#define __XC_LIBELF__ 1
-
-#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
-#define XEN_ELF_LITTLE_ENDIAN
-#else
-#error define architectural endianness
-#endif
-
-#undef ELFSIZE
-#include "elfnote.h"
-#include "elfstructs.h"
-#include "features.h"
-
-/* ------------------------------------------------------------------------ */
-
-typedef union {
-    Elf32_Ehdr e32;
-    Elf64_Ehdr e64;
-} elf_ehdr;
-
-typedef union {
-    Elf32_Phdr e32;
-    Elf64_Phdr e64;
-} elf_phdr;
-
-typedef union {
-    Elf32_Shdr e32;
-    Elf64_Shdr e64;
-} elf_shdr;
-
-typedef union {
-    Elf32_Sym e32;
-    Elf64_Sym e64;
-} elf_sym;
-
-typedef union {
-    Elf32_Rel e32;
-    Elf64_Rel e64;
-} elf_rel;
-
-typedef union {
-    Elf32_Rela e32;
-    Elf64_Rela e64;
-} elf_rela;
-
-typedef union {
-    Elf32_Note e32;
-    Elf64_Note e64;
-} elf_note;
-
-struct elf_binary {
-    /* elf binary */
-    const char *image;
-    size_t size;
-    char class;
-    char data;
-
-    const elf_ehdr *ehdr;
-    const char *sec_strtab;
-    const elf_shdr *sym_tab;
-    const char *sym_strtab;
-
-    /* loaded to */
-    char *dest;
-    uint64_t pstart;
-    uint64_t pend;
-    uint64_t reloc_offset;
-
-    uint64_t bsd_symtab_pstart;
-    uint64_t bsd_symtab_pend;
-
-#ifndef __XEN__
-    /* misc */
-    FILE *log;
-#endif
-    int verbose;
-};
-
-/* ------------------------------------------------------------------------ */
-/* accessing elf header fields                                              */
-
-#ifdef XEN_ELF_BIG_ENDIAN
-# define NATIVE_ELFDATA ELFDATA2MSB
-#else
-# define NATIVE_ELFDATA ELFDATA2LSB
-#endif
-
-#define elf_32bit(elf) (ELFCLASS32 == (elf)->class)
-#define elf_64bit(elf) (ELFCLASS64 == (elf)->class)
-#define elf_msb(elf)   (ELFDATA2MSB == (elf)->data)
-#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))
-
-uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
-                             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 elf_round_up(struct elf_binary *elf, uint64_t addr);
-
-/* ------------------------------------------------------------------------ */
-/* xc_libelf_tools.c                                                        */
-
-int elf_shdr_count(struct elf_binary *elf);
-int elf_phdr_count(struct elf_binary *elf);
-
-const elf_shdr *elf_shdr_by_name(struct elf_binary *elf, const char *name);
-const elf_shdr *elf_shdr_by_index(struct elf_binary *elf, int index);
-const elf_phdr *elf_phdr_by_index(struct elf_binary *elf, int index);
-
-const char *elf_section_name(struct elf_binary *elf, const elf_shdr * shdr);
-const void *elf_section_start(struct elf_binary *elf, const elf_shdr * shdr);
-const void *elf_section_end(struct elf_binary *elf, const elf_shdr * shdr);
-
-const void *elf_segment_start(struct elf_binary *elf, const elf_phdr * phdr);
-const void *elf_segment_end(struct elf_binary *elf, const elf_phdr * phdr);
-
-const elf_sym *elf_sym_by_name(struct elf_binary *elf, const char *symbol);
-const elf_sym *elf_sym_by_index(struct elf_binary *elf, int index);
-
-const char *elf_note_name(struct elf_binary *elf, const elf_note * note);
-const void *elf_note_desc(struct elf_binary *elf, const elf_note * note);
-uint64_t elf_note_numeric(struct elf_binary *elf, const elf_note * note);
-const elf_note *elf_note_next(struct elf_binary *elf, const elf_note * note);
-
-int elf_is_elfbinary(const void *image);
-int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr);
-
-/* ------------------------------------------------------------------------ */
-/* xc_libelf_loader.c                                                       */
-
-int elf_init(struct elf_binary *elf, const char *image, size_t size);
-#ifdef __XEN__
-void elf_set_verbose(struct elf_binary *elf);
-#else
-void elf_set_logfile(struct elf_binary *elf, FILE * log, int verbose);
-#endif
-
-void elf_parse_binary(struct elf_binary *elf);
-void elf_load_binary(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                                                     */
-
-int elf_reloc(struct elf_binary *elf);
-
-/* ------------------------------------------------------------------------ */
-/* xc_libelf_dominfo.c                                                      */
-
-#define UNSET_ADDR          ((uint64_t)-1)
-
-enum xen_elfnote_type {
-    XEN_ENT_NONE = 0,
-    XEN_ENT_LONG = 1,
-    XEN_ENT_STR  = 2
-};
-
-struct xen_elfnote {
-    enum xen_elfnote_type type;
-    const char *name;
-    union {
-        const char *str;
-        uint64_t num;
-    } data;
-};
-
-struct elf_dom_parms {
-    /* raw */
-    const char *guest_info;
-    const void *elf_note_start;
-    const void *elf_note_end;
-    struct xen_elfnote elf_notes[XEN_ELFNOTE_MAX + 1];
-  
-    /* parsed */
-    char guest_os[16];
-    char guest_ver[16];
-    char xen_ver[16];
-    char loader[16];
-    int pae;
-    int bsd_symtab;
-    uint64_t virt_base;
-    uint64_t virt_entry;
-    uint64_t virt_hypercall;
-    uint64_t virt_hv_start_low;
-    uint64_t elf_paddr_offset;
-    uint32_t f_supported[XENFEAT_NR_SUBMAPS];
-    uint32_t f_required[XENFEAT_NR_SUBMAPS];
-
-    /* calculated */
-    uint64_t virt_offset;
-    uint64_t virt_kstart;
-    uint64_t virt_kend;
-};
-
-static inline void elf_xen_feature_set(int nr, uint32_t * addr)
-{
-    addr[nr >> 5] |= 1 << (nr & 31);
-}
-static inline int elf_xen_feature_get(int nr, uint32_t * addr)
-{
-    return !!(addr[nr >> 5] & (1 << (nr & 31)));
-}
-
-int elf_xen_parse_features(const char *features,
-                           uint32_t *supported,
-                           uint32_t *required);
-int elf_xen_parse_note(struct elf_binary *elf,
-                       struct elf_dom_parms *parms,
-                       const elf_note *note);
-int elf_xen_parse_guest_info(struct elf_binary *elf,
-                             struct elf_dom_parms *parms);
-int elf_xen_parse(struct elf_binary *elf,
-                  struct elf_dom_parms *parms);
-
-#endif /* __XC_LIBELF__ */
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/physdev.h
--- a/include/xen/interface/physdev.h   Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/physdev.h   Wed Mar 18 15:43:57 2009 +0000
@@ -183,6 +183,15 @@ typedef struct physdev_manage_pci physde
 typedef struct physdev_manage_pci physdev_manage_pci_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_t);
 
+#define PHYSDEVOP_restore_msi            19
+struct physdev_restore_msi {
+    /* IN */
+    uint8_t bus;
+    uint8_t devfn;
+};
+typedef struct physdev_restore_msi physdev_restore_msi_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_restore_msi_t);
+
 /*
  * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
  * hypercall since 0x00030202.
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h    Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/sysctl.h    Wed Mar 18 15:43:57 2009 +0000
@@ -262,17 +262,181 @@ typedef struct xen_sysctl_get_pmstat xen
 typedef struct xen_sysctl_get_pmstat xen_sysctl_get_pmstat_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_get_pmstat_t);
 
+/*
+ * Status codes. Must be greater than 0 to avoid confusing
+ * sysctl callers that see 0 as a plain successful return.
+ */
+#define XEN_CPU_HOTPLUG_STATUS_OFFLINE 1
+#define XEN_CPU_HOTPLUG_STATUS_ONLINE  2
+#define XEN_CPU_HOTPLUG_STATUS_NEW     3
+
 #define XEN_SYSCTL_cpu_hotplug       11
 struct xen_sysctl_cpu_hotplug {
     /* IN variables */
     uint32_t cpu;   /* Physical cpu. */
 #define XEN_SYSCTL_CPU_HOTPLUG_ONLINE  0
 #define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1
+#define XEN_SYSCTL_CPU_HOTPLUG_STATUS 2
     uint32_t op;    /* hotplug opcode */
 };
 typedef struct xen_sysctl_cpu_hotplug xen_sysctl_cpu_hotplug_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_hotplug_t);
 
+/*
+ * Get/set xen power management, include 
+ * 1. cpufreq governors and related parameters
+ */
+#define XEN_SYSCTL_pm_op        12
+struct xen_userspace {
+    uint32_t scaling_setspeed;
+};
+typedef struct xen_userspace xen_userspace_t;
+
+struct xen_ondemand {
+    uint32_t sampling_rate_max;
+    uint32_t sampling_rate_min;
+
+    uint32_t sampling_rate;
+    uint32_t up_threshold;
+};
+typedef struct xen_ondemand xen_ondemand_t;
+
+/* 
+ * cpufreq para name of this structure named 
+ * same as sysfs file name of native linux
+ */
+#define CPUFREQ_NAME_LEN 16
+struct xen_get_cpufreq_para {
+    /* IN/OUT variable */
+    uint32_t cpu_num;
+    uint32_t freq_num;
+    uint32_t gov_num;
+
+    /* for all governors */
+    /* OUT variable */
+    XEN_GUEST_HANDLE_64(uint32) affected_cpus;
+    XEN_GUEST_HANDLE_64(uint32) scaling_available_frequencies;
+    XEN_GUEST_HANDLE_64(char)   scaling_available_governors;
+    char scaling_driver[CPUFREQ_NAME_LEN];
+
+    uint32_t cpuinfo_cur_freq;
+    uint32_t cpuinfo_max_freq;
+    uint32_t cpuinfo_min_freq;
+    uint32_t scaling_cur_freq;
+
+    char scaling_governor[CPUFREQ_NAME_LEN];
+    uint32_t scaling_max_freq;
+    uint32_t scaling_min_freq;
+
+    /* for specific governor */
+    union {
+        struct  xen_userspace userspace;
+        struct  xen_ondemand ondemand;
+    } u;
+};
+
+struct xen_set_cpufreq_gov {
+    char scaling_governor[CPUFREQ_NAME_LEN];
+};
+
+struct xen_set_cpufreq_para {
+    #define SCALING_MAX_FREQ           1
+    #define SCALING_MIN_FREQ           2
+    #define SCALING_SETSPEED           3
+    #define SAMPLING_RATE              4
+    #define UP_THRESHOLD               5
+
+    uint32_t ctrl_type;
+    uint32_t ctrl_value;
+}
+;
+/* Get physical CPU topology information. */
+
+
+#define INVALID_TOPOLOGY_ID  (~0U)
+struct xen_get_cputopo {
+     /* IN: maximum addressable entry in
+      * the caller-provided cpu_to_core/socket.
+      */
+    uint32_t max_cpus;
+    XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
+    XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
+
+    /* OUT: number of cpus returned
+     * If OUT is greater than IN then the cpu_to_core/socket is truncated!
+     */
+    uint32_t nr_cpus;
+};
+
+struct xen_sysctl_pm_op {
+    #define PM_PARA_CATEGORY_MASK      0xf0
+    #define CPUFREQ_PARA               0x10
+
+    /* cpufreq command type */
+    #define GET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x01)
+    #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
+    #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
+
+    /* get CPU topology */
+    #define XEN_SYSCTL_pm_op_get_cputopo  0x20
+
+    uint32_t cmd;
+    uint32_t cpuid;
+    union {
+        struct xen_get_cpufreq_para get_para;
+        struct xen_set_cpufreq_gov  set_gov;
+        struct xen_set_cpufreq_para set_para;
+        struct xen_get_cputopo      get_topo;
+    };
+};
+
+#define XEN_SYSCTL_page_offline_op        14
+struct xen_sysctl_page_offline_op {
+    /* IN: range of page to be offlined */
+#define sysctl_page_offline     1
+#define sysctl_page_online      2
+#define sysctl_query_page_offline  3
+    uint32_t cmd;
+    uint32_t start;
+    uint32_t end;
+    /* OUT: result of page offline request */
+    /*
+     * bit 0~15: result flags
+     * bit 16~31: owner
+     */
+    XEN_GUEST_HANDLE(uint32) status;
+};
+
+#define PG_OFFLINE_STATUS_MASK    (0xFFUL)
+
+/* The result is invalid, i.e. HV does not handle it */
+#define PG_OFFLINE_INVALID   (0x1UL << 0)
+
+#define PG_OFFLINE_OFFLINED  (0x1UL << 1)
+#define PG_OFFLINE_PENDING   (0x1UL << 2)
+#define PG_OFFLINE_FAILED    (0x1UL << 3)
+
+#define PG_ONLINE_FAILED     PG_OFFLINE_FAILED
+#define PG_ONLINE_ONLINED    PG_OFFLINE_OFFLINED
+
+#define PG_OFFLINE_STATUS_OFFLINED              (0x1UL << 1)
+#define PG_OFFLINE_STATUS_ONLINE                (0x1UL << 2)
+#define PG_OFFLINE_STATUS_OFFLINE_PENDING       (0x1UL << 3)
+#define PG_OFFLINE_STATUS_BROKEN                (0x1UL << 4)
+
+#define PG_OFFLINE_MISC_MASK    (0xFFUL << 4)
+
+/* only valid when PG_OFFLINE_FAILED */
+#define PG_OFFLINE_XENPAGE   (0x1UL << 8)
+#define PG_OFFLINE_DOM0PAGE  (0x1UL << 9)
+#define PG_OFFLINE_ANONYMOUS (0x1UL << 10)
+#define PG_OFFLINE_NOT_CONV_RAM   (0x1UL << 11)
+#define PG_OFFLINE_OWNED     (0x1UL << 12)
+
+#define PG_OFFLINE_BROKEN    (0x1UL << 13)
+#define PG_ONLINE_BROKEN     PG_OFFLINE_BROKEN
+
+#define PG_OFFLINE_OWNER_SHIFT 16
 
 struct xen_sysctl {
     uint32_t cmd;
@@ -289,6 +453,8 @@ struct xen_sysctl {
         struct xen_sysctl_availheap         availheap;
         struct xen_sysctl_get_pmstat        get_pmstat;
         struct xen_sysctl_cpu_hotplug       cpu_hotplug;
+        struct xen_sysctl_pm_op             pm_op;
+        struct xen_sysctl_page_offline_op   page_offline;
         uint8_t                             pad[128];
     } u;
 };
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/trace.h
--- a/include/xen/interface/trace.h     Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/trace.h     Wed Mar 18 15:43:57 2009 +0000
@@ -60,7 +60,8 @@
 #define TRC_TRACE_WRAP_BUFFER  (TRC_GEN + 2)
 #define TRC_TRACE_CPU_CHANGE    (TRC_GEN + 3)
 
-#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1)
+#define TRC_SCHED_RUNSTATE_CHANGE   (TRC_SCHED_MIN + 1)
+#define TRC_SCHED_CONTINUE_RUNNING  (TRC_SCHED_MIN + 2)
 #define TRC_SCHED_DOM_ADD        (TRC_SCHED_VERBOSE +  1)
 #define TRC_SCHED_DOM_REM        (TRC_SCHED_VERBOSE +  2)
 #define TRC_SCHED_SLEEP          (TRC_SCHED_VERBOSE +  3)
@@ -148,6 +149,7 @@
 #define TRC_HVM_CLTS            (TRC_HVM_HANDLER + 0x18)
 #define TRC_HVM_LMSW            (TRC_HVM_HANDLER + 0x19)
 #define TRC_HVM_LMSW64          (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19)
+#define TRC_HVM_INTR_WINDOW     (TRC_HVM_HANDLER + 0X20)
 
 /* trace subclasses for power management */
 #define TRC_PM_FREQ     0x00801000      /* xen cpu freq events */
diff -r ddb6d2257ec4 -r 4839e34e6795 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h       Wed Mar 18 15:28:03 2009 +0000
+++ b/include/xen/interface/xen.h       Wed Mar 18 15:43:57 2009 +0000
@@ -354,6 +354,9 @@ typedef uint16_t domid_t;
  */
 #define DOMID_XEN  (0x7FF2U)
 
+/* DOMID_INVALID is used to identity invalid domid */
+#define DOMID_INVALID (0x7FFFU)
+
 /*
  * Send an array of these to HYPERVISOR_mmu_update().
  * NB. The fields are natural pointer/address size for this architecture.
@@ -513,6 +516,7 @@ typedef struct shared_info shared_info_t
  *      a. relocated kernel image
  *      b. initial ram disk              [mod_start, mod_len]
  *      c. list of allocated page frames [mfn_list, nr_pages]
+ *         (unless relocated due to XEN_ELFNOTE_INIT_P2M)
  *      d. start_info_t structure        [register ESI (x86)]
  *      e. bootstrap page tables         [pt_base, CR3 (x86)]
  *      f. bootstrap stack               [register ESP (x86)]
@@ -554,6 +558,9 @@ struct start_info {
     unsigned long mod_start;    /* VIRTUAL address of pre-loaded module.  */
     unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
     int8_t cmd_line[MAX_GUEST_CMDLINE];
+    /* The pfn range here covers both page table and p->m table frames.   */
+    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
+    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
 };
 typedef struct start_info start_info_t;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.