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

xen/mcelog: add PPIN to record when available

This is to augment commit 3f5a7896a5 ("x86/mce: Include the PPIN in MCE
records when available").

I'm also adding "synd" and "ipid" fields to struct xen_mce, in an
attempt to keep field offsets in sync with struct mce. These two fields
won't get populated for now, though.

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
4e3f77d8 ca8ffdae

+15 -1
+2
arch/x86/include/asm/msr-index.h
··· 393 393 #define MSR_AMD_PSTATE_DEF_BASE 0xc0010064 394 394 #define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140 395 395 #define MSR_AMD64_OSVW_STATUS 0xc0010141 396 + #define MSR_AMD_PPIN_CTL 0xc00102f0 397 + #define MSR_AMD_PPIN 0xc00102f1 396 398 #define MSR_AMD64_LS_CFG 0xc0011020 397 399 #define MSR_AMD64_DC_CFG 0xc0011022 398 400 #define MSR_AMD64_BU_CFG2 0xc001102a
+5
drivers/xen/mcelog.c
··· 253 253 case MSR_IA32_MCG_CAP: 254 254 m.mcgcap = g_physinfo[i].mc_msrvalues[j].value; 255 255 break; 256 + 257 + case MSR_PPIN: 258 + case MSR_AMD_PPIN: 259 + m.ppin = g_physinfo[i].mc_msrvalues[j].value; 260 + break; 256 261 } 257 262 258 263 mic = NULL;
+8 -1
include/xen/interface/xen-mca.h
··· 331 331 }; 332 332 DEFINE_GUEST_HANDLE_STRUCT(xen_mc); 333 333 334 - /* Fields are zero when not available */ 334 + /* 335 + * Fields are zero when not available. Also, this struct is shared with 336 + * userspace mcelog and thus must keep existing fields at current offsets. 337 + * Only add new fields to the end of the structure 338 + */ 335 339 struct xen_mce { 336 340 __u64 status; 337 341 __u64 misc; ··· 356 352 __u32 socketid; /* CPU socket ID */ 357 353 __u32 apicid; /* CPU initial apic ID */ 358 354 __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */ 355 + __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */ 356 + __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */ 357 + __u64 ppin; /* Protected Processor Inventory Number */ 359 358 }; 360 359 361 360 /*