Changeset View
Changeset View
Standalone View
Standalone View
sys/xen/interface/arch-x86/xen-mca.h
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
#define MC_TYPE_BANK 1 | #define MC_TYPE_BANK 1 | ||||
#define MC_TYPE_EXTENDED 2 | #define MC_TYPE_EXTENDED 2 | ||||
#define MC_TYPE_RECOVERY 3 | #define MC_TYPE_RECOVERY 3 | ||||
struct mcinfo_common { | struct mcinfo_common { | ||||
uint16_t type; /* structure type */ | uint16_t type; /* structure type */ | ||||
uint16_t size; /* size of this struct in bytes */ | uint16_t size; /* size of this struct in bytes */ | ||||
}; | }; | ||||
typedef struct mcinfo_common xen_mcinfo_common_t; | |||||
#define MC_FLAG_CORRECTABLE (1 << 0) | #define MC_FLAG_CORRECTABLE (1 << 0) | ||||
#define MC_FLAG_UNCORRECTABLE (1 << 1) | #define MC_FLAG_UNCORRECTABLE (1 << 1) | ||||
#define MC_FLAG_RECOVERABLE (1 << 2) | #define MC_FLAG_RECOVERABLE (1 << 2) | ||||
#define MC_FLAG_POLLED (1 << 3) | #define MC_FLAG_POLLED (1 << 3) | ||||
#define MC_FLAG_RESET (1 << 4) | #define MC_FLAG_RESET (1 << 4) | ||||
#define MC_FLAG_CMCI (1 << 5) | #define MC_FLAG_CMCI (1 << 5) | ||||
#define MC_FLAG_MCE (1 << 6) | #define MC_FLAG_MCE (1 << 6) | ||||
/* contains global x86 mc information */ | /* contains global x86 mc information */ | ||||
struct mcinfo_global { | struct mcinfo_global { | ||||
struct mcinfo_common common; | xen_mcinfo_common_t common; | ||||
/* running domain at the time in error (most likely the impacted one) */ | /* running domain at the time in error (most likely the impacted one) */ | ||||
uint16_t mc_domid; | uint16_t mc_domid; | ||||
uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */ | uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */ | ||||
uint32_t mc_socketid; /* physical socket of the physical core */ | uint32_t mc_socketid; /* physical socket of the physical core */ | ||||
uint16_t mc_coreid; /* physical impacted core */ | uint16_t mc_coreid; /* physical impacted core */ | ||||
uint16_t mc_core_threadid; /* core thread of physical core */ | uint16_t mc_core_threadid; /* core thread of physical core */ | ||||
uint32_t mc_apicid; | uint32_t mc_apicid; | ||||
uint32_t mc_flags; | uint32_t mc_flags; | ||||
uint64_t mc_gstatus; /* global status */ | uint64_t mc_gstatus; /* global status */ | ||||
}; | }; | ||||
/* contains bank local x86 mc information */ | /* contains bank local x86 mc information */ | ||||
struct mcinfo_bank { | struct mcinfo_bank { | ||||
struct mcinfo_common common; | xen_mcinfo_common_t common; | ||||
uint16_t mc_bank; /* bank nr */ | uint16_t mc_bank; /* bank nr */ | ||||
uint16_t mc_domid; /* Usecase 5: domain referenced by mc_addr on dom0 | uint16_t mc_domid; /* Usecase 5: domain referenced by mc_addr on dom0 | ||||
* and if mc_addr is valid. Never valid on DomU. */ | * and if mc_addr is valid. Never valid on DomU. */ | ||||
uint64_t mc_status; /* bank status */ | uint64_t mc_status; /* bank status */ | ||||
uint64_t mc_addr; /* bank address, only valid | uint64_t mc_addr; /* bank address, only valid | ||||
* if addr bit is set in mc_status */ | * if addr bit is set in mc_status */ | ||||
uint64_t mc_misc; | uint64_t mc_misc; | ||||
uint64_t mc_ctrl2; | uint64_t mc_ctrl2; | ||||
uint64_t mc_tsc; | uint64_t mc_tsc; | ||||
}; | }; | ||||
struct mcinfo_msr { | struct mcinfo_msr { | ||||
uint64_t reg; /* MSR */ | uint64_t reg; /* MSR */ | ||||
uint64_t value; /* MSR value */ | uint64_t value; /* MSR value */ | ||||
}; | }; | ||||
typedef struct mcinfo_msr xen_mcinfo_msr_t; | |||||
/* contains mc information from other | /* contains mc information from other | ||||
* or additional mc MSRs */ | * or additional mc MSRs */ | ||||
struct mcinfo_extended { | struct mcinfo_extended { | ||||
struct mcinfo_common common; | xen_mcinfo_common_t common; | ||||
/* You can fill up to five registers. | /* You can fill up to five registers. | ||||
* If you need more, then use this structure | * If you need more, then use this structure | ||||
* multiple times. */ | * multiple times. */ | ||||
uint32_t mc_msrs; /* Number of msr with valid values. */ | uint32_t mc_msrs; /* Number of msr with valid values. */ | ||||
/* | /* | ||||
* Currently Intel extended MSR (32/64) include all gp registers | * Currently Intel extended MSR (32/64) include all gp registers | ||||
* and E(R)FLAGS, E(R)IP, E(R)MISC, up to 11/19 of them might be | * and E(R)FLAGS, E(R)IP, E(R)MISC, up to 11/19 of them might be | ||||
* useful at present. So expand this array to 32 to leave room. | * useful at present. So expand this array to 32 to leave room. | ||||
*/ | */ | ||||
struct mcinfo_msr mc_msr[32]; | xen_mcinfo_msr_t mc_msr[32]; | ||||
}; | }; | ||||
/* Recovery Action flags. Giving recovery result information to DOM0 */ | /* Recovery Action flags. Giving recovery result information to DOM0 */ | ||||
/* Xen takes successful recovery action, the error is recovered */ | /* Xen takes successful recovery action, the error is recovered */ | ||||
#define REC_ACTION_RECOVERED (0x1 << 0) | #define REC_ACTION_RECOVERED (0x1 << 0) | ||||
/* No action is performed by XEN */ | /* No action is performed by XEN */ | ||||
#define REC_ACTION_NONE (0x1 << 1) | #define REC_ACTION_NONE (0x1 << 1) | ||||
Show All 19 Lines | |||||
* easy broken page earlier when doing next reboot. | * easy broken page earlier when doing next reboot. | ||||
*/ | */ | ||||
struct page_offline_action | struct page_offline_action | ||||
{ | { | ||||
/* Params for passing the offlined page number to DOM0 */ | /* Params for passing the offlined page number to DOM0 */ | ||||
uint64_t mfn; | uint64_t mfn; | ||||
uint64_t status; | uint64_t status; | ||||
}; | }; | ||||
typedef struct page_offline_action xen_page_offline_action_t; | |||||
struct cpu_offline_action | struct cpu_offline_action | ||||
{ | { | ||||
/* Params for passing the identity of the offlined CPU to DOM0 */ | /* Params for passing the identity of the offlined CPU to DOM0 */ | ||||
uint32_t mc_socketid; | uint32_t mc_socketid; | ||||
uint16_t mc_coreid; | uint16_t mc_coreid; | ||||
uint16_t mc_core_threadid; | uint16_t mc_core_threadid; | ||||
}; | }; | ||||
typedef struct cpu_offline_action xen_cpu_offline_action_t; | |||||
#define MAX_UNION_SIZE 16 | #define MAX_UNION_SIZE 16 | ||||
struct mcinfo_recovery | struct mcinfo_recovery | ||||
{ | { | ||||
struct mcinfo_common common; | xen_mcinfo_common_t common; | ||||
uint16_t mc_bank; /* bank nr */ | uint16_t mc_bank; /* bank nr */ | ||||
uint8_t action_flags; | uint8_t action_flags; | ||||
uint8_t action_types; | uint8_t action_types; | ||||
union { | union { | ||||
struct page_offline_action page_retire; | xen_page_offline_action_t page_retire; | ||||
struct cpu_offline_action cpu_offline; | xen_cpu_offline_action_t cpu_offline; | ||||
uint8_t pad[MAX_UNION_SIZE]; | uint8_t pad[MAX_UNION_SIZE]; | ||||
} action_info; | } action_info; | ||||
}; | }; | ||||
#define MCINFO_HYPERCALLSIZE 1024 | #define MCINFO_HYPERCALLSIZE 1024 | ||||
#define MCINFO_MAXSIZE 768 | #define MCINFO_MAXSIZE 768 | ||||
Show All 36 Lines | struct mcinfo_logical_cpu { | ||||
uint32_t mc_model; | uint32_t mc_model; | ||||
uint32_t mc_step; | uint32_t mc_step; | ||||
char mc_vendorid[16]; | char mc_vendorid[16]; | ||||
char mc_brandid[64]; | char mc_brandid[64]; | ||||
uint32_t mc_cpu_caps[MC_NCAPS]; | uint32_t mc_cpu_caps[MC_NCAPS]; | ||||
uint32_t mc_cache_size; | uint32_t mc_cache_size; | ||||
uint32_t mc_cache_alignment; | uint32_t mc_cache_alignment; | ||||
int32_t mc_nmsrvals; | int32_t mc_nmsrvals; | ||||
struct mcinfo_msr mc_msrvalues[__MC_MSR_ARRAYSIZE]; | xen_mcinfo_msr_t mc_msrvalues[__MC_MSR_ARRAYSIZE]; | ||||
}; | }; | ||||
typedef struct mcinfo_logical_cpu xen_mc_logical_cpu_t; | typedef struct mcinfo_logical_cpu xen_mc_logical_cpu_t; | ||||
DEFINE_XEN_GUEST_HANDLE(xen_mc_logical_cpu_t); | DEFINE_XEN_GUEST_HANDLE(xen_mc_logical_cpu_t); | ||||
/* | /* | ||||
* OS's should use these instead of writing their own lookup function | * OS's should use these instead of writing their own lookup function | ||||
* each with its own bugs and drawbacks. | * each with its own bugs and drawbacks. | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
#define XEN_MC_physcpuinfo 3 | #define XEN_MC_physcpuinfo 3 | ||||
struct xen_mc_physcpuinfo { | struct xen_mc_physcpuinfo { | ||||
/* IN/OUT */ | /* IN/OUT */ | ||||
uint32_t ncpus; | uint32_t ncpus; | ||||
uint32_t _pad0; | uint32_t _pad0; | ||||
/* OUT */ | /* OUT */ | ||||
XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info; | XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info; | ||||
}; | }; | ||||
typedef struct xen_mc_physcpuinfo xen_mc_physcpuinfo_t; | |||||
#define XEN_MC_msrinject 4 | #define XEN_MC_msrinject 4 | ||||
#define MC_MSRINJ_MAXMSRS 8 | #define MC_MSRINJ_MAXMSRS 8 | ||||
struct xen_mc_msrinject { | struct xen_mc_msrinject { | ||||
/* IN */ | /* IN */ | ||||
uint32_t mcinj_cpunr; /* target processor id */ | uint32_t mcinj_cpunr; /* target processor id */ | ||||
uint32_t mcinj_flags; /* see MC_MSRINJ_F_* below */ | uint32_t mcinj_flags; /* see MC_MSRINJ_F_* below */ | ||||
uint32_t mcinj_count; /* 0 .. count-1 in array are valid */ | uint32_t mcinj_count; /* 0 .. count-1 in array are valid */ | ||||
domid_t mcinj_domid; /* valid only if MC_MSRINJ_F_GPADDR is | domid_t mcinj_domid; /* valid only if MC_MSRINJ_F_GPADDR is | ||||
present in mcinj_flags */ | present in mcinj_flags */ | ||||
uint16_t _pad0; | uint16_t _pad0; | ||||
struct mcinfo_msr mcinj_msr[MC_MSRINJ_MAXMSRS]; | xen_mcinfo_msr_t mcinj_msr[MC_MSRINJ_MAXMSRS]; | ||||
}; | }; | ||||
typedef struct xen_mc_msrinject xen_mc_msrinject_t; | |||||
/* Flags for mcinj_flags above; bits 16-31 are reserved */ | /* Flags for mcinj_flags above; bits 16-31 are reserved */ | ||||
#define MC_MSRINJ_F_INTERPOSE 0x1 | #define MC_MSRINJ_F_INTERPOSE 0x1 | ||||
#define MC_MSRINJ_F_GPADDR 0x2 | #define MC_MSRINJ_F_GPADDR 0x2 | ||||
#define XEN_MC_mceinject 5 | #define XEN_MC_mceinject 5 | ||||
struct xen_mc_mceinject { | struct xen_mc_mceinject { | ||||
unsigned int mceinj_cpunr; /* target processor id */ | unsigned int mceinj_cpunr; /* target processor id */ | ||||
}; | }; | ||||
typedef struct xen_mc_mceinject xen_mc_mceinject_t; | |||||
#if defined(__XEN__) || defined(__XEN_TOOLS__) | #if defined(__XEN__) || defined(__XEN_TOOLS__) | ||||
#define XEN_MC_inject_v2 6 | #define XEN_MC_inject_v2 6 | ||||
#define XEN_MC_INJECT_TYPE_MASK 0x7 | #define XEN_MC_INJECT_TYPE_MASK 0x7 | ||||
#define XEN_MC_INJECT_TYPE_MCE 0x0 | #define XEN_MC_INJECT_TYPE_MCE 0x0 | ||||
#define XEN_MC_INJECT_TYPE_CMCI 0x1 | #define XEN_MC_INJECT_TYPE_CMCI 0x1 | ||||
#define XEN_MC_INJECT_TYPE_LMCE 0x2 | #define XEN_MC_INJECT_TYPE_LMCE 0x2 | ||||
#define XEN_MC_INJECT_CPU_BROADCAST 0x8 | #define XEN_MC_INJECT_CPU_BROADCAST 0x8 | ||||
struct xen_mc_inject_v2 { | struct xen_mc_inject_v2 { | ||||
uint32_t flags; | uint32_t flags; | ||||
struct xenctl_bitmap cpumap; | xenctl_bitmap_t cpumap; | ||||
}; | }; | ||||
typedef struct xen_mc_inject_v2 xen_mc_inject_v2_t; | |||||
#endif | #endif | ||||
struct xen_mc { | struct xen_mc { | ||||
uint32_t cmd; | uint32_t cmd; | ||||
uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */ | uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */ | ||||
union { | union { | ||||
struct xen_mc_fetch mc_fetch; | xen_mc_fetch_t mc_fetch; | ||||
struct xen_mc_notifydomain mc_notifydomain; | xen_mc_notifydomain_t mc_notifydomain; | ||||
struct xen_mc_physcpuinfo mc_physcpuinfo; | xen_mc_physcpuinfo_t mc_physcpuinfo; | ||||
struct xen_mc_msrinject mc_msrinject; | xen_mc_msrinject_t mc_msrinject; | ||||
struct xen_mc_mceinject mc_mceinject; | xen_mc_mceinject_t mc_mceinject; | ||||
#if defined(__XEN__) || defined(__XEN_TOOLS__) | #if defined(__XEN__) || defined(__XEN_TOOLS__) | ||||
struct xen_mc_inject_v2 mc_inject_v2; | xen_mc_inject_v2_t mc_inject_v2; | ||||
#endif | #endif | ||||
} u; | } u; | ||||
}; | }; | ||||
typedef struct xen_mc xen_mc_t; | typedef struct xen_mc xen_mc_t; | ||||
DEFINE_XEN_GUEST_HANDLE(xen_mc_t); | DEFINE_XEN_GUEST_HANDLE(xen_mc_t); | ||||
#endif /* __ASSEMBLY__ */ | #endif /* __ASSEMBLY__ */ | ||||
#endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */ | #endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */ |