ia64/linux-2.6.18-xen.hg

changeset 646:9c94f6de5e30

Sync xen public headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Aug 13 13:53:31 2008 +0100 (2008-08-13)
parents 359b1e70d9eb
children a5bb490065f6
files include/xen/interface/arch-ia64.h include/xen/interface/arch-x86/xen-mca.h include/xen/interface/arch-x86/xen.h include/xen/interface/hvm/hvm_op.h include/xen/interface/hvm/params.h include/xen/interface/io/fbif.h include/xen/interface/io/fsif.h include/xen/interface/kexec.h include/xen/interface/memory.h include/xen/interface/physdev.h include/xen/interface/trace.h include/xen/interface/xen-compat.h include/xen/interface/xsm/flask_op.h
line diff
     1.1 --- a/include/xen/interface/arch-ia64.h	Wed Aug 13 13:46:14 2008 +0100
     1.2 +++ b/include/xen/interface/arch-ia64.h	Wed Aug 13 13:53:31 2008 +0100
     1.3 @@ -391,6 +391,7 @@ struct vcpu_guest_context_regs {
     1.4  struct vcpu_guest_context {
     1.5  #define VGCF_EXTRA_REGS (1UL << 1)	/* Set extra regs.  */
     1.6  #define VGCF_SET_CR_IRR (1UL << 2)	/* Set cr_irr[0:3]. */
     1.7 +#define VGCF_online     (1UL << 3)  /* make this vcpu online */
     1.8      unsigned long flags;       /* VGCF_* flags */
     1.9  
    1.10      struct vcpu_guest_context_regs regs;
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/include/xen/interface/arch-x86/xen-mca.h	Wed Aug 13 13:53:31 2008 +0100
     2.3 @@ -0,0 +1,279 @@
     2.4 +/******************************************************************************
     2.5 + * arch-x86/mca.h
     2.6 + * 
     2.7 + * Contributed by Advanced Micro Devices, Inc.
     2.8 + * Author: Christoph Egger <Christoph.Egger@amd.com>
     2.9 + *
    2.10 + * Guest OS machine check interface to x86 Xen.
    2.11 + * 
    2.12 + * Permission is hereby granted, free of charge, to any person obtaining a copy
    2.13 + * of this software and associated documentation files (the "Software"), to
    2.14 + * deal in the Software without restriction, including without limitation the
    2.15 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
    2.16 + * sell copies of the Software, and to permit persons to whom the Software is
    2.17 + * furnished to do so, subject to the following conditions:
    2.18 + *
    2.19 + * The above copyright notice and this permission notice shall be included in
    2.20 + * all copies or substantial portions of the Software.
    2.21 + *
    2.22 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    2.23 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    2.24 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    2.25 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    2.26 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    2.27 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    2.28 + * DEALINGS IN THE SOFTWARE.
    2.29 + */
    2.30 +
    2.31 +/* Full MCA functionality has the following Usecases from the guest side:
    2.32 + *
    2.33 + * Must have's:
    2.34 + * 1. Dom0 and DomU register machine check trap callback handlers
    2.35 + *    (already done via "set_trap_table" hypercall)
    2.36 + * 2. Dom0 registers machine check event callback handler
    2.37 + *    (doable via EVTCHNOP_bind_virq)
    2.38 + * 3. Dom0 and DomU fetches machine check data
    2.39 + * 4. Dom0 wants Xen to notify a DomU
    2.40 + * 5. Dom0 gets DomU ID from physical address
    2.41 + * 6. Dom0 wants Xen to kill DomU (already done for "xm destroy")
    2.42 + *
    2.43 + * Nice to have's:
    2.44 + * 7. Dom0 wants Xen to deactivate a physical CPU
    2.45 + *    This is better done as separate task, physical CPU hotplugging,
    2.46 + *    and hypercall(s) should be sysctl's
    2.47 + * 8. Page migration proposed from Xen NUMA work, where Dom0 can tell Xen to
    2.48 + *    move a DomU (or Dom0 itself) away from a malicious page
    2.49 + *    producing correctable errors.
    2.50 + * 9. offlining physical page:
    2.51 + *    Xen free's and never re-uses a certain physical page.
    2.52 + * 10. Testfacility: Allow Dom0 to write values into machine check MSR's
    2.53 + *     and tell Xen to trigger a machine check
    2.54 + */
    2.55 +
    2.56 +#ifndef __XEN_PUBLIC_ARCH_X86_MCA_H__
    2.57 +#define __XEN_PUBLIC_ARCH_X86_MCA_H__
    2.58 +
    2.59 +/* Hypercall */
    2.60 +#define __HYPERVISOR_mca __HYPERVISOR_arch_0
    2.61 +
    2.62 +#define XEN_MCA_INTERFACE_VERSION 0x03000001
    2.63 +
    2.64 +/* IN: Dom0 calls hypercall from MC event handler. */
    2.65 +#define XEN_MC_CORRECTABLE  0x0
    2.66 +/* IN: Dom0/DomU calls hypercall from MC trap handler. */
    2.67 +#define XEN_MC_TRAP         0x1
    2.68 +/* XEN_MC_CORRECTABLE and XEN_MC_TRAP are mutually exclusive. */
    2.69 +
    2.70 +/* OUT: All is ok */
    2.71 +#define XEN_MC_OK           0x0
    2.72 +/* OUT: Domain could not fetch data. */
    2.73 +#define XEN_MC_FETCHFAILED  0x1
    2.74 +/* OUT: There was no machine check data to fetch. */
    2.75 +#define XEN_MC_NODATA       0x2
    2.76 +/* OUT: Between notification time and this hypercall an other
    2.77 + *  (most likely) correctable error happened. The fetched data,
    2.78 + *  does not match the original machine check data. */
    2.79 +#define XEN_MC_NOMATCH      0x4
    2.80 +
    2.81 +/* OUT: DomU did not register MC NMI handler. Try something else. */
    2.82 +#define XEN_MC_CANNOTHANDLE 0x8
    2.83 +/* OUT: Notifying DomU failed. Retry later or try something else. */
    2.84 +#define XEN_MC_NOTDELIVERED 0x10
    2.85 +/* Note, XEN_MC_CANNOTHANDLE and XEN_MC_NOTDELIVERED are mutually exclusive. */
    2.86 +
    2.87 +
    2.88 +#ifndef __ASSEMBLY__
    2.89 +
    2.90 +#define VIRQ_MCA VIRQ_ARCH_0 /* G. (DOM0) Machine Check Architecture */
    2.91 +
    2.92 +/*
    2.93 + * Machine Check Architecure:
    2.94 + * structs are read-only and used to report all kinds of
    2.95 + * correctable and uncorrectable errors detected by the HW.
    2.96 + * Dom0 and DomU: register a handler to get notified.
    2.97 + * Dom0 only: Correctable errors are reported via VIRQ_MCA
    2.98 + * Dom0 and DomU: Uncorrectable errors are reported via nmi handlers
    2.99 + */
   2.100 +#define MC_TYPE_GLOBAL          0
   2.101 +#define MC_TYPE_BANK            1
   2.102 +#define MC_TYPE_EXTENDED        2
   2.103 +
   2.104 +struct mcinfo_common {
   2.105 +    uint16_t type;      /* structure type */
   2.106 +    uint16_t size;      /* size of this struct in bytes */
   2.107 +};
   2.108 +
   2.109 +
   2.110 +#define MC_FLAG_CORRECTABLE     (1 << 0)
   2.111 +#define MC_FLAG_UNCORRECTABLE   (1 << 1)
   2.112 +
   2.113 +/* contains global x86 mc information */
   2.114 +struct mcinfo_global {
   2.115 +    struct mcinfo_common common;
   2.116 +
   2.117 +    /* running domain at the time in error (most likely the impacted one) */
   2.118 +    uint16_t mc_domid;
   2.119 +    uint32_t mc_socketid; /* physical socket of the physical core */
   2.120 +    uint16_t mc_coreid; /* physical impacted core */
   2.121 +    uint16_t mc_core_threadid; /* core thread of physical core */
   2.122 +    uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */
   2.123 +    uint64_t mc_gstatus; /* global status */
   2.124 +    uint32_t mc_flags;
   2.125 +};
   2.126 +
   2.127 +/* contains bank local x86 mc information */
   2.128 +struct mcinfo_bank {
   2.129 +    struct mcinfo_common common;
   2.130 +
   2.131 +    uint16_t mc_bank; /* bank nr */
   2.132 +    uint16_t mc_domid; /* Usecase 5: domain referenced by mc_addr on dom0
   2.133 +                        * and if mc_addr is valid. Never valid on DomU. */
   2.134 +    uint64_t mc_status; /* bank status */
   2.135 +    uint64_t mc_addr;   /* bank address, only valid
   2.136 +                         * if addr bit is set in mc_status */
   2.137 +    uint64_t mc_misc;
   2.138 +};
   2.139 +
   2.140 +
   2.141 +struct mcinfo_msr {
   2.142 +    uint64_t reg;   /* MSR */
   2.143 +    uint64_t value; /* MSR value */
   2.144 +};
   2.145 +
   2.146 +/* contains mc information from other
   2.147 + * or additional mc MSRs */ 
   2.148 +struct mcinfo_extended {
   2.149 +    struct mcinfo_common common;
   2.150 +
   2.151 +    /* You can fill up to five registers.
   2.152 +     * If you need more, then use this structure
   2.153 +     * multiple times. */
   2.154 +
   2.155 +    uint32_t mc_msrs; /* Number of msr with valid values. */
   2.156 +    struct mcinfo_msr mc_msr[5];
   2.157 +};
   2.158 +
   2.159 +#define MCINFO_HYPERCALLSIZE	1024
   2.160 +#define MCINFO_MAXSIZE		768
   2.161 +
   2.162 +struct mc_info {
   2.163 +    /* Number of mcinfo_* entries in mi_data */
   2.164 +    uint32_t mi_nentries;
   2.165 +
   2.166 +    uint8_t mi_data[MCINFO_MAXSIZE - sizeof(uint32_t)];
   2.167 +};
   2.168 +typedef struct mc_info mc_info_t;
   2.169 +
   2.170 +
   2.171 +
   2.172 +/* 
   2.173 + * OS's should use these instead of writing their own lookup function
   2.174 + * each with its own bugs and drawbacks.
   2.175 + * We use macros instead of static inline functions to allow guests
   2.176 + * to include this header in assembly files (*.S).
   2.177 + */
   2.178 +/* Prototype:
   2.179 + *    uint32_t x86_mcinfo_nentries(struct mc_info *mi);
   2.180 + */
   2.181 +#define x86_mcinfo_nentries(_mi)    \
   2.182 +    (_mi)->mi_nentries
   2.183 +/* Prototype:
   2.184 + *    struct mcinfo_common *x86_mcinfo_first(struct mc_info *mi);
   2.185 + */
   2.186 +#define x86_mcinfo_first(_mi)       \
   2.187 +    (struct mcinfo_common *)((_mi)->mi_data)
   2.188 +/* Prototype:
   2.189 + *    struct mcinfo_common *x86_mcinfo_next(struct mcinfo_common *mic);
   2.190 + */
   2.191 +#define x86_mcinfo_next(_mic)       \
   2.192 +    (struct mcinfo_common *)((uint8_t *)(_mic) + (_mic)->size)
   2.193 +
   2.194 +/* Prototype:
   2.195 + *    void x86_mcinfo_lookup(void *ret, struct mc_info *mi, uint16_t type);
   2.196 + */
   2.197 +#define x86_mcinfo_lookup(_ret, _mi, _type)    \
   2.198 +    do {                                                        \
   2.199 +        uint32_t found, i;                                      \
   2.200 +        struct mcinfo_common *_mic;                             \
   2.201 +                                                                \
   2.202 +        found = 0;                                              \
   2.203 +	(_ret) = NULL;						\
   2.204 +	if (_mi == NULL) break;					\
   2.205 +        _mic = x86_mcinfo_first(_mi);                           \
   2.206 +        for (i = 0; i < x86_mcinfo_nentries(_mi); i++) {        \
   2.207 +            if (_mic->type == (_type)) {                        \
   2.208 +                found = 1;                                      \
   2.209 +                break;                                          \
   2.210 +            }                                                   \
   2.211 +            _mic = x86_mcinfo_next(_mic);                       \
   2.212 +        }                                                       \
   2.213 +        (_ret) = found ? _mic : NULL;                           \
   2.214 +    } while (0)
   2.215 +
   2.216 +
   2.217 +/* Usecase 1
   2.218 + * Register machine check trap callback handler
   2.219 + *    (already done via "set_trap_table" hypercall)
   2.220 + */
   2.221 +
   2.222 +/* Usecase 2
   2.223 + * Dom0 registers machine check event callback handler
   2.224 + * done by EVTCHNOP_bind_virq
   2.225 + */
   2.226 +
   2.227 +/* Usecase 3
   2.228 + * Fetch machine check data from hypervisor.
   2.229 + * Note, this hypercall is special, because both Dom0 and DomU must use this.
   2.230 + */
   2.231 +#define XEN_MC_fetch            1
   2.232 +struct xen_mc_fetch {
   2.233 +    /* IN/OUT variables. */
   2.234 +    uint32_t flags;
   2.235 +
   2.236 +/* IN: XEN_MC_CORRECTABLE, XEN_MC_TRAP */
   2.237 +/* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED, XEN_MC_NODATA, XEN_MC_NOMATCH */
   2.238 +
   2.239 +    /* OUT variables. */
   2.240 +    uint32_t fetch_idx;  /* only useful for Dom0 for the notify hypercall */
   2.241 +    struct mc_info mc_info;
   2.242 +};
   2.243 +typedef struct xen_mc_fetch xen_mc_fetch_t;
   2.244 +DEFINE_XEN_GUEST_HANDLE(xen_mc_fetch_t);
   2.245 +
   2.246 +
   2.247 +/* Usecase 4
   2.248 + * This tells the hypervisor to notify a DomU about the machine check error
   2.249 + */
   2.250 +#define XEN_MC_notifydomain     2
   2.251 +struct xen_mc_notifydomain {
   2.252 +    /* IN variables. */
   2.253 +    uint16_t mc_domid;    /* The unprivileged domain to notify. */
   2.254 +    uint16_t mc_vcpuid;   /* The vcpu in mc_domid to notify.
   2.255 +                           * Usually echo'd value from the fetch hypercall. */
   2.256 +    uint32_t fetch_idx;   /* echo'd value from the fetch hypercall. */
   2.257 +
   2.258 +    /* IN/OUT variables. */
   2.259 +    uint32_t flags;
   2.260 +
   2.261 +/* IN: XEN_MC_CORRECTABLE, XEN_MC_TRAP */
   2.262 +/* OUT: XEN_MC_OK, XEN_MC_CANNOTHANDLE, XEN_MC_NOTDELIVERED, XEN_MC_NOMATCH */
   2.263 +};
   2.264 +typedef struct xen_mc_notifydomain xen_mc_notifydomain_t;
   2.265 +DEFINE_XEN_GUEST_HANDLE(xen_mc_notifydomain_t);
   2.266 +
   2.267 +
   2.268 +struct xen_mc {
   2.269 +    uint32_t cmd;
   2.270 +    uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */
   2.271 +    union {
   2.272 +        struct xen_mc_fetch        mc_fetch;
   2.273 +        struct xen_mc_notifydomain mc_notifydomain;
   2.274 +        uint8_t pad[MCINFO_HYPERCALLSIZE];
   2.275 +    } u;
   2.276 +};
   2.277 +typedef struct xen_mc xen_mc_t;
   2.278 +DEFINE_XEN_GUEST_HANDLE(xen_mc_t);
   2.279 +
   2.280 +#endif /* __ASSEMBLY__ */
   2.281 +
   2.282 +#endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */
     3.1 --- a/include/xen/interface/arch-x86/xen.h	Wed Aug 13 13:46:14 2008 +0100
     3.2 +++ b/include/xen/interface/arch-x86/xen.h	Wed Aug 13 13:53:31 2008 +0100
     3.3 @@ -76,6 +76,10 @@ typedef unsigned long xen_pfn_t;
     3.4  /* Maximum number of virtual CPUs in multi-processor guests. */
     3.5  #define MAX_VIRT_CPUS 32
     3.6  
     3.7 +
     3.8 +/* Machine check support */
     3.9 +#include "xen-mca.h"
    3.10 +
    3.11  #ifndef __ASSEMBLY__
    3.12  
    3.13  typedef unsigned long xen_ulong_t;
     4.1 --- a/include/xen/interface/hvm/hvm_op.h	Wed Aug 13 13:46:14 2008 +0100
     4.2 +++ b/include/xen/interface/hvm/hvm_op.h	Wed Aug 13 13:53:31 2008 +0100
     4.3 @@ -92,6 +92,40 @@ struct xen_hvm_track_dirty_vram {
     4.4  typedef struct xen_hvm_track_dirty_vram xen_hvm_track_dirty_vram_t;
     4.5  DEFINE_XEN_GUEST_HANDLE(xen_hvm_track_dirty_vram_t);
     4.6  
     4.7 +/* Notify that some pages got modified by the Device Model. */
     4.8 +#define HVMOP_modified_memory    7
     4.9 +struct xen_hvm_modified_memory {
    4.10 +    /* Domain to be updated. */
    4.11 +    domid_t  domid;
    4.12 +    /* First pfn. */
    4.13 +    uint64_aligned_t first_pfn;
    4.14 +    /* Number of pages. */
    4.15 +    uint64_aligned_t nr;
    4.16 +};
    4.17 +typedef struct xen_hvm_modified_memory xen_hvm_modified_memory_t;
    4.18 +DEFINE_XEN_GUEST_HANDLE(xen_hvm_modified_memory_t);
    4.19 +
    4.20 +#define HVMOP_set_mem_type    8
    4.21 +typedef enum {
    4.22 +    HVMMEM_ram_rw,             /* Normal read/write guest RAM */
    4.23 +    HVMMEM_ram_ro,             /* Read-only; writes are discarded */
    4.24 +    HVMMEM_mmio_dm,            /* Reads and write go to the device model */
    4.25 +} hvmmem_type_t;
    4.26 +/* Notify that a region of memory is to be treated in a specific way. */
    4.27 +struct xen_hvm_set_mem_type {
    4.28 +    /* Domain to be updated. */
    4.29 +    domid_t domid;
    4.30 +    /* Memory type */
    4.31 +    hvmmem_type_t hvmmem_type;
    4.32 +    /* First pfn. */
    4.33 +    uint64_aligned_t first_pfn;
    4.34 +    /* Number of pages. */
    4.35 +    uint64_aligned_t nr;
    4.36 +};
    4.37 +typedef struct xen_hvm_set_mem_type xen_hvm_set_mem_type_t;
    4.38 +DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_mem_type_t);
    4.39 +
    4.40 +
    4.41  #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
    4.42  
    4.43  #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
     5.1 --- a/include/xen/interface/hvm/params.h	Wed Aug 13 13:46:14 2008 +0100
     5.2 +++ b/include/xen/interface/hvm/params.h	Wed Aug 13 13:53:31 2008 +0100
     5.3 @@ -90,6 +90,9 @@
     5.4  /* Device Model domain, defaults to 0. */
     5.5  #define HVM_PARAM_DM_DOMAIN    13
     5.6  
     5.7 -#define HVM_NR_PARAMS          14
     5.8 +/* ACPI S state: currently support S0 and S3 on x86. */
     5.9 +#define HVM_PARAM_ACPI_S_STATE 14
    5.10 +
    5.11 +#define HVM_NR_PARAMS          15
    5.12  
    5.13  #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
     6.1 --- a/include/xen/interface/io/fbif.h	Wed Aug 13 13:46:14 2008 +0100
     6.2 +++ b/include/xen/interface/io/fbif.h	Wed Aug 13 13:53:31 2008 +0100
     6.3 @@ -80,14 +80,33 @@ union xenfb_out_event
     6.4  
     6.5  /*
     6.6   * Frontends should ignore unknown in events.
     6.7 - * No in events currently defined.
     6.8   */
     6.9  
    6.10 +/*
    6.11 + * Framebuffer refresh period advice
    6.12 + * Backend sends it to advise the frontend their preferred period of
    6.13 + * refresh.  Frontends that keep the framebuffer constantly up-to-date
    6.14 + * just ignore it.  Frontends that use the advice should immediately
    6.15 + * refresh the framebuffer (and send an update notification event if
    6.16 + * those have been requested), then use the update frequency to guide
    6.17 + * their periodical refreshs.
    6.18 + */
    6.19 +#define XENFB_TYPE_REFRESH_PERIOD 1
    6.20 +#define XENFB_NO_REFRESH 0
    6.21 +
    6.22 +struct xenfb_refresh_period
    6.23 +{
    6.24 +    uint8_t type;    /* XENFB_TYPE_UPDATE_PERIOD */
    6.25 +    uint32_t period; /* period of refresh, in ms,
    6.26 +                      * XENFB_NO_REFRESH if no refresh is needed */
    6.27 +};
    6.28 +
    6.29  #define XENFB_IN_EVENT_SIZE 40
    6.30  
    6.31  union xenfb_in_event
    6.32  {
    6.33      uint8_t type;
    6.34 +    struct xenfb_refresh_period refresh_period;
    6.35      char pad[XENFB_IN_EVENT_SIZE];
    6.36  };
    6.37  
     7.1 --- a/include/xen/interface/io/fsif.h	Wed Aug 13 13:46:14 2008 +0100
     7.2 +++ b/include/xen/interface/io/fsif.h	Wed Aug 13 13:53:31 2008 +0100
     7.3 @@ -21,7 +21,7 @@
     7.4   * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     7.5   * DEALINGS IN THE SOFTWARE.
     7.6   *
     7.7 - * Copyright (c) 2007, Grzegorz Milos, Sun Microsystems, Inc.  
     7.8 + * Copyright (c) 2007, Grzegorz Milos, <gm281@cam.ac.uk>.
     7.9   */
    7.10  
    7.11  #ifndef __XEN_PUBLIC_IO_FSIF_H__
    7.12 @@ -54,30 +54,31 @@ struct fsif_close_request {
    7.13  
    7.14  struct fsif_read_request {
    7.15      uint32_t fd;
    7.16 -    grant_ref_t gref;
    7.17 +    int32_t pad;
    7.18      uint64_t len;
    7.19      uint64_t offset;
    7.20 +    grant_ref_t grefs[1];  /* Variable length */
    7.21  };
    7.22  
    7.23  struct fsif_write_request {
    7.24      uint32_t fd;
    7.25 -    grant_ref_t gref;
    7.26 +    int32_t pad;
    7.27      uint64_t len;
    7.28      uint64_t offset;
    7.29 +    grant_ref_t grefs[1];  /* Variable length */
    7.30  };
    7.31  
    7.32  struct fsif_stat_request {
    7.33      uint32_t fd;
    7.34 -    grant_ref_t gref;
    7.35  };
    7.36  
    7.37 -/* This structure is a copy of some fields from stat structure, writen to the
    7.38 - * granted page. */
    7.39 +/* This structure is a copy of some fields from stat structure, returned
    7.40 + * via the ring. */
    7.41  struct fsif_stat_response {
    7.42      int32_t  stat_mode;
    7.43      uint32_t stat_uid;
    7.44      uint32_t stat_gid;
    7.45 -    int32_t  pad;
    7.46 +    int32_t  stat_ret;
    7.47      int64_t  stat_size;
    7.48      int64_t  stat_atime;
    7.49      int64_t  stat_mtime;
    7.50 @@ -165,11 +166,20 @@ struct fsif_response {
    7.51      uint16_t id;
    7.52      uint16_t pad1;
    7.53      uint32_t pad2;
    7.54 -    uint64_t ret_val;
    7.55 +    union {
    7.56 +        uint64_t ret_val;
    7.57 +        struct fsif_stat_response fstat;
    7.58 +    };
    7.59  };
    7.60  
    7.61  typedef struct fsif_response fsif_response_t;
    7.62  
    7.63 +#define FSIF_RING_ENTRY_SIZE   64
    7.64 +
    7.65 +#define FSIF_NR_READ_GNTS  ((FSIF_RING_ENTRY_SIZE - sizeof(struct fsif_read_request)) /  \
    7.66 +                                sizeof(grant_ref_t) + 1)
    7.67 +#define FSIF_NR_WRITE_GNTS ((FSIF_RING_ENTRY_SIZE - sizeof(struct fsif_write_request)) / \
    7.68 +                                sizeof(grant_ref_t) + 1)
    7.69  
    7.70  DEFINE_RING_TYPES(fsif, struct fsif_request, struct fsif_response);
    7.71  
     8.1 --- a/include/xen/interface/kexec.h	Wed Aug 13 13:46:14 2008 +0100
     8.2 +++ b/include/xen/interface/kexec.h	Wed Aug 13 13:53:31 2008 +0100
     8.3 @@ -140,9 +140,6 @@ typedef struct xen_kexec_load {
     8.4                                       * of the EFI Memory Map */
     8.5  #define KEXEC_RANGE_MA_VMCOREINFO 6 /* machine address and size of vmcoreinfo */
     8.6  
     8.7 -extern size_t vmcoreinfo_size_xen;
     8.8 -extern unsigned long paddr_vmcoreinfo_xen;
     8.9 -
    8.10  /*
    8.11   * Find the address and size of certain memory areas
    8.12   * range == KEXEC_RANGE_... [in]
    8.13 @@ -158,6 +155,27 @@ typedef struct xen_kexec_range {
    8.14      unsigned long start;
    8.15  } xen_kexec_range_t;
    8.16  
    8.17 +/* vmcoreinfo stuff */
    8.18 +#define VMCOREINFO_BYTES           (4096)
    8.19 +#define VMCOREINFO_NOTE_NAME       "VMCOREINFO_XEN"
    8.20 +void arch_crash_save_vmcoreinfo(void);
    8.21 +void vmcoreinfo_append_str(const char *fmt, ...)
    8.22 +       __attribute__ ((format (printf, 1, 2)));
    8.23 +#define VMCOREINFO_PAGESIZE(value) \
    8.24 +       vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
    8.25 +#define VMCOREINFO_SYMBOL(name) \
    8.26 +       vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
    8.27 +#define VMCOREINFO_SYMBOL_ALIAS(alias, name) \
    8.28 +       vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #alias, (unsigned long)&name)
    8.29 +#define VMCOREINFO_STRUCT_SIZE(name) \
    8.30 +       vmcoreinfo_append_str("SIZE(%s)=%zu\n", #name, sizeof(struct name))
    8.31 +#define VMCOREINFO_OFFSET(name, field) \
    8.32 +       vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
    8.33 +                             (unsigned long)offsetof(struct name, field))
    8.34 +#define VMCOREINFO_OFFSET_ALIAS(name, field, alias) \
    8.35 +       vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #alias, \
    8.36 +                             (unsigned long)offsetof(struct name, field))
    8.37 +
    8.38  #endif /* _XEN_PUBLIC_KEXEC_H */
    8.39  
    8.40  /*
     9.1 --- a/include/xen/interface/memory.h	Wed Aug 13 13:46:14 2008 +0100
     9.2 +++ b/include/xen/interface/memory.h	Wed Aug 13 13:53:31 2008 +0100
     9.3 @@ -35,6 +35,21 @@
     9.4  #define XENMEM_increase_reservation 0
     9.5  #define XENMEM_decrease_reservation 1
     9.6  #define XENMEM_populate_physmap     6
     9.7 +
     9.8 +#if __XEN_INTERFACE_VERSION__ >= 0x00030209
     9.9 +/*
    9.10 + * Maximum # bits addressable by the user of the allocated region (e.g., I/O 
    9.11 + * devices often have a 32-bit limitation even in 64-bit systems). If zero 
    9.12 + * then the user has no addressing restriction. This field is not used by 
    9.13 + * XENMEM_decrease_reservation.
    9.14 + */
    9.15 +#define XENMEMF_address_bits(x)     (x)
    9.16 +#define XENMEMF_get_address_bits(x) ((x) & 0xffu)
    9.17 +/* NUMA node to allocate from. */
    9.18 +#define XENMEMF_node(x)     (((x) + 1) << 8)
    9.19 +#define XENMEMF_get_node(x) ((((x) >> 8) - 1) & 0xffu)
    9.20 +#endif
    9.21 +
    9.22  struct xen_memory_reservation {
    9.23  
    9.24      /*
    9.25 @@ -53,13 +68,12 @@ struct xen_memory_reservation {
    9.26      xen_ulong_t    nr_extents;
    9.27      unsigned int   extent_order;
    9.28  
    9.29 -    /*
    9.30 -     * Maximum # bits addressable by the user of the allocated region (e.g., 
    9.31 -     * I/O devices often have a 32-bit limitation even in 64-bit systems). If 
    9.32 -     * zero then the user has no addressing restriction.
    9.33 -     * This field is not used by XENMEM_decrease_reservation.
    9.34 -     */
    9.35 +#if __XEN_INTERFACE_VERSION__ >= 0x00030209
    9.36 +    /* XENMEMF flags. */
    9.37 +    unsigned int   mem_flags;
    9.38 +#else
    9.39      unsigned int   address_bits;
    9.40 +#endif
    9.41  
    9.42      /*
    9.43       * Domain whose reservation is being changed.
    10.1 --- a/include/xen/interface/physdev.h	Wed Aug 13 13:46:14 2008 +0100
    10.2 +++ b/include/xen/interface/physdev.h	Wed Aug 13 13:53:31 2008 +0100
    10.3 @@ -121,7 +121,7 @@ struct physdev_irq {
    10.4  };
    10.5  typedef struct physdev_irq physdev_irq_t;
    10.6  DEFINE_XEN_GUEST_HANDLE(physdev_irq_t);
    10.7 -
    10.8 + 
    10.9  #define MAP_PIRQ_TYPE_MSI               0x0
   10.10  #define MAP_PIRQ_TYPE_GSI               0x1
   10.11  #define MAP_PIRQ_TYPE_UNKNOWN           0x2
   10.12 @@ -163,7 +163,7 @@ struct physdev_manage_pci {
   10.13      /* IN */
   10.14      uint8_t bus;
   10.15      uint8_t devfn;
   10.16 -};
   10.17 +}; 
   10.18  
   10.19  typedef struct physdev_manage_pci physdev_manage_pci_t;
   10.20  DEFINE_XEN_GUEST_HANDLE(physdev_manage_pci_t);
    11.1 --- a/include/xen/interface/trace.h	Wed Aug 13 13:46:14 2008 +0100
    11.2 +++ b/include/xen/interface/trace.h	Wed Aug 13 13:53:31 2008 +0100
    11.3 @@ -87,21 +87,25 @@
    11.4  #define TRC_PV_PTWR_EMULATION        (TRC_PV + 11)
    11.5  #define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV + 12)
    11.6    /* Indicates that addresses in trace record are 64 bits */
    11.7 -#define TRC_PV_64_FLAG               (0x100) 
    11.8 +#define TRC_64_FLAG               (0x100) 
    11.9  
   11.10  /* trace events per subclass */
   11.11  #define TRC_HVM_VMENTRY         (TRC_HVM_ENTRYEXIT + 0x01)
   11.12  #define TRC_HVM_VMEXIT          (TRC_HVM_ENTRYEXIT + 0x02)
   11.13 -#define TRC_HVM_VMEXIT64        (TRC_HVM_ENTRYEXIT + 0x03)
   11.14 +#define TRC_HVM_VMEXIT64        (TRC_HVM_ENTRYEXIT + TRC_64_FLAG + 0x02)
   11.15  #define TRC_HVM_PF_XEN          (TRC_HVM_HANDLER + 0x01)
   11.16 +#define TRC_HVM_PF_XEN64        (TRC_HVM_HANDLER + TRC_64_FLAG + 0x01)
   11.17  #define TRC_HVM_PF_INJECT       (TRC_HVM_HANDLER + 0x02)
   11.18 +#define TRC_HVM_PF_INJECT64     (TRC_HVM_HANDLER + TRC_64_FLAG + 0x02)
   11.19  #define TRC_HVM_INJ_EXC         (TRC_HVM_HANDLER + 0x03)
   11.20  #define TRC_HVM_INJ_VIRQ        (TRC_HVM_HANDLER + 0x04)
   11.21  #define TRC_HVM_REINJ_VIRQ      (TRC_HVM_HANDLER + 0x05)
   11.22  #define TRC_HVM_IO_READ         (TRC_HVM_HANDLER + 0x06)
   11.23  #define TRC_HVM_IO_WRITE        (TRC_HVM_HANDLER + 0x07)
   11.24  #define TRC_HVM_CR_READ         (TRC_HVM_HANDLER + 0x08)
   11.25 +#define TRC_HVM_CR_READ64       (TRC_HVM_HANDLER + TRC_64_FLAG + 0x08)
   11.26  #define TRC_HVM_CR_WRITE        (TRC_HVM_HANDLER + 0x09)
   11.27 +#define TRC_HVM_CR_WRITE64      (TRC_HVM_HANDLER + TRC_64_FLAG + 0x09)
   11.28  #define TRC_HVM_DR_READ         (TRC_HVM_HANDLER + 0x0A)
   11.29  #define TRC_HVM_DR_WRITE        (TRC_HVM_HANDLER + 0x0B)
   11.30  #define TRC_HVM_MSR_READ        (TRC_HVM_HANDLER + 0x0C)
   11.31 @@ -113,12 +117,13 @@
   11.32  #define TRC_HVM_VMMCALL         (TRC_HVM_HANDLER + 0x12)
   11.33  #define TRC_HVM_HLT             (TRC_HVM_HANDLER + 0x13)
   11.34  #define TRC_HVM_INVLPG          (TRC_HVM_HANDLER + 0x14)
   11.35 +#define TRC_HVM_INVLPG64        (TRC_HVM_HANDLER + TRC_64_FLAG + 0x14)
   11.36  #define TRC_HVM_MCE             (TRC_HVM_HANDLER + 0x15)
   11.37  #define TRC_HVM_IO_ASSIST       (TRC_HVM_HANDLER + 0x16)
   11.38  #define TRC_HVM_MMIO_ASSIST     (TRC_HVM_HANDLER + 0x17)
   11.39  #define TRC_HVM_CLTS            (TRC_HVM_HANDLER + 0x18)
   11.40  #define TRC_HVM_LMSW            (TRC_HVM_HANDLER + 0x19)
   11.41 -#define TRC_HVM_PF_XEN64        (TRC_HVM_HANDLER + 0x20)
   11.42 +#define TRC_HVM_LMSW64          (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19)
   11.43  
   11.44  /* This structure represents a single trace buffer record. */
   11.45  struct t_rec {
    12.1 --- a/include/xen/interface/xen-compat.h	Wed Aug 13 13:46:14 2008 +0100
    12.2 +++ b/include/xen/interface/xen-compat.h	Wed Aug 13 13:53:31 2008 +0100
    12.3 @@ -27,7 +27,7 @@
    12.4  #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
    12.5  #define __XEN_PUBLIC_XEN_COMPAT_H__
    12.6  
    12.7 -#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030208
    12.8 +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030209
    12.9  
   12.10  #if defined(__XEN__) || defined(__XEN_TOOLS__)
   12.11  /* Xen is built with matching headers and implements the latest interface. */
    13.1 --- a/include/xen/interface/xsm/flask_op.h	Wed Aug 13 13:46:14 2008 +0100
    13.2 +++ b/include/xen/interface/xsm/flask_op.h	Wed Aug 13 13:53:31 2008 +0100
    13.3 @@ -32,10 +32,12 @@
    13.4  #define FLASK_AVC_CACHESTATS    19
    13.5  #define FLASK_MEMBER            20
    13.6  
    13.7 +#define FLASK_LAST              FLASK_MEMBER
    13.8 +
    13.9  typedef struct flask_op {
   13.10 -    int   cmd;
   13.11 -    int   size;
   13.12 -    char *buf;
   13.13 +    uint32_t  cmd;
   13.14 +    uint32_t  size;
   13.15 +    char      *buf;
   13.16  } flask_op_t;
   13.17  
   13.18  DEFINE_XEN_GUEST_HANDLE(flask_op_t);