From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 4CC513858400 for ; Thu, 26 Aug 2021 10:01:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4CC513858400 Received: by mail-ed1-x530.google.com with SMTP id g22so3758462edy.12 for ; Thu, 26 Aug 2021 03:01:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=aHmQvbo56Gm6EiCFC3S7jBJzR+IS/l/07vuI27o60Z0=; b=oCyC0Am1vQU4nacyVDd827/DOpJw+ezjQSh7j2kjNRQ4zHfqXTTc89bhdLoilAiZrA KrTY6ddCoWltdXIWZG6j9f+DvYRWoA9JxCPWKHJmJzJ5Odf45XaD42DPPf8lpFxLFkYl rwKBKv2CHyLhdehY6eUxJM7BmARFflKBcfNLmpq9uTY2mIh4gnz+zsRbQRryxdZXQJ5P kHDikkobEDGD854gUyAw9O7QCwItAgRRAGKNtKhcGIStjZE3loVZe5GCHSKvMNnGbUr5 iJqSJAb3MjrKi8G+X73zW9CYAIYSQZylTht+U4a4p4/WU38vVy7D5ekv+uVtqDjvqmCy 1FhA== X-Gm-Message-State: AOAM532XEfW09lAEqoxxdxHYsA4/XRZbvOWYD9aPbKvlDitNYsnP+nEK j5/SvP59+XulJtpIQi4DVB32e/npggyTeB1Q0TY= X-Google-Smtp-Source: ABdhPJyWigQ0omHP8Rcl6wsXplKo8wJ+ThnUGtP74isLpr5n3eR5kPaMYlfdKmv9ceNGAW9P9zo7M4QGzHwUojbgCg4= X-Received: by 2002:aa7:ccda:: with SMTP id y26mr3332450edt.245.1629972104707; Thu, 26 Aug 2021 03:01:44 -0700 (PDT) MIME-Version: 1.0 References: <20210804175411.6783-1-david.faust@oracle.com> <20210804175411.6783-8-david.faust@oracle.com> In-Reply-To: <20210804175411.6783-8-david.faust@oracle.com> From: Richard Biener Date: Thu, 26 Aug 2021 12:01:33 +0200 Message-ID: Subject: Re: [PATCH 7/7] doc: BPF CO-RE documentation To: David Faust Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 10:01:48 -0000 On Wed, Aug 4, 2021 at 8:01 PM David Faust via Gcc-patches 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} pack= et data pointed by the register > Load 32-bits from the @code{struct sk_buff} packet data pointed by the r= egister @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 generat= e CO-RE relocation records for any accesses to aggregate data structures (s= truct, union, array types) in @var{expr}. This builtin is otherwise transpa= rent, the return value is whatever @var{expr} evaluates to. It is also over= loaded: @var{expr} may be of any type (not necessarily a pointer), the retu= rn type is the same. Has no effect if @code{-mcore} is not in effect (eithe= r 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=3D@var{version} > --mframe-limit=3D@var{bytes} -mxbpf} > +-mframe-limit=3D@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 >