]> www.infradead.org Git - users/mchehab/rasdaemon.git/log
users/mchehab/rasdaemon.git
5 months agounified-sel: replace license boilerplate with SPDX
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:45:43 +0000 (16:45 +0100)]
unified-sel: replace license boilerplate with SPDX

Use GPL-2.0-or-later SPDX tag instead of a license boilerplate
to GPL-2.0+.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoras-page-isolation: fix additional coding style issues
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:43:02 +0000 (16:43 +0100)]
ras-page-isolation: fix additional coding style issues

Fix some indentation issues and an uneeded parenthesis
inside ras-page-isolation code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoras-page-isolation: make memory_location_field static
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:39:21 +0000 (16:39 +0100)]
ras-page-isolation: make memory_location_field static

Those structures are used only internally inside the
ras-page-isolation code. They're not public. Make them static.

While here, fix coding style.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoras-page-isolation: drop some uneeded prototype
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:31:32 +0000 (16:31 +0100)]
ras-page-isolation: drop some uneeded prototype

There is a prototype not used and two other prototypes that
are used only internally inside the function.

Make such functions static and drop the unused one.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoras-page-isolation: use snprintf() instead of sprintf()
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:28:36 +0000 (16:28 +0100)]
ras-page-isolation: use snprintf() instead of sprintf()

Use the safer snprintf() call to avoid the risk of going past the
buffer.

While here, make row_record_get_id() static.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agomce-intel: drop a code commented a long time ago with an action
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:20:34 +0000 (16:20 +0100)]
mce-intel: drop a code commented a long time ago with an action

There is a commented out code at mce-intel that has been at
rasdaemon for a long time.

Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agomce-intel-ivb/mce-intel-sb: remove code commented with #if 0
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:18:41 +0000 (16:18 +0100)]
mce-intel-ivb/mce-intel-sb: remove code commented with #if 0

The dead code is there for a long time without any attempts
to actually implement it for SB/IVB. As such CPUs were released
a long time ago, it is unlikely that someone would address the
comments there.

So, drop the dead code. If needed, this patch can be reversed
later.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agorasdaemon: don't use braces for single statement blocks
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:13:50 +0000 (16:13 +0100)]
rasdaemon: don't use braces for single statement blocks

Solve those checkpatch warnings:

WARNING: braces {} are not necessary for single statement blocks
+ if (clock_gettime(clk_id, &ts) == 0 && !strcmp(ev.error_type, "Corrected")) {
+ ras_record_row_error(ev.driver_detail, ev.error_count, ts.tv_sec, ev.address);
+ }

total: 0 errors, 1 warnings, 0 checks, 304 lines checked
WARNING: braces {} are not necessary for single statement blocks
+ if (!matched) {
+ log(TERM, LOG_INFO, "Improper %s, set to default off\n", env);
+ }

WARNING: braces {} are not necessary for any arm of this statement
+ if (rr1->type == GHES) {
[...]
+ } else {
[...]

WARNING: braces {} are not necessary for single statement blocks
+ for (int i = 0; i < ROW_LOCATION_FIELDS_NUM; i++) {
+ dst->location_fields[i] = src->location_fields[i];
+ }

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoras-page-isolation: don't use "/**" for normal comments
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:11:30 +0000 (16:11 +0100)]
ras-page-isolation: don't use "/**" for normal comments

