2c402a80 | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: support BMG crashlog
The Battlemage GPU has the type 1 version 2 crashlog feature.
Update the crashlog driver to support this crashlog version.
Signed-off-by: Michael J. Ru
platform/x86/intel/pmt: support BMG crashlog
The Battlemage GPU has the type 1 version 2 crashlog feature.
Update the crashlog driver to support this crashlog version.
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-14-michael.j.ruhl@intel.com [ij: make crashlog_type1_ver2 static] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
5623fa68 | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: use a version struct
In preparation for supporting multiple crashlog versions, use a struct to keep bit offset info for the status and control bits.
Reviewed-by: Ilpo Järvin
platform/x86/intel/pmt: use a version struct
In preparation for supporting multiple crashlog versions, use a struct to keep bit offset info for the status and control bits.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-13-michael.j.ruhl@intel.com [ij: move crashlog_type1_ver0 to its final place & add consts to crashlog_info] Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
66df9fa7 | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: refactor base parameter
To support an upcoming crashlog change, use the parent of struct intel_pmt_entry, struct crashlog_entry, as a main parameter.
Using struct crashlog_e
platform/x86/intel/pmt: refactor base parameter
To support an upcoming crashlog change, use the parent of struct intel_pmt_entry, struct crashlog_entry, as a main parameter.
Using struct crashlog_entry will allow for a more flexible interface to control the crashlog feature.
- Refactor to use struct crashlog_entry in place of struct intel_pmt_entry - Rename variables from "entry" to "crashlog"
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-12-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
f57b32cb | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: add register access helpers
The control register is used in a read/modify/write pattern. The status register is used in a read/check bit pattern.
Add helpers to eliminate co
platform/x86/intel/pmt: add register access helpers
The control register is used in a read/modify/write pattern. The status register is used in a read/check bit pattern.
Add helpers to eliminate common code.
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-11-michael.j.ruhl@intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
8ab4f88d | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: decouple sysfs and namespace
The PMT namespace includes the crashlog sysfs attribute information. Other crashlog version/types may need different sysfs attributes. Coupling t
platform/x86/intel/pmt: decouple sysfs and namespace
The PMT namespace includes the crashlog sysfs attribute information. Other crashlog version/types may need different sysfs attributes. Coupling the attributes with the namespace blocks this usage.
Decouple sysfs attributes from the name space and add them to the specific entry.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-10-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
5c7bfa10 | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: correct types
A couple of local variables do not match the return types of some of the functions.
Update the mismatched types to match.
Reviewed-by: Ilpo Järvinen <ilpo.jar
platform/x86/intel/pmt: correct types
A couple of local variables do not match the return types of some of the functions.
Update the mismatched types to match.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-9-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
147c18d8 | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: re-order trigger logic
Setting the clear bit or checking the complete bit before checking to see if crashlog is disabled seems incorrect.
Check disable before accessing any
platform/x86/intel/pmt: re-order trigger logic
Setting the clear bit or checking the complete bit before checking to see if crashlog is disabled seems incorrect.
Check disable before accessing any other bits.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-8-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
4f8fa22d | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: use guard(mutex)
Update the mutex paths to use the new guard() mechanism.
With the removal of goto, do some minor cleanup of the current logic path.
Reviewed-by: David E. B
platform/x86/intel/pmt: use guard(mutex)
Update the mutex paths to use the new guard() mechanism.
With the removal of goto, do some minor cleanup of the current logic path.
Reviewed-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-7-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
75a496aa | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: mutex clean up
The header file for mutex usage and mutex_destroy() cleanup code is absent from the crashlog.c module.
Add the header file and mutex_destroy().
Reviewed-by:
platform/x86/intel/pmt: mutex clean up
The header file for mutex usage and mutex_destroy() cleanup code is absent from the crashlog.c module.
Add the header file and mutex_destroy().
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-6-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
ba22fe0c | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: white space cleanup
Noticed two white space issues; cleaned them.
Reviewed-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.int
platform/x86/intel/pmt: white space cleanup
Noticed two white space issues; cleaned them.
Reviewed-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-5-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
54d5cd47 | 13-Jul-2025 |
Michael J. Ruhl <michael.j.ruhl@intel.com> |
platform/x86/intel/pmt: fix a crashlog NULL pointer access
Usage of the intel_pmt_read() for binary sysfs, requires a pcidev. The current use of the endpoint value is only valid for telemetry endpoi
platform/x86/intel/pmt: fix a crashlog NULL pointer access
Usage of the intel_pmt_read() for binary sysfs, requires a pcidev. The current use of the endpoint value is only valid for telemetry endpoint usage.
Without the ep, the crashlog usage causes the following NULL pointer exception:
BUG: kernel NULL pointer dereference, address: 0000000000000000 Oops: Oops: 0000 [#1] SMP NOPTI RIP: 0010:intel_pmt_read+0x3b/0x70 [pmt_class] Code: Call Trace: <TASK> ? sysfs_kf_bin_read+0xc0/0xe0 kernfs_fop_read_iter+0xac/0x1a0 vfs_read+0x26d/0x350 ksys_read+0x6b/0xe0 __x64_sys_read+0x1d/0x30 x64_sys_call+0x1bc8/0x1d70 do_syscall_64+0x6d/0x110
Augment struct intel_pmt_entry with a pointer to the pcidev to avoid the NULL pointer exception.
Fixes: 045a513040cc ("platform/x86/intel/pmt: Use PMT callbacks") Cc: stable@vger.kernel.org Reviewed-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-2-michael.j.ruhl@intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
6382c273 | 11-Jul-2025 |
Arnd Bergmann <arnd@arndb.de> |
platform/x86/intel/pmt/discovery: fix format string warning
When -Wformat-security is enabled, this new code triggers it:
drivers/platform/x86/intel/pmt/discovery.c: In function 'pmt_features_disco
platform/x86/intel/pmt/discovery: fix format string warning
When -Wformat-security is enabled, this new code triggers it:
drivers/platform/x86/intel/pmt/discovery.c: In function 'pmt_features_discovery': drivers/platform/x86/intel/pmt/discovery.c:505:36: error: format not a string literal and no format arguments [-Werror=format-security] 505 | pmt_feature_names[feature->id]);
Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20250711072718.2748415-1-arnd@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
428f6f3a | 09-Jul-2025 |
Nathan Chancellor <nathan@kernel.org> |
platform/x86/intel/pmt/discovery: Fix size_t specifiers for 32-bit
When building i386 allmodconfig, there are two warnings in the newly added discovery code:
drivers/platform/x86/intel/pmt/discov
platform/x86/intel/pmt/discovery: Fix size_t specifiers for 32-bit
When building i386 allmodconfig, there are two warnings in the newly added discovery code:
drivers/platform/x86/intel/pmt/discovery.c: In function 'pmt_feature_get_feature_table': drivers/platform/x86/intel/pmt/discovery.c:427:35: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] 427 | if (WARN(size > res_size, "Bad table size %ld > %pa", size, &res_size)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ | | | size_t {aka unsigned int} ... drivers/platform/x86/intel/pmt/discovery.c:427:53: note: format string is defined here 427 | if (WARN(size > res_size, "Bad table size %ld > %pa", size, &res_size)) | ~~^ | | | long int | %d
drivers/platform/x86/intel/pmt/discovery-kunit.c: In function 'validate_pmt_regions': include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] ... drivers/platform/x86/intel/pmt/discovery-kunit.c:35:17: note: in expansion of macro 'kunit_info' 35 | kunit_info(test, "\t\taddr=%p, size=%lu, num_rmids=%u", region->addr, region->size, | ^~~~~~~~~~
size_t is 'unsigned long' for 64-bit platforms but 'unsigned int' for 32-bit platforms, so '%ld' is not correct. Use the proper size_t specifier, '%zu', to resolve the warnings on 32-bit platforms while not affecting 64-bit platforms.
Reported-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kernelci.org bot <bot@kernelci.org> Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver") Fixes: b9707d46a959 ("platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API") Closes: https://lore.kernel.org/all/CACo-S-29Degjym-azsJNSd1yofLOB2_Rf5xpa9b7L-14OPn7wQ@mail.gmail.com/ Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20250708-discovery-pmt-fix-32-bit-formats-v1-1-296a5fc9c3d4@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
b9707d46 | 03-Jul-2025 |
David E. Box <david.e.box@linux.intel.com> |
platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API
Adds a KUNIT test for the intel_pmt_get_regions_by_feature() API.
Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: h
platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API
Adds a KUNIT test for the intel_pmt_get_regions_by_feature() API.
Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20250703022832.1302928-16-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
42dabe54 | 03-Jul-2025 |
David E. Box <david.e.box@linux.intel.com> |
platform/x86/intel/pmt/telemetry: Add API to retrieve telemetry regions by feature
Introduce a new API, intel_pmt_get_regions_by_feature(), that gathers telemetry regions based on a provided capabil
platform/x86/intel/pmt/telemetry: Add API to retrieve telemetry regions by feature
Introduce a new API, intel_pmt_get_regions_by_feature(), that gathers telemetry regions based on a provided capability flag. This API enables retrieval of regions with various capabilities (for example, RMID-based telemetry) and provides a unified interface for accessing them. Resource management is handled via reference counting using intel_pmt_put_feature_group().
Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20250703022832.1302928-15-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|