MCE: Implement memory page offlining for AMD
PATCH 1/1 MCE: Implement memory page offlining for AMD
Implement memory page offlining for AMD
Signed-off-by Christoph Egger <[email protected]>
Signature · 6 lines
---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632
# User Christoph Egger
# Date 1349440371 -7200
Implement page offline recovery action for AMD
Signed-off-by Christoph Egger <[email protected]>
xen/arch/x86/cpu/mcheck/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-y += k7.o obj-y += amd_k8.o obj-y += amd_f10.o obj-y += mce_amd.o +obj-y += mcaction.o obj-y += barrier.o obj-y += mctelem.o obj-y += mce.o
xen/arch/x86/cpu/mcheck/amd_f10.c +2 -0
@@ -44,6 +44,7 @@#include "mce_quirks.h" #include "x86_mca.h" #include "mce_amd.h" +#include "mcaction.h" static struct mcinfo_extended *amd_f10_handler (struct mc_info *mi,uint16_t bank,uint64_t status)
@@ -97,6 +98,7 @@ enum mcheck_type amd_f10_mcheck_init(strx86_mce_callback_register (amd_f10_handler);mce_recoverable_register (mc_amd_recoverable_scan); +mce_register_addrcheck (mc_amd_addrcheck);return mcheck_amd_famXX; }
xen/arch/x86/cpu/mcheck/mcaction.c new file +139 -0
139 lines not on this page · raw message
xen/arch/x86/cpu/mcheck/mcaction.h new file +20 -0
@@ -0,0 +1,20 @@ +#ifndef _MCHECK_ACTION_H +#define _MCHECK_ACTION_H + +#include <xen/types.h> +#include "x86_mca.h" + +void +mc_memerr_dhandler (struct mca_binfo *binfo, +enum mce_result *result, +struct cpu_user_regs *regs); + +#define MC_ADDR_PHYSICAL 0 +#define MC_ADDR_VIRTUAL 1 + +typedef int (*mce_check_addr_t )(uint64_t status,uint64_t misc,int addr_type); +extern void mce_register_addrcheck (mce_check_addr_t ); + +extern mce_check_addr_t mc_check_addr; + +#endif
xen/arch/x86/cpu/mcheck/mce.c +2 -1
@@ -24,6 +24,7 @@#include "mce.h" #include "barrier.h" +#include "mcaction.h" #include "util.h" #include "vmce.h"
@@ -216,7 +217,7 @@ static void mca_init_bank(enum mca_sourcif ((mib->mc_status & MCi_STATUS_MISCV) && (mib->mc_status & MCi_STATUS_ADDRV) && - ((mib->mc_misc & MCi_MISC_ADDRMOD_MASK) == MCi_MISC_PHYSMOD) && + (mc_check_addr (mib->mc_status, mib->mc_misc,MC_ADDR_PHYSICAL )) && (who ==MCA_POLLER || who ==MCA_CMCI_HANDLER ) && (mfn_valid (paddr_to_pfn (mib->mc_addr)))) {
xen/arch/x86/cpu/mcheck/mce_amd.c +23 -0
@@ -25,6 +25,7 @@#include "mce.h" #include "x86_mca.h" #include "mce_amd.h" +#include "mcaction.h" /* Error Code Types */ enum mc_ec_type {
@@ -75,3 +76,25 @@ mc_amd_recoverable_scan(uint64_t status)return ret; } + +int +mc_amd_addrcheck (uint64_t status,uint64_t misc,int addrtype) +{ +enum mc_ec_type ectype; +uint16_t errorcode; + + errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC); + ectype =mc_ec2type (errorcode); + +switch (ectype) { +case MC_EC_BUS_TYPE :/* value in addr MSR is physical */ +case MC_EC_MEM_TYPE :/* value in addr MSR is physical */ +return (addrtype ==MC_ADDR_PHYSICAL ); +case MC_EC_TLB_TYPE :/* value in addr MSR is virtual */ +return (addrtype ==MC_ADDR_VIRTUAL ); + } + +/* unreached */ +BUG (); +return 0 ; +}
xen/arch/x86/cpu/mcheck/mce_amd.h +1 -0
@@ -2,5 +2,6 @@#define _MCHECK_AMD_Hint mc_amd_recoverable_scan (uint64_t status); +int mc_amd_addrcheck (uint64_t status,uint64_t misc,int addrtype);#endif
xen/arch/x86/cpu/mcheck/mce_intel.c +16 -118
164 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel