Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6279267ybx; Mon, 11 Nov 2019 06:47:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxbZx3xIv5kXWxsRTKXhL1z4o1JqFwwSrNZ5vGRQ1II6IBwwFFtYVsO/NlGl5oj7Du84pzk X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr26850540edv.297.1573483636796; Mon, 11 Nov 2019 06:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573483636; cv=none; d=google.com; s=arc-20160816; b=S9zlr5etLy29wfWvVMNYyx4Fwcn/GSYg7i0Tsp4Djwi+DfmQvoBO6x8PhJjkzFSgbR WTwiHoDJbfVQl7B29Nc67wpii9r8bbhqexcU7X1+RPT9Nyv5WOtc8sBM49JseZrIr28j fpdshzHN/PjmOYY8yxVDcQnRMBCBwZ/1JpOanmrwVlaKji4tDdpLm5yAejDYG92B+krq YEr7CDiKDo2ezxY0PZ3FzmRrEUCrmXnPwEGjWRjRkgBAQXJMnVXMP8L5PLJU7NBfKh1L t498CQirDzYXR+B4gAa/SAKgtSl+gmGr/bdZcxhhmlJeF60Cuyf99lDR/TQVov2yFBaY C4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=x/KG5kljagf1HDPyP76ogOghQ1bD74MsStlWsubvP4A=; b=CxqhS5Z4vwcCJEeded0c94WXn+M/pxD3MBf0S0WC8HN5ruICl1EAyVQYv7XqtAFdvW fQjlfTgccPMYGULik5+073yD/VDd/91tv5sbdUuCGL9EyPsT9MHFi6OM7YTuGXSyftZq rHfNBZvTe+L3SAsULsjy2BvCssJy65nhUSLC3EYAwrewf1eW7O2L9V3eJfu3C38wndu4 uhIDz9OLtkagxitQy8qeJhRE2pBYZqJESCdvXM7HzAqLpNM+27JF67mHHuMjpPOg0yZT hHmjJoPR/Vm4uAyEUNS4i+DarSQJRVvJWr+jiZ6OOTGTIu6QNgDcZhtpqjgH7QUhtEEA wYew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a27si11572985edm.187.2019.11.11.06.46.52; Mon, 11 Nov 2019 06:47:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbfKKOqP (ORCPT + 99 others); Mon, 11 Nov 2019 09:46:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:51432 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726887AbfKKOqP (ORCPT ); Mon, 11 Nov 2019 09:46:15 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4E088B02E; Mon, 11 Nov 2019 14:46:13 +0000 (UTC) Subject: [PATCH 2/3] xen/mcelog: add PPIN to record when available From: Jan Beulich To: Boris Ostrovsky , Juergen Gross Cc: "xen-devel@lists.xenproject.org" , lkml , the arch/x86 maintainers References: Message-ID: Date: Mon, 11 Nov 2019 15:46:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -393,6 +393,8 @@ #define MSR_AMD_PSTATE_DEF_BASE 0xc0010064 #define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140 #define MSR_AMD64_OSVW_STATUS 0xc0010141 +#define MSR_AMD_PPIN_CTL 0xc00102f0 +#define MSR_AMD_PPIN 0xc00102f1 #define MSR_AMD64_LS_CFG 0xc0011020 #define MSR_AMD64_DC_CFG 0xc0011022 #define MSR_AMD64_BU_CFG2 0xc001102a --- a/drivers/xen/mcelog.c +++ b/drivers/xen/mcelog.c @@ -253,6 +253,11 @@ static int convert_log(struct mc_info *m case MSR_IA32_MCG_CAP: m.mcgcap = g_physinfo[i].mc_msrvalues[j].value; break; + + case MSR_PPIN: + case MSR_AMD_PPIN: + m.ppin = g_physinfo[i].mc_msrvalues[j].value; + break; } mic = NULL; --- a/include/xen/interface/xen-mca.h +++ b/include/xen/interface/xen-mca.h @@ -332,7 +332,11 @@ struct xen_mc { }; DEFINE_GUEST_HANDLE_STRUCT(xen_mc); -/* Fields are zero when not available */ +/* + * Fields are zero when not available. Also, this struct is shared with + * userspace mcelog and thus must keep existing fields at current offsets. + * Only add new fields to the end of the structure + */ struct xen_mce { __u64 status; __u64 misc; @@ -353,6 +357,9 @@ struct xen_mce { __u32 socketid; /* CPU socket ID */ __u32 apicid; /* CPU initial apic ID */ __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */ + __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */ + __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */ + __u64 ppin; /* Protected Processor Inventory Number */ }; /*