From: Joe Perches <joe@perches.com>
To: Song Liu <songliubraving@fb.com>
Cc: open list <linux-kernel@vger.kernel.org>,
bpf <bpf@vger.kernel.org>, Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH v4] checkpatch: do not apply "initialise globals to 0" check to BPF progs
Date: Tue, 09 Feb 2021 20:12:28 -0800 [thread overview]
Message-ID: <2c5ba548a8148afa2aa03cc2d9a2d71ca85f74e7.camel@perches.com> (raw)
In-Reply-To: <F5609C13-E5D7-47C2-94C2-F4C2443352C4@fb.com>
On Wed, 2021-02-10 at 04:07 +0000, Song Liu wrote:
> > On Feb 9, 2021, at 6:10 PM, Joe Perches <joe@perches.com> wrote:
> > On Tue, 2021-02-09 at 13:19 -0800, Song Liu wrote:
> > > BPF programs explicitly initialise global variables to 0 to make sure
> > > clang (v10 or older) do not put the variables in the common section.
> >
> > Acked-by: Joe Perches <joe@perches.com>
> >
> > So the patch is OK now, but I have a question about the concept:
> >
> > Do you mean that these initialized to 0 global variables
> > should go into bss or another section?
>
> We want these variables to go to bss.
OK, then the patch is fine.
> > Perhaps it'd be useful to somehow mark variables into specific
> > sections rather than bss when initialized to 0 and data when not
> > initialized to 0.
>
> Currently, libbpf expects zero initialized global data in bss. This
> convention works well so far. Is there any reason that we specify
> section for global data?
There's no need I know of.
cheers, Joe
prev parent reply other threads:[~2021-02-10 4:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 21:19 Song Liu
2021-02-10 2:10 ` Joe Perches
2021-02-10 4:07 ` Song Liu
2021-02-10 4:12 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c5ba548a8148afa2aa03cc2d9a2d71ca85f74e7.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®