[COMMITTED V2 7/7] doc: BPF CO-RE documentation

2021-09-07 Thread David Faust via Gcc-patches
Document the new command line options (-mco-re and -mno-co-re), 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.

[COMMITTED V2 4/7] btf: expose get_btf_id

2021-09-07 Thread David Faust via Gcc-patches
Expose the function get_btf_id, so that it may be used by the BPF backend. This enables the BPF CO-RE machinery in the BPF backend to lookup BTF type IDs, in order to create CO-RE relocation records. A prototype is added in ctfc.h gcc/ChangeLog: * btfout.c (get_btf_id): Function is no

[COMMITTED V2 2/7] ctfc: externalize ctf_dtd_lookup

2021-09-07 Thread David Faust via Gcc-patches
Expose the function ctf_dtd_lookup, so that it can be used by the BPF CO-RE machinery. The function is no longer static, and an extern prototype is added in ctfc.h. gcc/ChangeLog: * ctfc.c (ctf_dtd_lookup): Function is no longer static. * ctfc.h: Analogous change. --- gcc/ctfc.c

[COMMITTED V2 3/7] ctfc: add function to lookup CTF ID of a TREE type

2021-09-07 Thread David Faust via Gcc-patches
Add a new function, ctf_lookup_tree_type, to return the CTF type ID associated with a type via its is TREE node. The function is exposed via a prototype in ctfc.h. gcc/ChangeLog: * ctfc.c (ctf_lookup_tree_type): New function. * ctfc.h: Likewise. --- gcc/ctfc.c | 16

[COMMITTED V2 1/7] dwarf: externalize lookup_type_die

2021-09-07 Thread David Faust via Gcc-patches
Expose the function lookup_type_die in dwarf2out, so that it can be used by CTF/BTF when adding BPF CO-RE information. The function is now non-static, and an extern prototype is added in dwarf2out.h. gcc/ChangeLog: * dwarf2out.c (lookup_type_die): Function is no longer static. *

[COMMITTED V2 0/7] BPF CO-RE Support

2021-09-07 Thread David Faust via Gcc-patches
generation. For cases where BTF information is desired but CO-RE is not important, it can be disabled with -mno-core. David Faust (7): dwarf: externalize lookup_type_die ctfc: externalize ctf_dtd_lookup ctfc: add function to lookup CTF ID of a TREE type btf: expose get_btf_id bpf: BPF CO-RE s

Re: [PATCH, V2 3/3] dwarf2out: Emit BTF in dwarf2out_finish for BPF CO-RE usecase

2021-08-10 Thread David Faust via Gcc-patches
On 8/10/21 5:00 AM, Richard Biener via Gcc-patches wrote: On Thu, Aug 5, 2021 at 2:53 AM Indu Bhagat via Gcc-patches wrote: DWARF generation is split between early and late phases when LTO is in effect. This poses challenges for CTF/BTF generation especially if late debug info generation

[PATCH 5/7] bpf: BPF CO-RE support

2021-08-04 Thread David Faust via Gcc-patches
This commit introduces support for BPF Compile Once - Run Everywhere (CO-RE) in GCC. gcc/ChangeLog: * config/bpf/bpf.c: Adjust includes. (bpf_handle_preserve_access_index_attribute): New function. (bpf_attribute_table): Use it here. (bpf_builtins): Add

[PATCH 6/7] bpf testsuite: Add BPF CO-RE tests

2021-08-04 Thread David Faust via Gcc-patches
This commit adds several tests for the new BPF CO-RE functionality to the BPF target testsuite. gcc/testsuite/ChangeLog: * gcc.target/bpf/core-attr-1.c: New test. * gcc.target/bpf/core-attr-2.c: Likewise. * gcc.target/bpf/core-attr-3.c: Likewise. *

[PATCH 7/7] doc: BPF CO-RE documentation

2021-08-04 Thread David Faust via Gcc-patches
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.

[PATCH 2/7] ctfc: externalize ctf_dtd_lookup

2021-08-04 Thread David Faust via Gcc-patches
Expose the function ctf_dtd_lookup, so that it can be used by the BPF CO-RE machinery. The function is no longer static, and an extern prototype is added in ctfc.h. gcc/ChangeLog: * ctfc.c (ctf_dtd_lookup): Function is no longer static. * ctfc.h: Analogous change. --- gcc/ctfc.c

[PATCH 0/7] BPF CO-RE Support

2021-08-04 Thread David Faust via Gcc-patches
mation, -gbtf for BPF target implies -mcore, and -mcore requires BTF generation. For cases where BTF information is desired but CO-RE is not important, it can be disabled with -mno-core. David Faust (7): dwarf: externalize lookup_type_die ctfc: externalize ctf_dtd_lookup ctfc: add function to

[PATCH 4/7] btf: expose get_btf_id