The usage of /** is reserved for doxygen markups. Don't use
it where it doesn't belong.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agorasdaemon: use __func__ instead of the name of the function
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:09:18 +0000 (16:09 +0100)]
rasdaemon: use __func__ instead of the name of the function

Solve some checkpatch warnings about not usint __func__ at the
rasdaemon logs.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agorasdaemon: fix some coding style issues
Mauro Carvalho Chehab [Mon, 18 Nov 2024 15:01:23 +0000 (16:01 +0100)]
rasdaemon: fix some coding style issues

Use checkpatch to fix some trivial coding style issues with:

$ ./scripts/checkpatch.pl -f *.c -q --strict --fix-inplace

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoipmitool SEL logging of AER CEs on OpenBMC platforms
Krishna Dhulipala [Thu, 19 Sep 2024 14:58:37 +0000 (07:58 -0700)]
ipmitool SEL logging of AER CEs on OpenBMC platforms

Signed-off-by: Krishna Dhulipala <krishnad@meta.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agoThe rasdaemon service may fail to be started for the first time.
zhuofeng [Sat, 29 Jun 2024 09:27:56 +0000 (17:27 +0800)]
The rasdaemon service may fail to be started for the first time.

The rasdaemon creates a separate instance virtual directory on first startup, like `/sys/kernel/debug/tracing/instances/rasdaemon`.

After the directory is created, the kernel generates virtual files such as `trace_clock` and `set_event` in `/sys/kernel/debug/tracing/instances/rasdaemon`.

The kernel generates virtual files and the rasdaemon accesses the virtual files at the same time. Therefore, the kernel may not generate the virtual files when the rasdaemon accesses the virtual files.

So add up to 30 seconds to give the kernel enough time to generate the files.

Signed-off-by: zhuofeng <zhuofeng2@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agoMakefile: only enable rbtree if needed
Mauro Carvalho Chehab [Mon, 18 Nov 2024 13:35:28 +0000 (14:35 +0100)]
Makefile: only enable rbtree if needed

Don't enable rbtree and ras-page-isolation code unconditionally.
Only enable it if PFA is compiled.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoNew feature: support memory row CE threshold policy
zhuofeng [Mon, 4 Mar 2024 13:04:42 +0000 (21:04 +0800)]
New feature: support memory row CE threshold policy

- Introduction: Identify memory row faults in memory CE faults and
isolate the physical memory pages where row faults occur. This method
can effectively prevent CE storms or memory UCE faults caused by memory
row failures.

- Implementation: The system counts the number of CE faults in the same
memory row within a specified period. If the number of CE faults exceeds
the configured threshold, the system considers that the memory row may
fail and isolates all physical pages recorded in the memory row.

Notes:
1. This function is disabled by default. You can enable it by
configuring the'ROW_CE_ACTION' field in the '/etc/sysconfig/rasdaemon' configuration file.
2. If both row isolation and page isolation are enabled, page isolation is automatically
disabled by default.
3. If the number of fault times in the DIMM CE fault information received by the rasdaemon
is 0, the BIOS does not correctly parse the number of fault times when parsing the fault information.
When a fault occurs, the rasdaemon process considers that the number of faults is 1 by default,
which is the same as the kernel process.

Signed-off-by: zhuofeng <zhuofeng2@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agoras-page-isolation: drop an unused variable
Mauro Carvalho Chehab [Mon, 18 Nov 2024 13:03:26 +0000 (14:03 +0100)]
ras-page-isolation: drop an unused variable

There's no need to store the value of strtoul() during the
overflow check. Remove it, as this is causing a warning:

ras-page-isolation.c: In function ‘parse_isolation_env’:
ras-page-isolation.c:166:47: warning: unused variable ‘converted_value’ [-Wunused-variable]
  166 |                                 unsigned long converted_value = strtoul(config->env, &endptr, 10);
      |                                               ^~~~~~~~~~~~~~~

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoFix the bug that `config->env` is greater than `ulong_max` when units->val=1
zhuofeng [Thu, 7 Dec 2023 06:37:50 +0000 (14:37 +0800)]
Fix the bug that `config->env` is greater than `ulong_max` when units->val=1

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agorasdaemon: Modify support for vendor-specific machine check error information
Avadhut Naik [Thu, 7 Nov 2024 06:24:44 +0000 (06:24 +0000)]
rasdaemon: Modify support for vendor-specific machine check error information

Commit 83a3ced797256d ("rasdaemon: Add support for vendor-specific
machine check error information") assumes that MCA_CONFIG MSR will be
exported as part of vendor-specific error information through the MCE
tracepoint.

The same, however, is not true anymore. MCA_CONFIG MSR will not be
exported through the MCE tracepoint. Instead, the data from MCA_SYND1/2
MSRs, exported as vendor-specific error information on newer AMD SOCs,
should always be interpreted as FRUText.

Modify the error decoding support accordingly.

Fixes: 83a3ced797256d ("rasdaemon: Add support for vendor-specific
machine check error information")
Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agorasdaemon: ras-mc-ctl: Log hpa and region info from cxl_general_media and cxl_dram...
Shiju Jose [Thu, 16 May 2024 14:23:44 +0000 (15:23 +0100)]
rasdaemon: ras-mc-ctl: Log hpa and region info from cxl_general_media and cxl_dram tables

Add support for read and log hpa and region info from cxl_general_media and
cxl_dram tables.

Note: This change does not have backward compatability, because
the select command with newly added columns would fail with previous
CXL tables where newly added columns are not present.
The issue can be solved with updating the CXL table's name to v2,
but again no backward compatability in ras-mc-ctl for listing errors
which fails when previous version of CXL table only present in the
database as it cannot find v2 of the table.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: CXL: Extract, log and record region info from cxl_general_media and cxl_dr...
Shiju Jose [Wed, 15 May 2024 11:18:36 +0000 (12:18 +0100)]
rasdaemon: CXL: Extract, log and record region info from cxl_general_media and cxl_dram events

Add extract, log and record region info to cxl_general_media and
cxl_dram events.

The corresponding kernel changes:
https://lore.kernel.org/all/cover.1711598777.git.alison.schofield@intel.com/T/#m6fd773b5477fc44b875848e053708a1c8996c4e4

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: CXL: Fix uncorrectable macro spelling
Shiju Jose [Tue, 14 May 2024 14:22:42 +0000 (15:22 +0100)]
rasdaemon: CXL: Fix uncorrectable macro spelling

Fix the macro (CXL_GMER_EVT_DESC_UNCORECTABLE_EVENT) spelling .
Uncorrectable is spelled with two r's.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: ras-non-standard-handler: Fix checkpatch warning
Shiju Jose [Mon, 19 Aug 2024 11:11:44 +0000 (12:11 +0100)]
rasdaemon: ras-non-standard-handler: Fix checkpatch warning

Fix following checkpatch warning,
CHECK: spaces preferred around that '*' (ctx:WxV)
+ sqlite3_stmt *stmt_dec_record;

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: ras-events: Fix warning ‘filter_ras_mc_event’ defined but not used
Shiju Jose [Mon, 19 Aug 2024 10:56:15 +0000 (11:56 +0100)]
rasdaemon: ras-events: Fix warning ‘filter_ras_mc_event’ defined but not used

Fix following compilation warning,
ras-events.c:318:12: warning: ‘filter_ras_mc_event’ defined but not used [-Wunused-function]
 static int filter_ras_mc_event(struct ras_events *ras, char *group, char *event,

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: ras-arm-handler: Fix checkpatch warning length exceeds 120 columns
Shiju Jose [Mon, 19 Aug 2024 10:51:30 +0000 (11:51 +0100)]
rasdaemon: ras-arm-handler: Fix checkpatch warning length exceeds 120 columns

Fix following checkpatch warning in ras-arm-handler.
+ trace_seq_printf(s, " Program execution can be restarted reliably at the PC associated with the error");

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: ras-events: removed obselete code under #if 0
Shiju Jose [Mon, 19 Aug 2024 10:48:06 +0000 (11:48 +0100)]
rasdaemon: ras-events: removed obselete code under #if 0

Remove unused code enclosed under #if 0 to fix the checkpatch
warnings.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: ras-mce-handler: Fix checkpatch errors
Shiju Jose [Mon, 19 Aug 2024 10:44:58 +0000 (11:44 +0100)]
rasdaemon: ras-mce-handler: Fix checkpatch errors

Fix following checkpatch error in  ras-mce-handler.c

Delete below obselte code under #if 0 ... #endif
WARNING: Consider removing the code enclosed by this #if 0 and its #endif

WARNING: Consider removing the code enclosed by this #if 0 and its #endif

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: rbtree: removed unused definition for RB_ROOT
Shiju Jose [Mon, 19 Aug 2024 10:38:16 +0000 (11:38 +0100)]
rasdaemon: rbtree: removed unused definition for RB_ROOT

Removed unused definition for RB_ROOT from rbtree.h

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: Fix for compilation warning in ras-memory-failure-handler.c
Shiju Jose [Mon, 19 Aug 2024 10:33:08 +0000 (11:33 +0100)]
rasdaemon: Fix for compilation warning in ras-memory-failure-handler.c

Fix for following compilation warning,
ras-memory-failure-handler.c:120:6: warning: implicit declaration of function ‘asprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
  if (asprintf(&env[ei++], "PATH=%s", getenv("PATH") ?: "/sbin:/usr/sbin:/bin:/usr/bin") < 0)

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 months agorasdaemon: Fix mem_fail_event build breakage
Avadhut Naik [Fri, 16 Aug 2024 18:10:40 +0000 (18:10 +0000)]
rasdaemon: Fix mem_fail_event build breakage

Commit 566a52622b1d ("add mem_fail_event trigger") introduces an event
trigger for a memory failure event.

However, if the rasdaemon is not configured with enable-memory-failure,
the setup function of the trigger, mem_fail_event_trigger_setup(), will
result in an undefined reference linker error when called through
setup_event_trigger().

Ensure that the setup function for the trigger is called only when the
rasdaemon has been configured with enable-memory-failure.

Fixes: 566a52622b1d ("add mem_fail_event trigger")
Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoras-events: fix -d option to work again
Tomohiro Misono [Thu, 8 Aug 2024 09:21:17 +0000 (09:21 +0000)]
ras-events: fix -d option to work again

It seems commit 3e9a59a184ca("Add dynamic switch of ras events support.")
inadvertedly introduced the change to ignore -d option.
Fix this so that -d will disable all trace events at once like before.

Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
5 months agoChangeLog: fix 0.8.1 release date
Baruch Siach [Tue, 30 Jul 2024 07:02:10 +0000 (10:02 +0300)]
ChangeLog: fix 0.8.1 release date

2023 -> 2024.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoci.yml: Change the name of the second job
Mauro Carvalho Chehab [Fri, 19 Jul 2024 09:11:05 +0000 (11:11 +0200)]
ci.yml: Change the name of the second job

Using the same name seems to cause troubles

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoci.yml: place checkpatch check in separate
Mauro Carvalho Chehab [Fri, 19 Jul 2024 08:58:07 +0000 (10:58 +0200)]
ci.yml: place checkpatch check in separate

This doesn't need to run for all 3 architectures.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoci.yml: run checkpatch when doing tests
Mauro Carvalho Chehab [Fri, 19 Jul 2024 08:54:56 +0000 (10:54 +0200)]
ci.yml: run checkpatch when doing tests

That helps detecting new problems at the code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoMakefile.am: add types.h to the list of headers
Mauro Carvalho Chehab [Fri, 19 Jul 2024 08:42:25 +0000 (10:42 +0200)]
Makefile.am: add types.h to the list of headers

Without that, make mock won't work properly.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoscripts/checkpatch.pl: add support for checking SPDX
Mauro Carvalho Chehab [Fri, 19 Jul 2024 08:38:58 +0000 (10:38 +0200)]
scripts/checkpatch.pl: add support for checking SPDX

Now that rasdaemon files have SPDX tags, enforce it via checkpatch
script.

The code was imported from the Linux Kernel, with some changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: enforce SPDX license tags
Mauro Carvalho Chehab [Fri, 19 Jul 2024 07:53:41 +0000 (09:53 +0200)]
rasdaemon: enforce SPDX license tags

Replace license text comments with SPDX tags. For files that don't
have any license, use the COPYING license (GPL-2.0).

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-events: demote log information about trace being enabled/disabled
Mauro Carvalho Chehab [Fri, 19 Jul 2024 07:38:52 +0000 (09:38 +0200)]
ras-events: demote log information about trace being enabled/disabled

There are already enough information outside __toggle_ras_mc_event()
to identify if a feature was enabled or disabled.

So, this is mostly for debugging purposes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: cleanup coding style
Mauro Carvalho Chehab [Fri, 19 Jul 2024 07:29:51 +0000 (09:29 +0200)]
rasdaemon: cleanup coding style

Solve a series of coding style warnings:

mce-amd.c:132: WARNING:RETURN_VOID: void function return statements are not generally useful
mce-amd-smca.c:984: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'm->family == 0x19'
non-standard-ampere.c:743: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'err->subtype == 0x01'
non-standard-ampere.c:743: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'err->subtype == 0x02'
non-standard-jaguarmicro.c:382: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'mod_id >= tbl_size'
non-standard-jaguarmicro.c:382: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around '!module'
non-standard-jaguarmicro.c:425: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'sub_id >= tbl_size'
non-standard-jaguarmicro.c:425: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around '!sub_module'
ras-cxl-handler.c:408: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'i > 0'
ras-cxl-handler.c:705: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'i > 0'
ras-mce-handler.c:251: WARNING:USE_NEGATIVE_ERRNO: return of an errno should typically be negative (ie: return -ENOMEM)

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-events: make returned error code consistent
Mauro Carvalho Chehab [Fri, 19 Jul 2024 06:24:25 +0000 (08:24 +0200)]
ras-events: make returned error code consistent

- Rework the returned code logic to be more consistent;
  - error codes will be using negative values;
  - positive values indicate special return codes.
- Don't bloat the logs with lots of error messages due to
  unsupported traces;
- Ensure that the number of CPUs will probably retrieved or bail out;
- Don't bail if it can't setup a monotone clock: it is better
  to have a wrong timestamp than no log at all.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: add .editorconfig file to follow our coding style
Mauro Carvalho Chehab [Fri, 19 Jul 2024 05:36:17 +0000 (07:36 +0200)]
rasdaemon: add .editorconfig file to follow our coding style

That helps keeping the coding style, as lots of editors support
this file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-report.h: avoid long lines
Mauro Carvalho Chehab [Thu, 18 Jul 2024 16:06:49 +0000 (18:06 +0200)]
ras-report.h: avoid long lines

Better format the stubs on this file to avoid long lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agotypes.h: remove whitespaces
Mauro Carvalho Chehab [Thu, 18 Jul 2024 16:02:43 +0000 (18:02 +0200)]
types.h: remove whitespaces

Cut-and-pasting it from /usr/include/linux/bits.h ended adding
unwanted whitespaces. Remove those.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agotypes.h: don't depend on linux/bits.h
Mauro Carvalho Chehab [Thu, 18 Jul 2024 15:51:28 +0000 (17:51 +0200)]
types.h: don't depend on linux/bits.h

Such include would require Kernel sources to be installed.
We don't really need that: Just copy the two GENMASK macros
and be it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-events: don't use extern inside a C file
Mauro Carvalho Chehab [Thu, 18 Jul 2024 15:40:17 +0000 (17:40 +0200)]
ras-events: don't use extern inside a C file

Fix a checkpatch warning:

ras-events.c:66: WARNING:AVOID_EXTERNS: externs should be avoided in .c files

by better handing how checks_inside var is handled.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: don't use unsafe strcpy, strcat and sprintf
Mauro Carvalho Chehab [Thu, 18 Jul 2024 11:02:30 +0000 (13:02 +0200)]
rasdaemon: don't use unsafe strcpy, strcat and sprintf

Remove all occurrences of those calls.

While here, also fix a couple missing whitespace warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agotypes.h: add an implementation for strscpy() and strscat()
Mauro Carvalho Chehab [Thu, 18 Jul 2024 14:44:47 +0000 (16:44 +0200)]
types.h: add an implementation for strscpy() and strscat()

Do our own implementation for such routines, as the Kernel
implementation is a lot more complex than what it would be needed
here.

With that, change checkpatch.pl to request usage of such functions
instead of unsafe strcpy()/strcat().

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-events: drop a dead code to check number of CPUs
Mauro Carvalho Chehab [Thu, 18 Jul 2024 12:23:43 +0000 (14:23 +0200)]
ras-events: drop a dead code to check number of CPUs

Just use sysconf(_SC_NPROCESSORS_ONLN) here.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-report: fix coding style and string fill issues
Mauro Carvalho Chehab [Thu, 18 Jul 2024 10:58:23 +0000 (12:58 +0200)]
ras-report: fix coding style and string fill issues

Don't use unsafe sprintf(). Instead, re-implement the logic in
a way that buffer overflows won't occur.

While here, also avoid lines longer than 80 columns when possible.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agonon-standard-jaguarmicro: avoid CamelCase
Mauro Carvalho Chehab [Thu, 18 Jul 2024 09:54:08 +0000 (11:54 +0200)]
non-standard-jaguarmicro: avoid CamelCase

Coding-style: no need to use CamelCase here. So, use lowercase.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agocheckpatch.pl: warn also about strcat and sprintf usages
Mauro Carvalho Chehab [Thu, 18 Jul 2024 11:01:00 +0000 (13:01 +0200)]
checkpatch.pl: warn also about strcat and sprintf usages

strcpy, strncpy and sprintf aren't safe, as they don't check
buffer overflows. Change the checkpatch logic to warn about
such usages.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: alphabetically sort includes
Mauro Carvalho Chehab [Thu, 18 Jul 2024 09:45:16 +0000 (11:45 +0200)]
rasdaemon: alphabetically sort includes

Reorder includes to ensure that they'll all be alphabetically
sorted.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-arm-handler: use GENMASK() macro
Mauro Carvalho Chehab [Thu, 18 Jul 2024 08:44:57 +0000 (10:44 +0200)]
ras-arm-handler: use GENMASK() macro

Now that we have the macro defined on types.h, use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: move type macros to a separate header (types.h)
Mauro Carvalho Chehab [Thu, 18 Jul 2024 08:43:17 +0000 (10:43 +0200)]
rasdaemon: move type macros to a separate header (types.h)

That makes easier to use/maintain it, without needing to include
ras-record.h when all it is needed are common macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: fix a coding style issue
Mauro Carvalho Chehab [Thu, 18 Jul 2024 08:43:07 +0000 (10:43 +0200)]
rasdaemon: fix a coding style issue

Comment block identation was wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-arm-handler: Parse and log ARM Processor Error Info table
Shiju Jose [Tue, 16 Jul 2024 16:36:59 +0000 (17:36 +0100)]
ras-arm-handler: Parse and log ARM Processor Error Info table

Parse and log ARM Processor Error Info table data, UEFI 2.9A/2.10
specs section N2.4.4.1.

[mchehab: fix a typo]
Suggested-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: fix some typos and correct spelling
Mauro Carvalho Chehab [Wed, 17 Jul 2024 05:19:05 +0000 (07:19 +0200)]
rasdaemon: fix some typos and correct spelling

With the help of checkpatch.pl --codespell, fix some typos.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoscripts/checkpatch.pl: set default mode to strict
Mauro Carvalho Chehab [Wed, 17 Jul 2024 05:11:44 +0000 (07:11 +0200)]
scripts/checkpatch.pl: set default mode to strict

There aren't many false positives. So, change default to strict
mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-arm-handler: cope with latest upstream changes
Mauro Carvalho Chehab [Wed, 17 Jul 2024 05:01:29 +0000 (07:01 +0200)]
ras-arm-handler: cope with latest upstream changes

Unfortunately, rasdaemon support for the firmware first
CPER ARM processor extended trace was added years before
having it merged upstream. That's bad, specially since
upstream revision requested a change on some fields.

Fix support for it by aligning with latest upstream version:
        https://lore.kernel.org/linux-edac/3853853f820a666253ca8ed6c7c724dc3d50044a.1720679234.git.mchehab+huawei@kernel.org/T/#m17003e47912b228e91e57ac6e4f90ea30061aa3b

A backward-compatible logic was added to avoid breaking with
existing OOT support.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoscripts/checkpatch.pl: some improvements to reduce false positives
Mauro Carvalho Chehab [Wed, 17 Jul 2024 04:23:00 +0000 (06:23 +0200)]
scripts/checkpatch.pl: some improvements to reduce false positives

- camelcase is OK for printk inttypes.h;
- strncpy is OK;
- accept up to 120 chars on lines without warnings;
- stop complaining about "BACKTRACE=" strings split on multiple lines;
- remove PREFER_DEFINED_ATTRIBUTE_MACRO, as this is kernel-specific;
- remove MACRO_ARG_REUSE, as this applies mostly to multithreading;
- don't warn on using do{} while(0) with single line statements;

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: coding style cleanup
Mauro Carvalho Chehab [Tue, 16 Jul 2024 23:06:52 +0000 (01:06 +0200)]
rasdaemon: coding style cleanup

Solve lots of coding style issues reported by:

./scripts/checkpatch.pl --terse --show-types --strict \
-f $(git ls-files|grep -E '\.[ch]$') \
--ignore MACRO_ARG_REUSE,STRCPY,IF_0,UNNECESSARY_PARENTHESES,CAMELCASE,STRNCPY; done

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoscripts/checkpatch.pl: do some additional cleanups
Mauro Carvalho Chehab [Tue, 16 Jul 2024 23:06:21 +0000 (01:06 +0200)]
scripts/checkpatch.pl: do some additional cleanups

Remove more things that won't make sense for rasdaemon.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoBump version to 0.8.1 v0.8.1
Mauro Carvalho Chehab [Tue, 16 Jul 2024 08:24:51 +0000 (10:24 +0200)]
Bump version to 0.8.1

There were lots of changes on this version. The summary at
ChangeLog contains a sanitized version of it.

It should be noticed that the next version will likely bring
an uAPI incompatible change. Unfortunately, UEFI CPER record
trace for ARM processor is currently incomplete upstream.

Rasdaemon gained support for an extended arm trace event that
supports all fields of the CPER record, but it depends on a
patch that it is not upstreamed yet.

While looked on such patches, there are some changes needed
to get it merged, meaning that future versions of rasdaemon
may not be compatible with the downstream patch anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: adjust install targets for the spec to be build
Mauro Carvalho Chehab [Tue, 16 Jul 2024 08:41:49 +0000 (10:41 +0200)]
rasdaemon: adjust install targets for the spec to be build

We use Fedora spec file to check if everything is OK. Do some
changes to make it happy.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-aer-handler: handle errors when running ipmitool
Mauro Carvalho Chehab [Tue, 16 Jul 2024 08:37:23 +0000 (10:37 +0200)]
ras-aer-handler: handle errors when running ipmitool

Without that, Fedora build will produce warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorbtree.h: Fix an issue introduced by checkpatch logic
Mauro Carvalho Chehab [Tue, 16 Jul 2024 08:12:42 +0000 (10:12 +0200)]
rbtree.h: Fix an issue introduced by checkpatch logic

Checkpatch actually broke RB_EMPTY_ROOT macro. It was defined
as:

#define RB_EMPTY_ROOT(root)    ((root)->rb_node == NULL)

It ended replacing it by:
((root)->!rb_node)

Which is not the way we espect it. Weird enough, this was compiling.
Anyway, what we want, instead, is:

#define RB_EMPTY_ROOT(root)    (!(root)->rb_node)

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: do some coding style cleanups
Mauro Carvalho Chehab [Tue, 16 Jul 2024 06:34:27 +0000 (08:34 +0200)]
rasdaemon: do some coding style cleanups

Adjust coding style on some files to somewhat match the Kernel's
coding style, with the help of scripts/checkpatch.pl.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoscripts/checkpatch.pl: add a script to check coding style
Mauro Carvalho Chehab [Tue, 16 Jul 2024 06:47:23 +0000 (08:47 +0200)]
scripts/checkpatch.pl: add a script to check coding style

We sort of follow Kernel coding style. Import a version of it,
making it compatible with rasdaemon coding style by removing
stuff that doesn't fix here.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: mce-amd-smca: Optimizing decoding of MCA_CTL_SMU bits
sathya priya kumar [Thu, 13 Jun 2024 05:29:09 +0000 (05:29 +0000)]
rasdaemon: mce-amd-smca: Optimizing decoding of MCA_CTL_SMU bits

Optimize smca_smu2_mce_desc in better way from the commit ced615c.

Update existing array with extended error descriptions instead
of creating new array, simplifying the code.

Signed-off-by: Sathya Priya Kumar <sathyapriya.k@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoAdd labels for TRX50 WS
tictooc [Sat, 29 Jun 2024 14:03:42 +0000 (14:03 +0000)]
Add labels for TRX50 WS

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoCleanup MCE error log on non-x86 args
Mauro Carvalho Chehab [Mon, 15 Jul 2024 14:40:26 +0000 (14:40 +0000)]
Cleanup MCE error log on non-x86 args

We can only register for MCE on x86 arch.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agocontrib/qemu_einj.py: make it more generic to allow other einj types
Mauro Carvalho Chehab [Mon, 15 Jul 2024 12:26:15 +0000 (14:26 +0200)]
contrib/qemu_einj.py: make it more generic to allow other einj types

Currently, the einj logic handles just ARM processor CPER events, but
it is easy to change it to support other types as well.

Rename the script and make it more generic to accept new subparsers
for different types of EINJ.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: add mem_fail_event trigger
Mauro Carvalho Chehab [Tue, 16 Jul 2024 05:05:32 +0000 (05:05 +0000)]
rasdaemon: add mem_fail_event trigger

This event is somewhat similar to mc_event, except that this one
occurs on ARM platforms and the fields are different.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agotrigger: parse only once TRIGGER_DIR env variable
Mauro Carvalho Chehab [Mon, 15 Jul 2024 11:40:37 +0000 (13:40 +0200)]
trigger: parse only once TRIGGER_DIR env variable

Instead of parsing TRIGGER_DIR every time a new event happens,
store the trigger full path, simplifying the logic and avoiding
memory leaks.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoras-mc-handler: cleanup trigger logic
Mauro Carvalho Chehab [Tue, 16 Jul 2024 05:38:13 +0000 (07:38 +0200)]
ras-mc-handler: cleanup trigger logic

- Only setup mc_ce_trigger/mc_ue_trigger if the trigger is
  valid;

- Check if the trigger is there before doing strcmp, as
  checking if a pointer is not null is faster than strcmp();

- Ensure that the trigger env vars will be const, as we don't
  want to accidentally override those env vars;

- Print trigger enabled messages when rasdaemon runs with -f;

- ensure that trigger variables will initialize to NULL;

- coding style cleanups.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agorasdaemon: add mc_event trigger
Ruidong Tian [Thu, 23 Nov 2023 09:47:25 +0000 (17:47 +0800)]
rasdaemon: add mc_event trigger

Allow users to run a trigger when RAS mc_event occurs, The mc_event
trigger is separated into CE trigger and UE trigger, this is because
CE is more frequent than UE, and the CE trigger will lead to more
performance hits. Users can choose different triggers for CE/UE to
reduce this effect.

Users can config trigger in /etc/sysconfig/rasdaemon:

    TRIGGER_DIR: The trigger diretory
    MC_CE_TRIGGER: The script executed when corrected error occurs.
    MC_UE_TRIGGER: The script executed when uncorrected error occurs.

No script will be executed if MC_CE_TRIGGER/MC_UE_TRIGGER is null.

Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoutil/arm_einj.py: fix a typo at virt-addr
Mauro Carvalho Chehab [Wed, 10 Jul 2024 13:07:44 +0000 (15:07 +0200)]
util/arm_einj.py: fix a typo at virt-addr

Typo: QAPI parameter is virt-addr.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoutil/arm_einj.py: remove a debug print
Mauro Carvalho Chehab [Wed, 10 Jul 2024 13:07:39 +0000 (15:07 +0200)]
util/arm_einj.py: remove a debug print

This was meant only for testing argument handling. Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9 months agoutil/arm_einj.py: add an utility for ARM error injection via QEMU
Mauro Carvalho Chehab [Wed, 10 Jul 2024 12:15:24 +0000 (14:15 +0200)]
util/arm_einj.py: add an utility for ARM error injection via QEMU

Testing rasdaemon is not easy, as it depends on either having
real hardware producing events or a test BIOS. This is usually
not available and/or not too reliable.

So, take a different approach by adding a QEMU QAPI designed for
doing hardware error injection. The QEMU patches are at:

https://gitlab.com/mchehab_kernel/qemu/-/tree/arm-error-inject-v2

And some instructions about how to use it are at rasdaemon wiki
pages at github:

https://github.com/mchehab/rasdaemon/wiki

Add the error injection tool to rasdaemon sources.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agoras-arm-handler: be compatible with upstream Kernel
Mauro Carvalho Chehab [Tue, 25 Jun 2024 08:05:45 +0000 (10:05 +0200)]
ras-arm-handler: be compatible with upstream Kernel

Changeset e37eb2f11a82 ("Add code to decode Ampere specific error")
broke ARM event record with upstream Kernel, as it requires a different
trace event than the one that it is on upstream Kernel, and it is
part of a pending pull request:

https://lore.kernel.org/all/20240321-b4-arm-ras-error-vendor-info-v5-rc3-v5-0-850f9bfb97a8@os.amperecomputing.com/

Restore its behavior by making parsing the UEFI 2.6+ N.17 and N.16
table extra fields to be optional. That should make it compatible
with current upstream Kernels again.

Fixes: e37eb2f11a82 ("Add code to decode Ampere specific error")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agoDo a coding style cleanup with regards to tabs and white spaces
Mauro Carvalho Chehab [Tue, 11 Jun 2024 10:01:40 +0000 (12:01 +0200)]
Do a coding style cleanup with regards to tabs and white spaces

Use tabs instead of spaces and remove blank ending whitespaces.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: Add Corrected Internal Error for aer_cor_errors
Jesus Esquivel [Mon, 3 Jun 2024 22:47:20 +0000 (16:47 -0600)]
rasdaemon: Add Corrected Internal Error for aer_cor_errors

Add "Corrected Internal Error" for aer_cor_errors to decode
the error reported in status register in bit 14.

Signed-off-by: Jesus Esquivel <jesus.esquivel@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: Update SMCA bank error descriptions
Avadhut Naik [Fri, 10 May 2024 18:20:19 +0000 (13:20 -0500)]
rasdaemon: Update SMCA bank error descriptions

Update error descriptions of SMCA bank types to support AMD's new Family
1Ah-based processors.
Also, modify some existing error descriptions to better reflect the error
received.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agoAdd Lenovo P920 DIMM labels
Raul E Rangel [Thu, 9 May 2024 18:55:11 +0000 (18:55 +0000)]
Add Lenovo P920 DIMM labels

This adds the labels entry for the Lenovo ThinkStation P920.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: Fix for vendor errors are not recorded in the SQLite database if some...
Shiju Jose [Wed, 20 Mar 2024 12:16:05 +0000 (12:16 +0000)]
rasdaemon: Fix for vendor errors are not recorded in the SQLite database if some cpus are offline

Fix for vendor errors are not recorded in the SQLite database if some cpus
are offline at the system start.

Issue:

This issue is reproducible by offline some cpus, run
./rasdaemon -f --record & and
inject vendor specific error supported in the rasdaemon.

Reason:

When the system starts with some of the cpus offline and then run
the rasdaemon, read_ras_event_all_cpus() exit with error and switch to
the multi thread way. However read() in read_ras_event() return error in
threads for each of the offline CPUs and does clean up including calling
ras_ns_finalize_vendor_tables(), which invokes sqlite3_finalize() on vendor
tables created. Thus the vendor error data does not stored in the SQLite
database when such error is reported next time.

Solution:

In ras_ns_add_vendor_tables() and ras_ns_finalize_vendor_tables() use
reference count and close vendor tables which created in ras_ns_add_vendor_tables()
based on the reference count.

Reported-by: Junhao He <hejunhao3@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agomce-amd-smca: update smca_hwid to use smca_bank_types
Aristeu Rozanski [Tue, 9 Apr 2024 14:06:30 +0000 (10:06 -0400)]
mce-amd-smca: update smca_hwid to use smca_bank_types

bank_type is used as smca_bank_types everywhere, there's no point in
declaring it as unsigned int. It also upsets covscan:

3. rasdaemon-0.6.7/mce-amd-smca.c:914: assignment: Assigning: "bank_type" = "s_hwid->bank_type".
7. rasdaemon-0.6.7/mce-amd-smca.c:926: cond_at_most: Checking "bank_type >= 64U" implies that "bank_type" and "s_hwid->bank_type" may be up to 63 on the false branch.
14. rasdaemon-0.6.7/mce-amd-smca.c:942: overrun-local: Overrunning array "smca_mce_descs" of 38 16-byte elements at element index 63 (byte offset 1023) using index "bank_type" (which evaluates to 63).
#   940|        /* Only print the descriptor of valid extended error code */
#   941|        if (xec < smca_mce_descs[bank_type].num_descs)
#   942|->              mce_snprintf(e->mcastatus_msg,
#   943|                             "%s. Ext Err Code: %d",
#   944|                             smca_mce_descs[bank_type].descs[xec],

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agolabels/asrock: Add DIMM labels for ASRock Rack X570D4U
Ivan Mironov [Thu, 28 Mar 2024 00:40:13 +0000 (05:40 +0500)]
labels/asrock: Add DIMM labels for ASRock Rack X570D4U

Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: Add support to parse microcode field of mce tracepoint
Avadhut Naik [Tue, 2 Apr 2024 05:07:38 +0000 (00:07 -0500)]
rasdaemon: Add support to parse microcode field of mce tracepoint

