Message ID | 20230527110409.497408-1-linmiaohe@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp107032vqr; Fri, 26 May 2023 20:31:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71d6D4wBkXqzXpNInxPNMujKe8P7esALO1X8AXUAOzOWWuoSmKEa2H4vzeZwi/agHBbikt X-Received: by 2002:a17:902:f547:b0:1ac:7405:d3ba with SMTP id h7-20020a170902f54700b001ac7405d3bamr5997340plf.40.1685158263362; Fri, 26 May 2023 20:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685158263; cv=none; d=google.com; s=arc-20160816; b=XMCKcYt+N0DZshDfB9OJM7VPSajYP94Dd9Fgqe6TMapysuX5INSIGizbdHUEC+vtK9 Q6ugrCRHUHr7KTeiFVczEwhx2IHsbs6Rc8bIJnwauh7yC7UeY6tUYNT3e5SYHAcuo7OH sdj+x1jLB9JtlOSp2klM9CzYOzaGM9bIV03H8V95Ww92RnbGlhBaXiEcwAiqU1XVc2U7 m1raYf/CrsU0Op4Z0zSBAJAeVfSPcgRoTn1/qMPh4Hqt9/p7dhubV3YKah8m5bLst1+u XkHnXPsNH+9by2YFlp0cWb1iQlCmoqqyUnrSRCWtI1GP6MgcRs/Q6X6uEbZDaVL7d3/d zHNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=euG0RONdaze+eePg0Qf56oRwdv24VCnkeMBVo0H6TrA=; b=x5/9BbMT5sDY3G2ZzPHPuhduCjFCklDmK0VrnIGQck5MLE0aovl4rsFXLX34CoLB7c xXS08B5Gz+HEMlfgLkSOpybhHXs8AaG7dbkK+FtVN6xL4Rgpa6bka030aymIYFz9qwFE 2FBpJkADBRe+hG/7lLu1WsdmGoQjUqq9FNKalvYLb2BF1h2+9HO5fQctXGzuw/QQVemG W5XEKwMGo9udYlJvENqs+vbXHTcA4cACEBZmgyde32y3f5r1ODa9aFJHi+/jvrkx+rzz lE8n7Wr9IfkCFlfXmfwpCLCuTCXy7GT+hgam3OeW6UaUrSBK7qhJ7QoyGJfBu7D1+LJo GgAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a17090301c300b001aaf59c9633si5895083plh.565.2023.05.26.20.30.31; Fri, 26 May 2023 20:31:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236077AbjE0DM6 (ORCPT <rfc822;zhanglyra.2023@gmail.com> + 99 others); Fri, 26 May 2023 23:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbjE0DM5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 26 May 2023 23:12:57 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 466DAE3; Fri, 26 May 2023 20:12:56 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QSmvS304nzqSg2; Sat, 27 May 2023 11:08:20 +0800 (CST) Received: from huawei.com (10.175.104.170) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 27 May 2023 11:12:53 +0800 From: Miaohe Lin <linmiaohe@huawei.com> To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com> CC: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linmiaohe@huawei.com> Subject: [PATCH] net: skbuff: fix missing a __noreturn annotation warning Date: Sat, 27 May 2023 19:04:09 +0800 Message-ID: <20230527110409.497408-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767016511359941340?= X-GMAIL-MSGID: =?utf-8?q?1767016511359941340?= |
Series |
net: skbuff: fix missing a __noreturn annotation warning
|
|
Commit Message
Miaohe Lin
May 27, 2023, 11:04 a.m. UTC
Add __noreturn annotation to fix the warning:
net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation
net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
net/core/skbuff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
From: Miaohe Lin <linmiaohe@huawei.com> Date: Sat, 27 May 2023 19:04:09 +0800 > Add __noreturn annotation to fix the warning: > net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation > net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation What arch are you using ? IIUC, BUG() should have an annotation for objtool, for example, __builtin_unreachable() for x86. Maybe the arch is missing such an annotation ? Also I'm curious why objtool complains about only skb_push(), there should be more non-inline functions that has BUG(). Thanks, Kuniyuki > > Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> > --- > net/core/skbuff.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index 6724a84ebb09..12b525aa4783 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -181,8 +181,8 @@ EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys); > * Keep out of line to prevent kernel bloat. > * __builtin_return_address is not used because it is not always reliable. > */ > -static void skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, > - const char msg[]) > +static void __noreturn skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, > + const char msg[]) > { > pr_emerg("%s: text:%px len:%d put:%d head:%px data:%px tail:%#lx end:%#lx dev:%s\n", > msg, addr, skb->len, sz, skb->head, skb->data, > -- > 2.27.0
On 2023/5/27 12:00, Kuniyuki Iwashima wrote: > From: Miaohe Lin <linmiaohe@huawei.com> > Date: Sat, 27 May 2023 19:04:09 +0800 >> Add __noreturn annotation to fix the warning: >> net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation >> net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation > > What arch are you using ? > > IIUC, BUG() should have an annotation for objtool, for > example, __builtin_unreachable() for x86. > > Maybe the arch is missing such an annotation ? > > Also I'm curious why objtool complains about only skb_push(), > there should be more non-inline functions that has BUG(). I'm not really sure. I was just compiling the kernel using my old gcc (GCC) 7.3.0 and saw this warning. Maybe this warning is just false positive. Thanks. > > Thanks, > Kuniyuki > > >> >> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> >> --- >> net/core/skbuff.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/net/core/skbuff.c b/net/core/skbuff.c >> index 6724a84ebb09..12b525aa4783 100644 >> --- a/net/core/skbuff.c >> +++ b/net/core/skbuff.c >> @@ -181,8 +181,8 @@ EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys); >> * Keep out of line to prevent kernel bloat. >> * __builtin_return_address is not used because it is not always reliable. >> */ >> -static void skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, >> - const char msg[]) >> +static void __noreturn skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, >> + const char msg[]) >> { >> pr_emerg("%s: text:%px len:%d put:%d head:%px data:%px tail:%#lx end:%#lx dev:%s\n", >> msg, addr, skb->len, sz, skb->head, skb->data, >> -- >> 2.27.0 > . >
On Fri, 2023-05-26 at 21:00 -0700, Kuniyuki Iwashima wrote: > From: Miaohe Lin <linmiaohe@huawei.com> > Date: Sat, 27 May 2023 19:04:09 +0800 > > Add __noreturn annotation to fix the warning: > > net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation > > net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation > > What arch are you using ? > > IIUC, BUG() should have an annotation for objtool, for > example, __builtin_unreachable() for x86. > > Maybe the arch is missing such an annotation ? > > Also I'm curious why objtool complains about only skb_push(), > there should be more non-inline functions that has BUG(). AFAICS, the BUG() macro implementation should already carry the __noreturn annotation, via panic() or other arch-specific way. This looks like the old toolchain not being able to successfully/correctly propagate the annotation??? I think we can drop this patch. Cheers, Paolo
On 2023/5/30 18:28, Paolo Abeni wrote: > On Fri, 2023-05-26 at 21:00 -0700, Kuniyuki Iwashima wrote: >> From: Miaohe Lin <linmiaohe@huawei.com> >> Date: Sat, 27 May 2023 19:04:09 +0800 >>> Add __noreturn annotation to fix the warning: >>> net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation >>> net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation >> >> What arch are you using ? >> >> IIUC, BUG() should have an annotation for objtool, for >> example, __builtin_unreachable() for x86. >> >> Maybe the arch is missing such an annotation ? >> >> Also I'm curious why objtool complains about only skb_push(), >> there should be more non-inline functions that has BUG(). > > AFAICS, the BUG() macro implementation should already carry the > __noreturn annotation, via panic() or other arch-specific way. > > This looks like the old toolchain not being able to > successfully/correctly propagate the annotation??? I tend to agree with you. Will drop it. Thanks for your comment. > > I think we can drop this patch. > > Cheers, > > Paolo > > . >
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6724a84ebb09..12b525aa4783 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -181,8 +181,8 @@ EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys); * Keep out of line to prevent kernel bloat. * __builtin_return_address is not used because it is not always reliable. */ -static void skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, - const char msg[]) +static void __noreturn skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, + const char msg[]) { pr_emerg("%s: text:%px len:%d put:%d head:%px data:%px tail:%#lx end:%#lx dev:%s\n", msg, addr, skb->len, sz, skb->head, skb->data,