From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61C3D13D8A3; Tue, 27 May 2025 03:30:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748316656; cv=none; b=BkAoTSY7oPxTj22whIgesem09KbHz0sz4yKkAmbhHl+vaI4OG/EzqLtVUSyb+y4NO+ec6SpV0z82XFzUaGvOd/wlxrZMgXaZmkqfuFeYG6VZQRTY5I9DzIG39w07WI4x++9qivMurScmmviEzOydti47tAg6LnxynDc0J1+JW+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748316656; c=relaxed/simple; bh=4+1dYOsA3kHiY8rIfLnjAgd8wOHuIeN0O4AklhVQ26M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tNgPsuz+bFx9p4F0t8inlF8y/5XUgtuJWyWiqw1UWQ9oGu6l6IO65YMF0CREu1OjL3Ep3yJ46a6AMQJRjElZoTmOoio1FfNbYDqdGQeYu3oRKjtivEtMl4AgB1ll4ehm2YLqpTirZM2ZqP1bkAXKVCAmB1Afo+54aksJr/hfP5U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PDpCasoc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PDpCasoc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D81B4C4CEED; Tue, 27 May 2025 03:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748316655; bh=4+1dYOsA3kHiY8rIfLnjAgd8wOHuIeN0O4AklhVQ26M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PDpCasocKfbRpFVO+Gva5E2erDIv83oOIdsyR75Vq2GGa56oNa5MOdQa5qay1G54y S3D805nuKzNhvN1MGkOcNzDYg75XhUCqp/yL2uAtapUbK1S3n1G1UqKFxjn4ntxa2t CxK7rnXc/L95iZlTUmMOfPm+tWQHp0eHX8ylQn1MLkMLwWEVbEIqOGdVT8vlbCWjXx 1q7/F23sOsIArXHlRGvPt/BGFksZoRCqKz9JnzG/1PYvusJQ1vfQN1bIMcZcy537wE EtK8ERnZ0Vf1prle9VJ/upLUeNrvka0s29uYXbrEKAL1WDGe39ZbtoexMTV0Oi8rty ACZ9lz8fPa0vg== Date: Mon, 26 May 2025 20:30:52 -0700 From: Kees Cook To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Henrique de Moraes Holschuh , Hans de Goede , "Rafael J. Wysocki" , Len Brown , Masami Hiramatsu , Ard Biesheuvel , Mike Rapoport , Michal Wilczynski , Juergen Gross , Andy Shevchenko , "Kirill A. Shutemov" , Roger Pau Monne , David Woodhouse , Usama Arif , "Guilherme G. Piccoli" , Thomas Huth , Brian Gerst , kvm@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-mm@kvack.org, "Gustavo A. R. Silva" , Christoph Hellwig , Marco Elver , Andrey Konovalov , Andrey Ryabinin , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , LKML , kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2 04/14] x86: Handle KCOV __init vs inline mismatches Message-ID: <202505262028.E5B7A7E8@keescook> References: <20250523043251.it.550-kees@kernel.org> <20250523043935.2009972-4-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, May 26, 2025 at 12:53:13AM +0300, Ilpo Järvinen wrote: > On Thu, 22 May 2025, 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, we have to > > handle differences in how GCC's inline optimizations get resolved. For > > x86 this means forcing several functions to be inline with > > __always_inline. > > > > Signed-off-by: Kees Cook > > --- > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: Borislav Petkov > > Cc: Dave Hansen > > Cc: > > Cc: "H. Peter Anvin" > > Cc: Paolo Bonzini > > Cc: Vitaly Kuznetsov > > Cc: Henrique de Moraes Holschuh > > Cc: Hans de Goede > > Cc: "Ilpo Järvinen" > > Cc: "Rafael J. Wysocki" > > Cc: Len Brown > > Cc: Masami Hiramatsu > > Cc: Ard Biesheuvel > > Cc: Mike Rapoport > > Cc: Michal Wilczynski > > Cc: Juergen Gross > > Cc: Andy Shevchenko > > Cc: "Kirill A. Shutemov" > > Cc: Roger Pau Monne > > Cc: David Woodhouse > > Cc: Usama Arif > > Cc: "Guilherme G. Piccoli" > > Cc: Thomas Huth > > Cc: Brian Gerst > > Cc: > > Cc: > > Cc: > > Cc: > > Cc: > > Cc: > > Cc: > > --- > > > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c > > index e7350c9fa3aa..0518d5b1f4ec 100644 > > --- a/drivers/platform/x86/thinkpad_acpi.c > > +++ b/drivers/platform/x86/thinkpad_acpi.c > > @@ -559,12 +559,12 @@ static unsigned long __init tpacpi_check_quirks( > > return 0; > > } > > > > -static inline bool __pure __init tpacpi_is_lenovo(void) > > +static __always_inline bool __pure 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 tpacpi_is_ibm(void) > > { > > return thinkpad_id.vendor == PCI_VENDOR_ID_IBM; > > } > > Hi Kees, > > What's your plan on upstreaming route/timeline for this? I'd prefer to > retain full control over this file as we were planning on some > reorganization of files into lenovo/ subdir. I'm not in a big rush. I'm hoping to have this all in place for v6.17, but the Clang feature won't be in a released compiler version until September. :) I can send this bit separately for your tree. Thanks for taking a look! -- Kees Cook