linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Handle KCOV __init vs inline mismatches
@ 2025-05-29 18:18 Kees Cook
  2025-06-13 10:14 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2025-05-29 18:18 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Kees Cook, Henrique de Moraes Holschuh, Hans de Goede,
	ibm-acpi-devel, platform-driver-x86, linux-kernel,
	linux-hardening

When KCOV is enabled all functions get instrumented, unless the
__no_sanitize_coverage attribute is used. To prepare for
__no_sanitize_coverage being applied to __init functions[1], we have
to handle differences in how GCC's inline optimizations get resolved.
For thinkpad_acpi routines, this means forcing two functions to be
inline with __always_inline.

Link: https://lore.kernel.org/lkml/20250523043935.2009972-11-kees@kernel.org/ [1]
Signed-off-by: Kees Cook <kees@kernel.org>
---
This is split out of https://lore.kernel.org/lkml/20250523043935.2009972-4-kees@kernel.org/
at Ilpo's request.
---
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: <ibm-acpi-devel@lists.sourceforge.net>
Cc: <platform-driver-x86@vger.kernel.org>
---
 drivers/platform/x86/thinkpad_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 657625dd60a0..dc1fc069fed9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -558,12 +558,12 @@ static unsigned long __init tpacpi_check_quirks(
 	return 0;
 }
 
-static inline bool __pure __init tpacpi_is_lenovo(void)
+static __always_inline bool __pure __init tpacpi_is_lenovo(void)
 {
 	return thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO;
 }
 
-static inline bool __pure __init tpacpi_is_ibm(void)
+static __always_inline bool __pure __init tpacpi_is_ibm(void)
 {
 	return thinkpad_id.vendor == PCI_VENDOR_ID_IBM;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: thinkpad_acpi: Handle KCOV __init vs inline mismatches
  2025-05-29 18:18 [PATCH] platform/x86: thinkpad_acpi: Handle KCOV __init vs inline mismatches Kees Cook
@ 2025-06-13 10:14 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-06-13 10:14 UTC (permalink / raw)
  To: Kees Cook
  Cc: Henrique de Moraes Holschuh, Hans de Goede, ibm-acpi-devel,
	platform-driver-x86, linux-kernel, linux-hardening

On Thu, 29 May 2025 11:18:37 -0700, Kees Cook wrote:

> When KCOV is enabled all functions get instrumented, unless the
> __no_sanitize_coverage attribute is used. To prepare for
> __no_sanitize_coverage being applied to __init functions[1], we have
> to handle differences in how GCC's inline optimizations get resolved.
> For thinkpad_acpi routines, this means forcing two functions to be
> inline with __always_inline.
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: thinkpad_acpi: Handle KCOV __init vs inline mismatches
      commit: 6418a8504187dc7f5b6f9d0649c03e362cb0664b

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-13 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29 18:18 [PATCH] platform/x86: thinkpad_acpi: Handle KCOV __init vs inline mismatches Kees Cook
2025-06-13 10:14 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).