On 5/24/22 04:07, Jose E. Marchesi wrote:
>
>> On 5/11/22 11:44 AM, David Faust wrote:
>>>
>>> On 5/10/22 22:05, Yonghong Song wrote:
>>>>
>>>>
>>>> On 5/10/22 8:43 PM, Yonghong Song wrote:
>>>>>
>>>>&g
On 5/24/22 09:03, Yonghong Song wrote:
>
>
> On 5/24/22 8:53 AM, David Faust wrote:
>>
>>
>> On 5/24/22 04:07, Jose E. Marchesi wrote:
>>>
>>>> On 5/11/22 11:44 AM, David Faust wrote:
>>>>>
>>>>> On 5/10/22 22:0
ore
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 lookup CTF ID of a TREE type
btf: expose get_btf_i
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.
* d
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 ++
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
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 lo
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.
Docume
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.
* gcc.target/bpf/c
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 BPF_BUILTIN_
The output templates for zero_extendhidi2 and zero_extendqidi2 could
lead to incorrect code generation when zero-extending one register into
another. This patch adds a new output template to the define_insns to
handle such cases and produce correct asm.
gcc/ChangeLog:
* config/bpf/bpf.md (
.
Enabled for CPU v3 and above.
Negative versions of -mjmpext, -mjmp32, and -malu32 options are also
supported.
David Faust (3):
bpf: add -mcpu and related feature options
bpf testsuite: add tests for new feature options
doc: document BPF -mcpu and related options
gcc/config/bpf/bpf-opts.h
This commit adds documentation for the new BPF options -mcpu, -mjmpext,
-mjmp32, and -malu32.
gcc/ChangeLog:
* doc/invoke.texi: Document BPF -mcpu, -mjmpext, -mjmp32 and -malu32
options.
---
gcc/doc/invoke.texi | 39 ++-
1 file changed, 38 inser
This commit adds tests for the new -mjmpext, -mjmp32 and -malu32 feature
options in the BPF backend.
gcc/testsuite/ChangeLog:
* gcc.target/bpf/alu-1.c: New test.
* gcc.target/bpf/jmp-1.c: New test.
---
gcc/testsuite/gcc.target/bpf/alu-1.c | 56 +++
gcc/test
New instructions have been added over time to the eBPF ISA, but
previously there has been no good method to select which version to
target in GCC.
This patch adds the following options to the BPF backend:
-mcpu={v1, v2, v3}
Select which version of the eBPF ISA to target. This enables or
The BPF CO-RE support (commit 8bdabb37549f12ce727800a1c8aa182c0b1dd42a)
mistakenly overwrote bpf-*-* extra_headers in config.gcc, causing
bpf-helpers.h to not be installed. The redefinition with coreout.h is
unneeded, so delete it.
gcc/ChangeLog:
* config.gcc (bpf-*-*): Do not overwrite e
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 s
>>
>> OK for backport to GCC 11 (both patches)?
>
> Yes please. Provided releases/gcc-11 is open for backports..
>
Done, thanks.
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
>>>
On 12/8/22 23:36, Indu Bhagat wrote:
> On 12/7/22 12:57, David Faust wrote:
>> The eBPF loader expects to find entries for functions declared as extern
>> in the corresponding BTF_KIND_DATASEC record, but we were not generating
>> these entries.
>>
>> This p
On 12/8/22 22:55, Indu Bhagat wrote:
> Hi David,
>
> On 12/7/22 12:57, David Faust wrote:
>> Add support for the 'extern' linkage value for BTF_KIND_VAR records,
>> which is used for variables declared as extern in the source file.
>>
>> PR targ
On 12/8/22 23:34, Indu Bhagat wrote:
> Looks OK to me overall. Minor comments below.
>
> Thanks
>
> On 12/7/22 12:57, David Faust wrote:
>> The eBPF loader expects to find BTF_KIND_VAR records for references to
>> extern const void symbols. We were mis
feedback. ]
Hi,
This series fixes the issues reported in target/PR106773. I decided to
split it into three commits, as there are ultimately three distinct
issues and fixes. See each patch for details.
Tested on bpf-unknown-none and x86_64-linux-gnu, no known regressions.
OK to push?
Thanks.
David
[Changes from v1:
- Add enum btf_var_linkage in include/btf.h and use that instead of
local #defines.
- Fix BTF generation for extern variable with both non-defining and
defining decls in the same CU. Add a test for this. ]
Add support for the 'extern' linkage value for BTF_KIND_VAR record
[Changes from v1: Minor updates to comments per review. ]
The eBPF loader expects to find BTF_KIND_VAR records for references to
extern const void symbols. We were mistakenly identifing these as
unsupported types, and as a result skipping emitting VAR records for
them.
In addition, the internal D
[Changes from v1:
- Add enum btf_func_linkage to include/btf.h and use it.
- Minor updates to comments based on review. ]
The eBPF loader expects to find entries for functions declared as extern
in the corresponding BTF_KIND_DATASEC record, but we were not generating
these entries.
This patch a
The existing logic in bpf_print_operand was only correct for integral
CONST_DOUBLEs, and emitted garbage for floating point modes. Fix it so
floating point mode operands are correctly handled.
Tested on bpf-unknown-none, no known regressions.
OK to check-in?
Thanks.
PR target/108293
gc
Hi Jose,
As we discussed on IRC, since we don't currently define
TARGET_SUPPORTS_WIDE_INT it is safer to keep the handling for VOIDmode
CONST_DOUBLEs. My current understanding is that it may be needed if the
host is a 32-bit platform.
I also added a gcc_unreachable () as you pointed out. V2 below
, David Faust via Gcc-patches wrote:
> Hello,
>
> This series adds support for a new attribute, "btf_decl_tag" in GCC.
> The same attribute is already supported in clang, and is used by various
> components of the BPF ecosystem.
>
> The purpose of the attribute is
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_S
Commit 068baae1864 "bpf: add preserve_field_info builtin" factored out
some repeated code to a new function maybe_make_core_relo (), but missed
using it in one place. Clean that up.
Regtested on bpf-unknown-none, pushed as obvious.
gcc/
* config/bpf/bpf.cc (handle_attr_preserve): Use may
Change several places in the eBPF backend dealing with overloaded
built-in functions to consistently use the enum bpf_builtins type,
rather than variously using integer constants or booleans. The result is
eaiser to read and extend.
Tested on bpf-unknown-none, no known regressions.
OK to push?
Th
Fix a maybe-uninitialized warning introduced in commit:
068baae1864 bpf: add preserve_field_info builtin
Thanks to Jan-Benedict Glaw for pointing this out.
Tested on bpf-unknown-none, committed as obvious.
gcc/
* config/bpf/bpf.cc (bpf_expand_builtin): Avoid use of uninitialized
On 5/26/22 00:29, Yonghong Song wrote:
>
>
> On 5/24/22 10:04 AM, David Faust wrote:
>>
>>
>> On 5/24/22 09:03, Yonghong Song wrote:
>>>
>>>
>>> On 5/24/22 8:53 AM, David Faust wrote:
>>>>
>>>>
>>>> On
On 6/2/22 19:04, Yonghong Song wrote:
>
>
> On 5/27/22 12:56 PM, David Faust wrote:
>>
>>
>> On 5/26/22 00:29, Yonghong Song wrote:
>>>
>>>
>>> On 5/24/22 10:04 AM, David Faust wrote:
>>>>
>>>>
>>>> On 5
gcc/
* dwarf2out.cc (dw_get_die_parent): New function.
* dwarf2out.h (dw_get_die_parent): Declare it here.
---
gcc/dwarf2out.cc | 8
gcc/dwarf2out.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 29f32ec6939..9c61026bb34 1
: int
<1><64>: Abbrev Number: 0
In the case of BTF, the annotations are recorded in two type kinds recently
added to the BTF specification: BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG.
The above example declaration prodcues the following BTF information:
[1] INT 'int' size=4
include/
* btf.h: Add BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG defines. Update
comments.
(struct btf_decl_tag): New.
* dwarf2.def: Add new DWARF extension DW_TAG_GNU_annotation.
---
include/btf.h | 17 +++--
include/dwarf2.def | 4
2 files cha
This patch adds attribute handlers for two new attributes:
"debug_annotate_decl" and "debug_annotate_type". Both attributes accept
a single string argument, and are used to add arbitrary annotations to
debug information generated for the decls or types to which they apply.
gcc/c-family/
*
BTF generation currently relies on the internal CTF representation to
convert debug info from DWARF dies. This patch adds a new internal
header, "ctf-int.h", which defines CTF kinds to be used internally to
represent BTF tags which must pass through the CTF container. It also
adds a new type for re
This patch updates btfout.cc to be aware of debug annotations, convert
them to BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records, and output them
appropriately.
gcc/
* btfout.cc (get_btf_kind): Handle TYPE_TAG and DECL_TAG kinds.
(btf_calc_num_vbytes): Likewise.
(btf_asm_typ
The "debug_annotate_decl" and "debug_annotate_type" attributes are
handled by constructing DW_TAG_GNU_annotation DIEs. These DIEs are
children of the declarations or types which they annotate, and convey
the information via a string constant.
gcc/
* dwarf2out.cc (gen_decl_annotation_dies)
This patch makes the DWARF-to-CTF conversion process aware of the new
DW_TAG_GNU annotation DIEs. The DIEs are converted to an internal-only
CTF representation as appropriate and added to the compilation unit CTF
container.
gcc/
* dwarf2ctf.cc (handle_debug_annotations): New function.
This patch adds tests for debug annotations, in BTF and in DWARF.
gcc/testsuite/
* gcc.dg/debug/btf/btf-decltag-func.c: New test.
* gcc.dg/debug/btf/btf-decltag-sou.c: Likewise.
* gcc.dg/debug/btf/btf-decltag-typedef.c: Likewise.
* gcc.dg/debug/btf/btf-typetag-1.c:
gcc/
* doc/extend.texi (Common Function Attributes): Document
debug_annotate_decl attribute.
(Common Variable Attributes): Likewise.
(Common Type Attributes): Likewise. Also document
debug_annotate_type attribute.
---
gcc/doc/extend.texi | 106 +
On 6/14/22 22:53, Yonghong Song wrote:
>
>
> On 6/7/22 2:43 PM, David Faust wrote:
>> Hello,
>>
>> This patch series adds support for:
>>
>> - Two new C-language-level attributes that allow to associate (to "annotate"
>> or
>>
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
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
>> .lo
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 poi
Hi,
This series fixes the issues reported in target/PR106773. I decided to
split it into three commits, as there are ultimately three distinct
issues and fixes. See each patch for details.
Tested on bpf-unknown-none and x86_64-linux-gnu, no known regressions.
OK to push?
Thanks.
David Faust (3
The eBPF loader expects to find BTF_KIND_VAR records for references to
extern const void symbols. We were mistakenly identifing these as
unsupported types, and as a result skipping emitting VAR records for
them.
In addition, the internal DWARF representation from which BTF is
produced does not gen
The eBPF loader expects to find entries for functions declared as extern
in the corresponding BTF_KIND_DATASEC record, but we were not generating
these entries.
This patch adds support for the 'extern' linkage of function types in
BTF, and creates entries for for them BTF_KIND_DATASEC records as n
Add support for the 'extern' linkage value for BTF_KIND_VAR records,
which is used for variables declared as extern in the source file.
PR target/106773
gcc/
* btfout.cc (BTF_LINKAGE_STATIC): New define.
(BTF_LINKAGE_GLOBAL): Likewise.
(BTF_LINKAGE_EXTERN): Likewi
The eBPF architecture provides 'end[be,le]' instructions for endianness
swapping. Add a define_insn for bswap2 to use them instaed of
falling back on a libcall.
Tested on bpf-unknown-none, no known regressions.
OK to commit?
Thanks
gcc/
* config/bpf/bpf.md (bswap2): New define_insn.
gc
uld be sufficiently correct.
Yes, I would agree that the test case can be adapted as mentioned. The
purpose of the test case is to check that BTF is correctly generated for
whatever section the symbols end up in.
Adding David Faust in CC for ACK.
Thanks Indu
I concur. This looks like a goo
201 - 255 of 255 matches
Mail list logo