ia64/linux-2.6.18-xen.hg

changeset 834:4839e34e6795

Sync Xen public headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 18 15:43:57 2009 +0000 (2009-03-18)
parents ddb6d2257ec4
children 071ee07f9226
files include/xen/interface/acm.h include/xen/interface/acm_ops.h include/xen/interface/arch-ia64.h include/xen/interface/arch-ia64/hvm/save.h include/xen/interface/arch-powerpc.h include/xen/interface/arch-x86/hvm/save.h include/xen/interface/arch-x86/xen-mca.h include/xen/interface/domctl.h include/xen/interface/elfnote.h include/xen/interface/elfstructs.h include/xen/interface/foreign/Makefile include/xen/interface/foreign/mkchecker.py include/xen/interface/foreign/mkheader.py include/xen/interface/foreign/reference.size include/xen/interface/foreign/structs.py include/xen/interface/hvm/hvm_info_table.h include/xen/interface/hvm/params.h include/xen/interface/hvm/vmx_assist.h include/xen/interface/io/fsif.h include/xen/interface/io/pciif.h include/xen/interface/libelf.h include/xen/interface/physdev.h include/xen/interface/sysctl.h include/xen/interface/trace.h include/xen/interface/xen.h
line diff
     1.1 --- a/include/xen/interface/acm.h	Wed Mar 18 15:28:03 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,228 +0,0 @@
     1.4 -/*
     1.5 - * acm.h: Xen access control module interface defintions
     1.6 - *
     1.7 - * Permission is hereby granted, free of charge, to any person obtaining a copy
     1.8 - * of this software and associated documentation files (the "Software"), to
     1.9 - * deal in the Software without restriction, including without limitation the
    1.10 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
    1.11 - * sell copies of the Software, and to permit persons to whom the Software is
    1.12 - * furnished to do so, subject to the following conditions:
    1.13 - *
    1.14 - * The above copyright notice and this permission notice shall be included in
    1.15 - * all copies or substantial portions of the Software.
    1.16 - *
    1.17 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    1.18 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    1.19 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    1.20 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    1.21 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    1.22 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    1.23 - * DEALINGS IN THE SOFTWARE.
    1.24 - *
    1.25 - * Reiner Sailer <sailer@watson.ibm.com>
    1.26 - * Copyright (c) 2005, International Business Machines Corporation.
    1.27 - */
    1.28 -
    1.29 -#ifndef _XEN_PUBLIC_ACM_H
    1.30 -#define _XEN_PUBLIC_ACM_H
    1.31 -
    1.32 -#include "xen.h"
    1.33 -
    1.34 -/* if ACM_DEBUG defined, all hooks should
    1.35 - * print a short trace message (comment it out
    1.36 - * when not in testing mode )
    1.37 - */
    1.38 -/* #define ACM_DEBUG */
    1.39 -
    1.40 -#ifdef ACM_DEBUG
    1.41 -#  define printkd(fmt, args...) printk(fmt,## args)
    1.42 -#else
    1.43 -#  define printkd(fmt, args...)
    1.44 -#endif
    1.45 -
    1.46 -/* default ssid reference value if not supplied */
    1.47 -#define ACM_DEFAULT_SSID  0x0
    1.48 -#define ACM_DEFAULT_LOCAL_SSID  0x0
    1.49 -
    1.50 -/* Internal ACM ERROR types */
    1.51 -#define ACM_OK     0
    1.52 -#define ACM_UNDEF   -1
    1.53 -#define ACM_INIT_SSID_ERROR  -2
    1.54 -#define ACM_INIT_SOID_ERROR  -3
    1.55 -#define ACM_ERROR          -4
    1.56 -
    1.57 -/* External ACCESS DECISIONS */
    1.58 -#define ACM_ACCESS_PERMITTED        0
    1.59 -#define ACM_ACCESS_DENIED           -111
    1.60 -#define ACM_NULL_POINTER_ERROR      -200
    1.61 -
    1.62 -/*
    1.63 -   Error codes reported in when trying to test for a new policy
    1.64 -   These error codes are reported in an array of tuples where
    1.65 -   each error code is followed by a parameter describing the error
    1.66 -   more closely, such as a domain id.
    1.67 -*/
    1.68 -#define ACM_EVTCHN_SHARING_VIOLATION       0x100
    1.69 -#define ACM_GNTTAB_SHARING_VIOLATION       0x101
    1.70 -#define ACM_DOMAIN_LOOKUP                  0x102
    1.71 -#define ACM_CHWALL_CONFLICT                0x103
    1.72 -#define ACM_SSIDREF_IN_USE                 0x104
    1.73 -
    1.74 -
    1.75 -/* primary policy in lower 4 bits */
    1.76 -#define ACM_NULL_POLICY 0
    1.77 -#define ACM_CHINESE_WALL_POLICY 1
    1.78 -#define ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY 2
    1.79 -#define ACM_POLICY_UNDEFINED 15
    1.80 -
    1.81 -/* combinations have secondary policy component in higher 4bit */
    1.82 -#define ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY \
    1.83 -    ((ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY << 4) | ACM_CHINESE_WALL_POLICY)
    1.84 -
    1.85 -/* policy: */
    1.86 -#define ACM_POLICY_NAME(X) \
    1.87 - ((X) == (ACM_NULL_POLICY)) ? "NULL" :                        \
    1.88 -    ((X) == (ACM_CHINESE_WALL_POLICY)) ? "CHINESE WALL" :        \
    1.89 -    ((X) == (ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "SIMPLE TYPE ENFORCEMENT" : \
    1.90 -    ((X) == (ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY)) ? "CHINESE WALL AND SIMPLE TYPE ENFORCEMENT" : \
    1.91 -     "UNDEFINED"
    1.92 -
    1.93 -/* the following policy versions must be increased
    1.94 - * whenever the interpretation of the related
    1.95 - * policy's data structure changes
    1.96 - */
    1.97 -#define ACM_POLICY_VERSION 3
    1.98 -#define ACM_CHWALL_VERSION 1
    1.99 -#define ACM_STE_VERSION  1
   1.100 -
   1.101 -/* defines a ssid reference used by xen */
   1.102 -typedef uint32_t ssidref_t;
   1.103 -
   1.104 -/* hooks that are known to domains */
   1.105 -#define ACMHOOK_none    0
   1.106 -#define ACMHOOK_sharing 1
   1.107 -
   1.108 -/* -------security policy relevant type definitions-------- */
   1.109 -
   1.110 -/* type identifier; compares to "equal" or "not equal" */
   1.111 -typedef uint16_t domaintype_t;
   1.112 -
   1.113 -/* CHINESE WALL POLICY DATA STRUCTURES
   1.114 - *
   1.115 - * current accumulated conflict type set:
   1.116 - * When a domain is started and has a type that is in
   1.117 - * a conflict set, the conflicting types are incremented in
   1.118 - * the aggregate set. When a domain is destroyed, the 
   1.119 - * conflicting types to its type are decremented.
   1.120 - * If a domain has multiple types, this procedure works over
   1.121 - * all those types.
   1.122 - *
   1.123 - * conflict_aggregate_set[i] holds the number of
   1.124 - *   running domains that have a conflict with type i.
   1.125 - *
   1.126 - * running_types[i] holds the number of running domains
   1.127 - *        that include type i in their ssidref-referenced type set
   1.128 - *
   1.129 - * conflict_sets[i][j] is "0" if type j has no conflict
   1.130 - *    with type i and is "1" otherwise.
   1.131 - */
   1.132 -/* high-16 = version, low-16 = check magic */
   1.133 -#define ACM_MAGIC  0x0001debc
   1.134 -
   1.135 -/* each offset in bytes from start of the struct they
   1.136 - * are part of */
   1.137 -
   1.138 -/* V3 of the policy buffer aded a version structure */
   1.139 -struct acm_policy_version
   1.140 -{
   1.141 -    uint32_t major;
   1.142 -    uint32_t minor;
   1.143 -};
   1.144 -
   1.145 -
   1.146 -/* each buffer consists of all policy information for
   1.147 - * the respective policy given in the policy code
   1.148 - *
   1.149 - * acm_policy_buffer, acm_chwall_policy_buffer,
   1.150 - * and acm_ste_policy_buffer need to stay 32-bit aligned
   1.151 - * because we create binary policies also with external
   1.152 - * tools that assume packed representations (e.g. the java tool)
   1.153 - */
   1.154 -struct acm_policy_buffer {
   1.155 -    uint32_t policy_version; /* ACM_POLICY_VERSION */
   1.156 -    uint32_t magic;
   1.157 -    uint32_t len;
   1.158 -    uint32_t policy_reference_offset;
   1.159 -    uint32_t primary_policy_code;
   1.160 -    uint32_t primary_buffer_offset;
   1.161 -    uint32_t secondary_policy_code;
   1.162 -    uint32_t secondary_buffer_offset;
   1.163 -    struct acm_policy_version xml_pol_version; /* add in V3 */
   1.164 -};
   1.165 -
   1.166 -
   1.167 -struct acm_policy_reference_buffer {
   1.168 -    uint32_t len;
   1.169 -};
   1.170 -
   1.171 -struct acm_chwall_policy_buffer {
   1.172 -    uint32_t policy_version; /* ACM_CHWALL_VERSION */
   1.173 -    uint32_t policy_code;
   1.174 -    uint32_t chwall_max_types;
   1.175 -    uint32_t chwall_max_ssidrefs;
   1.176 -    uint32_t chwall_max_conflictsets;
   1.177 -    uint32_t chwall_ssid_offset;
   1.178 -    uint32_t chwall_conflict_sets_offset;
   1.179 -    uint32_t chwall_running_types_offset;
   1.180 -    uint32_t chwall_conflict_aggregate_offset;
   1.181 -};
   1.182 -
   1.183 -struct acm_ste_policy_buffer {
   1.184 -    uint32_t policy_version; /* ACM_STE_VERSION */
   1.185 -    uint32_t policy_code;
   1.186 -    uint32_t ste_max_types;
   1.187 -    uint32_t ste_max_ssidrefs;
   1.188 -    uint32_t ste_ssid_offset;
   1.189 -};
   1.190 -
   1.191 -struct acm_stats_buffer {
   1.192 -    uint32_t magic;
   1.193 -    uint32_t len;
   1.194 -    uint32_t primary_policy_code;
   1.195 -    uint32_t primary_stats_offset;
   1.196 -    uint32_t secondary_policy_code;
   1.197 -    uint32_t secondary_stats_offset;
   1.198 -};
   1.199 -
   1.200 -struct acm_ste_stats_buffer {
   1.201 -    uint32_t ec_eval_count;
   1.202 -    uint32_t gt_eval_count;
   1.203 -    uint32_t ec_denied_count;
   1.204 -    uint32_t gt_denied_count;
   1.205 -    uint32_t ec_cachehit_count;
   1.206 -    uint32_t gt_cachehit_count;
   1.207 -};
   1.208 -
   1.209 -struct acm_ssid_buffer {
   1.210 -    uint32_t len;
   1.211 -    ssidref_t ssidref;
   1.212 -    uint32_t policy_reference_offset;
   1.213 -    uint32_t primary_policy_code;
   1.214 -    uint32_t primary_max_types;
   1.215 -    uint32_t primary_types_offset;
   1.216 -    uint32_t secondary_policy_code;
   1.217 -    uint32_t secondary_max_types;
   1.218 -    uint32_t secondary_types_offset;
   1.219 -};
   1.220 -
   1.221 -#endif
   1.222 -
   1.223 -/*
   1.224 - * Local variables:
   1.225 - * mode: C
   1.226 - * c-set-style: "BSD"
   1.227 - * c-basic-offset: 4
   1.228 - * tab-width: 4
   1.229 - * indent-tabs-mode: nil
   1.230 - * End:
   1.231 - */
     2.1 --- a/include/xen/interface/acm_ops.h	Wed Mar 18 15:28:03 2009 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,159 +0,0 @@
     2.4 -/*
     2.5 - * acm_ops.h: Xen access control module hypervisor commands
     2.6 - *
     2.7 - * Permission is hereby granted, free of charge, to any person obtaining a copy
     2.8 - * of this software and associated documentation files (the "Software"), to
     2.9 - * deal in the Software without restriction, including without limitation the
    2.10 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
    2.11 - * sell copies of the Software, and to permit persons to whom the Software is
    2.12 - * furnished to do so, subject to the following conditions:
    2.13 - *
    2.14 - * The above copyright notice and this permission notice shall be included in
    2.15 - * all copies or substantial portions of the Software.
    2.16 - *
    2.17 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    2.18 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    2.19 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    2.20 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    2.21 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    2.22 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    2.23 - * DEALINGS IN THE SOFTWARE.
    2.24 - *
    2.25 - * Reiner Sailer <sailer@watson.ibm.com>
    2.26 - * Copyright (c) 2005,2006 International Business Machines Corporation.
    2.27 - */
    2.28 -
    2.29 -#ifndef __XEN_PUBLIC_ACM_OPS_H__
    2.30 -#define __XEN_PUBLIC_ACM_OPS_H__
    2.31 -
    2.32 -#include "xen.h"
    2.33 -#include "acm.h"
    2.34 -
    2.35 -/*
    2.36 - * Make sure you increment the interface version whenever you modify this file!
    2.37 - * This makes sure that old versions of acm tools will stop working in a
    2.38 - * well-defined way (rather than crashing the machine, for instance).
    2.39 - */
    2.40 -#define ACM_INTERFACE_VERSION   0xAAAA000A
    2.41 -
    2.42 -/************************************************************************/
    2.43 -
    2.44 -/*
    2.45 - * Prototype for this hypercall is:
    2.46 - *  int acm_op(int cmd, void *args)
    2.47 - * @cmd  == ACMOP_??? (access control module operation).
    2.48 - * @args == Operation-specific extra arguments (NULL if none).
    2.49 - */
    2.50 -
    2.51 -
    2.52 -#define ACMOP_setpolicy         1
    2.53 -struct acm_setpolicy {
    2.54 -    /* IN */
    2.55 -    XEN_GUEST_HANDLE_64(void) pushcache;
    2.56 -    uint32_t pushcache_size;
    2.57 -};
    2.58 -
    2.59 -
    2.60 -#define ACMOP_getpolicy         2
    2.61 -struct acm_getpolicy {
    2.62 -    /* IN */
    2.63 -    XEN_GUEST_HANDLE_64(void) pullcache;
    2.64 -    uint32_t pullcache_size;
    2.65 -};
    2.66 -
    2.67 -
    2.68 -#define ACMOP_dumpstats         3
    2.69 -struct acm_dumpstats {
    2.70 -    /* IN */
    2.71 -    XEN_GUEST_HANDLE_64(void) pullcache;
    2.72 -    uint32_t pullcache_size;
    2.73 -};
    2.74 -
    2.75 -
    2.76 -#define ACMOP_getssid           4
    2.77 -#define ACM_GETBY_ssidref  1
    2.78 -#define ACM_GETBY_domainid 2
    2.79 -struct acm_getssid {
    2.80 -    /* IN */
    2.81 -    uint32_t get_ssid_by; /* ACM_GETBY_* */
    2.82 -    union {
    2.83 -        domaintype_t domainid;
    2.84 -        ssidref_t    ssidref;
    2.85 -    } id;
    2.86 -    XEN_GUEST_HANDLE_64(void) ssidbuf;
    2.87 -    uint32_t ssidbuf_size;
    2.88 -};
    2.89 -
    2.90 -#define ACMOP_getdecision      5
    2.91 -struct acm_getdecision {
    2.92 -    /* IN */
    2.93 -    uint32_t get_decision_by1; /* ACM_GETBY_* */
    2.94 -    uint32_t get_decision_by2; /* ACM_GETBY_* */
    2.95 -    union {
    2.96 -        domaintype_t domainid;
    2.97 -        ssidref_t    ssidref;
    2.98 -    } id1;
    2.99 -    union {
   2.100 -        domaintype_t domainid;
   2.101 -        ssidref_t    ssidref;
   2.102 -    } id2;
   2.103 -    uint32_t hook;
   2.104 -    /* OUT */
   2.105 -    uint32_t acm_decision;
   2.106 -};
   2.107 -
   2.108 -
   2.109 -#define ACMOP_chgpolicy        6
   2.110 -struct acm_change_policy {
   2.111 -    /* IN */
   2.112 -    XEN_GUEST_HANDLE_64(void) policy_pushcache;
   2.113 -    uint32_t policy_pushcache_size;
   2.114 -    XEN_GUEST_HANDLE_64(void) del_array;
   2.115 -    uint32_t delarray_size;
   2.116 -    XEN_GUEST_HANDLE_64(void) chg_array;
   2.117 -    uint32_t chgarray_size;
   2.118 -    /* OUT */
   2.119 -    /* array with error code */
   2.120 -    XEN_GUEST_HANDLE_64(void) err_array;
   2.121 -    uint32_t errarray_size;
   2.122 -};
   2.123 -
   2.124 -#define ACMOP_relabeldoms       7
   2.125 -struct acm_relabel_doms {
   2.126 -    /* IN */
   2.127 -    XEN_GUEST_HANDLE_64(void) relabel_map;
   2.128 -    uint32_t relabel_map_size;
   2.129 -    /* OUT */
   2.130 -    XEN_GUEST_HANDLE_64(void) err_array;
   2.131 -    uint32_t errarray_size;
   2.132 -};
   2.133 -
   2.134 -/* future interface to Xen */
   2.135 -struct xen_acmctl {
   2.136 -    uint32_t cmd;
   2.137 -    uint32_t interface_version;
   2.138 -    union {
   2.139 -        struct acm_setpolicy     setpolicy;
   2.140 -        struct acm_getpolicy     getpolicy;
   2.141 -        struct acm_dumpstats     dumpstats;
   2.142 -        struct acm_getssid       getssid;
   2.143 -        struct acm_getdecision   getdecision;
   2.144 -        struct acm_change_policy change_policy;
   2.145 -        struct acm_relabel_doms  relabel_doms;
   2.146 -    } u;
   2.147 -};
   2.148 -
   2.149 -typedef struct xen_acmctl xen_acmctl_t;
   2.150 -DEFINE_XEN_GUEST_HANDLE(xen_acmctl_t);
   2.151 -
   2.152 -#endif /* __XEN_PUBLIC_ACM_OPS_H__ */
   2.153 -
   2.154 -/*
   2.155 - * Local variables:
   2.156 - * mode: C
   2.157 - * c-set-style: "BSD"
   2.158 - * c-basic-offset: 4
   2.159 - * tab-width: 4
   2.160 - * indent-tabs-mode: nil
   2.161 - * End:
   2.162 - */
     3.1 --- a/include/xen/interface/arch-ia64.h	Wed Mar 18 15:28:03 2009 +0000
     3.2 +++ b/include/xen/interface/arch-ia64.h	Wed Mar 18 15:43:57 2009 +0000
     3.3 @@ -198,6 +198,15 @@ struct mapped_regs {
     3.4              unsigned long rrs[8]; // region registers
     3.5              unsigned long krs[8]; // kernel registers
     3.6              unsigned long tmp[16]; // temp registers (e.g. for hyperprivops)
     3.7 +
     3.8 +            /* itc paravirtualization
     3.9 +             * vAR.ITC = mAR.ITC + itc_offset
    3.10 +             * itc_last is one which was lastly passed to
    3.11 +             * the guest OS in order to prevent it from
    3.12 +             * going backwords.
    3.13 +             */
    3.14 +            unsigned long itc_offset;
    3.15 +            unsigned long itc_last;
    3.16          };
    3.17      };
    3.18  };
    3.19 @@ -392,6 +401,7 @@ struct vcpu_guest_context {
    3.20  #define VGCF_EXTRA_REGS (1UL << 1)	/* Set extra regs.  */
    3.21  #define VGCF_SET_CR_IRR (1UL << 2)	/* Set cr_irr[0:3]. */
    3.22  #define VGCF_online     (1UL << 3)  /* make this vcpu online */
    3.23 +#define VGCF_SET_AR_ITC (1UL << 4)  /* set pv ar.itc. itc_offset, itc_last */
    3.24      unsigned long flags;       /* VGCF_* flags */
    3.25  
    3.26      struct vcpu_guest_context_regs regs;
     4.1 --- a/include/xen/interface/arch-ia64/hvm/save.h	Wed Mar 18 15:28:03 2009 +0000
     4.2 +++ b/include/xen/interface/arch-ia64/hvm/save.h	Wed Mar 18 15:43:57 2009 +0000
     4.3 @@ -23,8 +23,8 @@
     4.4  #ifndef __XEN_PUBLIC_HVM_SAVE_IA64_H__
     4.5  #define __XEN_PUBLIC_HVM_SAVE_IA64_H__
     4.6  
     4.7 -#include <public/hvm/save.h>
     4.8 -#include <public/arch-ia64.h>
     4.9 +#include "../../hvm/save.h"
    4.10 +#include "../../arch-ia64.h"
    4.11  
    4.12  /* 
    4.13   * Save/restore header: general info about the save file. 
     5.1 --- a/include/xen/interface/arch-powerpc.h	Wed Mar 18 15:28:03 2009 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,120 +0,0 @@
     5.4 -/*
     5.5 - * Permission is hereby granted, free of charge, to any person obtaining a copy
     5.6 - * of this software and associated documentation files (the "Software"), to
     5.7 - * deal in the Software without restriction, including without limitation the
     5.8 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
     5.9 - * sell copies of the Software, and to permit persons to whom the Software is
    5.10 - * furnished to do so, subject to the following conditions:
    5.11 - *
    5.12 - * The above copyright notice and this permission notice shall be included in
    5.13 - * all copies or substantial portions of the Software.
    5.14 - *
    5.15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    5.16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    5.17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    5.18 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    5.19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    5.20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    5.21 - * DEALINGS IN THE SOFTWARE.
    5.22 - *
    5.23 - * Copyright (C) IBM Corp. 2005, 2006
    5.24 - *
    5.25 - * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    5.26 - */
    5.27 -
    5.28 -#include "xen.h"
    5.29 -
    5.30 -#ifndef __XEN_PUBLIC_ARCH_PPC_64_H__
    5.31 -#define __XEN_PUBLIC_ARCH_PPC_64_H__
    5.32 -
    5.33 -#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
    5.34 -    typedef struct { \
    5.35 -        int __pad[(sizeof (long long) - sizeof (void *)) / sizeof (int)]; \
    5.36 -        type *p; \
    5.37 -    } __attribute__((__aligned__(8))) __guest_handle_ ## name
    5.38 -
    5.39 -#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
    5.40 -    ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
    5.41 -    ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
    5.42 -#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
    5.43 -#define XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
    5.44 -#define set_xen_guest_handle(hnd, val) \
    5.45 -    do { \
    5.46 -        if (sizeof ((hnd).__pad)) \
    5.47 -            (hnd).__pad[0] = 0; \
    5.48 -        (hnd).p = val; \
    5.49 -    } while (0)
    5.50 -
    5.51 -#ifdef __XEN_TOOLS__
    5.52 -#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    5.53 -#endif
    5.54 -
    5.55 -#ifndef __ASSEMBLY__
    5.56 -typedef unsigned long long xen_pfn_t;
    5.57 -#define PRI_xen_pfn "llx"
    5.58 -#endif
    5.59 -
    5.60 -/*
    5.61 - * Pointers and other address fields inside interface structures are padded to
    5.62 - * 64 bits. This means that field alignments aren't different between 32- and
    5.63 - * 64-bit architectures. 
    5.64 - */
    5.65 -/* NB. Multi-level macro ensures __LINE__ is expanded before concatenation. */
    5.66 -#define __MEMORY_PADDING(_X)
    5.67 -#define _MEMORY_PADDING(_X)  __MEMORY_PADDING(_X)
    5.68 -#define MEMORY_PADDING       _MEMORY_PADDING(__LINE__)
    5.69 -
    5.70 -/* And the trap vector is... */
    5.71 -#define TRAP_INSTR "li 0,-1; sc" /* XXX just "sc"? */
    5.72 -
    5.73 -#ifndef __ASSEMBLY__
    5.74 -
    5.75 -#define XENCOMM_INLINE_FLAG (1UL << 63)
    5.76 -
    5.77 -typedef uint64_t xen_ulong_t;
    5.78 -
    5.79 -/* User-accessible registers: nost of these need to be saved/restored
    5.80 - * for every nested Xen invocation. */
    5.81 -struct cpu_user_regs
    5.82 -{
    5.83 -    uint64_t gprs[32];
    5.84 -    uint64_t lr;
    5.85 -    uint64_t ctr;
    5.86 -    uint64_t srr0;
    5.87 -    uint64_t srr1;
    5.88 -    uint64_t pc;
    5.89 -    uint64_t msr;
    5.90 -    uint64_t fpscr;             /* XXX Is this necessary */
    5.91 -    uint64_t xer;
    5.92 -    uint64_t hid4;              /* debug only */
    5.93 -    uint64_t dar;               /* debug only */
    5.94 -    uint32_t dsisr;             /* debug only */
    5.95 -    uint32_t cr;
    5.96 -    uint32_t __pad;             /* good spot for another 32bit reg */
    5.97 -    uint32_t entry_vector;
    5.98 -};
    5.99 -typedef struct cpu_user_regs cpu_user_regs_t;
   5.100 -
   5.101 -typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */ /* XXX timebase */
   5.102 -
   5.103 -/* ONLY used to communicate with dom0! See also struct exec_domain. */
   5.104 -struct vcpu_guest_context {
   5.105 -    cpu_user_regs_t user_regs;         /* User-level CPU registers     */
   5.106 -    uint64_t sdr1;                     /* Pagetable base               */
   5.107 -    /* XXX etc */
   5.108 -};
   5.109 -typedef struct vcpu_guest_context vcpu_guest_context_t;
   5.110 -DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
   5.111 -
   5.112 -struct arch_shared_info {
   5.113 -    uint64_t boot_timebase;
   5.114 -};
   5.115 -
   5.116 -struct arch_vcpu_info {
   5.117 -};
   5.118 -
   5.119 -/* Support for multi-processor guests. */
   5.120 -#define MAX_VIRT_CPUS 32
   5.121 -#endif
   5.122 -
   5.123 -#endif
     6.1 --- a/include/xen/interface/arch-x86/hvm/save.h	Wed Mar 18 15:28:03 2009 +0000
     6.2 +++ b/include/xen/interface/arch-x86/hvm/save.h	Wed Mar 18 15:43:57 2009 +0000
     6.3 @@ -287,7 +287,7 @@ struct hvm_hw_pci_irqs {
     6.4       * Indexed by: device*4 + INTx#.
     6.5       */
     6.6      union {
     6.7 -        DECLARE_BITMAP(i, 32*4);
     6.8 +        unsigned long i[16 / sizeof (unsigned long)]; /* DECLARE_BITMAP(i, 32*4); */
     6.9          uint64_t pad[2];
    6.10      };
    6.11  };
    6.12 @@ -300,7 +300,7 @@ struct hvm_hw_isa_irqs {
    6.13       * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
    6.14       */
    6.15      union {
    6.16 -        DECLARE_BITMAP(i, 16);
    6.17 +        unsigned long i[1];  /* DECLARE_BITMAP(i, 16); */
    6.18          uint64_t pad[1];
    6.19      };
    6.20  };
     7.1 --- a/include/xen/interface/arch-x86/xen-mca.h	Wed Mar 18 15:28:03 2009 +0000
     7.2 +++ b/include/xen/interface/arch-x86/xen-mca.h	Wed Mar 18 15:43:57 2009 +0000
     7.3 @@ -56,13 +56,20 @@
     7.4  /* Hypercall */
     7.5  #define __HYPERVISOR_mca __HYPERVISOR_arch_0
     7.6  
     7.7 -#define XEN_MCA_INTERFACE_VERSION 0x03000001
     7.8 +/*
     7.9 + * The xen-unstable repo has interface version 0x03000001; out interface
    7.10 + * is incompatible with that and any future minor revisions, so we
    7.11 + * choose a different version number range that is numerically less
    7.12 + * than that used in xen-unstable.
    7.13 + */
    7.14 +#define XEN_MCA_INTERFACE_VERSION 0x01ecc002
    7.15  
    7.16 -/* IN: Dom0 calls hypercall from MC event handler. */
    7.17 -#define XEN_MC_CORRECTABLE  0x0
    7.18 -/* IN: Dom0/DomU calls hypercall from MC trap handler. */
    7.19 -#define XEN_MC_TRAP         0x1
    7.20 -/* XEN_MC_CORRECTABLE and XEN_MC_TRAP are mutually exclusive. */
    7.21 +/* IN: Dom0 calls hypercall to retrieve nonurgent telemetry */
    7.22 +#define XEN_MC_NONURGENT  0x0001
    7.23 +/* IN: Dom0/DomU calls hypercall to retrieve urgent telemetry */
    7.24 +#define XEN_MC_URGENT     0x0002
    7.25 +/* IN: Dom0 acknowledges previosly-fetched telemetry */
    7.26 +#define XEN_MC_ACK        0x0004
    7.27  
    7.28  /* OUT: All is ok */
    7.29  #define XEN_MC_OK           0x0
    7.30 @@ -106,7 +113,11 @@ struct mcinfo_common {
    7.31  
    7.32  #define MC_FLAG_CORRECTABLE     (1 << 0)
    7.33  #define MC_FLAG_UNCORRECTABLE   (1 << 1)
    7.34 -
    7.35 +#define MC_FLAG_RECOVERABLE	(1 << 2)
    7.36 +#define MC_FLAG_POLLED		(1 << 3)
    7.37 +#define MC_FLAG_RESET		(1 << 4)
    7.38 +#define MC_FLAG_CMCI		(1 << 5)
    7.39 +#define MC_FLAG_MCE		(1 << 6)
    7.40  /* contains global x86 mc information */
    7.41  struct mcinfo_global {
    7.42      struct mcinfo_common common;
    7.43 @@ -115,6 +126,7 @@ struct mcinfo_global {
    7.44      uint16_t mc_domid;
    7.45      uint32_t mc_socketid; /* physical socket of the physical core */
    7.46      uint16_t mc_coreid; /* physical impacted core */
    7.47 +    uint32_t mc_apicid;
    7.48      uint16_t mc_core_threadid; /* core thread of physical core */
    7.49      uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */
    7.50      uint64_t mc_gstatus; /* global status */
    7.51 @@ -132,6 +144,8 @@ struct mcinfo_bank {
    7.52      uint64_t mc_addr;   /* bank address, only valid
    7.53                           * if addr bit is set in mc_status */
    7.54      uint64_t mc_misc;
    7.55 +    uint64_t mc_ctrl2;
    7.56 +    uint64_t mc_tsc;
    7.57  };
    7.58  
    7.59  
    7.60 @@ -150,7 +164,12 @@ struct mcinfo_extended {
    7.61       * multiple times. */
    7.62  
    7.63      uint32_t mc_msrs; /* Number of msr with valid values. */
    7.64 -    struct mcinfo_msr mc_msr[5];
    7.65 +    /*
    7.66 +     * Currently Intel extended MSR (32/64) including all gp registers
    7.67 +     * and E(R)DI, E(R)BP, E(R)SP, E(R)FLAGS, E(R)IP, E(R)MISC, only 10
    7.68 +     * of them might be useful. So expend this array to 10.
    7.69 +    */
    7.70 +    struct mcinfo_msr mc_msr[10];
    7.71  };
    7.72  
    7.73  #define MCINFO_HYPERCALLSIZE	1024
    7.74 @@ -163,7 +182,43 @@ struct mc_info {
    7.75      uint8_t mi_data[MCINFO_MAXSIZE - sizeof(uint32_t)];
    7.76  };
    7.77  typedef struct mc_info mc_info_t;
    7.78 +DEFINE_XEN_GUEST_HANDLE(mc_info_t);
    7.79  
    7.80 +#define __MC_MSR_ARRAYSIZE 8
    7.81 +#define __MC_NMSRS 1
    7.82 +#define MC_NCAPS	7	/* 7 CPU feature flag words */
    7.83 +#define MC_CAPS_STD_EDX	0	/* cpuid level 0x00000001 (%edx) */
    7.84 +#define MC_CAPS_AMD_EDX	1	/* cpuid level 0x80000001 (%edx) */
    7.85 +#define MC_CAPS_TM	2	/* cpuid level 0x80860001 (TransMeta) */
    7.86 +#define MC_CAPS_LINUX	3	/* Linux-defined */
    7.87 +#define MC_CAPS_STD_ECX	4	/* cpuid level 0x00000001 (%ecx) */
    7.88 +#define MC_CAPS_VIA	5	/* cpuid level 0xc0000001 */
    7.89 +#define MC_CAPS_AMD_ECX	6	/* cpuid level 0x80000001 (%ecx) */
    7.90 +
    7.91 +typedef struct mcinfo_logical_cpu {
    7.92 +    uint32_t mc_cpunr;          
    7.93 +    uint32_t mc_chipid; 
    7.94 +    uint16_t mc_coreid;
    7.95 +    uint16_t mc_threadid;
    7.96 +    uint32_t mc_apicid;
    7.97 +    uint32_t mc_clusterid;
    7.98 +    uint32_t mc_ncores;
    7.99 +    uint32_t mc_ncores_active;
   7.100 +    uint32_t mc_nthreads;
   7.101 +    int32_t mc_cpuid_level;
   7.102 +    uint32_t mc_family;
   7.103 +    uint32_t mc_vendor;
   7.104 +    uint32_t mc_model;
   7.105 +    uint32_t mc_step;
   7.106 +    char mc_vendorid[16];
   7.107 +    char mc_brandid[64];
   7.108 +    uint32_t mc_cpu_caps[MC_NCAPS];
   7.109 +    uint32_t mc_cache_size;
   7.110 +    uint32_t mc_cache_alignment;
   7.111 +    int32_t mc_nmsrvals;
   7.112 +    struct mcinfo_msr mc_msrvalues[__MC_MSR_ARRAYSIZE];
   7.113 +} xen_mc_logical_cpu_t;
   7.114 +DEFINE_XEN_GUEST_HANDLE(xen_mc_logical_cpu_t);
   7.115  
   7.116  
   7.117  /* 
   7.118 @@ -228,14 +283,14 @@ typedef struct mc_info mc_info_t;
   7.119  #define XEN_MC_fetch            1
   7.120  struct xen_mc_fetch {
   7.121      /* IN/OUT variables. */
   7.122 -    uint32_t flags;
   7.123 -
   7.124 -/* IN: XEN_MC_CORRECTABLE, XEN_MC_TRAP */
   7.125 -/* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED, XEN_MC_NODATA, XEN_MC_NOMATCH */
   7.126 +    uint32_t flags;	/* IN: XEN_MC_NONURGENT, XEN_MC_URGENT,
   7.127 +                           XEN_MC_ACK if ack'ing an earlier fetch */
   7.128 +			/* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED,
   7.129 +			   XEN_MC_NODATA, XEN_MC_NOMATCH */
   7.130 +    uint64_t fetch_id;	/* OUT: id for ack, IN: id we are ack'ing */
   7.131  
   7.132      /* OUT variables. */
   7.133 -    uint32_t fetch_idx;  /* only useful for Dom0 for the notify hypercall */
   7.134 -    struct mc_info mc_info;
   7.135 +    XEN_GUEST_HANDLE(mc_info_t) data;
   7.136  };
   7.137  typedef struct xen_mc_fetch xen_mc_fetch_t;
   7.138  DEFINE_XEN_GUEST_HANDLE(xen_mc_fetch_t);
   7.139 @@ -250,7 +305,6 @@ struct xen_mc_notifydomain {
   7.140      uint16_t mc_domid;    /* The unprivileged domain to notify. */
   7.141      uint16_t mc_vcpuid;   /* The vcpu in mc_domid to notify.
   7.142                             * Usually echo'd value from the fetch hypercall. */
   7.143 -    uint32_t fetch_idx;   /* echo'd value from the fetch hypercall. */
   7.144  
   7.145      /* IN/OUT variables. */
   7.146      uint32_t flags;
   7.147 @@ -261,15 +315,46 @@ struct xen_mc_notifydomain {
   7.148  typedef struct xen_mc_notifydomain xen_mc_notifydomain_t;
   7.149  DEFINE_XEN_GUEST_HANDLE(xen_mc_notifydomain_t);
   7.150  
   7.151 +#define XEN_MC_physcpuinfo 3
   7.152 +struct xen_mc_physcpuinfo {
   7.153 +	/* IN/OUT */
   7.154 +	uint32_t ncpus;
   7.155 +	uint32_t pad0;
   7.156 +	/* OUT */
   7.157 +	XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info;
   7.158 +};
   7.159 +
   7.160 +#define XEN_MC_msrinject    4
   7.161 +#define MC_MSRINJ_MAXMSRS       8
   7.162 +struct xen_mc_msrinject {
   7.163 +       /* IN */
   7.164 +	unsigned int mcinj_cpunr;       /* target processor id */
   7.165 +	uint32_t mcinj_flags;           /* see MC_MSRINJ_F_* below */
   7.166 +	uint32_t mcinj_count;           /* 0 .. count-1 in array are valid */
   7.167 +	uint32_t mcinj_pad0;
   7.168 +	struct mcinfo_msr mcinj_msr[MC_MSRINJ_MAXMSRS];
   7.169 +};
   7.170 +
   7.171 +/* Flags for mcinj_flags above; bits 16-31 are reserved */
   7.172 +#define MC_MSRINJ_F_INTERPOSE   0x1
   7.173 +
   7.174 +#define XEN_MC_mceinject    5
   7.175 +struct xen_mc_mceinject {
   7.176 +	unsigned int mceinj_cpunr;      /* target processor id */
   7.177 +};
   7.178 +
   7.179 +typedef union {
   7.180 +    struct xen_mc_fetch        mc_fetch;
   7.181 +    struct xen_mc_notifydomain mc_notifydomain;
   7.182 +    struct xen_mc_physcpuinfo  mc_physcpuinfo;
   7.183 +    struct xen_mc_msrinject    mc_msrinject;
   7.184 +    struct xen_mc_mceinject    mc_mceinject;
   7.185 +} xen_mc_arg_t;
   7.186  
   7.187  struct xen_mc {
   7.188      uint32_t cmd;
   7.189      uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */
   7.190 -    union {
   7.191 -        struct xen_mc_fetch        mc_fetch;
   7.192 -        struct xen_mc_notifydomain mc_notifydomain;
   7.193 -        uint8_t pad[MCINFO_HYPERCALLSIZE];
   7.194 -    } u;
   7.195 +    xen_mc_arg_t u;
   7.196  };
   7.197  typedef struct xen_mc xen_mc_t;
   7.198  DEFINE_XEN_GUEST_HANDLE(xen_mc_t);
     8.1 --- a/include/xen/interface/domctl.h	Wed Mar 18 15:28:03 2009 +0000
     8.2 +++ b/include/xen/interface/domctl.h	Wed Mar 18 15:43:57 2009 +0000
     8.3 @@ -51,11 +51,14 @@ struct xen_domctl_createdomain {
     8.4      uint32_t ssidref;
     8.5      xen_domain_handle_t handle;
     8.6   /* Is this an HVM guest (as opposed to a PV guest)? */
     8.7 -#define _XEN_DOMCTL_CDF_hvm_guest 0
     8.8 -#define XEN_DOMCTL_CDF_hvm_guest  (1U<<_XEN_DOMCTL_CDF_hvm_guest)
     8.9 +#define _XEN_DOMCTL_CDF_hvm_guest     0
    8.10 +#define XEN_DOMCTL_CDF_hvm_guest      (1U<<_XEN_DOMCTL_CDF_hvm_guest)
    8.11   /* Use hardware-assisted paging if available? */
    8.12 -#define _XEN_DOMCTL_CDF_hap       1
    8.13 -#define XEN_DOMCTL_CDF_hap        (1U<<_XEN_DOMCTL_CDF_hap)
    8.14 +#define _XEN_DOMCTL_CDF_hap           1
    8.15 +#define XEN_DOMCTL_CDF_hap            (1U<<_XEN_DOMCTL_CDF_hap)
    8.16 + /* Should domain memory integrity be verifed by tboot during Sx? */
    8.17 +#define _XEN_DOMCTL_CDF_s3_integrity  2
    8.18 +#define XEN_DOMCTL_CDF_s3_integrity   (1U<<_XEN_DOMCTL_CDF_s3_integrity)
    8.19      uint32_t flags;
    8.20  };
    8.21  typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
    8.22 @@ -466,6 +469,7 @@ typedef enum pt_irq_type_e {
    8.23      PT_IRQ_TYPE_PCI,
    8.24      PT_IRQ_TYPE_ISA,
    8.25      PT_IRQ_TYPE_MSI,
    8.26 +    PT_IRQ_TYPE_MSI_TRANSLATE,
    8.27  } pt_irq_type_t;
    8.28  struct xen_domctl_bind_pt_irq {
    8.29      uint32_t machine_irq;
    8.30 @@ -484,6 +488,7 @@ struct xen_domctl_bind_pt_irq {
    8.31          struct {
    8.32              uint8_t gvec;
    8.33              uint32_t gflags;
    8.34 +            uint64_aligned_t gtable;
    8.35          } msi;
    8.36      } u;
    8.37  };
    8.38 @@ -619,6 +624,28 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_subsc
    8.39   */
    8.40  #define XEN_DOMCTL_suppress_spurious_page_faults 53
    8.41  
    8.42 +#define XEN_DOMCTL_debug_op    54
    8.43 +#define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF         0
    8.44 +#define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON          1
    8.45 +struct xen_domctl_debug_op {
    8.46 +    uint32_t op;   /* IN */
    8.47 +    uint32_t vcpu; /* IN */
    8.48 +};
    8.49 +typedef struct xen_domctl_debug_op xen_domctl_debug_op_t;
    8.50 +DEFINE_XEN_GUEST_HANDLE(xen_domctl_debug_op_t);
    8.51 +
    8.52 +/*
    8.53 + * Request a particular record from the HVM context
    8.54 + */
    8.55 +#define XEN_DOMCTL_gethvmcontext_partial   55
    8.56 +typedef struct xen_domctl_hvmcontext_partial {
    8.57 +    uint32_t type;                      /* IN: Type of record required */
    8.58 +    uint32_t instance;                  /* IN: Instance of that type */
    8.59 +    XEN_GUEST_HANDLE_64(uint8) buffer;  /* OUT: buffer to write record into */
    8.60 +} xen_domctl_hvmcontext_partial_t;
    8.61 +DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_partial_t);
    8.62 +
    8.63 +
    8.64  struct xen_domctl {
    8.65      uint32_t cmd;
    8.66      uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
    8.67 @@ -646,6 +673,7 @@ struct xen_domctl {
    8.68          struct xen_domctl_settimeoffset     settimeoffset;
    8.69          struct xen_domctl_real_mode_area    real_mode_area;
    8.70          struct xen_domctl_hvmcontext        hvmcontext;
    8.71 +        struct xen_domctl_hvmcontext_partial hvmcontext_partial;
    8.72          struct xen_domctl_address_size      address_size;
    8.73          struct xen_domctl_sendtrigger       sendtrigger;
    8.74          struct xen_domctl_get_device_group  get_device_group;
    8.75 @@ -658,6 +686,7 @@ struct xen_domctl {
    8.76          struct xen_domctl_set_opt_feature   set_opt_feature;
    8.77          struct xen_domctl_set_target        set_target;
    8.78          struct xen_domctl_subscribe         subscribe;
    8.79 +        struct xen_domctl_debug_op          debug_op;
    8.80  #if defined(__i386__) || defined(__x86_64__)
    8.81          struct xen_domctl_cpuid             cpuid;
    8.82  #endif
     9.1 --- a/include/xen/interface/elfnote.h	Wed Mar 18 15:28:03 2009 +0000
     9.2 +++ b/include/xen/interface/elfnote.h	Wed Mar 18 15:43:57 2009 +0000
     9.3 @@ -162,9 +162,20 @@
     9.4  #define XEN_ELFNOTE_SUSPEND_CANCEL 14
     9.5  
     9.6  /*
     9.7 + * The (non-default) location the initial phys-to-machine map should be
     9.8 + * placed at by the hypervisor (Dom0) or the tools (DomU).
     9.9 + * The kernel must be prepared for this mapping to be established using
    9.10 + * large pages, despite such otherwise not being available to guests.
    9.11 + * The kernel must also be able to handle the page table pages used for
    9.12 + * this mapping not being accessible through the initial mapping.
    9.13 + * (Only x86-64 supports this at present.)
    9.14 + */
    9.15 +#define XEN_ELFNOTE_INIT_P2M      15
    9.16 +
    9.17 +/*
    9.18   * The number of the highest elfnote defined.
    9.19   */
    9.20 -#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL
    9.21 +#define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M
    9.22  
    9.23  /*
    9.24   * System information exported through crash notes.
    10.1 --- a/include/xen/interface/elfstructs.h	Wed Mar 18 15:28:03 2009 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,527 +0,0 @@
    10.4 -#ifndef __XEN_PUBLIC_ELFSTRUCTS_H__
    10.5 -#define __XEN_PUBLIC_ELFSTRUCTS_H__ 1
    10.6 -/*
    10.7 - * Copyright (c) 1995, 1996 Erik Theisen.  All rights reserved.
    10.8 - *
    10.9 - * Redistribution and use in source and binary forms, with or without
   10.10 - * modification, are permitted provided that the following conditions
   10.11 - * are met:
   10.12 - * 1. Redistributions of source code must retain the above copyright
   10.13 - *    notice, this list of conditions and the following disclaimer.
   10.14 - * 2. Redistributions in binary form must reproduce the above copyright
   10.15 - *    notice, this list of conditions and the following disclaimer in the
   10.16 - *    documentation and/or other materials provided with the distribution.
   10.17 - * 3. The name of the author may not be used to endorse or promote products
   10.18 - *    derived from this software without specific prior written permission
   10.19 - *
   10.20 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   10.21 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   10.22 - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   10.23 - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   10.24 - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   10.25 - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   10.26 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   10.27 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   10.28 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   10.29 - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   10.30 - */
   10.31 -
   10.32 -typedef uint8_t		Elf_Byte;
   10.33 -
   10.34 -typedef uint32_t	Elf32_Addr;	/* Unsigned program address */
   10.35 -typedef uint32_t	Elf32_Off;	/* Unsigned file offset */
   10.36 -typedef int32_t		Elf32_Sword;	/* Signed large integer */
   10.37 -typedef uint32_t	Elf32_Word;	/* Unsigned large integer */
   10.38 -typedef uint16_t	Elf32_Half;	/* Unsigned medium integer */
   10.39 -
   10.40 -typedef uint64_t	Elf64_Addr;
   10.41 -typedef uint64_t	Elf64_Off;
   10.42 -typedef int32_t		Elf64_Shalf;
   10.43 -
   10.44 -typedef int32_t		Elf64_Sword;
   10.45 -typedef uint32_t	Elf64_Word;
   10.46 -
   10.47 -typedef int64_t		Elf64_Sxword;
   10.48 -typedef uint64_t	Elf64_Xword;
   10.49 -
   10.50 -typedef uint32_t	Elf64_Half;
   10.51 -typedef uint16_t	Elf64_Quarter;
   10.52 -
   10.53 -/*
   10.54 - * e_ident[] identification indexes
   10.55 - * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html
   10.56 - */
   10.57 -#define EI_MAG0		0		/* file ID */
   10.58 -#define EI_MAG1		1		/* file ID */
   10.59 -#define EI_MAG2		2		/* file ID */
   10.60 -#define EI_MAG3		3		/* file ID */
   10.61 -#define EI_CLASS	4		/* file class */
   10.62 -#define EI_DATA		5		/* data encoding */
   10.63 -#define EI_VERSION	6		/* ELF header version */
   10.64 -#define EI_OSABI	7		/* OS/ABI ID */
   10.65 -#define EI_ABIVERSION	8		/* ABI version */
   10.66 -#define EI_PAD		9		/* start of pad bytes */
   10.67 -#define EI_NIDENT	16		/* Size of e_ident[] */
   10.68 -
   10.69 -/* e_ident[] magic number */
   10.70 -#define	ELFMAG0		0x7f		/* e_ident[EI_MAG0] */
   10.71 -#define	ELFMAG1		'E'		/* e_ident[EI_MAG1] */
   10.72 -#define	ELFMAG2		'L'		/* e_ident[EI_MAG2] */
   10.73 -#define	ELFMAG3		'F'		/* e_ident[EI_MAG3] */
   10.74 -#define	ELFMAG		"\177ELF"	/* magic */
   10.75 -#define	SELFMAG		4		/* size of magic */
   10.76 -
   10.77 -/* e_ident[] file class */
   10.78 -#define	ELFCLASSNONE	0		/* invalid */
   10.79 -#define	ELFCLASS32	1		/* 32-bit objs */
   10.80 -#define	ELFCLASS64	2		/* 64-bit objs */
   10.81 -#define	ELFCLASSNUM	3		/* number of classes */
   10.82 -
   10.83 -/* e_ident[] data encoding */
   10.84 -#define ELFDATANONE	0		/* invalid */
   10.85 -#define ELFDATA2LSB	1		/* Little-Endian */
   10.86 -#define ELFDATA2MSB	2		/* Big-Endian */
   10.87 -#define ELFDATANUM	3		/* number of data encode defines */
   10.88 -
   10.89 -/* e_ident[] Operating System/ABI */
   10.90 -#define ELFOSABI_SYSV		0	/* UNIX System V ABI */
   10.91 -#define ELFOSABI_HPUX		1	/* HP-UX operating system */
   10.92 -#define ELFOSABI_NETBSD		2	/* NetBSD */
   10.93 -#define ELFOSABI_LINUX		3	/* GNU/Linux */
   10.94 -#define ELFOSABI_HURD		4	/* GNU/Hurd */
   10.95 -#define ELFOSABI_86OPEN		5	/* 86Open common IA32 ABI */
   10.96 -#define ELFOSABI_SOLARIS	6	/* Solaris */
   10.97 -#define ELFOSABI_MONTEREY	7	/* Monterey */
   10.98 -#define ELFOSABI_IRIX		8	/* IRIX */
   10.99 -#define ELFOSABI_FREEBSD	9	/* FreeBSD */
  10.100 -#define ELFOSABI_TRU64		10	/* TRU64 UNIX */
  10.101 -#define ELFOSABI_MODESTO	11	/* Novell Modesto */
  10.102 -#define ELFOSABI_OPENBSD	12	/* OpenBSD */
  10.103 -#define ELFOSABI_ARM		97	/* ARM */
  10.104 -#define ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
  10.105 -
  10.106 -/* e_ident */
  10.107 -#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
  10.108 -                      (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
  10.109 -                      (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
  10.110 -                      (ehdr).e_ident[EI_MAG3] == ELFMAG3)
  10.111 -
  10.112 -/* ELF Header */
  10.113 -typedef struct elfhdr {
  10.114 -	unsigned char	e_ident[EI_NIDENT]; /* ELF Identification */
  10.115 -	Elf32_Half	e_type;		/* object file type */
  10.116 -	Elf32_Half	e_machine;	/* machine */
  10.117 -	Elf32_Word	e_version;	/* object file version */
  10.118 -	Elf32_Addr	e_entry;	/* virtual entry point */
  10.119 -	Elf32_Off	e_phoff;	/* program header table offset */
  10.120 -	Elf32_Off	e_shoff;	/* section header table offset */
  10.121 -	Elf32_Word	e_flags;	/* processor-specific flags */
  10.122 -	Elf32_Half	e_ehsize;	/* ELF header size */
  10.123 -	Elf32_Half	e_phentsize;	/* program header entry size */
  10.124 -	Elf32_Half	e_phnum;	/* number of program header entries */
  10.125 -	Elf32_Half	e_shentsize;	/* section header entry size */
  10.126 -	Elf32_Half	e_shnum;	/* number of section header entries */
  10.127 -	Elf32_Half	e_shstrndx;	/* section header table's "section
  10.128 -					   header string table" entry offset */
  10.129 -} Elf32_Ehdr;
  10.130 -
  10.131 -typedef struct {
  10.132 -	unsigned char	e_ident[EI_NIDENT];	/* Id bytes */
  10.133 -	Elf64_Quarter	e_type;			/* file type */
  10.134 -	Elf64_Quarter	e_machine;		/* machine type */
  10.135 -	Elf64_Half	e_version;		/* version number */
  10.136 -	Elf64_Addr	e_entry;		/* entry point */
  10.137 -	Elf64_Off	e_phoff;		/* Program hdr offset */
  10.138 -	Elf64_Off	e_shoff;		/* Section hdr offset */
  10.139 -	Elf64_Half	e_flags;		/* Processor flags */
  10.140 -	Elf64_Quarter	e_ehsize;		/* sizeof ehdr */
  10.141 -	Elf64_Quarter	e_phentsize;		/* Program header entry size */
  10.142 -	Elf64_Quarter	e_phnum;		/* Number of program headers */
  10.143 -	Elf64_Quarter	e_shentsize;		/* Section header entry size */
  10.144 -	Elf64_Quarter	e_shnum;		/* Number of section headers */
  10.145 -	Elf64_Quarter	e_shstrndx;		/* String table index */
  10.146 -} Elf64_Ehdr;
  10.147 -
  10.148 -/* e_type */
  10.149 -#define ET_NONE		0		/* No file type */
  10.150 -#define ET_REL		1		/* relocatable file */
  10.151 -#define ET_EXEC		2		/* executable file */
  10.152 -#define ET_DYN		3		/* shared object file */
  10.153 -#define ET_CORE		4		/* core file */
  10.154 -#define ET_NUM		5		/* number of types */
  10.155 -#define ET_LOPROC	0xff00		/* reserved range for processor */
  10.156 -#define ET_HIPROC	0xffff		/*  specific e_type */
  10.157 -
  10.158 -/* e_machine */
  10.159 -#define EM_NONE		0		/* No Machine */
  10.160 -#define EM_M32		1		/* AT&T WE 32100 */
  10.161 -#define EM_SPARC	2		/* SPARC */
  10.162 -#define EM_386		3		/* Intel 80386 */
  10.163 -#define EM_68K		4		/* Motorola 68000 */
  10.164 -#define EM_88K		5		/* Motorola 88000 */
  10.165 -#define EM_486		6		/* Intel 80486 - unused? */
  10.166 -#define EM_860		7		/* Intel 80860 */
  10.167 -#define EM_MIPS		8		/* MIPS R3000 Big-Endian only */
  10.168 -/*
  10.169 - * Don't know if EM_MIPS_RS4_BE,
  10.170 - * EM_SPARC64, EM_PARISC,
  10.171 - * or EM_PPC are ABI compliant
  10.172 - */
  10.173 -#define EM_MIPS_RS4_BE	10		/* MIPS R4000 Big-Endian */
  10.174 -#define EM_SPARC64	11		/* SPARC v9 64-bit unoffical */
  10.175 -#define EM_PARISC	15		/* HPPA */
  10.176 -#define EM_SPARC32PLUS	18		/* Enhanced instruction set SPARC */
  10.177 -#define EM_PPC		20		/* PowerPC */
  10.178 -#define EM_PPC64	21		/* PowerPC 64-bit */
  10.179 -#define EM_ARM		40		/* Advanced RISC Machines ARM */
  10.180 -#define EM_ALPHA	41		/* DEC ALPHA */
  10.181 -#define EM_SPARCV9	43		/* SPARC version 9 */
  10.182 -#define EM_ALPHA_EXP	0x9026		/* DEC ALPHA */
  10.183 -#define EM_IA_64	50		/* Intel Merced */
  10.184 -#define EM_X86_64	62		/* AMD x86-64 architecture */
  10.185 -#define EM_VAX		75		/* DEC VAX */
  10.186 -
  10.187 -/* Version */
  10.188 -#define EV_NONE		0		/* Invalid */
  10.189 -#define EV_CURRENT	1		/* Current */
  10.190 -#define EV_NUM		2		/* number of versions */
  10.191 -
  10.192 -/* Section Header */
  10.193 -typedef struct {
  10.194 -	Elf32_Word	sh_name;	/* name - index into section header
  10.195 -					   string table section */
  10.196 -	Elf32_Word	sh_type;	/* type */
  10.197 -	Elf32_Word	sh_flags;	/* flags */
  10.198 -	Elf32_Addr	sh_addr;	/* address */
  10.199 -	Elf32_Off	sh_offset;	/* file offset */
  10.200 -	Elf32_Word	sh_size;	/* section size */
  10.201 -	Elf32_Word	sh_link;	/* section header table index link */
  10.202 -	Elf32_Word	sh_info;	/* extra information */
  10.203 -	Elf32_Word	sh_addralign;	/* address alignment */
  10.204 -	Elf32_Word	sh_entsize;	/* section entry size */
  10.205 -} Elf32_Shdr;
  10.206 -
  10.207 -typedef struct {
  10.208 -	Elf64_Half	sh_name;	/* section name */
  10.209 -	Elf64_Half	sh_type;	/* section type */
  10.210 -	Elf64_Xword	sh_flags;	/* section flags */
  10.211 -	Elf64_Addr	sh_addr;	/* virtual address */
  10.212 -	Elf64_Off	sh_offset;	/* file offset */
  10.213 -	Elf64_Xword	sh_size;	/* section size */
  10.214 -	Elf64_Half	sh_link;	/* link to another */
  10.215 -	Elf64_Half	sh_info;	/* misc info */
  10.216 -	Elf64_Xword	sh_addralign;	/* memory alignment */
  10.217 -	Elf64_Xword	sh_entsize;	/* table entry size */
  10.218 -} Elf64_Shdr;
  10.219 -
  10.220 -/* Special Section Indexes */
  10.221 -#define SHN_UNDEF	0		/* undefined */
  10.222 -#define SHN_LORESERVE	0xff00		/* lower bounds of reserved indexes */
  10.223 -#define SHN_LOPROC	0xff00		/* reserved range for processor */
  10.224 -#define SHN_HIPROC	0xff1f		/*   specific section indexes */
  10.225 -#define SHN_ABS		0xfff1		/* absolute value */
  10.226 -#define SHN_COMMON	0xfff2		/* common symbol */
  10.227 -#define SHN_HIRESERVE	0xffff		/* upper bounds of reserved indexes */
  10.228 -
  10.229 -/* sh_type */
  10.230 -#define SHT_NULL	0		/* inactive */
  10.231 -#define SHT_PROGBITS	1		/* program defined information */
  10.232 -#define SHT_SYMTAB	2		/* symbol table section */
  10.233 -#define SHT_STRTAB	3		/* string table section */
  10.234 -#define SHT_RELA	4		/* relocation section with addends*/
  10.235 -#define SHT_HASH	5		/* symbol hash table section */
  10.236 -#define SHT_DYNAMIC	6		/* dynamic section */
  10.237 -#define SHT_NOTE	7		/* note section */
  10.238 -#define SHT_NOBITS	8		/* no space section */
  10.239 -#define SHT_REL		9		/* relation section without addends */
  10.240 -#define SHT_SHLIB	10		/* reserved - purpose unknown */
  10.241 -#define SHT_DYNSYM	11		/* dynamic symbol table section */
  10.242 -#define SHT_NUM		12		/* number of section types */
  10.243 -#define SHT_LOPROC	0x70000000	/* reserved range for processor */
  10.244 -#define SHT_HIPROC	0x7fffffff	/*  specific section header types */
  10.245 -#define SHT_LOUSER	0x80000000	/* reserved range for application */
  10.246 -#define SHT_HIUSER	0xffffffff	/*  specific indexes */
  10.247 -
  10.248 -/* Section names */
  10.249 -#define ELF_BSS         ".bss"		/* uninitialized data */
  10.250 -#define ELF_DATA        ".data"		/* initialized data */
  10.251 -#define ELF_DEBUG       ".debug"	/* debug */
  10.252 -#define ELF_DYNAMIC     ".dynamic"	/* dynamic linking information */
  10.253 -#define ELF_DYNSTR      ".dynstr"	/* dynamic string table */
  10.254 -#define ELF_DYNSYM      ".dynsym"	/* dynamic symbol table */
  10.255 -#define ELF_FINI        ".fini"		/* termination code */
  10.256 -#define ELF_GOT         ".got"		/* global offset table */
  10.257 -#define ELF_HASH        ".hash"		/* symbol hash table */
  10.258 -#define ELF_INIT        ".init"		/* initialization code */
  10.259 -#define ELF_REL_DATA    ".rel.data"	/* relocation data */
  10.260 -#define ELF_REL_FINI    ".rel.fini"	/* relocation termination code */
  10.261 -#define ELF_REL_INIT    ".rel.init"	/* relocation initialization code */
  10.262 -#define ELF_REL_DYN     ".rel.dyn"	/* relocaltion dynamic link info */
  10.263 -#define ELF_REL_RODATA  ".rel.rodata"	/* relocation read-only data */
  10.264 -#define ELF_REL_TEXT    ".rel.text"	/* relocation code */
  10.265 -#define ELF_RODATA      ".rodata"	/* read-only data */
  10.266 -#define ELF_SHSTRTAB    ".shstrtab"	/* section header string table */
  10.267 -#define ELF_STRTAB      ".strtab"	/* string table */
  10.268 -#define ELF_SYMTAB      ".symtab"	/* symbol table */
  10.269 -#define ELF_TEXT        ".text"		/* code */
  10.270 -
  10.271 -
  10.272 -/* Section Attribute Flags - sh_flags */
  10.273 -#define SHF_WRITE	0x1		/* Writable */
  10.274 -#define SHF_ALLOC	0x2		/* occupies memory */
  10.275 -#define SHF_EXECINSTR	0x4		/* executable */
  10.276 -#define SHF_MASKPROC	0xf0000000	/* reserved bits for processor */
  10.277 -					/*  specific section attributes */
  10.278 -
  10.279 -/* Symbol Table Entry */
  10.280 -typedef struct elf32_sym {
  10.281 -	Elf32_Word	st_name;	/* name - index into string table */
  10.282 -	Elf32_Addr	st_value;	/* symbol value */
  10.283 -	Elf32_Word	st_size;	/* symbol size */
  10.284 -	unsigned char	st_info;	/* type and binding */
  10.285 -	unsigned char	st_other;	/* 0 - no defined meaning */
  10.286 -	Elf32_Half	st_shndx;	/* section header index */
  10.287 -} Elf32_Sym;
  10.288 -
  10.289 -typedef struct {
  10.290 -	Elf64_Half	st_name;	/* Symbol name index in str table */
  10.291 -	Elf_Byte	st_info;	/* type / binding attrs */
  10.292 -	Elf_Byte	st_other;	/* unused */
  10.293 -	Elf64_Quarter	st_shndx;	/* section index of symbol */
  10.294 -	Elf64_Xword	st_value;	/* value of symbol */
  10.295 -	Elf64_Xword	st_size;	/* size of symbol */
  10.296 -} Elf64_Sym;
  10.297 -
  10.298 -/* Symbol table index */
  10.299 -#define STN_UNDEF	0		/* undefined */
  10.300 -
  10.301 -/* Extract symbol info - st_info */
  10.302 -#define ELF32_ST_BIND(x)	((x) >> 4)
  10.303 -#define ELF32_ST_TYPE(x)	(((unsigned int) x) & 0xf)
  10.304 -#define ELF32_ST_INFO(b,t)	(((b) << 4) + ((t) & 0xf))
  10.305 -
  10.306 -#define ELF64_ST_BIND(x)	((x) >> 4)
  10.307 -#define ELF64_ST_TYPE(x)	(((unsigned int) x) & 0xf)
  10.308 -#define ELF64_ST_INFO(b,t)	(((b) << 4) + ((t) & 0xf))
  10.309 -
  10.310 -/* Symbol Binding - ELF32_ST_BIND - st_info */
  10.311 -#define STB_LOCAL	0		/* Local symbol */
  10.312 -#define STB_GLOBAL	1		/* Global symbol */
  10.313 -#define STB_WEAK	2		/* like global - lower precedence */
  10.314 -#define STB_NUM		3		/* number of symbol bindings */
  10.315 -#define STB_LOPROC	13		/* reserved range for processor */
  10.316 -#define STB_HIPROC	15		/*  specific symbol bindings */
  10.317 -
  10.318 -/* Symbol type - ELF32_ST_TYPE - st_info */
  10.319 -#define STT_NOTYPE	0		/* not specified */
  10.320 -#define STT_OBJECT	1		/* data object */
  10.321 -#define STT_FUNC	2		/* function */
  10.322 -#define STT_SECTION	3		/* section */
  10.323 -#define STT_FILE	4		/* file */
  10.324 -#define STT_NUM		5		/* number of symbol types */
  10.325 -#define STT_LOPROC	13		/* reserved range for processor */
  10.326 -#define STT_HIPROC	15		/*  specific symbol types */
  10.327 -
  10.328 -/* Relocation entry with implicit addend */
  10.329 -typedef struct {
  10.330 -	Elf32_Addr	r_offset;	/* offset of relocation */
  10.331 -	Elf32_Word	r_info;		/* symbol table index and type */
  10.332 -} Elf32_Rel;
  10.333 -
  10.334 -/* Relocation entry with explicit addend */
  10.335 -typedef struct {
  10.336 -	Elf32_Addr	r_offset;	/* offset of relocation */
  10.337 -	Elf32_Word	r_info;		/* symbol table index and type */
  10.338 -	Elf32_Sword	r_addend;
  10.339 -} Elf32_Rela;
  10.340 -
  10.341 -/* Extract relocation info - r_info */
  10.342 -#define ELF32_R_SYM(i)		((i) >> 8)
  10.343 -#define ELF32_R_TYPE(i)		((unsigned char) (i))
  10.344 -#define ELF32_R_INFO(s,t) 	(((s) << 8) + (unsigned char)(t))
  10.345 -
  10.346 -typedef struct {
  10.347 -	Elf64_Xword	r_offset;	/* where to do it */
  10.348 -	Elf64_Xword	r_info;		/* index & type of relocation */
  10.349 -} Elf64_Rel;
  10.350 -
  10.351 -typedef struct {
  10.352 -	Elf64_Xword	r_offset;	/* where to do it */
  10.353 -	Elf64_Xword	r_info;		/* index & type of relocation */
  10.354 -	Elf64_Sxword	r_addend;	/* adjustment value */
  10.355 -} Elf64_Rela;
  10.356 -
  10.357 -#define	ELF64_R_SYM(info)	((info) >> 32)
  10.358 -#define	ELF64_R_TYPE(info)	((info) & 0xFFFFFFFF)
  10.359 -#define ELF64_R_INFO(s,t) 	(((s) << 32) + (u_int32_t)(t))
  10.360 -
  10.361 -/* Program Header */
  10.362 -typedef struct {
  10.363 -	Elf32_Word	p_type;		/* segment type */
  10.364 -	Elf32_Off	p_offset;	/* segment offset */
  10.365 -	Elf32_Addr	p_vaddr;	/* virtual address of segment */
  10.366 -	Elf32_Addr	p_paddr;	/* physical address - ignored? */
  10.367 -	Elf32_Word	p_filesz;	/* number of bytes in file for seg. */
  10.368 -	Elf32_Word	p_memsz;	/* number of bytes in mem. for seg. */
  10.369 -	Elf32_Word	p_flags;	/* flags */
  10.370 -	Elf32_Word	p_align;	/* memory alignment */
  10.371 -} Elf32_Phdr;
  10.372 -
  10.373 -typedef struct {
  10.374 -	Elf64_Half	p_type;		/* entry type */
  10.375 -	Elf64_Half	p_flags;	/* flags */
  10.376 -	Elf64_Off	p_offset;	/* offset */
  10.377 -	Elf64_Addr	p_vaddr;	/* virtual address */
  10.378 -	Elf64_Addr	p_paddr;	/* physical address */
  10.379 -	Elf64_Xword	p_filesz;	/* file size */
  10.380 -	Elf64_Xword	p_memsz;	/* memory size */
  10.381 -	Elf64_Xword	p_align;	/* memory & file alignment */
  10.382 -} Elf64_Phdr;
  10.383 -
  10.384 -/* Segment types - p_type */
  10.385 -#define PT_NULL		0		/* unused */
  10.386 -#define PT_LOAD		1		/* loadable segment */
  10.387 -#define PT_DYNAMIC	2		/* dynamic linking section */
  10.388 -#define PT_INTERP	3		/* the RTLD */
  10.389 -#define PT_NOTE		4		/* auxiliary information */
  10.390 -#define PT_SHLIB	5		/* reserved - purpose undefined */
  10.391 -#define PT_PHDR		6		/* program header */
  10.392 -#define PT_NUM		7		/* Number of segment types */
  10.393 -#define PT_LOPROC	0x70000000	/* reserved range for processor */
  10.394 -#define PT_HIPROC	0x7fffffff	/*  specific segment types */
  10.395 -
  10.396 -/* Segment flags - p_flags */
  10.397 -#define PF_X		0x1		/* Executable */
  10.398 -#define PF_W		0x2		/* Writable */
  10.399 -#define PF_R		0x4		/* Readable */
  10.400 -#define PF_MASKPROC	0xf0000000	/* reserved bits for processor */
  10.401 -					/*  specific segment flags */
  10.402 -
  10.403 -/* Dynamic structure */
  10.404 -typedef struct {
  10.405 -	Elf32_Sword	d_tag;		/* controls meaning of d_val */
  10.406 -	union {
  10.407 -		Elf32_Word	d_val;	/* Multiple meanings - see d_tag */
  10.408 -		Elf32_Addr	d_ptr;	/* program virtual address */
  10.409 -	} d_un;
  10.410 -} Elf32_Dyn;
  10.411 -
  10.412 -typedef struct {
  10.413 -	Elf64_Xword	d_tag;		/* controls meaning of d_val */
  10.414 -	union {
  10.415 -		Elf64_Addr	d_ptr;
  10.416 -		Elf64_Xword	d_val;
  10.417 -	} d_un;
  10.418 -} Elf64_Dyn;
  10.419 -
  10.420 -/* Dynamic Array Tags - d_tag */
  10.421 -#define DT_NULL		0		/* marks end of _DYNAMIC array */
  10.422 -#define DT_NEEDED	1		/* string table offset of needed lib */
  10.423 -#define DT_PLTRELSZ	2		/* size of relocation entries in PLT */
  10.424 -#define DT_PLTGOT	3		/* address PLT/GOT */
  10.425 -#define DT_HASH		4		/* address of symbol hash table */
  10.426 -#define DT_STRTAB	5		/* address of string table */
  10.427 -#define DT_SYMTAB	6		/* address of symbol table */
  10.428 -#define DT_RELA		7		/* address of relocation table */
  10.429 -#define DT_RELASZ	8		/* size of relocation table */
  10.430 -#define DT_RELAENT	9		/* size of relocation entry */
  10.431 -#define DT_STRSZ	10		/* size of string table */
  10.432 -#define DT_SYMENT	11		/* size of symbol table entry */
  10.433 -#define DT_INIT		12		/* address of initialization func. */
  10.434 -#define DT_FINI		13		/* address of termination function */
  10.435 -#define DT_SONAME	14		/* string table offset of shared obj */
  10.436 -#define DT_RPATH	15		/* string table offset of library
  10.437 -					   search path */
  10.438 -#define DT_SYMBOLIC	16		/* start sym search in shared obj. */
  10.439 -#define DT_REL		17		/* address of rel. tbl. w addends */
  10.440 -#define DT_RELSZ	18		/* size of DT_REL relocation table */
  10.441 -#define DT_RELENT	19		/* size of DT_REL relocation entry */
  10.442 -#define DT_PLTREL	20		/* PLT referenced relocation entry */
  10.443 -#define DT_DEBUG	21		/* bugger */
  10.444 -#define DT_TEXTREL	22		/* Allow rel. mod. to unwritable seg */
  10.445 -#define DT_JMPREL	23		/* add. of PLT's relocation entries */
  10.446 -#define DT_BIND_NOW	24		/* Bind now regardless of env setting */
  10.447 -#define DT_NUM		25		/* Number used. */
  10.448 -#define DT_LOPROC	0x70000000	/* reserved range for processor */
  10.449 -#define DT_HIPROC	0x7fffffff	/*  specific dynamic array tags */
  10.450 -
  10.451 -/* Standard ELF hashing function */
  10.452 -unsigned int elf_hash(const unsigned char *name);
  10.453 -
  10.454 -/*
  10.455 - * Note Definitions
  10.456 - */
  10.457 -typedef struct {
  10.458 -	Elf32_Word namesz;
  10.459 -	Elf32_Word descsz;
  10.460 -	Elf32_Word type;
  10.461 -} Elf32_Note;
  10.462 -
  10.463 -typedef struct {
  10.464 -	Elf64_Half namesz;
  10.465 -	Elf64_Half descsz;
  10.466 -	Elf64_Half type;
  10.467 -} Elf64_Note;
  10.468 -
  10.469 -
  10.470 -#if defined(ELFSIZE)
  10.471 -#define CONCAT(x,y)	__CONCAT(x,y)
  10.472 -#define ELFNAME(x)	CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
  10.473 -#define ELFNAME2(x,y)	CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
  10.474 -#define ELFNAMEEND(x)	CONCAT(x,CONCAT(_elf,ELFSIZE))
  10.475 -#define ELFDEFNNAME(x)	CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
  10.476 -#endif
  10.477 -
  10.478 -#if defined(ELFSIZE) && (ELFSIZE == 32)
  10.479 -#define Elf_Ehdr	Elf32_Ehdr
  10.480 -#define Elf_Phdr	Elf32_Phdr
  10.481 -#define Elf_Shdr	Elf32_Shdr
  10.482 -#define Elf_Sym		Elf32_Sym
  10.483 -#define Elf_Rel		Elf32_Rel
  10.484 -#define Elf_RelA	Elf32_Rela
  10.485 -#define Elf_Dyn		Elf32_Dyn
  10.486 -#define Elf_Word	Elf32_Word
  10.487 -#define Elf_Sword	Elf32_Sword
  10.488 -#define Elf_Addr	Elf32_Addr
  10.489 -#define Elf_Off		Elf32_Off
  10.490 -#define Elf_Nhdr	Elf32_Nhdr
  10.491 -#define Elf_Note	Elf32_Note
  10.492 -
  10.493 -#define ELF_R_SYM	ELF32_R_SYM
  10.494 -#define ELF_R_TYPE	ELF32_R_TYPE
  10.495 -#define ELF_R_INFO	ELF32_R_INFO
  10.496 -#define ELFCLASS	ELFCLASS32
  10.497 -
  10.498 -#define ELF_ST_BIND	ELF32_ST_BIND
  10.499 -#define ELF_ST_TYPE	ELF32_ST_TYPE
  10.500 -#define ELF_ST_INFO	ELF32_ST_INFO
  10.501 -
  10.502 -#define AuxInfo		Aux32Info
  10.503 -#elif defined(ELFSIZE) && (ELFSIZE == 64)
  10.504 -#define Elf_Ehdr	Elf64_Ehdr
  10.505 -#define Elf_Phdr	Elf64_Phdr
  10.506 -#define Elf_Shdr	Elf64_Shdr
  10.507 -#define Elf_Sym		Elf64_Sym
  10.508 -#define Elf_Rel		Elf64_Rel
  10.509 -#define Elf_RelA	Elf64_Rela
  10.510 -#define Elf_Dyn		Elf64_Dyn
  10.511 -#define Elf_Word	Elf64_Word
  10.512 -#define Elf_Sword	Elf64_Sword
  10.513 -#define Elf_Addr	Elf64_Addr
  10.514 -#define Elf_Off		Elf64_Off
  10.515 -#define Elf_Nhdr	Elf64_Nhdr
  10.516 -#define Elf_Note	Elf64_Note
  10.517 -
  10.518 -#define ELF_R_SYM	ELF64_R_SYM
  10.519 -#define ELF_R_TYPE	ELF64_R_TYPE
  10.520 -#define ELF_R_INFO	ELF64_R_INFO
  10.521 -#define ELFCLASS	ELFCLASS64
  10.522 -
  10.523 -#define ELF_ST_BIND	ELF64_ST_BIND
  10.524 -#define ELF_ST_TYPE	ELF64_ST_TYPE
  10.525 -#define ELF_ST_INFO	ELF64_ST_INFO
  10.526 -
  10.527 -#define AuxInfo		Aux64Info
  10.528 -#endif
  10.529 -
  10.530 -#endif /* __XEN_PUBLIC_ELFSTRUCTS_H__ */
    11.1 --- a/include/xen/interface/foreign/Makefile	Wed Mar 18 15:28:03 2009 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,37 +0,0 @@
    11.4 -XEN_ROOT=../../../..
    11.5 -include $(XEN_ROOT)/Config.mk
    11.6 -
    11.7 -architectures := x86_32 x86_64 ia64
    11.8 -headers := $(patsubst %, %.h, $(architectures))
    11.9 -scripts := $(wildcard *.py)
   11.10 -
   11.11 -.PHONY: all clean check-headers
   11.12 -all: $(headers) check-headers
   11.13 -
   11.14 -clean:
   11.15 -	rm -f $(headers)
   11.16 -	rm -f checker checker.c $(XEN_TARGET_ARCH).size
   11.17 -	rm -f *.pyc *.o *~
   11.18 -
   11.19 -ifeq ($(CROSS_COMPILE)$(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
   11.20 -check-headers: checker
   11.21 -	./checker > $(XEN_TARGET_ARCH).size
   11.22 -	diff -u reference.size $(XEN_TARGET_ARCH).size
   11.23 -checker: checker.c $(headers)
   11.24 -	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
   11.25 -else
   11.26 -check-headers:
   11.27 -	@echo "cross build: skipping check"
   11.28 -endif
   11.29 -
   11.30 -x86_32.h: ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h $(scripts)
   11.31 -	python mkheader.py $* $@ $(filter %.h,$^)
   11.32 -
   11.33 -x86_64.h: ../arch-x86/xen-x86_64.h ../arch-x86/xen.h ../xen.h $(scripts)
   11.34 -	python mkheader.py $* $@ $(filter %.h,$^)
   11.35 -
   11.36 -ia64.h: ../arch-ia64.h ../xen.h $(scripts)
   11.37 -	python mkheader.py $* $@ $(filter %.h,$^)
   11.38 -
   11.39 -checker.c: $(scripts)
   11.40 -	python mkchecker.py $(XEN_TARGET_ARCH) $@ $(architectures)
    12.1 --- a/include/xen/interface/foreign/mkchecker.py	Wed Mar 18 15:28:03 2009 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,58 +0,0 @@
    12.4 -#!/usr/bin/python
    12.5 -
    12.6 -import sys;
    12.7 -from structs import structs;
    12.8 -
    12.9 -# command line arguments
   12.10 -arch    = sys.argv[1];
   12.11 -outfile = sys.argv[2];
   12.12 -archs   = sys.argv[3:];
   12.13 -
   12.14 -f = open(outfile, "w");
   12.15 -f.write('''
   12.16 -/*
   12.17 - * sanity checks for generated foreign headers:
   12.18 - *  - verify struct sizes
   12.19 - *
   12.20 - * generated by %s -- DO NOT EDIT
   12.21 - */
   12.22 -#include <stdio.h>
   12.23 -#include <stdlib.h>
   12.24 -#include <stddef.h>
   12.25 -#include <inttypes.h>
   12.26 -#include "../xen.h"
   12.27 -''');
   12.28 -
   12.29 -for a in archs:
   12.30 -    f.write('#include "%s.h"\n' % a);
   12.31 -
   12.32 -f.write('int main(int argc, char *argv[])\n{\n');
   12.33 -
   12.34 -f.write('\tprintf("\\n");');
   12.35 -f.write('printf("%-25s |", "structs");\n');
   12.36 -for a in archs:
   12.37 -    f.write('\tprintf("%%8s", "%s");\n' % a);
   12.38 -f.write('\tprintf("\\n");');
   12.39 -
   12.40 -f.write('\tprintf("\\n");');
   12.41 -for struct in structs:
   12.42 -    f.write('\tprintf("%%-25s |", "%s");\n' % struct);
   12.43 -    for a in archs:
   12.44 -        if a == arch:
   12.45 -            s = struct; # native
   12.46 -        else:
   12.47 -            s = struct + "_" + a;
   12.48 -        f.write('#ifdef %s_has_no_%s\n' % (a, struct));
   12.49 -        f.write('\tprintf("%8s", "-");\n');
   12.50 -        f.write("#else\n");
   12.51 -        f.write('\tprintf("%%8zd", sizeof(struct %s));\n' % s);
   12.52 -        f.write("#endif\n");
   12.53 -
   12.54 -    f.write('\tprintf("\\n");\n\n');
   12.55 -
   12.56 -f.write('\tprintf("\\n");\n');
   12.57 -f.write('\texit(0);\n');
   12.58 -f.write('}\n');
   12.59 -
   12.60 -f.close();
   12.61 -
    13.1 --- a/include/xen/interface/foreign/mkheader.py	Wed Mar 18 15:28:03 2009 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,167 +0,0 @@
    13.4 -#!/usr/bin/python
    13.5 -
    13.6 -import sys, re;
    13.7 -from structs import unions, structs, defines;
    13.8 -
    13.9 -# command line arguments
   13.10 -arch    = sys.argv[1];
   13.11 -outfile = sys.argv[2];
   13.12 -infiles = sys.argv[3:];
   13.13 -
   13.14 -
   13.15 -###########################################################################
   13.16 -# configuration #2: architecture information
   13.17 -
   13.18 -inttypes = {};
   13.19 -header = {};
   13.20 -footer = {};
   13.21 -
   13.22 -# x86_32
   13.23 -inttypes["x86_32"] = {
   13.24 -    "unsigned long" : "uint32_t",
   13.25 -    "long"          : "uint32_t",
   13.26 -    "xen_pfn_t"     : "uint32_t",
   13.27 -};
   13.28 -header["x86_32"] = """
   13.29 -#define __i386___X86_32 1
   13.30 -#pragma pack(4)
   13.31 -""";
   13.32 -footer["x86_32"] = """
   13.33 -#pragma pack()
   13.34 -""";
   13.35 -
   13.36 -# x86_64
   13.37 -inttypes["x86_64"] = {
   13.38 -    "unsigned long" : "__align8__ uint64_t",
   13.39 -    "long"          : "__align8__ uint64_t",
   13.40 -    "xen_pfn_t"     : "__align8__ uint64_t",
   13.41 -};
   13.42 -header["x86_64"] = """
   13.43 -#ifdef __GNUC__
   13.44 -# define __DECL_REG(name) union { uint64_t r ## name, e ## name; }
   13.45 -# define __align8__ __attribute__((aligned (8)))
   13.46 -#else
   13.47 -# define __DECL_REG(name) uint64_t r ## name
   13.48 -# define __align8__ FIXME
   13.49 -#endif
   13.50 -#define __x86_64___X86_64 1
   13.51 -""";
   13.52 -
   13.53 -# ia64
   13.54 -inttypes["ia64"] = {
   13.55 -    "unsigned long" : "__align8__ uint64_t",
   13.56 -    "long"          : "__align8__ uint64_t",
   13.57 -    "xen_pfn_t"     : "__align8__ uint64_t",
   13.58 -    "long double"   : "__align16__ ldouble_t",
   13.59 -};
   13.60 -header["ia64"] = """
   13.61 -#define __align8__ __attribute__((aligned (8)))
   13.62 -#define __align16__ __attribute__((aligned (16)))
   13.63 -typedef unsigned char ldouble_t[16];
   13.64 -""";
   13.65 -
   13.66 -
   13.67 -###########################################################################
   13.68 -# main
   13.69 -
   13.70 -input  = "";
   13.71 -output = "";
   13.72 -fileid = re.sub("[-.]", "_", "__FOREIGN_%s__" % outfile.upper());
   13.73 -
   13.74 -# read input header files
   13.75 -for name in infiles:
   13.76 -    f = open(name, "r");
   13.77 -    input += f.read();
   13.78 -    f.close();
   13.79 -
   13.80 -# add header
   13.81 -output += """
   13.82 -/*
   13.83 - * public xen defines and struct for %s
   13.84 - * generated by %s -- DO NOT EDIT
   13.85 - */
   13.86 -
   13.87 -#ifndef %s
   13.88 -#define %s 1
   13.89 -
   13.90 -""" % (arch, sys.argv[0], fileid, fileid)
   13.91 -
   13.92 -if arch in header:
   13.93 -    output += header[arch];
   13.94 -    output += "\n";
   13.95 -
   13.96 -# add defines to output
   13.97 -for line in re.findall("#define[^\n]+", input):
   13.98 -    for define in defines:
   13.99 -        regex = "#define\s+%s\\b" % define;
  13.100 -        match = re.search(regex, line);
  13.101 -        if None == match:
  13.102 -            continue;
  13.103 -        if define.upper()[0] == define[0]:
  13.104 -            replace = define + "_" + arch.upper();
  13.105 -        else:
  13.106 -            replace = define + "_" + arch;
  13.107 -        regex = "\\b%s\\b" % define;
  13.108 -        output += re.sub(regex, replace, line) + "\n";
  13.109 -output += "\n";
  13.110 -
  13.111 -# delete defines, comments, empty lines
  13.112 -input = re.sub("#define[^\n]+\n", "", input);
  13.113 -input = re.compile("/\*(.*?)\*/", re.S).sub("", input)
  13.114 -input = re.compile("\n\s*\n", re.S).sub("\n", input);
  13.115 -
  13.116 -# add unions to output
  13.117 -for union in unions:
  13.118 -    regex = "union\s+%s\s*\{(.*?)\n\};" % union;
  13.119 -    match = re.search(regex, input, re.S)
  13.120 -    if None == match:
  13.121 -        output += "#define %s_has_no_%s 1\n" % (arch, union);
  13.122 -    else:
  13.123 -        output += "union %s_%s {%s\n};\n" % (union, arch, match.group(1));
  13.124 -    output += "\n";
  13.125 -
  13.126 -# add structs to output
  13.127 -for struct in structs:
  13.128 -    regex = "struct\s+%s\s*\{(.*?)\n\};" % struct;
  13.129 -    match = re.search(regex, input, re.S)
  13.130 -    if None == match:
  13.131 -        output += "#define %s_has_no_%s 1\n" % (arch, struct);
  13.132 -    else:
  13.133 -        output += "struct %s_%s {%s\n};\n" % (struct, arch, match.group(1));
  13.134 -        output += "typedef struct %s_%s %s_%s_t;\n" % (struct, arch, struct, arch);
  13.135 -    output += "\n";
  13.136 -
  13.137 -# add footer
  13.138 -if arch in footer:
  13.139 -    output += footer[arch];
  13.140 -    output += "\n";
  13.141 -output += "#endif /* %s */\n" % fileid;
  13.142 -
  13.143 -# replace: defines
  13.144 -for define in defines:
  13.145 -    if define.upper()[0] == define[0]:
  13.146 -        replace = define + "_" + arch.upper();
  13.147 -    else:
  13.148 -        replace = define + "_" + arch;
  13.149 -    output = re.sub("\\b%s\\b" % define, replace, output);
  13.150 -
  13.151 -# replace: unions
  13.152 -for union in unions:
  13.153 -    output = re.sub("\\b(union\s+%s)\\b" % union, "\\1_%s" % arch, output);
  13.154 -
  13.155 -# replace: structs + struct typedefs
  13.156 -for struct in structs:
  13.157 -    output = re.sub("\\b(struct\s+%s)\\b" % struct, "\\1_%s" % arch, output);
  13.158 -    output = re.sub("\\b(%s)_t\\b" % struct, "\\1_%s_t" % arch, output);
  13.159 -
  13.160 -# replace: integer types
  13.161 -integers = inttypes[arch].keys();
  13.162 -integers.sort(lambda a, b: cmp(len(b),len(a)));
  13.163 -for type in integers:
  13.164 -    output = re.sub("\\b%s\\b" % type, inttypes[arch][type], output);
  13.165 -
  13.166 -# print results
  13.167 -f = open(outfile, "w");
  13.168 -f.write(output);
  13.169 -f.close;
  13.170 -
    14.1 --- a/include/xen/interface/foreign/reference.size	Wed Mar 18 15:28:03 2009 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,18 +0,0 @@
    14.4 -
    14.5 -structs                   |  x86_32  x86_64    ia64
    14.6 -
    14.7 -start_info                |    1104    1152    1152
    14.8 -trap_info                 |       8      16       -
    14.9 -pt_fpreg                  |       -       -      16
   14.10 -cpu_user_regs             |      68     200       -
   14.11 -xen_ia64_boot_param       |       -       -      96
   14.12 -ia64_tr_entry             |       -       -      32
   14.13 -vcpu_tr_regs              |       -       -     768
   14.14 -vcpu_guest_context_regs   |       -       -   22176
   14.15 -vcpu_guest_context        |    2800    5168   22208
   14.16 -arch_vcpu_info            |      24      16       0
   14.17 -vcpu_time_info            |      32      32      32
   14.18 -vcpu_info                 |      64      64      48
   14.19 -arch_shared_info          |     268     280     272
   14.20 -shared_info               |    2584    3368    4384
   14.21 -
    15.1 --- a/include/xen/interface/foreign/structs.py	Wed Mar 18 15:28:03 2009 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,58 +0,0 @@
    15.4 -# configuration: what needs translation
    15.5 -
    15.6 -unions  = [ "vcpu_cr_regs",
    15.7 -            "vcpu_ar_regs" ];
    15.8 -
    15.9 -structs = [ "start_info",
   15.10 -            "trap_info",
   15.11 -            "pt_fpreg",
   15.12 -            "cpu_user_regs",
   15.13 -            "xen_ia64_boot_param",
   15.14 -            "ia64_tr_entry",
   15.15 -            "vcpu_tr_regs",
   15.16 -            "vcpu_guest_context_regs",
   15.17 -            "vcpu_guest_context",
   15.18 -            "arch_vcpu_info",
   15.19 -            "vcpu_time_info",
   15.20 -            "vcpu_info",
   15.21 -            "arch_shared_info",
   15.22 -            "shared_info" ];
   15.23 -
   15.24 -defines = [ "__i386__",
   15.25 -            "__x86_64__",
   15.26 -
   15.27 -            "FLAT_RING1_CS",
   15.28 -            "FLAT_RING1_DS",
   15.29 -            "FLAT_RING1_SS",
   15.30 -
   15.31 -            "FLAT_RING3_CS64",
   15.32 -            "FLAT_RING3_DS64",
   15.33 -            "FLAT_RING3_SS64",
   15.34 -            "FLAT_KERNEL_CS64",
   15.35 -            "FLAT_KERNEL_DS64",
   15.36 -            "FLAT_KERNEL_SS64",
   15.37 -
   15.38 -            "FLAT_KERNEL_CS",
   15.39 -            "FLAT_KERNEL_DS",
   15.40 -            "FLAT_KERNEL_SS",
   15.41 -
   15.42 -            # x86_{32,64}
   15.43 -            "_VGCF_i387_valid",
   15.44 -            "VGCF_i387_valid",
   15.45 -            "_VGCF_in_kernel",
   15.46 -            "VGCF_in_kernel",
   15.47 -            "_VGCF_failsafe_disables_events",
   15.48 -            "VGCF_failsafe_disables_events",
   15.49 -            "_VGCF_syscall_disables_events",
   15.50 -            "VGCF_syscall_disables_events",
   15.51 -            "_VGCF_online",
   15.52 -            "VGCF_online",
   15.53 -
   15.54 -            # ia64
   15.55 -            "VGCF_EXTRA_REGS",
   15.56 -
   15.57 -            # all archs
   15.58 -            "xen_pfn_to_cr3",
   15.59 -            "MAX_VIRT_CPUS",
   15.60 -            "MAX_GUEST_CMDLINE" ];
   15.61 -
    16.1 --- a/include/xen/interface/hvm/hvm_info_table.h	Wed Mar 18 15:28:03 2009 +0000
    16.2 +++ b/include/xen/interface/hvm/hvm_info_table.h	Wed Mar 18 15:43:57 2009 +0000
    16.3 @@ -33,9 +33,37 @@ struct hvm_info_table {
    16.4      char        signature[8]; /* "HVM INFO" */
    16.5      uint32_t    length;
    16.6      uint8_t     checksum;
    16.7 +
    16.8 +    /* Should firmware build ACPI tables? */
    16.9      uint8_t     acpi_enabled;
   16.10 +
   16.11 +    /* Should firmware build APIC descriptors (APIC MADT / MP BIOS)? */
   16.12      uint8_t     apic_mode;
   16.13 +
   16.14 +    /* How many CPUs does this domain have? */
   16.15      uint32_t    nr_vcpus;
   16.16 +
   16.17 +    /*
   16.18 +     * MEMORY MAP provided by HVM domain builder.
   16.19 +     * Notes:
   16.20 +     *  1. page_to_phys(x) = x << 12
   16.21 +     *  2. If a field is zero, the corresponding range does not exist.
   16.22 +     */
   16.23 +    /*
   16.24 +     *  0x0 to page_to_phys(low_mem_pgend)-1:
   16.25 +     *    RAM below 4GB (except for VGA hole 0xA0000-0xBFFFF)
   16.26 +     */
   16.27 +    uint32_t    low_mem_pgend;
   16.28 +    /*
   16.29 +     *  page_to_phys(reserved_mem_pgstart) to 0xFFFFFFFF:
   16.30 +     *    Reserved for special memory mappings
   16.31 +     */
   16.32 +    uint32_t    reserved_mem_pgstart;
   16.33 +    /*
   16.34 +     *  0x100000000 to page_to_phys(high_mem_pgend)-1:
   16.35 +     *    RAM above 4GB
   16.36 +     */
   16.37 +    uint32_t    high_mem_pgend;
   16.38  };
   16.39  
   16.40  #endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */
    17.1 --- a/include/xen/interface/hvm/params.h	Wed Mar 18 15:28:03 2009 +0000
    17.2 +++ b/include/xen/interface/hvm/params.h	Wed Mar 18 15:43:57 2009 +0000
    17.3 @@ -100,6 +100,12 @@
    17.4  /* ACPI S state: currently support S0 and S3 on x86. */
    17.5  #define HVM_PARAM_ACPI_S_STATE 14
    17.6  
    17.7 -#define HVM_NR_PARAMS          15
    17.8 +/* TSS used on Intel when CR0.PE=0. */
    17.9 +#define HVM_PARAM_VM86_TSS     15
   17.10 +
   17.11 +/* Boolean: Enable aligning all periodic vpts to reduce interrupts */
   17.12 +#define HVM_PARAM_VPT_ALIGN    16
   17.13 +
   17.14 +#define HVM_NR_PARAMS          17
   17.15  
   17.16  #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
    18.1 --- a/include/xen/interface/hvm/vmx_assist.h	Wed Mar 18 15:28:03 2009 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,122 +0,0 @@
    18.4 -/*
    18.5 - * vmx_assist.h: Context definitions for the VMXASSIST world switch.
    18.6 - *
    18.7 - * Permission is hereby granted, free of charge, to any person obtaining a copy
    18.8 - * of this software and associated documentation files (the "Software"), to
    18.9 - * deal in the Software without restriction, including without limitation the
   18.10 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   18.11 - * sell copies of the Software, and to permit persons to whom the Software is
   18.12 - * furnished to do so, subject to the following conditions:
   18.13 - *
   18.14 - * The above copyright notice and this permission notice shall be included in
   18.15 - * all copies or substantial portions of the Software.
   18.16 - *
   18.17 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   18.18 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   18.19 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   18.20 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   18.21 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   18.22 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   18.23 - * DEALINGS IN THE SOFTWARE.
   18.24 - *
   18.25 - * Leendert van Doorn, leendert@watson.ibm.com
   18.26 - * Copyright (c) 2005, International Business Machines Corporation.
   18.27 - */
   18.28 -
   18.29 -#ifndef _VMX_ASSIST_H_
   18.30 -#define _VMX_ASSIST_H_
   18.31 -
   18.32 -#define VMXASSIST_BASE         0xD0000
   18.33 -#define VMXASSIST_MAGIC        0x17101966
   18.34 -#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
   18.35 -
   18.36 -#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
   18.37 -#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
   18.38 -
   18.39 -#ifndef __ASSEMBLY__
   18.40 -
   18.41 -#define NR_EXCEPTION_HANDLER    32
   18.42 -#define NR_INTERRUPT_HANDLERS   16
   18.43 -#define NR_TRAPS        (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
   18.44 -
   18.45 -union vmcs_arbytes {
   18.46 -    struct arbyte_fields {
   18.47 -        unsigned int seg_type : 4,
   18.48 -            s         : 1,
   18.49 -            dpl       : 2,
   18.50 -            p         : 1,
   18.51 -            reserved0 : 4,
   18.52 -            avl       : 1,
   18.53 -            reserved1 : 1,
   18.54 -            default_ops_size: 1,
   18.55 -            g         : 1,
   18.56 -            null_bit  : 1,
   18.57 -            reserved2 : 15;
   18.58 -    } fields;
   18.59 -    unsigned int bytes;
   18.60 -};
   18.61 -
   18.62 -/*
   18.63 - * World switch state
   18.64 - */
   18.65 -struct vmx_assist_context {
   18.66 -    uint32_t  eip;        /* execution pointer */
   18.67 -    uint32_t  esp;        /* stack pointer */
   18.68 -    uint32_t  eflags;     /* flags register */
   18.69 -    uint32_t  cr0;
   18.70 -    uint32_t  cr3;        /* page table directory */
   18.71 -    uint32_t  cr4;
   18.72 -    uint32_t  idtr_limit; /* idt */
   18.73 -    uint32_t  idtr_base;
   18.74 -    uint32_t  gdtr_limit; /* gdt */
   18.75 -    uint32_t  gdtr_base;
   18.76 -    uint32_t  cs_sel;     /* cs selector */
   18.77 -    uint32_t  cs_limit;
   18.78 -    uint32_t  cs_base;
   18.79 -    union vmcs_arbytes cs_arbytes;
   18.80 -    uint32_t  ds_sel;     /* ds selector */
   18.81 -    uint32_t  ds_limit;
   18.82 -    uint32_t  ds_base;
   18.83 -    union vmcs_arbytes ds_arbytes;
   18.84 -    uint32_t  es_sel;     /* es selector */
   18.85 -    uint32_t  es_limit;
   18.86 -    uint32_t  es_base;
   18.87 -    union vmcs_arbytes es_arbytes;
   18.88 -    uint32_t  ss_sel;     /* ss selector */
   18.89 -    uint32_t  ss_limit;
   18.90 -    uint32_t  ss_base;
   18.91 -    union vmcs_arbytes ss_arbytes;
   18.92 -    uint32_t  fs_sel;     /* fs selector */
   18.93 -    uint32_t  fs_limit;
   18.94 -    uint32_t  fs_base;
   18.95 -    union vmcs_arbytes fs_arbytes;
   18.96 -    uint32_t  gs_sel;     /* gs selector */
   18.97 -    uint32_t  gs_limit;
   18.98 -    uint32_t  gs_base;
   18.99 -    union vmcs_arbytes gs_arbytes;
  18.100 -    uint32_t  tr_sel;     /* task selector */
  18.101 -    uint32_t  tr_limit;
  18.102 -    uint32_t  tr_base;
  18.103 -    union vmcs_arbytes tr_arbytes;
  18.104 -    uint32_t  ldtr_sel;   /* ldtr selector */
  18.105 -    uint32_t  ldtr_limit;
  18.106 -    uint32_t  ldtr_base;
  18.107 -    union vmcs_arbytes ldtr_arbytes;
  18.108 -
  18.109 -    unsigned char rm_irqbase[2];
  18.110 -};
  18.111 -typedef struct vmx_assist_context vmx_assist_context_t;
  18.112 -
  18.113 -#endif /* __ASSEMBLY__ */
  18.114 -
  18.115 -#endif /* _VMX_ASSIST_H_ */
  18.116 -
  18.117 -/*
  18.118 - * Local variables:
  18.119 - * mode: C
  18.120 - * c-set-style: "BSD"
  18.121 - * c-basic-offset: 4
  18.122 - * tab-width: 4
  18.123 - * indent-tabs-mode: nil
  18.124 - * End:
  18.125 - */
    19.1 --- a/include/xen/interface/io/fsif.h	Wed Mar 18 15:28:03 2009 +0000
    19.2 +++ b/include/xen/interface/io/fsif.h	Wed Mar 18 15:43:57 2009 +0000
    19.3 @@ -185,7 +185,8 @@ DEFINE_RING_TYPES(fsif, struct fsif_requ
    19.4  
    19.5  #define STATE_INITIALISED     "init"
    19.6  #define STATE_READY           "ready"
    19.7 -
    19.8 +#define STATE_CLOSING         "closing"
    19.9 +#define STATE_CLOSED          "closed"
   19.10  
   19.11  
   19.12  #endif
    20.1 --- a/include/xen/interface/io/pciif.h	Wed Mar 18 15:28:03 2009 +0000
    20.2 +++ b/include/xen/interface/io/pciif.h	Wed Mar 18 15:43:57 2009 +0000
    20.3 @@ -29,7 +29,7 @@
    20.4  
    20.5  /* xen_pci_sharedinfo flags */
    20.6  #define _XEN_PCIF_active     (0)
    20.7 -#define XEN_PCIF_active      (1<<_XEN_PCI_active)
    20.8 +#define XEN_PCIF_active      (1<<_XEN_PCIF_active)
    20.9  #define _XEN_PCIB_AERHANDLER (1)
   20.10  #define XEN_PCIB_AERHANDLER  (1<<_XEN_PCIB_AERHANDLER)
   20.11  #define _XEN_PCIB_active     (2)
    21.1 --- a/include/xen/interface/libelf.h	Wed Mar 18 15:28:03 2009 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,265 +0,0 @@
    21.4 -/******************************************************************************
    21.5 - * libelf.h
    21.6 - * 
    21.7 - * Permission is hereby granted, free of charge, to any person obtaining a copy
    21.8 - * of this software and associated documentation files (the "Software"), to
    21.9 - * deal in the Software without restriction, including without limitation the
   21.10 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   21.11 - * sell copies of the Software, and to permit persons to whom the Software is
   21.12 - * furnished to do so, subject to the following conditions:
   21.13 - *
   21.14 - * The above copyright notice and this permission notice shall be included in
   21.15 - * all copies or substantial portions of the Software.
   21.16 - *
   21.17 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   21.18 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   21.19 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   21.20 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   21.21 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   21.22 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   21.23 - * DEALINGS IN THE SOFTWARE.
   21.24 - */
   21.25 -
   21.26 -#ifndef __XC_LIBELF__
   21.27 -#define __XC_LIBELF__ 1
   21.28 -
   21.29 -#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
   21.30 -#define XEN_ELF_LITTLE_ENDIAN
   21.31 -#else
   21.32 -#error define architectural endianness
   21.33 -#endif
   21.34 -
   21.35 -#undef ELFSIZE
   21.36 -#include "elfnote.h"
   21.37 -#include "elfstructs.h"
   21.38 -#include "features.h"
   21.39 -
   21.40 -/* ------------------------------------------------------------------------ */
   21.41 -
   21.42 -typedef union {
   21.43 -    Elf32_Ehdr e32;
   21.44 -    Elf64_Ehdr e64;
   21.45 -} elf_ehdr;
   21.46 -
   21.47 -typedef union {
   21.48 -    Elf32_Phdr e32;
   21.49 -    Elf64_Phdr e64;
   21.50 -} elf_phdr;
   21.51 -
   21.52 -typedef union {
   21.53 -    Elf32_Shdr e32;
   21.54 -    Elf64_Shdr e64;
   21.55 -} elf_shdr;
   21.56 -
   21.57 -typedef union {
   21.58 -    Elf32_Sym e32;
   21.59 -    Elf64_Sym e64;
   21.60 -} elf_sym;
   21.61 -
   21.62 -typedef union {
   21.63 -    Elf32_Rel e32;
   21.64 -    Elf64_Rel e64;
   21.65 -} elf_rel;
   21.66 -
   21.67 -typedef union {
   21.68 -    Elf32_Rela e32;
   21.69 -    Elf64_Rela e64;
   21.70 -} elf_rela;
   21.71 -
   21.72 -typedef union {
   21.73 -    Elf32_Note e32;
   21.74 -    Elf64_Note e64;
   21.75 -} elf_note;
   21.76 -
   21.77 -struct elf_binary {
   21.78 -    /* elf binary */
   21.79 -    const char *image;
   21.80 -    size_t size;
   21.81 -    char class;
   21.82 -    char data;
   21.83 -
   21.84 -    const elf_ehdr *ehdr;
   21.85 -    const char *sec_strtab;
   21.86 -    const elf_shdr *sym_tab;
   21.87 -    const char *sym_strtab;
   21.88 -
   21.89 -    /* loaded to */
   21.90 -    char *dest;
   21.91 -    uint64_t pstart;
   21.92 -    uint64_t pend;
   21.93 -    uint64_t reloc_offset;
   21.94 -
   21.95 -    uint64_t bsd_symtab_pstart;
   21.96 -    uint64_t bsd_symtab_pend;
   21.97 -
   21.98 -#ifndef __XEN__
   21.99 -    /* misc */
  21.100 -    FILE *log;
  21.101 -#endif
  21.102 -    int verbose;
  21.103 -};
  21.104 -
  21.105 -/* ------------------------------------------------------------------------ */
  21.106 -/* accessing elf header fields                                              */
  21.107 -
  21.108 -#ifdef XEN_ELF_BIG_ENDIAN
  21.109 -# define NATIVE_ELFDATA ELFDATA2MSB
  21.110 -#else
  21.111 -# define NATIVE_ELFDATA ELFDATA2LSB
  21.112 -#endif
  21.113 -
  21.114 -#define elf_32bit(elf) (ELFCLASS32 == (elf)->class)
  21.115 -#define elf_64bit(elf) (ELFCLASS64 == (elf)->class)
  21.116 -#define elf_msb(elf)   (ELFDATA2MSB == (elf)->data)
  21.117 -#define elf_lsb(elf)   (ELFDATA2LSB == (elf)->data)
  21.118 -#define elf_swap(elf)  (NATIVE_ELFDATA != (elf)->data)
  21.119 -
  21.120 -#define elf_uval(elf, str, elem)                                        \
  21.121 -    ((ELFCLASS64 == (elf)->class)                                       \
  21.122 -     ? elf_access_unsigned((elf), (str),                                \
  21.123 -                           offsetof(typeof(*(str)),e64.elem),           \
  21.124 -                           sizeof((str)->e64.elem))                     \
  21.125 -     : elf_access_unsigned((elf), (str),                                \
  21.126 -                           offsetof(typeof(*(str)),e32.elem),           \
  21.127 -                           sizeof((str)->e32.elem)))
  21.128 -
  21.129 -#define elf_sval(elf, str, elem)                                        \
  21.130 -    ((ELFCLASS64 == (elf)->class)                                       \
  21.131 -     ? elf_access_signed((elf), (str),                                  \
  21.132 -                         offsetof(typeof(*(str)),e64.elem),             \
  21.133 -                         sizeof((str)->e64.elem))                       \
  21.134 -     : elf_access_signed((elf), (str),                                  \
  21.135 -                         offsetof(typeof(*(str)),e32.elem),             \
  21.136 -                         sizeof((str)->e32.elem)))
  21.137 -
  21.138 -#define elf_size(elf, str)                              \
  21.139 -    ((ELFCLASS64 == (elf)->class)                       \
  21.140 -     ? sizeof((str)->e64) : sizeof((str)->e32))
  21.141 -
  21.142 -uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
  21.143 -                             uint64_t offset, size_t size);
  21.144 -int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
  21.145 -                          uint64_t offset, size_t size);
  21.146 -
  21.147 -uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
  21.148 -
  21.149 -/* ------------------------------------------------------------------------ */
  21.150 -/* xc_libelf_tools.c                                                        */
  21.151 -
  21.152 -int elf_shdr_count(struct elf_binary *elf);
  21.153 -int elf_phdr_count(struct elf_binary *elf);
  21.154 -
  21.155 -const elf_shdr *elf_shdr_by_name(struct elf_binary *elf, const char *name);
  21.156 -const elf_shdr *elf_shdr_by_index(struct elf_binary *elf, int index);
  21.157 -const elf_phdr *elf_phdr_by_index(struct elf_binary *elf, int index);
  21.158 -
  21.159 -const char *elf_section_name(struct elf_binary *elf, const elf_shdr * shdr);
  21.160 -const void *elf_section_start(struct elf_binary *elf, const elf_shdr * shdr);
  21.161 -const void *elf_section_end(struct elf_binary *elf, const elf_shdr * shdr);
  21.162 -
  21.163 -const void *elf_segment_start(struct elf_binary *elf, const elf_phdr * phdr);
  21.164 -const void *elf_segment_end(struct elf_binary *elf, const elf_phdr * phdr);
  21.165 -
  21.166 -const elf_sym *elf_sym_by_name(struct elf_binary *elf, const char *symbol);
  21.167 -const elf_sym *elf_sym_by_index(struct elf_binary *elf, int index);
  21.168 -
  21.169 -const char *elf_note_name(struct elf_binary *elf, const elf_note * note);
  21.170 -const void *elf_note_desc(struct elf_binary *elf, const elf_note * note);
  21.171 -uint64_t elf_note_numeric(struct elf_binary *elf, const elf_note * note);
  21.172 -const elf_note *elf_note_next(struct elf_binary *elf, const elf_note * note);
  21.173 -
  21.174 -int elf_is_elfbinary(const void *image);
  21.175 -int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr);
  21.176 -
  21.177 -/* ------------------------------------------------------------------------ */
  21.178 -/* xc_libelf_loader.c                                                       */
  21.179 -
  21.180 -int elf_init(struct elf_binary *elf, const char *image, size_t size);
  21.181 -#ifdef __XEN__
  21.182 -void elf_set_verbose(struct elf_binary *elf);
  21.183 -#else
  21.184 -void elf_set_logfile(struct elf_binary *elf, FILE * log, int verbose);
  21.185 -#endif
  21.186 -
  21.187 -void elf_parse_binary(struct elf_binary *elf);
  21.188 -void elf_load_binary(struct elf_binary *elf);
  21.189 -
  21.190 -void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
  21.191 -uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
  21.192 -
  21.193 -void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
  21.194 -
  21.195 -/* ------------------------------------------------------------------------ */
  21.196 -/* xc_libelf_relocate.c                                                     */
  21.197 -
  21.198 -int elf_reloc(struct elf_binary *elf);
  21.199 -
  21.200 -/* ------------------------------------------------------------------------ */
  21.201 -/* xc_libelf_dominfo.c                                                      */
  21.202 -
  21.203 -#define UNSET_ADDR          ((uint64_t)-1)
  21.204 -
  21.205 -enum xen_elfnote_type {
  21.206 -    XEN_ENT_NONE = 0,
  21.207 -    XEN_ENT_LONG = 1,
  21.208 -    XEN_ENT_STR  = 2
  21.209 -};
  21.210 -
  21.211 -struct xen_elfnote {
  21.212 -    enum xen_elfnote_type type;
  21.213 -    const char *name;
  21.214 -    union {
  21.215 -        const char *str;
  21.216 -        uint64_t num;
  21.217 -    } data;
  21.218 -};
  21.219 -
  21.220 -struct elf_dom_parms {
  21.221 -    /* raw */
  21.222 -    const char *guest_info;
  21.223 -    const void *elf_note_start;
  21.224 -    const void *elf_note_end;
  21.225 -    struct xen_elfnote elf_notes[XEN_ELFNOTE_MAX + 1];
  21.226 -  
  21.227 -    /* parsed */
  21.228 -    char guest_os[16];
  21.229 -    char guest_ver[16];
  21.230 -    char xen_ver[16];
  21.231 -    char loader[16];
  21.232 -    int pae;
  21.233 -    int bsd_symtab;
  21.234 -    uint64_t virt_base;
  21.235 -    uint64_t virt_entry;
  21.236 -    uint64_t virt_hypercall;
  21.237 -    uint64_t virt_hv_start_low;
  21.238 -    uint64_t elf_paddr_offset;
  21.239 -    uint32_t f_supported[XENFEAT_NR_SUBMAPS];
  21.240 -    uint32_t f_required[XENFEAT_NR_SUBMAPS];
  21.241 -
  21.242 -    /* calculated */
  21.243 -    uint64_t virt_offset;
  21.244 -    uint64_t virt_kstart;
  21.245 -    uint64_t virt_kend;
  21.246 -};
  21.247 -
  21.248 -static inline void elf_xen_feature_set(int nr, uint32_t * addr)
  21.249 -{
  21.250 -    addr[nr >> 5] |= 1 << (nr & 31);
  21.251 -}
  21.252 -static inline int elf_xen_feature_get(int nr, uint32_t * addr)
  21.253 -{
  21.254 -    return !!(addr[nr >> 5] & (1 << (nr & 31)));
  21.255 -}
  21.256 -
  21.257 -int elf_xen_parse_features(const char *features,
  21.258 -                           uint32_t *supported,
  21.259 -                           uint32_t *required);
  21.260 -int elf_xen_parse_note(struct elf_binary *elf,
  21.261 -                       struct elf_dom_parms *parms,
  21.262 -                       const elf_note *note);
  21.263 -int elf_xen_parse_guest_info(struct elf_binary *elf,
  21.264 -                             struct elf_dom_parms *parms);
  21.265 -int elf_xen_parse(struct elf_binary *elf,
  21.266 -                  struct elf_dom_parms *parms);
  21.267 -
  21.268 -#endif /* __XC_LIBELF__ */
    22.1 --- a/include/xen/interface/physdev.h	Wed Mar 18 15:28:03 2009 +0000
    22.2 +++ b/include/xen/interface/physdev.h	Wed Mar 18 15:43:57 2009 +0000
    22.3 @@ -183,6 +183,15 @@ struct physdev_manage_pci {
    22.4  typedef struct physdev_manage_pci physdev_manage_pci_t;
    22.5  DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_t);
    22.6  
    22.7 +#define PHYSDEVOP_restore_msi            19
    22.8 +struct physdev_restore_msi {
    22.9 +    /* IN */
   22.10 +    uint8_t bus;
   22.11 +    uint8_t devfn;
   22.12 +};
   22.13 +typedef struct physdev_restore_msi physdev_restore_msi_t;
   22.14 +DEFINE_XEN_GUEST_HANDLE(physdev_restore_msi_t);
   22.15 +
   22.16  /*
   22.17   * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
   22.18   * hypercall since 0x00030202.
    23.1 --- a/include/xen/interface/sysctl.h	Wed Mar 18 15:28:03 2009 +0000
    23.2 +++ b/include/xen/interface/sysctl.h	Wed Mar 18 15:43:57 2009 +0000
    23.3 @@ -262,17 +262,181 @@ struct xen_sysctl_get_pmstat {
    23.4  typedef struct xen_sysctl_get_pmstat xen_sysctl_get_pmstat_t;
    23.5  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_get_pmstat_t);
    23.6  
    23.7 +/*
    23.8 + * Status codes. Must be greater than 0 to avoid confusing
    23.9 + * sysctl callers that see 0 as a plain successful return.
   23.10 + */
   23.11 +#define XEN_CPU_HOTPLUG_STATUS_OFFLINE 1
   23.12 +#define XEN_CPU_HOTPLUG_STATUS_ONLINE  2
   23.13 +#define XEN_CPU_HOTPLUG_STATUS_NEW     3
   23.14 +
   23.15  #define XEN_SYSCTL_cpu_hotplug       11
   23.16  struct xen_sysctl_cpu_hotplug {
   23.17      /* IN variables */
   23.18      uint32_t cpu;   /* Physical cpu. */
   23.19  #define XEN_SYSCTL_CPU_HOTPLUG_ONLINE  0
   23.20  #define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1
   23.21 +#define XEN_SYSCTL_CPU_HOTPLUG_STATUS 2
   23.22      uint32_t op;    /* hotplug opcode */
   23.23  };
   23.24  typedef struct xen_sysctl_cpu_hotplug xen_sysctl_cpu_hotplug_t;
   23.25  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_hotplug_t);
   23.26  
   23.27 +/*
   23.28 + * Get/set xen power management, include 
   23.29 + * 1. cpufreq governors and related parameters
   23.30 + */
   23.31 +#define XEN_SYSCTL_pm_op        12
   23.32 +struct xen_userspace {
   23.33 +    uint32_t scaling_setspeed;
   23.34 +};
   23.35 +typedef struct xen_userspace xen_userspace_t;
   23.36 +
   23.37 +struct xen_ondemand {
   23.38 +    uint32_t sampling_rate_max;
   23.39 +    uint32_t sampling_rate_min;
   23.40 +
   23.41 +    uint32_t sampling_rate;
   23.42 +    uint32_t up_threshold;
   23.43 +};
   23.44 +typedef struct xen_ondemand xen_ondemand_t;
   23.45 +
   23.46 +/* 
   23.47 + * cpufreq para name of this structure named 
   23.48 + * same as sysfs file name of native linux
   23.49 + */
   23.50 +#define CPUFREQ_NAME_LEN 16
   23.51 +struct xen_get_cpufreq_para {
   23.52 +    /* IN/OUT variable */
   23.53 +    uint32_t cpu_num;
   23.54 +    uint32_t freq_num;
   23.55 +    uint32_t gov_num;
   23.56 +
   23.57 +    /* for all governors */
   23.58 +    /* OUT variable */
   23.59 +    XEN_GUEST_HANDLE_64(uint32) affected_cpus;
   23.60 +    XEN_GUEST_HANDLE_64(uint32) scaling_available_frequencies;
   23.61 +    XEN_GUEST_HANDLE_64(char)   scaling_available_governors;
   23.62 +    char scaling_driver[CPUFREQ_NAME_LEN];
   23.63 +
   23.64 +    uint32_t cpuinfo_cur_freq;
   23.65 +    uint32_t cpuinfo_max_freq;
   23.66 +    uint32_t cpuinfo_min_freq;
   23.67 +    uint32_t scaling_cur_freq;
   23.68 +
   23.69 +    char scaling_governor[CPUFREQ_NAME_LEN];
   23.70 +    uint32_t scaling_max_freq;
   23.71 +    uint32_t scaling_min_freq;
   23.72 +
   23.73 +    /* for specific governor */
   23.74 +    union {
   23.75 +        struct  xen_userspace userspace;
   23.76 +        struct  xen_ondemand ondemand;
   23.77 +    } u;
   23.78 +};
   23.79 +
   23.80 +struct xen_set_cpufreq_gov {
   23.81 +    char scaling_governor[CPUFREQ_NAME_LEN];
   23.82 +};
   23.83 +
   23.84 +struct xen_set_cpufreq_para {
   23.85 +    #define SCALING_MAX_FREQ           1
   23.86 +    #define SCALING_MIN_FREQ           2
   23.87 +    #define SCALING_SETSPEED           3
   23.88 +    #define SAMPLING_RATE              4
   23.89 +    #define UP_THRESHOLD               5
   23.90 +
   23.91 +    uint32_t ctrl_type;
   23.92 +    uint32_t ctrl_value;
   23.93 +}
   23.94 +;
   23.95 +/* Get physical CPU topology information. */
   23.96 +
   23.97 +
   23.98 +#define INVALID_TOPOLOGY_ID  (~0U)
   23.99 +struct xen_get_cputopo {
  23.100 +     /* IN: maximum addressable entry in
  23.101 +      * the caller-provided cpu_to_core/socket.
  23.102 +      */
  23.103 +    uint32_t max_cpus;
  23.104 +    XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
  23.105 +    XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
  23.106 +
  23.107 +    /* OUT: number of cpus returned
  23.108 +     * If OUT is greater than IN then the cpu_to_core/socket is truncated!
  23.109 +     */
  23.110 +    uint32_t nr_cpus;
  23.111 +};
  23.112 +
  23.113 +struct xen_sysctl_pm_op {
  23.114 +    #define PM_PARA_CATEGORY_MASK      0xf0
  23.115 +    #define CPUFREQ_PARA               0x10
  23.116 +
  23.117 +    /* cpufreq command type */
  23.118 +    #define GET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x01)
  23.119 +    #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
  23.120 +    #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
  23.121 +
  23.122 +    /* get CPU topology */
  23.123 +    #define XEN_SYSCTL_pm_op_get_cputopo  0x20
  23.124 +
  23.125 +    uint32_t cmd;
  23.126 +    uint32_t cpuid;
  23.127 +    union {
  23.128 +        struct xen_get_cpufreq_para get_para;
  23.129 +        struct xen_set_cpufreq_gov  set_gov;
  23.130 +        struct xen_set_cpufreq_para set_para;
  23.131 +        struct xen_get_cputopo      get_topo;
  23.132 +    };
  23.133 +};
  23.134 +
  23.135 +#define XEN_SYSCTL_page_offline_op        14
  23.136 +struct xen_sysctl_page_offline_op {
  23.137 +    /* IN: range of page to be offlined */
  23.138 +#define sysctl_page_offline     1
  23.139 +#define sysctl_page_online      2
  23.140 +#define sysctl_query_page_offline  3
  23.141 +    uint32_t cmd;
  23.142 +    uint32_t start;
  23.143 +    uint32_t end;
  23.144 +    /* OUT: result of page offline request */
  23.145 +    /*
  23.146 +     * bit 0~15: result flags
  23.147 +     * bit 16~31: owner
  23.148 +     */
  23.149 +    XEN_GUEST_HANDLE(uint32) status;
  23.150 +};
  23.151 +
  23.152 +#define PG_OFFLINE_STATUS_MASK    (0xFFUL)
  23.153 +
  23.154 +/* The result is invalid, i.e. HV does not handle it */
  23.155 +#define PG_OFFLINE_INVALID   (0x1UL << 0)
  23.156 +
  23.157 +#define PG_OFFLINE_OFFLINED  (0x1UL << 1)
  23.158 +#define PG_OFFLINE_PENDING   (0x1UL << 2)
  23.159 +#define PG_OFFLINE_FAILED    (0x1UL << 3)
  23.160 +
  23.161 +#define PG_ONLINE_FAILED     PG_OFFLINE_FAILED
  23.162 +#define PG_ONLINE_ONLINED    PG_OFFLINE_OFFLINED
  23.163 +
  23.164 +#define PG_OFFLINE_STATUS_OFFLINED              (0x1UL << 1)
  23.165 +#define PG_OFFLINE_STATUS_ONLINE                (0x1UL << 2)
  23.166 +#define PG_OFFLINE_STATUS_OFFLINE_PENDING       (0x1UL << 3)
  23.167 +#define PG_OFFLINE_STATUS_BROKEN                (0x1UL << 4)
  23.168 +
  23.169 +#define PG_OFFLINE_MISC_MASK    (0xFFUL << 4)
  23.170 +
  23.171 +/* only valid when PG_OFFLINE_FAILED */
  23.172 +#define PG_OFFLINE_XENPAGE   (0x1UL << 8)
  23.173 +#define PG_OFFLINE_DOM0PAGE  (0x1UL << 9)
  23.174 +#define PG_OFFLINE_ANONYMOUS (0x1UL << 10)
  23.175 +#define PG_OFFLINE_NOT_CONV_RAM   (0x1UL << 11)
  23.176 +#define PG_OFFLINE_OWNED     (0x1UL << 12)
  23.177 +
  23.178 +#define PG_OFFLINE_BROKEN    (0x1UL << 13)
  23.179 +#define PG_ONLINE_BROKEN     PG_OFFLINE_BROKEN
  23.180 +
  23.181 +#define PG_OFFLINE_OWNER_SHIFT 16
  23.182  
  23.183  struct xen_sysctl {
  23.184      uint32_t cmd;
  23.185 @@ -289,6 +453,8 @@ struct xen_sysctl {
  23.186          struct xen_sysctl_availheap         availheap;
  23.187          struct xen_sysctl_get_pmstat        get_pmstat;
  23.188          struct xen_sysctl_cpu_hotplug       cpu_hotplug;
  23.189 +        struct xen_sysctl_pm_op             pm_op;
  23.190 +        struct xen_sysctl_page_offline_op   page_offline;
  23.191          uint8_t                             pad[128];
  23.192      } u;
  23.193  };
    24.1 --- a/include/xen/interface/trace.h	Wed Mar 18 15:28:03 2009 +0000
    24.2 +++ b/include/xen/interface/trace.h	Wed Mar 18 15:43:57 2009 +0000
    24.3 @@ -60,7 +60,8 @@
    24.4  #define TRC_TRACE_WRAP_BUFFER  (TRC_GEN + 2)
    24.5  #define TRC_TRACE_CPU_CHANGE    (TRC_GEN + 3)
    24.6  
    24.7 -#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1)
    24.8 +#define TRC_SCHED_RUNSTATE_CHANGE   (TRC_SCHED_MIN + 1)
    24.9 +#define TRC_SCHED_CONTINUE_RUNNING  (TRC_SCHED_MIN + 2)
   24.10  #define TRC_SCHED_DOM_ADD        (TRC_SCHED_VERBOSE +  1)
   24.11  #define TRC_SCHED_DOM_REM        (TRC_SCHED_VERBOSE +  2)
   24.12  #define TRC_SCHED_SLEEP          (TRC_SCHED_VERBOSE +  3)
   24.13 @@ -148,6 +149,7 @@
   24.14  #define TRC_HVM_CLTS            (TRC_HVM_HANDLER + 0x18)
   24.15  #define TRC_HVM_LMSW            (TRC_HVM_HANDLER + 0x19)
   24.16  #define TRC_HVM_LMSW64          (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19)
   24.17 +#define TRC_HVM_INTR_WINDOW     (TRC_HVM_HANDLER + 0X20)
   24.18  
   24.19  /* trace subclasses for power management */
   24.20  #define TRC_PM_FREQ     0x00801000      /* xen cpu freq events */
    25.1 --- a/include/xen/interface/xen.h	Wed Mar 18 15:28:03 2009 +0000
    25.2 +++ b/include/xen/interface/xen.h	Wed Mar 18 15:43:57 2009 +0000
    25.3 @@ -354,6 +354,9 @@ typedef uint16_t domid_t;
    25.4   */
    25.5  #define DOMID_XEN  (0x7FF2U)
    25.6  
    25.7 +/* DOMID_INVALID is used to identity invalid domid */
    25.8 +#define DOMID_INVALID (0x7FFFU)
    25.9 +
   25.10  /*
   25.11   * Send an array of these to HYPERVISOR_mmu_update().
   25.12   * NB. The fields are natural pointer/address size for this architecture.
   25.13 @@ -513,6 +516,7 @@ typedef struct shared_info shared_info_t
   25.14   *      a. relocated kernel image
   25.15   *      b. initial ram disk              [mod_start, mod_len]
   25.16   *      c. list of allocated page frames [mfn_list, nr_pages]
   25.17 + *         (unless relocated due to XEN_ELFNOTE_INIT_P2M)
   25.18   *      d. start_info_t structure        [register ESI (x86)]
   25.19   *      e. bootstrap page tables         [pt_base, CR3 (x86)]
   25.20   *      f. bootstrap stack               [register ESP (x86)]
   25.21 @@ -554,6 +558,9 @@ struct start_info {
   25.22      unsigned long mod_start;    /* VIRTUAL address of pre-loaded module.  */
   25.23      unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
   25.24      int8_t cmd_line[MAX_GUEST_CMDLINE];
   25.25 +    /* The pfn range here covers both page table and p->m table frames.   */
   25.26 +    unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table.    */
   25.27 +    unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table.  */
   25.28  };
   25.29  typedef struct start_info start_info_t;
   25.30