Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6278450ybx; Mon, 11 Nov 2019 06:46:26 -0800 (PST) X-Google-Smtp-Source: APXvYqx4t7b3LYgwz7K8kQiMk5zUTDS+Xo9axn3J4/1ABqlpEP/CohUgMy0a7qXLQ7btWauAUNGW X-Received: by 2002:a17:906:8591:: with SMTP id v17mr23281944ejx.185.1573483586606; Mon, 11 Nov 2019 06:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573483586; cv=none; d=google.com; s=arc-20160816; b=sRTRDNegW4W3BHYC87/DGc4/SIZZpmpsv7Xmh/r/wPr5m0HHiFbjHRnsDGT9262fWH wE+wDsFEhpsGCH9IcrP/p3TXXNQPDFp6bQQdBQhweBwDWKPvt7G5b0fBSiKuCrU3ZKfF 92wYuXffVH/T63A9QxlFu70GybBc4fv4h7Z0Wu+yRyJ4bS7lh+lAX2A5aqCKcD9YL/fR Iz+HlHukh1fi7WduFsl+jvQenRg6+0KukcP6E+poP/2YhILiNQOKyWC2r0Sn/ZtgrnbB ITXiqeEgBcg8/C6uNAaAvMqfi+pWvnqjBtqeMiYJVr7xAQXSwW4l+54C44hLUllEBiKY ANgw== 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=K2xp6zz8N39m7vLvkMiEQ/b4MK36l+pcL2hysnVkELM=; b=sVrGTJMiwrdw54E2pd5kGIRz7dbzublCRKQ7Tr6vEbmwMlz6+bMFLnXmfxxdQfrZ2k i4sUM+u5zSe+knAEHjLAc165l4U3WvjdC1Yv+OCM32S5xNSGC/DNRSwcSaNPmjg0BP9F jyIKmLhdWyRA2rDNXCavsE/TkX9cjCqCNK1s0QpzjgKdEvje5AzLuL5YEEjTX6f7iSFj BBKXqjyAiKv/az8wzxCgqjPk2/dPSbNiu4rk3UgeHaq+kiOWQ13B5L7SYuxK+jl0Tbcl 7Rvo1tHnhW6dq3vl5BRiN+tuFeYkOQOr94Zx8WIO/P6IwVV2mGXWhG7FjsahU1sOqHIE 4/RQ== 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 m19si9304226eje.312.2019.11.11.06.46.02; Mon, 11 Nov 2019 06:46:26 -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 S1727122AbfKKOpa (ORCPT + 99 others); Mon, 11 Nov 2019 09:45:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:51084 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726915AbfKKOpa (ORCPT ); Mon, 11 Nov 2019 09:45:30 -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 14105ACB7; Mon, 11 Nov 2019 14:45:29 +0000 (UTC) Subject: [PATCH 1/3] xen/mcelog: drop __MC_MSR_MCGCAP From: Jan Beulich To: Boris Ostrovsky , Juergen Gross Cc: "xen-devel@lists.xenproject.org" , lkml References: Message-ID: Date: Mon, 11 Nov 2019 15:45:42 +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 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 --- a/drivers/xen/mcelog.c +++ b/drivers/xen/mcelog.c @@ -222,7 +222,7 @@ static int convert_log(struct mc_info *m struct mcinfo_global *mc_global; struct mcinfo_bank *mc_bank; struct xen_mce m; - uint32_t i; + unsigned int i, j; mic = NULL; x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL); @@ -248,7 +248,12 @@ static int convert_log(struct mc_info *m m.socketid = g_physinfo[i].mc_chipid; m.cpu = m.extcpu = g_physinfo[i].mc_cpunr; m.cpuvendor = (__u8)g_physinfo[i].mc_vendor; - m.mcgcap = g_physinfo[i].mc_msrvalues[__MC_MSR_MCGCAP].value; + for (j = 0; j < g_physinfo[i].mc_nmsrvals; ++j) + switch (g_physinfo[i].mc_msrvalues[j].reg) { + case MSR_IA32_MCG_CAP: + m.mcgcap = g_physinfo[i].mc_msrvalues[j].value; + break; + } mic = NULL; x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK); --- a/include/xen/interface/xen-mca.h +++ b/include/xen/interface/xen-mca.h @@ -183,7 +183,6 @@ struct mc_info { DEFINE_GUEST_HANDLE_STRUCT(mc_info); #define __MC_MSR_ARRAYSIZE 8 -#define __MC_MSR_MCGCAP 0 #define __MC_NMSRS 1 #define MC_NCAPS 7 struct mcinfo_logical_cpu {