lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240523155641.2805411-4-yazen.ghannam@amd.com>
Date: Thu, 23 May 2024 10:56:35 -0500
From: Yazen Ghannam <yazen.ghannam@....com>
To: <linux-edac@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>, <tony.luck@...el.com>, <x86@...nel.org>,
	<avadhut.naik@....com>, <john.allen@....com>, Yazen Ghannam
	<yazen.ghannam@....com>
Subject: [PATCH 3/9] x86/mce: Increment MCP count only for timer calls

MCP count is currently incremented for any call to machine_check_poll().
Therefore, the count includes calls from the timer, boot-time polling,
and interrupt handlers.

Only increment the MCP count when called from the timer so as to avoid
double counting the interrupt handlers.

Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
---
 arch/x86/kernel/cpu/mce/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 287108de210e..70c8df1a766a 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -683,8 +683,6 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
 	struct mce m;
 	int i;
 
-	this_cpu_inc(mce_poll_count);
-
 	mce_gather_info(&m, NULL);
 
 	if (flags & MCP_TIMESTAMP)
@@ -1667,8 +1665,10 @@ static void mce_timer_fn(struct timer_list *t)
 
 	iv = __this_cpu_read(mce_next_interval);
 
-	if (mce_available(this_cpu_ptr(&cpu_info)))
+	if (mce_available(this_cpu_ptr(&cpu_info))) {
+		this_cpu_inc(mce_poll_count);
 		mc_poll_banks();
+	}
 
 	/*
 	 * Alert userspace if needed. If we logged an MCE, reduce the polling
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