Skip to content

Commit

Permalink
xen/mcelog: drop __MC_MSR_MCGCAP
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
  • Loading branch information
jbeulich authored and jgross1 committed Nov 14, 2019
1 parent fa6614d commit ca8ffda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions drivers/xen/mcelog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion include/xen/interface/xen-mca.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ca8ffda

Please sign in to comment.