2021-08-04 Thread David Faust via Gcc-patches
Expose the function get_btf_id, so that it may be used by the BPF backend. This enables the BPF CO-RE machinery in the BPF backend to lookup BTF type IDs, in order to create CO-RE relocation records. A prototype is added in ctfc.h gcc/ChangeLog: * btfout.c (get_btf_id): Function is no

[PATCH 3/7] ctfc: add function to lookup CTF ID of a TREE type

2021-08-04 Thread David Faust via Gcc-patches
Add a new function, ctf_lookup_tree_type, to return the CTF type ID associated with a type via its is TREE node. The function is exposed via a prototype in ctfc.h. gcc/ChangeLog: * ctfc.c (ctf_lookup_tree_type): New function. * ctfc.h: Likewise. --- gcc/ctfc.c | 16

[PATCH 1/7] dwarf: externalize lookup_type_die

2021-08-04 Thread David Faust via Gcc-patches
Expose the function lookup_type_die in dwarf2out, so that it can be used by CTF/BTF when adding BPF CO-RE information. The function is now non-static, and an extern prototype is added in dwarf2out.h. gcc/ChangeLog: * dwarf2out.c (lookup_type_die): Function is no longer static. *

[PATCH] BTF: Support for BTF_KIND_FLOAT

2021-07-01 Thread David Faust via Gcc-patches
Add BTF_KIND_FLOAT, a new BTF type kind which has recently stabilized in the linux kernel [1]. This kind is used for encoding floating point types, and is of particular use when generating BTF for some s390 arch-specific kernel headers. Also update some BTF tests which previously used floating

Re: [PATCH V7 4/7] CTF/BTF debug formats

2021-04-30 Thread David Faust via Gcc-patches
On 4/30/21 9:11 AM, Jose E. Marchesi via Gcc-patches wrote: > >>> For a moment, for the sake of this question, if we establish that CTF/BTF >>> generation always feeds off DWARF DIEs (so there is no need to access >>> type/decl tree nodes), what will it take to keep LTO support while keeping

Re: [PATCH 2/2] bpf: allow BSS symbols to be global symbols

2021-04-28 Thread David Faust via Gcc-patches
>> >> OK for backport to GCC 11 (both patches)? > > Yes please. Provided releases/gcc-11 is open for backports.. > Done, thanks.

Re: [PATCH 2/2] bpf: allow BSS symbols to be global symbols

2021-04-27 Thread David Faust via Gcc-patches
On 4/22/21 11:54 PM, Jose E. Marchesi via Gcc-patches wrote: > > Hi YiFei. > >> Prior to this, a BSS declaration such as: >> >> int foo; >> static int bar; >> >> Generates: >> >> .global foo >> .local foo >> .comm foo,4,4 >> .local bar >> .commbar,4,4 >> >> Creating

Re: [PATCH 2/2] bpf: allow BSS symbols to be global symbols

2021-04-23 Thread David Faust via Gcc-patches
Hi YiFei, I've just checked in both patches to master and GCC 10 on your behalf. Thanks! On 4/22/21 11:54 PM, Jose E. Marchesi via Gcc-patches wrote: > > Hi YiFei. > >> Prior to this, a BSS declaration such as: >> >> int foo; >> static int bar; >> >> Generates: >> >> .global foo >>

[committed] MAINTAINERS: Add myself for write after approval

2021-04-23 Thread David Faust via Gcc-patches
ChangeLog: 2021-04-23 David Faust * MAINTAINERS (Write After Approval): Add myself. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index db25583b37b..c589c0b30ac 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -387,6 +387,7 @@ Doug Evans

Re: [PATCH] bpf: use xBPF signed div, mod insns when available

2020-09-18 Thread David Faust via Gcc-patches
od to use them when targetting >>> xBPF, and add new tests to ensure they are used appropriately. >>> >>> 2020-09-17 David Faust >>> >>> gcc/ >>> * config/bpf/bpf.md: Add defines for signed div and mod operators. >>> >>>

[PATCH] bpf: use xBPF signed div, mod insns when available

2020-09-17 Thread David Faust via Gcc-patches
to ensure they are used appropriately. 2020-09-17 David Faust gcc/ * config/bpf/bpf.md: Add defines for signed div and mod operators. gcc/testsuite/ * gcc.target/bpf/diag-sdiv.c: New test. * gcc.target/bpf/diag-smod.c: New test. * gcc.target/bpf/xbpf-sdiv-1.c: New test

[PATCH] bpf: generate indirect calls for xBPF

2020-09-03 Thread David Faust via Gcc-patches
This patch updates the BPF back end to generate indirect calls via the 'call %reg' instruction when targetting xBPF. Additionally, the BPF ASM_SPEC is updated to pass along -mxbpf to gas, where it is now supported. 2020-09-03 David Faust gcc/ * config/bpf/bpf.h (ASM_SPEC): Pass

<    1   2   3