Support for exporting the Microcode Revision is being added to the
mce_record tracepoint.

Add the required, corresponding support in the rasdaemon for the field
to be parsed and logged or added to the database and viewed later through
ras-mc-ctl utility.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: Add support to parse the PPIN field of mce tracepoint
Avadhut Naik [Tue, 2 Apr 2024 04:33:07 +0000 (23:33 -0500)]
rasdaemon: Add support to parse the PPIN field of mce tracepoint

Support for exporting the PPIN (Protected Processor Inventory Number)
is being added to the mce_record tracepoint.

Add the required, corresponding support in the rasdaemon for the field
to be parsed and logged or added to the database and viewed later through
ras-mc-ctl utility.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support to display mcastatus_msg string
Avadhut Naik [Tue, 26 Mar 2024 04:06:08 +0000 (23:06 -0500)]
rasdaemon: ras-mc-ctl: Add support to display mcastatus_msg string

Currently, the mcastatus_msg string of struct mce_event is added to the
SQLite database by the rasdaemon when it is recording errors. The same
however, is not outputted by the ras-mc-ctl utility.

The string provides important error information relating to the received
MCE. For example, on AMD SMCA systems, the string outputs extended error
code and description. As such, the string should be present in the
output of ras-mc-ctl utility.

Add support to output the string through the ras-mc-ctl utility.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agoprint logs in the same line
zhuofeng [Tue, 12 Mar 2024 06:28:55 +0000 (14:28 +0800)]
print logs in the same line

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL memory module trace events
Shiju Jose [Mon, 12 Feb 2024 11:29:13 +0000 (11:29 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL memory module trace events

Add support for CXL memory module events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL DRAM trace events
Shiju Jose [Mon, 12 Feb 2024 11:22:03 +0000 (11:22 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL DRAM trace events

Add support for CXL DRAM events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL general media trace events
Shiju Jose [Mon, 12 Feb 2024 11:14:03 +0000 (11:14 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL general media trace events

Add support for CXL general media events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL generic trace events
Shiju Jose [Mon, 12 Feb 2024 10:56:25 +0000 (10:56 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL generic trace events

Add support for CXL generic events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL poison trace events
Shiju Jose [Mon, 12 Feb 2024 10:49:10 +0000 (10:49 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL poison trace events

Add support for CXL poison events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL overflow trace events
Shiju Jose [Mon, 12 Feb 2024 10:38:51 +0000 (10:38 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL overflow trace events

Add support for CXL overflow events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL AER correctable trace events
Shiju Jose [Mon, 12 Feb 2024 10:35:25 +0000 (10:35 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL AER correctable trace events

Add support for CXL AER correctable events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-mc-ctl: Add support for CXL AER uncorrectable trace events
Shiju Jose [Mon, 12 Feb 2024 10:27:58 +0000 (10:27 +0000)]
rasdaemon: ras-mc-ctl: Add support for CXL AER uncorrectable trace events

Add support for CXL AER uncorrectable events to the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
10 months agorasdaemon: ras-memory-failure-handler: update memory failure action page types
Shiju Jose [Tue, 6 Feb 2024 12:08:00 +0000 (12:08 +0000)]
rasdaemon: ras-memory-failure-handler: update memory failure action page types

Update memory failure action page types corresponding to the same in
mm/memory-failure.c in the kernel.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>