ia64/linux-2.6.18-xen.hg

changeset 873:57acc535fd37

Sync Xen public headers with 3.4.0 release.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon May 18 14:14:15 2009 +0100 (2009-05-18)
parents 84d9b28550f6
children 68d582b0ad05
files include/xen/interface/arch-x86/xen-mca.h include/xen/interface/arch-x86/xen.h include/xen/interface/domctl.h include/xen/interface/sysctl.h include/xen/interface/trace.h include/xen/interface/xen.h
line diff
     1.1 --- a/include/xen/interface/arch-x86/xen-mca.h	Mon May 18 13:21:07 2009 +0100
     1.2 +++ b/include/xen/interface/arch-x86/xen-mca.h	Mon May 18 14:14:15 2009 +0100
     1.3 @@ -62,7 +62,7 @@
     1.4   * choose a different version number range that is numerically less
     1.5   * than that used in xen-unstable.
     1.6   */
     1.7 -#define XEN_MCA_INTERFACE_VERSION 0x01ecc002
     1.8 +#define XEN_MCA_INTERFACE_VERSION 0x01ecc003
     1.9  
    1.10  /* IN: Dom0 calls hypercall to retrieve nonurgent telemetry */
    1.11  #define XEN_MC_NONURGENT  0x0001
    1.12 @@ -104,6 +104,7 @@
    1.13  #define MC_TYPE_GLOBAL          0
    1.14  #define MC_TYPE_BANK            1
    1.15  #define MC_TYPE_EXTENDED        2
    1.16 +#define MC_TYPE_RECOVERY        3
    1.17  
    1.18  struct mcinfo_common {
    1.19      uint16_t type;      /* structure type */
    1.20 @@ -124,13 +125,13 @@ struct mcinfo_global {
    1.21  
    1.22      /* running domain at the time in error (most likely the impacted one) */
    1.23      uint16_t mc_domid;
    1.24 +    uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */
    1.25      uint32_t mc_socketid; /* physical socket of the physical core */
    1.26      uint16_t mc_coreid; /* physical impacted core */
    1.27 -    uint32_t mc_apicid;
    1.28      uint16_t mc_core_threadid; /* core thread of physical core */
    1.29 -    uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */
    1.30 +    uint32_t mc_apicid;
    1.31 +    uint32_t mc_flags;
    1.32      uint64_t mc_gstatus; /* global status */
    1.33 -    uint32_t mc_flags;
    1.34  };
    1.35  
    1.36  /* contains bank local x86 mc information */
    1.37 @@ -165,21 +166,78 @@ struct mcinfo_extended {
    1.38  
    1.39      uint32_t mc_msrs; /* Number of msr with valid values. */
    1.40      /*
    1.41 -     * Currently Intel extended MSR (32/64) including all gp registers
    1.42 -     * and E(R)DI, E(R)BP, E(R)SP, E(R)FLAGS, E(R)IP, E(R)MISC, only 10
    1.43 -     * of them might be useful. So expend this array to 10.
    1.44 -    */
    1.45 -    struct mcinfo_msr mc_msr[10];
    1.46 +     * Currently Intel extended MSR (32/64) include all gp registers
    1.47 +     * and E(R)FLAGS, E(R)IP, E(R)MISC, up to 11/19 of them might be
    1.48 +     * useful at present. So expand this array to 16/32 to leave room.
    1.49 +     */
    1.50 +    struct mcinfo_msr mc_msr[sizeof(void *) * 4];
    1.51  };
    1.52  
    1.53 +/* Recovery Action flags. Giving recovery result information to DOM0 */
    1.54 +
    1.55 +/* Xen takes successful recovery action, the error is recovered */
    1.56 +#define REC_ACTION_RECOVERED (0x1 << 0)
    1.57 +/* No action is performed by XEN */
    1.58 +#define REC_ACTION_NONE (0x1 << 1)
    1.59 +/* It's possible DOM0 might take action ownership in some case */
    1.60 +#define REC_ACTION_NEED_RESET (0x1 << 2)
    1.61 +
    1.62 +/* Different Recovery Action types, if the action is performed successfully,
    1.63 + * REC_ACTION_RECOVERED flag will be returned.
    1.64 + */
    1.65 +
    1.66 +/* Page Offline Action */
    1.67 +#define MC_ACTION_PAGE_OFFLINE (0x1 << 0)
    1.68 +/* CPU offline Action */
    1.69 +#define MC_ACTION_CPU_OFFLINE (0x1 << 1)
    1.70 +/* L3 cache disable Action */
    1.71 +#define MC_ACTION_CACHE_SHRINK (0x1 << 2)
    1.72 +
    1.73 +/* Below interface used between XEN/DOM0 for passing XEN's recovery action 
    1.74 + * information to DOM0. 
    1.75 + * usage Senario: After offlining broken page, XEN might pass its page offline
    1.76 + * recovery action result to DOM0. DOM0 will save the information in 
    1.77 + * non-volatile memory for further proactive actions, such as offlining the
    1.78 + * easy broken page earlier when doing next reboot.
    1.79 +*/
    1.80 +struct page_offline_action
    1.81 +{
    1.82 +    /* Params for passing the offlined page number to DOM0 */
    1.83 +    uint64_t mfn;
    1.84 +    uint64_t status;
    1.85 +};
    1.86 +
    1.87 +struct cpu_offline_action
    1.88 +{
    1.89 +    /* Params for passing the identity of the offlined CPU to DOM0 */
    1.90 +    uint32_t mc_socketid;
    1.91 +    uint16_t mc_coreid;
    1.92 +    uint16_t mc_core_threadid;
    1.93 +};
    1.94 +
    1.95 +#define MAX_UNION_SIZE 16
    1.96 +struct mcinfo_recovery
    1.97 +{
    1.98 +    struct mcinfo_common common;
    1.99 +    uint16_t mc_bank; /* bank nr */
   1.100 +    uint8_t action_flags;
   1.101 +    uint8_t action_types;
   1.102 +    union {
   1.103 +        struct page_offline_action page_retire;
   1.104 +        struct cpu_offline_action cpu_offline;
   1.105 +        uint8_t pad[MAX_UNION_SIZE];
   1.106 +    } action_info;
   1.107 +};
   1.108 +
   1.109 +
   1.110  #define MCINFO_HYPERCALLSIZE	1024
   1.111  #define MCINFO_MAXSIZE		768
   1.112  
   1.113  struct mc_info {
   1.114      /* Number of mcinfo_* entries in mi_data */
   1.115      uint32_t mi_nentries;
   1.116 -
   1.117 -    uint8_t mi_data[MCINFO_MAXSIZE - sizeof(uint32_t)];
   1.118 +    uint32_t _pad0;
   1.119 +    uint64_t mi_data[(MCINFO_MAXSIZE - 1) / 8];
   1.120  };
   1.121  typedef struct mc_info mc_info_t;
   1.122  DEFINE_XEN_GUEST_HANDLE(mc_info_t);
   1.123 @@ -195,7 +253,7 @@ DEFINE_XEN_GUEST_HANDLE(mc_info_t);
   1.124  #define MC_CAPS_VIA	5	/* cpuid level 0xc0000001 */
   1.125  #define MC_CAPS_AMD_ECX	6	/* cpuid level 0x80000001 (%ecx) */
   1.126  
   1.127 -typedef struct mcinfo_logical_cpu {
   1.128 +struct mcinfo_logical_cpu {
   1.129      uint32_t mc_cpunr;          
   1.130      uint32_t mc_chipid; 
   1.131      uint16_t mc_coreid;
   1.132 @@ -217,7 +275,8 @@ typedef struct mcinfo_logical_cpu {
   1.133      uint32_t mc_cache_alignment;
   1.134      int32_t mc_nmsrvals;
   1.135      struct mcinfo_msr mc_msrvalues[__MC_MSR_ARRAYSIZE];
   1.136 -} xen_mc_logical_cpu_t;
   1.137 +};
   1.138 +typedef struct mcinfo_logical_cpu xen_mc_logical_cpu_t;
   1.139  DEFINE_XEN_GUEST_HANDLE(xen_mc_logical_cpu_t);
   1.140  
   1.141  
   1.142 @@ -236,12 +295,12 @@ DEFINE_XEN_GUEST_HANDLE(xen_mc_logical_c
   1.143   *    struct mcinfo_common *x86_mcinfo_first(struct mc_info *mi);
   1.144   */
   1.145  #define x86_mcinfo_first(_mi)       \
   1.146 -    (struct mcinfo_common *)((_mi)->mi_data)
   1.147 +    ((struct mcinfo_common *)(_mi)->mi_data)
   1.148  /* Prototype:
   1.149   *    struct mcinfo_common *x86_mcinfo_next(struct mcinfo_common *mic);
   1.150   */
   1.151  #define x86_mcinfo_next(_mic)       \
   1.152 -    (struct mcinfo_common *)((uint8_t *)(_mic) + (_mic)->size)
   1.153 +    ((struct mcinfo_common *)((uint8_t *)(_mic) + (_mic)->size))
   1.154  
   1.155  /* Prototype:
   1.156   *    void x86_mcinfo_lookup(void *ret, struct mc_info *mi, uint16_t type);
   1.157 @@ -287,6 +346,7 @@ struct xen_mc_fetch {
   1.158                             XEN_MC_ACK if ack'ing an earlier fetch */
   1.159  			/* OUT: XEN_MC_OK, XEN_MC_FETCHFAILED,
   1.160  			   XEN_MC_NODATA, XEN_MC_NOMATCH */
   1.161 +    uint32_t _pad0;
   1.162      uint64_t fetch_id;	/* OUT: id for ack, IN: id we are ack'ing */
   1.163  
   1.164      /* OUT variables. */
   1.165 @@ -319,7 +379,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_mc_notifydom
   1.166  struct xen_mc_physcpuinfo {
   1.167  	/* IN/OUT */
   1.168  	uint32_t ncpus;
   1.169 -	uint32_t pad0;
   1.170 +	uint32_t _pad0;
   1.171  	/* OUT */
   1.172  	XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info;
   1.173  };
   1.174 @@ -328,10 +388,10 @@ struct xen_mc_physcpuinfo {
   1.175  #define MC_MSRINJ_MAXMSRS       8
   1.176  struct xen_mc_msrinject {
   1.177         /* IN */
   1.178 -	unsigned int mcinj_cpunr;       /* target processor id */
   1.179 +	uint32_t mcinj_cpunr;           /* target processor id */
   1.180  	uint32_t mcinj_flags;           /* see MC_MSRINJ_F_* below */
   1.181  	uint32_t mcinj_count;           /* 0 .. count-1 in array are valid */
   1.182 -	uint32_t mcinj_pad0;
   1.183 +	uint32_t _pad0;
   1.184  	struct mcinfo_msr mcinj_msr[MC_MSRINJ_MAXMSRS];
   1.185  };
   1.186  
   1.187 @@ -343,18 +403,16 @@ struct xen_mc_mceinject {
   1.188  	unsigned int mceinj_cpunr;      /* target processor id */
   1.189  };
   1.190  
   1.191 -typedef union {
   1.192 -    struct xen_mc_fetch        mc_fetch;
   1.193 -    struct xen_mc_notifydomain mc_notifydomain;
   1.194 -    struct xen_mc_physcpuinfo  mc_physcpuinfo;
   1.195 -    struct xen_mc_msrinject    mc_msrinject;
   1.196 -    struct xen_mc_mceinject    mc_mceinject;
   1.197 -} xen_mc_arg_t;
   1.198 -
   1.199  struct xen_mc {
   1.200      uint32_t cmd;
   1.201      uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */
   1.202 -    xen_mc_arg_t u;
   1.203 +    union {
   1.204 +        struct xen_mc_fetch        mc_fetch;
   1.205 +        struct xen_mc_notifydomain mc_notifydomain;
   1.206 +        struct xen_mc_physcpuinfo  mc_physcpuinfo;
   1.207 +        struct xen_mc_msrinject    mc_msrinject;
   1.208 +        struct xen_mc_mceinject    mc_mceinject;
   1.209 +    } u;
   1.210  };
   1.211  typedef struct xen_mc xen_mc_t;
   1.212  DEFINE_XEN_GUEST_HANDLE(xen_mc_t);
     2.1 --- a/include/xen/interface/arch-x86/xen.h	Mon May 18 13:21:07 2009 +0100
     2.2 +++ b/include/xen/interface/arch-x86/xen.h	Mon May 18 14:14:15 2009 +0100
     2.3 @@ -76,10 +76,6 @@ typedef unsigned long xen_pfn_t;
     2.4  /* Maximum number of virtual CPUs in multi-processor guests. */
     2.5  #define MAX_VIRT_CPUS 32
     2.6  
     2.7 -
     2.8 -/* Machine check support */
     2.9 -#include "xen-mca.h"
    2.10 -
    2.11  #ifndef __ASSEMBLY__
    2.12  
    2.13  typedef unsigned long xen_ulong_t;
     3.1 --- a/include/xen/interface/domctl.h	Mon May 18 13:21:07 2009 +0100
     3.2 +++ b/include/xen/interface/domctl.h	Mon May 18 14:14:15 2009 +0100
     3.3 @@ -433,6 +433,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_
     3.4  #define XEN_DOMCTL_SENDTRIGGER_NMI    0
     3.5  #define XEN_DOMCTL_SENDTRIGGER_RESET  1
     3.6  #define XEN_DOMCTL_SENDTRIGGER_INIT   2
     3.7 +#define XEN_DOMCTL_SENDTRIGGER_POWER  3
     3.8  struct xen_domctl_sendtrigger {
     3.9      uint32_t  trigger;  /* IN */
    3.10      uint32_t  vcpu;     /* IN */
     4.1 --- a/include/xen/interface/sysctl.h	Mon May 18 13:21:07 2009 +0100
     4.2 +++ b/include/xen/interface/sysctl.h	Mon May 18 14:14:15 2009 +0100
     4.3 @@ -348,11 +348,9 @@ struct xen_set_cpufreq_para {
     4.4  
     4.5      uint32_t ctrl_type;
     4.6      uint32_t ctrl_value;
     4.7 -}
     4.8 -;
     4.9 +};
    4.10 +
    4.11  /* Get physical CPU topology information. */
    4.12 -
    4.13 -
    4.14  #define INVALID_TOPOLOGY_ID  (~0U)
    4.15  struct xen_get_cputopo {
    4.16       /* IN: maximum addressable entry in
    4.17 @@ -376,17 +374,35 @@ struct xen_sysctl_pm_op {
    4.18      #define GET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x01)
    4.19      #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
    4.20      #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
    4.21 +    #define GET_CPUFREQ_AVGFREQ        (CPUFREQ_PARA | 0x04)
    4.22  
    4.23      /* get CPU topology */
    4.24      #define XEN_SYSCTL_pm_op_get_cputopo  0x20
    4.25  
    4.26 +    /* set/reset scheduler power saving option */
    4.27 +    #define XEN_SYSCTL_pm_op_set_sched_opt_smt    0x21
    4.28 +
    4.29 +    /* cpuidle max_cstate access command */
    4.30 +    #define XEN_SYSCTL_pm_op_get_max_cstate       0x22
    4.31 +    #define XEN_SYSCTL_pm_op_set_max_cstate       0x23
    4.32 +
    4.33 +    /* set scheduler migration cost value */
    4.34 +    #define XEN_SYSCTL_pm_op_set_vcpu_migration_delay   0x24
    4.35 +    #define XEN_SYSCTL_pm_op_get_vcpu_migration_delay   0x25
    4.36 +
    4.37      uint32_t cmd;
    4.38      uint32_t cpuid;
    4.39      union {
    4.40          struct xen_get_cpufreq_para get_para;
    4.41          struct xen_set_cpufreq_gov  set_gov;
    4.42          struct xen_set_cpufreq_para set_para;
    4.43 +        uint64_t get_avgfreq;
    4.44          struct xen_get_cputopo      get_topo;
    4.45 +        uint32_t                    set_sched_opt_smt;
    4.46 +        uint32_t                    get_max_cstate;
    4.47 +        uint32_t                    set_max_cstate;
    4.48 +        uint32_t                    get_vcpu_migration_delay;
    4.49 +        uint32_t                    set_vcpu_migration_delay;
    4.50      };
    4.51  };
    4.52  
     5.1 --- a/include/xen/interface/trace.h	Mon May 18 13:21:07 2009 +0100
     5.2 +++ b/include/xen/interface/trace.h	Mon May 18 14:14:15 2009 +0100
     5.3 @@ -142,14 +142,14 @@
     5.4  #define TRC_HVM_INVLPG          (TRC_HVM_HANDLER + 0x14)
     5.5  #define TRC_HVM_INVLPG64        (TRC_HVM_HANDLER + TRC_64_FLAG + 0x14)
     5.6  #define TRC_HVM_MCE             (TRC_HVM_HANDLER + 0x15)
     5.7 -#define TRC_HVM_IO_ASSIST       (TRC_HVM_HANDLER + 0x16)
     5.8 -#define TRC_HVM_IO_ASSIST64     (TRC_HVM_HANDLER + TRC_64_FLAG + 0x16)
     5.9 -#define TRC_HVM_MMIO_ASSIST     (TRC_HVM_HANDLER + 0x17)
    5.10 -#define TRC_HVM_MMIO_ASSIST64   (TRC_HVM_HANDLER + TRC_64_FLAG + 0x17)
    5.11 +#define TRC_HVM_IOPORT_READ     (TRC_HVM_HANDLER + 0x16)
    5.12 +#define TRC_HVM_IOMEM_READ      (TRC_HVM_HANDLER + 0x17)
    5.13  #define TRC_HVM_CLTS            (TRC_HVM_HANDLER + 0x18)
    5.14  #define TRC_HVM_LMSW            (TRC_HVM_HANDLER + 0x19)
    5.15  #define TRC_HVM_LMSW64          (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19)
    5.16 -#define TRC_HVM_INTR_WINDOW     (TRC_HVM_HANDLER + 0X20)
    5.17 +#define TRC_HVM_INTR_WINDOW     (TRC_HVM_HANDLER + 0x20)
    5.18 +#define TRC_HVM_IOPORT_WRITE    (TRC_HVM_HANDLER + 0x216)
    5.19 +#define TRC_HVM_IOMEM_WRITE     (TRC_HVM_HANDLER + 0x217)
    5.20  
    5.21  /* trace subclasses for power management */
    5.22  #define TRC_PM_FREQ     0x00801000      /* xen cpu freq events */
     6.1 --- a/include/xen/interface/xen.h	Mon May 18 13:21:07 2009 +0100
     6.2 +++ b/include/xen/interface/xen.h	Mon May 18 14:14:15 2009 +0100
     6.3 @@ -272,9 +272,9 @@ struct mmuext_op {
     6.4          unsigned int nr_ents;
     6.5          /* TLB_FLUSH_MULTI, INVLPG_MULTI */
     6.6  #if __XEN_INTERFACE_VERSION__ >= 0x00030205
     6.7 -        XEN_GUEST_HANDLE(void) vcpumask;
     6.8 +        XEN_GUEST_HANDLE(const_void) vcpumask;
     6.9  #else
    6.10 -        void *vcpumask;
    6.11 +        const void *vcpumask;
    6.12  #endif
    6.13          /* COPY_PAGE */
    6.14          xen_pfn_t src_mfn;