summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-11-11 15:45:42 +0100
committerJuergen Gross <jgross@suse.com>2019-11-14 09:45:32 +0100
commitca8ffdaea560a3be3f0701ff4b019fa25a308f82 (patch)
tree23ef0fc510ba954ec673b02b4ee7eea47a82f8ea
parentfa6614d8ef13c63aac52ad7c07c5e69ce4aba3dd (diff)
downloadlinux-stable-ca8ffdaea560a3be3f0701ff4b019fa25a308f82.tar.gz
linux-stable-ca8ffdaea560a3be3f0701ff4b019fa25a308f82.tar.bz2
linux-stable-ca8ffdaea560a3be3f0701ff4b019fa25a308f82.zip
xen/mcelog: drop __MC_MSR_MCGCAP
It has never been part of Xen's public interface, and there's therefore no guarantee for MCG_CAP's value to always be present in array entry 0. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Juergen Gross <jgross@suse.com>
-rw-r--r--drivers/xen/mcelog.c9
-rw-r--r--include/xen/interface/xen-mca.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c
index b8bf61abb65b..c870cdcc9bbf 100644
--- a/drivers/xen/mcelog.c
+++ b/drivers/xen/mcelog.c
@@ -222,7 +222,7 @@ static int convert_log(struct mc_info *mi)
struct mcinfo_global *mc_global;
struct mcinfo_bank *mc_bank;
struct xen_mce m;
- uint32_t i;
+ unsigned int i, j;
mic = NULL;
x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL);
@@ -248,7 +248,12 @@ static int convert_log(struct mc_info *mi)
m.socketid = g_physinfo[i].mc_chipid;
m.cpu = m.extcpu = g_physinfo[i].mc_cpunr;
m.cpuvendor = (__u8)g_physinfo[i].mc_vendor;
- m.mcgcap = g_physinfo[i].mc_msrvalues[__MC_MSR_MCGCAP].value;
+ for (j = 0; j < g_physinfo[i].mc_nmsrvals; ++j)
+ switch (g_physinfo[i].mc_msrvalues[j].reg) {
+ case MSR_IA32_MCG_CAP:
+ m.mcgcap = g_physinfo[i].mc_msrvalues[j].value;
+ break;
+ }
mic = NULL;
x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK);
diff --git a/include/xen/interface/xen-mca.h b/include/xen/interface/xen-mca.h
index 73a4ea714d93..d7a45f08fb48 100644
--- a/include/xen/interface/xen-mca.h
+++ b/include/xen/interface/xen-mca.h
@@ -183,7 +183,6 @@ struct mc_info {
DEFINE_GUEST_HANDLE_STRUCT(mc_info);
#define __MC_MSR_ARRAYSIZE 8
-#define __MC_MSR_MCGCAP 0
#define __MC_NMSRS 1
#define MC_NCAPS 7
struct mcinfo_logical_cpu {