From: Richard Biener <richard.guenther@gmail.com>
To: David Faust <david.faust@oracle.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 7/7] doc: BPF CO-RE documentation
Date: Thu, 26 Aug 2021 12:01:33 +0200 [thread overview]
Message-ID: <CAFiYyc2W6kEgsEutLTAR8eJqbrPqVHcLDKWR0GQw2P_FY_LZJg@mail.gmail.com> (raw)
In-Reply-To: <20210804175411.6783-8-david.faust@oracle.com>
On Wed, Aug 4, 2021 at 8:01 PM David Faust via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Document the new command line options (-mcore and -mno-core), the new
> BPF target builtin (__builtin_preserve_access_index), and the new BPF
> target attribute (preserve_access_index) introduced with BPF CO-RE.
OK.
> gcc/ChangeLog:
>
> * doc/extend.texi (BPF Type Attributes) New node.
> Document new preserve_access_index attribute.
> Document new preserve_access_index builtin.
> ---
> gcc/doc/extend.texi | 16 ++++++++++++++++
> gcc/doc/invoke.texi | 13 ++++++++++++-
> 2 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
> index b83cd4919bb..bb5fc921907 100644
> --- a/gcc/doc/extend.texi
> +++ b/gcc/doc/extend.texi
> @@ -8194,6 +8194,7 @@ attributes.
> * Common Type Attributes::
> * ARC Type Attributes::
> * ARM Type Attributes::
> +* BPF Type Attributes::
> * MeP Type Attributes::
> * PowerPC Type Attributes::
> * x86 Type Attributes::
> @@ -8757,6 +8758,17 @@ virtual table for @code{C} is not exported. (You can use
> @code{__attribute__} instead of @code{__declspec} if you prefer, but
> most Symbian OS code uses @code{__declspec}.)
>
> +@node BPF Type Attributes
> +@subsection BPF Type Attributes
> +
> +@cindex @code{preserve_access_index} type attribute, BPF
> +BPF Compile Once - Run Everywhere (CO-RE) support. When attached to a
> +@code{struct} or @code{union} type definition, indicates that CO-RE
> +relocation information should be generated for any access to a variable
> +of that type. The behavior is equivalent to the programmer manually
> +wrapping every such access with @code{__builtin_preserve_access_index}.
> +
> +
> @node MeP Type Attributes
> @subsection MeP Type Attributes
>
> @@ -15388,6 +15400,10 @@ Load 16-bits from the @code{struct sk_buff} packet data pointed by the register
> Load 32-bits from the @code{struct sk_buff} packet data pointed by the register @code{%r6} and return it.
> @end deftypefn
>
> +@deftypefn {Built-in Function} void * __builtin_preserve_access_index (@var{expr})
> +BPF Compile Once-Run Everywhere (CO-RE) support. Instruct GCC to generate CO-RE relocation records for any accesses to aggregate data structures (struct, union, array types) in @var{expr}. This builtin is otherwise transparent, the return value is whatever @var{expr} evaluates to. It is also overloaded: @var{expr} may be of any type (not necessarily a pointer), the return type is the same. Has no effect if @code{-mcore} is not in effect (either specified or implied).
> +@end deftypefn
> +
> @node FR-V Built-in Functions
> @subsection FR-V Built-in Functions
>
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 32697e6117c..915bbc4ee65 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -903,7 +903,7 @@ Objective-C and Objective-C++ Dialects}.
>
> @emph{eBPF Options}
> @gccoptlist{-mbig-endian -mlittle-endian -mkernel=@var{version}
> --mframe-limit=@var{bytes} -mxbpf}
> +-mframe-limit=@var{bytes} -mxbpf -mcore -mno-core}
>
> @emph{FR30 Options}
> @gccoptlist{-msmall-model -mno-lsim}
> @@ -22520,6 +22520,17 @@ Generate code for a big-endian target.
> @opindex mlittle-endian
> Generate code for a little-endian target. This is the default.
>
> +@item -mcore
> +@opindex mcore
> +Enable BPF Compile Once - Run Everywhere (CO-RE) support. Requires and
> +is implied by @option{-gbtf}.
> +
> +@item -mno-core
> +@opindex mno-core
> +Disable BPF Compile Once - Run Everywhere (CO-RE) support. BPF CO-RE
> +support is enabled by default when generating BTF debug information for
> +the BPF target.
> +
> @item -mxbpf
> Generate code for an expanded version of BPF, which relaxes some of
> the restrictions imposed by the BPF architecture:
> --
> 2.32.0
>
prev parent reply other threads:[~2021-08-26 10:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 17:54 [PATCH 0/7] BPF CO-RE Support David Faust
2021-08-04 17:54 ` [PATCH 1/7] dwarf: externalize lookup_type_die David Faust
2021-08-05 9:07 ` Richard Biener
2021-08-04 17:54 ` [PATCH 2/7] ctfc: externalize ctf_dtd_lookup David Faust
2021-08-04 17:54 ` [PATCH 3/7] ctfc: add function to lookup CTF ID of a TREE type David Faust
2021-08-04 17:54 ` [PATCH 4/7] btf: expose get_btf_id David Faust
2021-08-26 10:01 ` Richard Biener
2021-08-04 17:54 ` [PATCH 5/7] bpf: BPF CO-RE support David Faust
2021-08-10 15:11 ` Jose E. Marchesi
2021-08-04 17:54 ` [PATCH 6/7] bpf testsuite: Add BPF CO-RE tests David Faust
2021-08-10 15:12 ` Jose E. Marchesi
2021-08-04 17:54 ` [PATCH 7/7] doc: BPF CO-RE documentation David Faust
2021-08-26 10:01 ` Richard Biener [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=CAFiYyc2W6kEgsEutLTAR8eJqbrPqVHcLDKWR0GQw2P_FY_LZJg@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=david.faust@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).