Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1396743pxk; Fri, 4 Sep 2020 08:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdZa3HNMmzJPg96U3nMi4VwwTm5RIpfs28Qc1O73e1K8rp20q9cOakXVlpbHNv/2EbM9IK X-Received: by 2002:aa7:d6ce:: with SMTP id x14mr9303298edr.359.1599233024726; Fri, 04 Sep 2020 08:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599233024; cv=none; d=google.com; s=arc-20160816; b=FHf3/ztToG9boEFDKniiBm0w2Pgr7VEf+Sz+LGGXEqCnsQiCp3sJ8g5triOJLQLyrN 7YMQ0fT7rZ6Wp0QG0AIyu8d1NY2r0H9NjX34FUCEnYcXmEBs/Reecs4nvloWa+lugBRp gsInLvbgD5zxaxw+QaeuvwY5unSPw6kQ9LGfdPNutgB6hvZKHoThU/SV80GctG4PfPJw 5hw96HDFtV7ftpCX1jShPVNMqERultJ5kY1IZ/jGQjm86V7V2d1dx2qeOb73tflOGj0A tmV4DCK+O2qzOY2g64+WqwbPVONoYyIhAv1zA5qjxF5wjelEQ73e3CsV0tNgVgrbafLa S+4w== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=LaX8mwKBi/XAJYbEflwlLJF4Sx6k1YhDQbEOGqO2B2U=; b=zqVIPi6Gbcmq3tPNH18zZNzZXvnYw3CnyqbgaifDJ/7L/qiRbeZALKYpo9raQyjtqz 8bNDbL4ohDb6o2OAHGg8X55Dr5JpQPID875GoJEmGVKFASs3GjoP6/ei6rLVNoay5A/Y b/xVqEFNrrouuGpwRBECyxZviJXwxkcFknEvMduyaUkJgb79MdgP2fz4pa6+2PwIIbgG 2nG1GPkpAR2oyFCQaruJk2iE0xaWrX/bu1VFt5UO/orUSJsUtqayZaViruqp5M3FkkvH +jBm8FZPOqhbBHs2Vze0pfXkaskkuKT6t/EB8gG31eYfVO5gPR644La8Ywl/szpAI4sP X8OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=SyjR3aW8; dkim=neutral (no key) header.i=@vger.kernel.org; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si4232829edq.362.2020.09.04.08.23.20; Fri, 04 Sep 2020 08:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=SyjR3aW8; dkim=neutral (no key) header.i=@vger.kernel.org; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730883AbgIDPWZ (ORCPT + 99 others); Fri, 4 Sep 2020 11:22:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730160AbgIDPV7 (ORCPT ); Fri, 4 Sep 2020 11:21:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BB5BC061244; Fri, 4 Sep 2020 08:21:59 -0700 (PDT) Date: Fri, 04 Sep 2020 15:21:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1599232915; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LaX8mwKBi/XAJYbEflwlLJF4Sx6k1YhDQbEOGqO2B2U=; b=SyjR3aW8eL3UhKO08YYBRO1cqRRerjvSHPkcjV2QX7aKIVDo3hTaTc2xQSdudd8Q4guAqT ChlgJGqzGeA1qaVLz+l4uHm0gLkaHg7iXw32xtKQ1HjSWXlwbXdVvqZKcYyiP7l8FvDJh9 oGIxsnPotxXLn5dZW3K0ZrA+veAScWGyrQFyXAMnJmlwtPKigD9X7mo/euOmBuRMJDzOlJ H4VyUnkcnwVwO3JKXJVWDHfz97px+91bdRZ9beEX0O2AZ5ZFdzuZeVmZxAKtHXxqn9mXn4 WltVkuzEGq0F7CJWbU5U18UVMG3pI2BDX9CrtjETLvj/J1299itr1otZaCgJNw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1599232915; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LaX8mwKBi/XAJYbEflwlLJF4Sx6k1YhDQbEOGqO2B2U=; b=N/2YWXu3cC8cyAeel8JYKDuSEuIML+9C15GQPYaJa8gZQaLAWwIH3oU8vO8fqIpMNWGpAe 01pb02D81fIUmzDw== From: "tip-bot2 for Akshay Gupta" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: ras/core] x86/mce: Increase maximum number of banks to 64 Cc: Akshay Gupta , Yazen Ghannam , Borislav Petkov , x86 , LKML In-Reply-To: <20200828192412.320052-1-Yazen.Ghannam@amd.com> References: <20200828192412.320052-1-Yazen.Ghannam@amd.com> MIME-Version: 1.0 Message-ID: <159923291431.20229.1749748339999502192.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the ras/core branch of tip: Commit-ID: a0bc32b3cacf194dc479b342f006203fd1e1941a Gitweb: https://git.kernel.org/tip/a0bc32b3cacf194dc479b342f006203fd1e1941a Author: Akshay Gupta AuthorDate: Fri, 28 Aug 2020 19:24:12 Committer: Borislav Petkov CommitterDate: Fri, 04 Sep 2020 17:17:27 +02:00 x86/mce: Increase maximum number of banks to 64 ...because future AMD systems will support up to 64 MCA banks per CPU. MAX_NR_BANKS is used to allocate a number of data structures, and it is used as a ceiling for values read from MCG_CAP[Count]. Therefore, this change will have no functional effect on existing systems with 32 or fewer MCA banks per CPU. However, this will increase the size of the following structures: Global bitmaps: - core.c / mce_banks_ce_disabled - core.c / all_banks - core.c / valid_banks - core.c / toclear - Total: 32 new bits * 4 bitmaps = 16 new bytes Per-CPU bitmaps: - core.c / mce_poll_banks - intel.c / mce_banks_owned - Total: 32 new bits * 2 bitmaps = 8 new bytes The bitmaps are arrays of longs. So this change will only affect 32-bit execution, since there will be one additional long used. There will be no additional memory use on 64-bit execution, because the size of long is 64 bits. Global structs: - amd.c / struct smca_bank smca_banks[]: 16 bytes per bank - core.c / struct mce_bank_dev mce_bank_devs[]: 56 bytes per bank - Total: 32 new banks * (16 + 56) bytes = 2304 new bytes Per-CPU structs: - core.c / struct mce_bank mce_banks_array[]: 16 bytes per bank - Total: 32 new banks * 16 bytes = 512 new bytes 32-bit Total global size increase: 2320 bytes Total per-CPU size increase: 520 bytes 64-bit Total global size increase: 2304 bytes Total per-CPU size increase: 512 bytes This additional memory should still fit within the existing .data section of the kernel binary. However, in the case where it doesn't fit, an additional page (4kB) of memory will be added to the binary to accommodate the extra data which will be the maximum size increase of vmlinux. Signed-off-by: Akshay Gupta [ Adjust commit message and code comment. ] Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200828192412.320052-1-Yazen.Ghannam@amd.com --- arch/x86/include/asm/mce.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 6adced6..109af5c 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -200,12 +200,8 @@ void mce_setup(struct mce *m); void mce_log(struct mce *m); DECLARE_PER_CPU(struct device *, mce_device); -/* - * Maximum banks number. - * This is the limit of the current register layout on - * Intel CPUs. - */ -#define MAX_NR_BANKS 32 +/* Maximum number of MCA banks per CPU. */ +#define MAX_NR_BANKS 64 #ifdef CONFIG_X86_MCE_INTEL void mce_intel_feature_init(struct cpuinfo_x86 *c);