From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 7D88C3951822 for ; Wed, 4 Aug 2021 17:55:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D88C3951822 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 174Hq7sV008065 for ; Wed, 4 Aug 2021 17:55:15 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a70pjvgk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 04 Aug 2021 17:55:15 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 174Ho9XC010600 for ; Wed, 4 Aug 2021 17:55:14 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by aserp3030.oracle.com with ESMTP id 3a78d74b4r-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 04 Aug 2021 17:55:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c8DCMoSn8jnAj/aIJXFZiUzsU2PHvTyMEDYwnYRf05fWOQgtImXbxIc1ABpSL11EV3e/5ObaoIDUtN8uz1jw3Mr9urlCrYj/gvHoS5zfXv2KQyXJAz60rhnoJd7I6T1N/V3ftq30Br9/wCycbYEmvrvFGF/wd6eIkBIsa3N0tyMh7To+fUT6ujW1tyrPajCR8P/bOa7mkpORAZX6y/XLTe8f7DeJZVtDQ/2OIoJUoUXwWf6VpU19rX5A6OPwXsZfrcmnn8gWp45S6jwBwr6eZu4HIpgIVoWDJrp82ZjaE6zcekDigsP2sIDxd6UzEl93myYz+j7OoDeFgB8+v9I4Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NFZqz24x05wZrP27VtE0k4MuWCIVu0lW1iZZGOyoqt4=; b=kD8uSQxS7xz2l7bu20uj92qM8zfU0Yn2GSUXG6RMyBulBHa9+7VPyHafp/IAKwf1+326WoX3nw4DzAr342+IuIAXYrYIbrIPToudG+Q44ZqJ+YOMUQBUja6HVH64wonseObIBqSfWLVN+oNq6KSywMSTk/nh6JjvZbsAnjzduQjP3ZFopUKFSvuy3CjiO1lx8hO8lKdXN+ZQmOaIRo6fQdlrspRQSXdDdA9UIznbApU7aTYkXU76yJC+e1aUvtnmTBmTHEoUo4UGKFiIbUrHdA3L8NqhtVYjSyP0jW7HoDXhoW42bMCykihXScrvMWTGndCxLwxKGZWLDPUrmxMp2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from SA2PR10MB4458.namprd10.prod.outlook.com (2603:10b6:806:f8::24) by SA2PR10MB4555.namprd10.prod.outlook.com (2603:10b6:806:115::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Wed, 4 Aug 2021 17:55:12 +0000 Received: from SA2PR10MB4458.namprd10.prod.outlook.com ([fe80::9d08:a59a:abb8:3632]) by SA2PR10MB4458.namprd10.prod.outlook.com ([fe80::9d08:a59a:abb8:3632%5]) with mapi id 15.20.4394.016; Wed, 4 Aug 2021 17:55:12 +0000 From: David Faust To: gcc-patches@gcc.gnu.org Subject: [PATCH 7/7] doc: BPF CO-RE documentation Date: Wed, 4 Aug 2021 10:54:11 -0700 Message-Id: <20210804175411.6783-8-david.faust@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210804175411.6783-1-david.faust@oracle.com> References: <20210804175411.6783-1-david.faust@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SA0PR11CA0203.namprd11.prod.outlook.com (2603:10b6:806:1bc::28) To SA2PR10MB4458.namprd10.prod.outlook.com (2603:10b6:806:f8::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sequence.us.oracle.com (2606:b400:8004:44::1f) by SA0PR11CA0203.namprd11.prod.outlook.com (2603:10b6:806:1bc::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 4 Aug 2021 17:55:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7c429cc-f29b-46e7-26fe-08d9577101bc X-MS-TrafficTypeDiagnostic: SA2PR10MB4555: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +28g/5Dm8/jA+95acubw14q+LfbFf6HhqPVpyxjFYpOT2B9kFMugNkGHXmvtF0SKizT3E+89PCsNhPEYzat+SQsl/A7IJx+nrjqXbWVAZgH8ruwJouhoJxe9PNqETWSEjK8RvEhZ5hdsaUHMN/oI+YjlTMxaIQKvY+uF1u27XHXsrQLtk6WlQxXpAvs0DI64C9EcB2tkfbTxX//47W7CDwI/fvobliPjW+BIIhklSfhTj3vEvLOuhreBRJ6/e6iXt8nnyzZ3zqWk+QGIsarj6qz9Zn2ptZ3s/0SXN3BuTiWk/20XLjCBqCkvbioH/m0+7IQdqDL67eKtx61D++cs9hrZtWxvIp+9ewVP4be9ZOHyzcaqnVyJBzH5dApuV5SU1X2j2rCDRzwry2DodciFeXkAMSOzvr4AhW7m8FSRmpwvPIfPa3jcJX0SrgpM3HvLBo3lyNZJn3Tgzug9aqclZNi70P63yajouWPZgsHhNK6tr7MaY/0PZibygoQzlxw/oNybTB5NF6o0WQ9BwXA8YVU5cyE8s47q04xXmhvXTTs59Q5J+EOLU9cOTupeEoDYBY3ZoYwIcVlrbUVRUfN55f+FspamgNFzuTertIAtgymuZMZniJEZmQUilJBs2RZVwQl0ey217aoN67N+jZB81w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4458.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6486002)(44832011)(316002)(8936002)(66476007)(66946007)(6916009)(83380400001)(66556008)(86362001)(5660300002)(8676002)(7696005)(38100700002)(52116002)(508600001)(36756003)(186003)(2906002)(1076003)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?H937EWCUOeCGNwUOJ/KUmNgw322ERwurN/fYUeImTwcmyvPy+hHJbQJVh7Ya?= =?us-ascii?Q?X9zoX3BSz54Td1QyBtjZCxe2XHF2ajh0z59Kno+mM8SRmpmMtw1DrNcsQz4r?= =?us-ascii?Q?tbPyztFo97nJXuGaRhOrhhBKAQWPb22Rvlx0o7PefY0aaAOTlQ4fUADd94Cg?= =?us-ascii?Q?k3GL/F0va2ekQc08SBAaayJKF2W3anm+B4IrEDJO87xJ86A1lfJIcvl++6mD?= =?us-ascii?Q?NNup7yPc77A9PDiKPPktqa0mgW0GMXQGHaZStlMy37IRRCBNQV63JvSgC3Q3?= =?us-ascii?Q?7/t7bLhtKakzWl8YAqeZtR5Au+EAOxfFBSYDzYO7uFn8x7Ik4dM3Ttt1M5Pd?= =?us-ascii?Q?IEUDTqhrCRQgKPdmOKWU8d18L/tYpZQepHX6eKZZarfEyxWrOgMQKII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ub5h0I8Pg7pLc7XFkZ0LzpBGAROpuQqs6?= =?us-ascii?Q?rBVd6b5Cn6N42pSMpsMzuw6Q8k8FVvp1Tf2wAZQey6J45Q=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7c429cc-f29b-46e7-26fe-08d9577101bc X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4458.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 17:55:12.3516 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uI0oQB3nEPHXORpoeSCyM/Bp2jQT+YQB390bbrlHZEB8cUJEbJ28voc1VZrSiKpthGzzBCsBidLffIAoXTFkRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4555 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10066 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108040104 X-Proofpoint-GUID: _5Eynl0hlmHdu1AZXgJjKxCkNBH3i9P9 X-Proofpoint-ORIG-GUID: _5Eynl0hlmHdu1AZXgJjKxCkNBH3i9P9 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: Wed, 04 Aug 2021 17:55:16 -0000 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. 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