Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jan Beulich and committed by
Juergen Gross
ca8ffdae fa6614d8

+7 -3
+7 -2
drivers/xen/mcelog.c
··· 222 222 struct mcinfo_global *mc_global; 223 223 struct mcinfo_bank *mc_bank; 224 224 struct xen_mce m; 225 - uint32_t i; 225 + unsigned int i, j; 226 226 227 227 mic = NULL; 228 228 x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL); ··· 248 248 m.socketid = g_physinfo[i].mc_chipid; 249 249 m.cpu = m.extcpu = g_physinfo[i].mc_cpunr; 250 250 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 + } 252 257 253 258 mic = NULL; 254 259 x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK);
-1
include/xen/interface/xen-mca.h
··· 183 183 DEFINE_GUEST_HANDLE_STRUCT(mc_info); 184 184 185 185 #define __MC_MSR_ARRAYSIZE 8 186 - #define __MC_MSR_MCGCAP 0 187 186 #define __MC_NMSRS 1 188 187 #define MC_NCAPS 7 189 188 struct mcinfo_logical_cpu {