From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6276C36010 for ; Mon, 7 Apr 2025 21:50:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 967A6610BF; Mon, 7 Apr 2025 21:50:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AhXfHHgWsbWb; Mon, 7 Apr 2025 21:50:23 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BEBB361094 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1744062623; bh=gU9lD+RqDMo0wEfUDiyRdrBfsjXAPrpF0e2SpfAHy3o=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jZI6l3UighDDPpO7PCtswTryDkz9hrvma/OZQyAUP9DtArgYOB50qI22zdQHi3aoS SxVaT8LJoY5Ix7Vtx+UsNfOqPoRKZrvpT3TnaTWQQwqsAQAB8WlHyfCQIPKaF6//Ld BOo317jibQIfKJHB+b+MPteg8jXUyAOVtJstmZC2bS91NemSH1Konxzhq8B8IVMart 7/soAYQ9KrZ74I8nxPcNw5ufCf66TCr2m3fphmujY9fSspk5PRbL2fFbewW9ZQM0dQ HmuI99OlxGTkQlkJq9lojHSF7l07F2EhY/yXpfrjtQfhDERvcHswnCKcTDeDrGbuu5 zOulIxDJPs6ew== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id BEBB361094; Mon, 7 Apr 2025 21:50:23 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id AE9281DE for ; Mon, 7 Apr 2025 21:50:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8C64340C6A for ; Mon, 7 Apr 2025 21:50:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 3RF6l7BkK6KJ for ; Mon, 7 Apr 2025 21:50:21 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=199.247.17.104; helo=prime.voidband.net; envelope-from=oleksandr@natalenko.name; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 31FB340203 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 31FB340203 Received: from prime.voidband.net (prime.voidband.net [199.247.17.104]) by smtp4.osuosl.org (Postfix) with ESMTPS id 31FB340203 for ; Mon, 7 Apr 2025 21:50:20 +0000 (UTC) Received: from spock.localnet (unknown [212.20.115.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by prime.voidband.net (Postfix) with ESMTPSA id A20EE616710F; Mon, 07 Apr 2025 23:50:14 +0200 (CEST) From: Oleksandr Natalenko To: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, Przemek Kitszel , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Andrew Lunn , Tony Nguyen , Peter Zijlstra Date: Mon, 07 Apr 2025 23:49:35 +0200 Message-ID: <2983242.e9J7NaK4W3@natalenko.name> In-Reply-To: References: <4970551.GXAFRqVoOG@natalenko.name> <5874052.DvuYhMxLoT@natalenko.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3343055.aeNJFYEL58"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1744062615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gU9lD+RqDMo0wEfUDiyRdrBfsjXAPrpF0e2SpfAHy3o=; b=LC3gxE5VZ4L+DEwuwpOEE+tzW6EXFqsP2z9PdoW+xbBc6jHNK+Kw/5ptPjToRWcdggytT1 LtD7iF+q19Ny6NbPcHiSlggLtsT/A4YojUngAdMGoLxJy6gl5op/Y2FI7bigtNMnzmi3FX wPdW5gI0b3YnHEZV34kX+mgbSC+J2Q0= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=natalenko.name X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=natalenko.name header.i=@natalenko.name header.a=rsa-sha256 header.s=dkim-20170712 header.b=LC3gxE5V Subject: Re: [Intel-wired-lan] objtool warning in ice_free_prof_mask X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --nextPart3343055.aeNJFYEL58 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Oleksandr Natalenko To: Josh Poimboeuf Subject: Re: objtool warning in ice_free_prof_mask Date: Mon, 07 Apr 2025 23:49:35 +0200 Message-ID: <2983242.e9J7NaK4W3@natalenko.name> MIME-Version: 1.0 Hello. On pond=C4=9Bl=C3=AD 7. dubna 2025 23:42:51, st=C5=99edoevropsk=C3=BD letn= =C3=AD =C4=8Das Josh Poimboeuf wrote: > On Mon, Apr 07, 2025 at 11:21:27AM +0200, Oleksandr Natalenko wrote: > > It's not a new warning, I've observe it for several recent major kernel= releases already. > >=20 > > I do not build with CONFIG_COMPILE_TEST. > >=20 > > I've also realised I see this warning with -O3 only. I know this is > > unsupported, so feel free to ignore me, but I do -O3 builds for > > finding out possible loose ends in the code, and this is the only > > place where it breaks. > >=20 > > > > ``` > > > > drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof= _mask.isra.0() falls through to next function ice_free_flow_profs.cold() > > > > drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof= _mask.isra.0.cold() is missing an ELF size annotation > > > > ``` > > > >=20 > > > > If I mark ice_write_prof_mask_reg() as noinline, this warning disap= pears. > > > >=20 > > > > Any idea what's going wrong? >=20 > This type of error usually means some type of undefined behavior. Can > you share your config? No guarantees since it is -O3 after all, but I > can still take a look to see if it's pointing to a bug of some kind. Sure, thank you for looking into this. Here's my recipe to reproduce the issue: 1. expose -O3 ``` diff --git a/Makefile b/Makefile index 38689a0c36052..5ce5b44fa1496 100644 =2D-- a/Makefile +++ b/Makefile @@ -858,6 +858,9 @@ KBUILD_CFLAGS +=3D -fno-delete-null-pointer-checks ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE KBUILD_CFLAGS +=3D -O2 KBUILD_RUSTFLAGS +=3D -Copt-level=3D2 +else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 +KBUILD_CFLAGS +=3D -O3 +KBUILD_RUSTFLAGS +=3D -Copt-level=3D3 else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS +=3D -Os KBUILD_RUSTFLAGS +=3D -Copt-level=3Ds diff --git a/init/Kconfig b/init/Kconfig index dd2ea3b9a7992..03b1d768d1a55 100644 =2D-- a/init/Kconfig +++ b/init/Kconfig @@ -1481,6 +1481,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE with the "-O2" compiler flag for best performance and most helpful compile-time warnings. =20 +config CC_OPTIMIZE_FOR_PERFORMANCE_O3 + bool "Optimize more for performance (-O3)" + help + Choosing this option will pass "-O3" to your compiler to optimize + the kernel yet more for performance. + config CC_OPTIMIZE_FOR_SIZE bool "Optimize for size (-Os)" help ``` 2. use this config with v6.15-rc1: https://paste.voidband.net/2BVaYDQS.txt 3. compile: ``` $ make drivers/net/ethernet/intel/ice/ice.o =E2=80=A6 LD [M] drivers/net/ethernet/intel/ice/ice.o drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.is= ra.0() falls through to next function ice_free_flow_profs.cold() drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.is= ra.0.cold() is missing an ELF size annotation =E2=80=A6 ``` =2D-=20 Oleksandr Natalenko, MSE --nextPart3343055.aeNJFYEL58 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZUOOw5ESFLHZZtOKil/iNcg8M0sFAmf0SG8ACgkQil/iNcg8 M0vxehAA03RuT6O689+5Jdr4noiuWvqomKVkLszYT1147iwghBc2GiXu4qBx2ft4 Jq38NpHncquNMkr4I6ZHWR6dtqpdvlhYCVSFZWBzGzXQDZEGh64Yabro1FcoVszE OGCnaJBXcs8q5vgBIg0hnRvkeyEczcrWAiywXbTcuBzNQFhLct+ewYzUJGeHyRMW OZZ97N7lRGOzCjwbH2a5n8vqyv2rtOYRAg3BbAsIuLfVf5U6xGEXXjBvGGsGDxKM 2WeQBLzsXU4CIHZ3BXUBunDSTDCoUvdu3IppzHaptlGeVBlv481Phaanne3uGbkf qv4kYELOm7V/FGw5lKKgQnqzwzQaMqbr6ds6aiIkABdewjQpIPi4qYpHEBqO14Bl jBiC1OghCz2oCwK2KQtoOAobWXhLTDSQ6ykpX20BqO2YGodTG4SjWi4sTly11zSC Cwo7dpeNTQOtwbDsBCHhiu2R5265qc9cg2cNBLM2P5UFrcOI6qVAR/r1/yXpUnoY qKTGhb4vrqlyctCzgfqAEaJ70BUUIR33nVhmSEZ1vPmxrYLiroFzFWHc3bvkdfvC 2DFrbO5MNnnBi1anMDXlU3NIIx/i9lhjBKUnYvS/0heVnSkBapdcZPQaB4KCK0Hw AVtDt1wPysYqWRL0JgxGf+P3BfDU307+2QhNVKbuP5JenUcFUE4= =FX5o -----END PGP SIGNATURE----- --nextPart3343055.aeNJFYEL58-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from prime.voidband.net (prime.voidband.net [199.247.17.104]) (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 79505B672; Mon, 7 Apr 2025 21:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.247.17.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744062623; cv=none; b=blcIDc+SNKBzxqUesfIJg+59Jh+nMZo1GusiVWDjWxlYCRrrxAjxpvneCQ0UeUp6mHEYsvzrKowreoiYdbeMQtAlBDROCk0kK1gn/0gocwpMIZDWEeJzDqBhLExy8B92iiHrKuAW2DwB1FUZE4zOTmRUtybrbagyZKiqldr1qXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744062623; c=relaxed/simple; bh=dTTtQINgOmcAEPJfigLOj/BUnIrZ7vpHtP8H7uhII/w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uYAgzg7ARPti1iw5P5QovuH6onyeSBbDIOf/SXkXh1EqZgZPkjlBt8OeO3DUFUwlHWjR8zdXpbajUTjWVCHIJLKwQePNHyJ4/n6gmBZIDgw/tOeniDUTjKr/VFYTA70qAeKb5JburTLf1nM0NjR6O93ArLKFQR1rTqt9b+aasZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=natalenko.name; spf=pass smtp.mailfrom=natalenko.name; dkim=pass (1024-bit key) header.d=natalenko.name header.i=@natalenko.name header.b=LC3gxE5V; arc=none smtp.client-ip=199.247.17.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=natalenko.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=natalenko.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=natalenko.name header.i=@natalenko.name header.b="LC3gxE5V" Received: from spock.localnet (unknown [212.20.115.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by prime.voidband.net (Postfix) with ESMTPSA id A20EE616710F; Mon, 07 Apr 2025 23:50:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1744062615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gU9lD+RqDMo0wEfUDiyRdrBfsjXAPrpF0e2SpfAHy3o=; b=LC3gxE5VZ4L+DEwuwpOEE+tzW6EXFqsP2z9PdoW+xbBc6jHNK+Kw/5ptPjToRWcdggytT1 LtD7iF+q19Ny6NbPcHiSlggLtsT/A4YojUngAdMGoLxJy6gl5op/Y2FI7bigtNMnzmi3FX wPdW5gI0b3YnHEZV34kX+mgbSC+J2Q0= From: Oleksandr Natalenko To: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, Przemek Kitszel , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Andrew Lunn , Tony Nguyen , Peter Zijlstra Subject: Re: objtool warning in ice_free_prof_mask Date: Mon, 07 Apr 2025 23:49:35 +0200 Message-ID: <2983242.e9J7NaK4W3@natalenko.name> In-Reply-To: References: <4970551.GXAFRqVoOG@natalenko.name> <5874052.DvuYhMxLoT@natalenko.name> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3343055.aeNJFYEL58"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart3343055.aeNJFYEL58 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Oleksandr Natalenko To: Josh Poimboeuf Subject: Re: objtool warning in ice_free_prof_mask Date: Mon, 07 Apr 2025 23:49:35 +0200 Message-ID: <2983242.e9J7NaK4W3@natalenko.name> MIME-Version: 1.0 Hello. On pond=C4=9Bl=C3=AD 7. dubna 2025 23:42:51, st=C5=99edoevropsk=C3=BD letn= =C3=AD =C4=8Das Josh Poimboeuf wrote: > On Mon, Apr 07, 2025 at 11:21:27AM +0200, Oleksandr Natalenko wrote: > > It's not a new warning, I've observe it for several recent major kernel= releases already. > >=20 > > I do not build with CONFIG_COMPILE_TEST. > >=20 > > I've also realised I see this warning with -O3 only. I know this is > > unsupported, so feel free to ignore me, but I do -O3 builds for > > finding out possible loose ends in the code, and this is the only > > place where it breaks. > >=20 > > > > ``` > > > > drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof= _mask.isra.0() falls through to next function ice_free_flow_profs.cold() > > > > drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof= _mask.isra.0.cold() is missing an ELF size annotation > > > > ``` > > > >=20 > > > > If I mark ice_write_prof_mask_reg() as noinline, this warning disap= pears. > > > >=20 > > > > Any idea what's going wrong? >=20 > This type of error usually means some type of undefined behavior. Can > you share your config? No guarantees since it is -O3 after all, but I > can still take a look to see if it's pointing to a bug of some kind. Sure, thank you for looking into this. Here's my recipe to reproduce the issue: 1. expose -O3 ``` diff --git a/Makefile b/Makefile index 38689a0c36052..5ce5b44fa1496 100644 =2D-- a/Makefile +++ b/Makefile @@ -858,6 +858,9 @@ KBUILD_CFLAGS +=3D -fno-delete-null-pointer-checks ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE KBUILD_CFLAGS +=3D -O2 KBUILD_RUSTFLAGS +=3D -Copt-level=3D2 +else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 +KBUILD_CFLAGS +=3D -O3 +KBUILD_RUSTFLAGS +=3D -Copt-level=3D3 else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS +=3D -Os KBUILD_RUSTFLAGS +=3D -Copt-level=3Ds diff --git a/init/Kconfig b/init/Kconfig index dd2ea3b9a7992..03b1d768d1a55 100644 =2D-- a/init/Kconfig +++ b/init/Kconfig @@ -1481,6 +1481,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE with the "-O2" compiler flag for best performance and most helpful compile-time warnings. =20 +config CC_OPTIMIZE_FOR_PERFORMANCE_O3 + bool "Optimize more for performance (-O3)" + help + Choosing this option will pass "-O3" to your compiler to optimize + the kernel yet more for performance. + config CC_OPTIMIZE_FOR_SIZE bool "Optimize for size (-Os)" help ``` 2. use this config with v6.15-rc1: https://paste.voidband.net/2BVaYDQS.txt 3. compile: ``` $ make drivers/net/ethernet/intel/ice/ice.o =E2=80=A6 LD [M] drivers/net/ethernet/intel/ice/ice.o drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.is= ra.0() falls through to next function ice_free_flow_profs.cold() drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.is= ra.0.cold() is missing an ELF size annotation =E2=80=A6 ``` =2D-=20 Oleksandr Natalenko, MSE --nextPart3343055.aeNJFYEL58 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZUOOw5ESFLHZZtOKil/iNcg8M0sFAmf0SG8ACgkQil/iNcg8 M0vxehAA03RuT6O689+5Jdr4noiuWvqomKVkLszYT1147iwghBc2GiXu4qBx2ft4 Jq38NpHncquNMkr4I6ZHWR6dtqpdvlhYCVSFZWBzGzXQDZEGh64Yabro1FcoVszE OGCnaJBXcs8q5vgBIg0hnRvkeyEczcrWAiywXbTcuBzNQFhLct+ewYzUJGeHyRMW OZZ97N7lRGOzCjwbH2a5n8vqyv2rtOYRAg3BbAsIuLfVf5U6xGEXXjBvGGsGDxKM 2WeQBLzsXU4CIHZ3BXUBunDSTDCoUvdu3IppzHaptlGeVBlv481Phaanne3uGbkf qv4kYELOm7V/FGw5lKKgQnqzwzQaMqbr6ds6aiIkABdewjQpIPi4qYpHEBqO14Bl jBiC1OghCz2oCwK2KQtoOAobWXhLTDSQ6ykpX20BqO2YGodTG4SjWi4sTly11zSC Cwo7dpeNTQOtwbDsBCHhiu2R5265qc9cg2cNBLM2P5UFrcOI6qVAR/r1/yXpUnoY qKTGhb4vrqlyctCzgfqAEaJ70BUUIR33nVhmSEZ1vPmxrYLiroFzFWHc3bvkdfvC 2DFrbO5MNnnBi1anMDXlU3NIIx/i9lhjBKUnYvS/0heVnSkBapdcZPQaB4KCK0Hw AVtDt1wPysYqWRL0JgxGf+P3BfDU307+2QhNVKbuP5JenUcFUE4= =FX5o -----END PGP SIGNATURE----- --nextPart3343055.aeNJFYEL58--