Skip to content

Commit 4e3f77d

Browse files
jbeulichjgross1
authored andcommitted
xen/mcelog: add PPIN to record when available
This is to augment commit 3f5a789 ("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>
1 parent ca8ffda commit 4e3f77d

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎arch/x86/include/asm/msr-index.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@
393393
#define MSR_AMD_PSTATE_DEF_BASE 0xc0010064
394394
#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140
395395
#define MSR_AMD64_OSVW_STATUS 0xc0010141
396+
#define MSR_AMD_PPIN_CTL 0xc00102f0
397+
#define MSR_AMD_PPIN 0xc00102f1
396398
#define MSR_AMD64_LS_CFG 0xc0011020
397399
#define MSR_AMD64_DC_CFG 0xc0011022
398400
#define MSR_AMD64_BU_CFG2 0xc001102a

‎drivers/xen/mcelog.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ static int convert_log(struct mc_info *mi)
253253
case MSR_IA32_MCG_CAP:
254254
m.mcgcap = g_physinfo[i].mc_msrvalues[j].value;
255255
break;
256+
257+
case MSR_PPIN:
258+
case MSR_AMD_PPIN:
259+
m.ppin = g_physinfo[i].mc_msrvalues[j].value;
260+
break;
256261
}
257262

258263
mic = NULL;

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ struct xen_mc {
331331
};
332332
DEFINE_GUEST_HANDLE_STRUCT(xen_mc);
333333

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+
*/
335339
struct xen_mce {
336340
__u64 status;
337341
__u64 misc;
@@ -352,6 +356,9 @@ struct xen_mce {
352356
__u32 socketid; /* CPU socket ID */
353357
__u32 apicid; /* CPU initial apic ID */
354358
__u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
359+
__u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */
360+
__u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */
361+
__u64 ppin; /* Protected Processor Inventory Number */
355362
};
356363

357364
/*

0 commit comments

Comments
 (0)