Skip to content

Commit ca8ffda

Browse files
jbeulichjgross1
authored andcommitted
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>
1 parent fa6614d commit ca8ffda

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎drivers/xen/mcelog.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int convert_log(struct mc_info *mi)
222222
struct mcinfo_global *mc_global;
223223
struct mcinfo_bank *mc_bank;
224224
struct xen_mce m;
225-
uint32_t i;
225+
unsigned int i, j;
226226

227227
mic = NULL;
228228
x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL);
@@ -248,7 +248,12 @@ static int convert_log(struct mc_info *mi)
248248
m.socketid = g_physinfo[i].mc_chipid;
249249
m.cpu = m.extcpu = g_physinfo[i].mc_cpunr;
250250
m.cpuvendor = (__u8)g_physinfo[i].mc_vendor;
251-
m.mcgcap = g_physinfo[i].mc_msrvalues[__MC_MSR_MCGCAP].value;
251+
for (j = 0; j < g_physinfo[i].mc_nmsrvals; ++j)
252+
switch (g_physinfo[i].mc_msrvalues[j].reg) {
253+
case MSR_IA32_MCG_CAP:
254+
m.mcgcap = g_physinfo[i].mc_msrvalues[j].value;
255+
break;
256+
}
252257

253258
mic = NULL;
254259
x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK);

‎include/xen/interface/xen-mca.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ struct mc_info {
183183
DEFINE_GUEST_HANDLE_STRUCT(mc_info);
184184

185185
#define __MC_MSR_ARRAYSIZE 8
186-
#define __MC_MSR_MCGCAP 0
187186
#define __MC_NMSRS 1
188187
#define MC_NCAPS 7
189188
struct mcinfo_logical_cpu {

0 commit comments

Comments
 (0)