Page MenuHomePhabricator

ast (Alexei Starovoitov)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 2 2014, 6:51 PM (433 w, 6 d)

Recent Activity

Mon, Mar 13

ast accepted D145816: [BPF] Improve pruning to avoid generate more types in BTF.
Mon, Mar 13, 8:52 AM · Restricted Project, Restricted Project

Jan 19 2023

ast added a comment to D142046: [BPF][clang] Ignore stack protector options for BPF target.

@ast With this patch, gentoo clang compilation will hit the warning even if people appends -fno-stack-protector. Is this okay? In general, if the option is '-fstack-protector -fno-stack-protector', we should not issue warning, right?

Jan 19 2023, 11:54 AM · Restricted Project, Restricted Project
ast accepted D142046: [BPF][clang] Ignore stack protector options for BPF target.

This approach looks better to me than NVPTX warn and I agree with Ed that it's better to leave NVPTX as-is to avoid any regression.

Jan 19 2023, 11:39 AM · Restricted Project, Restricted Project

Sep 23 2022

ast added reviewers for D134533: [BPF] Fix Segfault in BTFDebug: yonghong-song, eddyz87.
Sep 23 2022, 7:33 AM · Restricted Project, Restricted Project
ast added a comment to D134533: [BPF] Fix Segfault in BTFDebug.

looks fine, but could you add a unit test for it?

Sep 23 2022, 7:33 AM · Restricted Project, Restricted Project

Sep 8 2022

ast added inline comments to D133464: [WIP][BPF] Add sext load instructions.
Sep 8 2022, 3:18 PM · Restricted Project, Restricted Project
ast added inline comments to D133464: [WIP][BPF] Add sext load instructions.
Sep 8 2022, 2:30 PM · Restricted Project, Restricted Project

Aug 18 2022

ast accepted D132144: [Clang][BPF] Support record argument with direct values.
Aug 18 2022, 4:50 PM · Restricted Project, Restricted Project, Restricted Project
ast added a comment to D132144: [Clang][BPF] Support record argument with direct values.

clang -target bpf -O2 -S t3.c
t3.c:1:5: error: defined with too many args

Aug 18 2022, 1:13 PM · Restricted Project, Restricted Project, Restricted Project

Aug 16 2022

ast accepted D131598: [Clang][BPF]: Force sign/zero extension for return values in caller.
Aug 16 2022, 2:50 PM · Restricted Project, Restricted Project

Jul 13 2022

ast accepted D129621: [BPF] Handle anon record for CO-RE relocations.

The workaround is not pretty, but I couldn't come up with a better way.

Jul 13 2022, 12:58 PM · Restricted Project, Restricted Project

May 12 2022

ast accepted D124641: [BPF] Add BTF 64bit enum value support.

good catch.

May 12 2022, 8:34 PM · Restricted Project, Restricted Project

May 11 2022

ast accepted D124641: [BPF] Add BTF 64bit enum value support.
May 11 2022, 4:53 PM · Restricted Project, Restricted Project

May 10 2022

ast added a comment to D125185: [BPF] Mark FI_ri as isPseudo to avoid assertion during disassembly.

a test got lost?

May 10 2022, 5:20 PM · Restricted Project, Restricted Project
ast accepted D125207: [BPF] Implement mod operation.

lgtm as well.

May 10 2022, 9:39 AM · Restricted Project, Restricted Project

Apr 19 2022

ast accepted D123883: [BPF] Fix a bug in BPFMISimplifyPatchable pass.
Apr 19 2022, 2:57 PM · Restricted Project, Restricted Project
ast accepted D123877: [BPF] Emit fatal error if out of range for FK_PCRel_2 branch target.

Thanks!

Apr 19 2022, 1:30 PM · Restricted Project, Restricted Project
ast added inline comments to D123883: [BPF] Fix a bug in BPFMISimplifyPatchable pass.
Apr 19 2022, 10:31 AM · Restricted Project, Restricted Project
ast accepted D123877: [BPF] Emit fatal error if out of range for FK_PCRel_2 branch target.

assert is a heavy hammer.
can we exit with report_fatal_error instead?

Apr 19 2022, 10:29 AM · Restricted Project, Restricted Project

Apr 14 2022

ast accepted D123800: [BPF] handle opaque-pointer for __builtin_preserve_enum_value.

The fix to prevent the crash looks good, but what should be the expected codegen for a global variable?
CO-RE needs a constant.
Are we assuming that the global data will be inited with some constant and a later pass will propagate it further into __builtin_preserve,
so at the end it will become a constant?

Apr 14 2022, 9:17 AM · Restricted Project, Restricted Project

Mar 29 2022

ast accepted D122676: BPF: support inlining __builtin_memcmp intrinsic call.
Mar 29 2022, 12:21 PM · Restricted Project, Restricted Project
ast added a comment to D122676: BPF: support inlining __builtin_memcmp intrinsic call.

builtin_memcpy is not inlined

Mar 29 2022, 12:05 PM · Restricted Project, Restricted Project

Mar 17 2022

ast accepted D121937: [BPF] handle unsigned icmp ops in BPFAdjustOpt pass.

makes sense. without scalar evolution in the verfiier we cannot really propagate the range of r3 back into r2 and adjust it through reverse transformation of 13: (07) r3 += -3.
The llvm path is better.
Thanks!

Mar 17 2022, 3:50 PM · Restricted Project, Restricted Project
ast accepted D121883: [BPF] Fix a bug in BPFAdjustOpt pass for icmp transformation.
Mar 17 2022, 8:30 AM · Restricted Project, Restricted Project

Mar 16 2022

ast accepted D121821: [BPF] fix a CO-RE bitfield relocation error with >8 record alignment.
Mar 16 2022, 10:59 AM · Restricted Project, Restricted Project

Feb 28 2022

ast added a comment to D116063: BPF: report better error message for BTF_TYPE_ID_REMOTE relo failure.

@ast Is this OK to backport to release/14.x ?

Feb 28 2022, 3:53 PM · Restricted Project

Feb 16 2022

ast accepted D119986: [BPF] Fix a BTF type pruning bug.
Feb 16 2022, 4:53 PM · Restricted Project

Feb 14 2022

ast accepted D119799: [BPF] Fix a bug in BTF_KIND_TYPE_TAG generation.
Feb 14 2022, 6:06 PM · Restricted Project

Jan 6 2022

ast resigned from D116754: Bugfix for application of trivial loop optimization in LoopIdiomRecognize(Github Issue #50308).
Jan 6 2022, 9:54 PM · Restricted Project, Restricted Project, Restricted Project

Dec 20 2021

ast accepted D116063: BPF: report better error message for BTF_TYPE_ID_REMOTE relo failure.
Dec 20 2021, 7:53 PM · Restricted Project

Nov 18 2021

ast accepted D114215: BPF: Workaround InstCombine trunc+icmp => mask+icmp Optimization.
Nov 18 2021, 8:04 PM · Restricted Project

Nov 9 2021

ast accepted D113496: BPF: change btf_type_tag BTF output format.
Nov 9 2021, 10:23 AM · Restricted Project

Nov 4 2021

ast accepted D113222: BPF: Support btf_type_tag attribute.
Nov 4 2021, 4:04 PM · Restricted Project

Nov 1 2021

ast accepted D112938: BPF: Workaround an InstCombine ICmp transformation with llvm.bpf.compare builtin.
Nov 1 2021, 11:03 AM · Restricted Project

Oct 21 2021

ast accepted D112259: BPF: emit BTF_KIND_DECL_TAG for typedef types.
Oct 21 2021, 11:52 AM · Restricted Project

Oct 18 2021

ast accepted D111897: BPF: remove intrindics @llvm.stacksave() and @llvm.stackrestore().
Oct 18 2021, 8:31 AM · Restricted Project

Sep 30 2021

ast accepted D110789: BPF: implement isLegalAddressingMode() properly.
Sep 30 2021, 4:21 PM · Restricted Project

Sep 23 2021

ast added a reviewer for D110339: SelectionDAGBuilder: Improve canonicalization by not swapping branch targets: yonghong-song.
Sep 23 2021, 9:03 AM · Restricted Project, Restricted Project

Sep 20 2021

ast accepted D109073: BPF: make 32bit register spill with 64bit alignment.
Sep 20 2021, 8:26 PM · Restricted Project

Jun 7 2021

ast accepted D103864: BPF: fix relocation types in lib/Object/RelocationResolver.cpp.
Jun 7 2021, 7:21 PM · Restricted Project

Jun 2 2021

ast added a comment to D103549: [POC] Put annotation strings into debuginfo..

Yep LLVM does have some custom attributes and such, eg: https://github.com/llvm/llvm-project/blob/effb87dfa810a28e763f914fe3e6e984782cc846/llvm/include/llvm/BinaryFormat/Dwarf.def#L592

Jun 2 2021, 4:38 PM · Restricted Project, Restricted Project, debug-info

May 24 2021

ast accepted D102712: BPF: Add more relocation kinds.
May 24 2021, 3:37 PM · Restricted Project

May 11 2021

ast accepted D101336: [LLD][BPF] Add bpf support.

I think addition of emitFuncDataSections is justified.
The rest is bpf specific.

May 11 2021, 2:53 PM · Restricted Project, lld, Restricted Project

May 6 2021

ast accepted D102036: BPF: fix FIELD_EXISTS relocation with array subscripts.
May 6 2021, 6:30 PM · Restricted Project

Apr 15 2021

ast accepted D100568: BPF: generate BTF info for LD_imm64 loaded function pointer.
Apr 15 2021, 8:34 AM · Restricted Project
ast accepted D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested.

Makes sense to me. Only BPF target will notice this difference.

Apr 15 2021, 8:25 AM · Restricted Project, debug-info

Apr 13 2021

ast accepted D100392: BPF: remove default .extern data section.
Apr 13 2021, 9:54 AM · Restricted Project
ast accepted D100362: BPF: generate proper BTF for globals with WeakODRLinkage.
Apr 13 2021, 8:39 AM · Restricted Project

Mar 25 2021

ast accepted D93563: BPF: add extern func to data sections if specified.
Mar 25 2021, 3:05 PM · Restricted Project

Mar 11 2021

ast accepted D98471: BPF: provide better error message for unsupported atomic operations.
Mar 11 2021, 6:31 PM · Restricted Project

Mar 4 2021

ast accepted D97986: BPF: permit type modifiers for __builtin_btf_type_id() relocation.
Mar 4 2021, 3:04 PM · Restricted Project

Mar 2 2021

ast accepted D97792: BPF: Fix a bug in peephole TRUNC elimination optimization.

thanks for the quick fix!

Mar 2 2021, 12:10 PM · Restricted Project

Mar 1 2021

ast accepted D97659: BPF: fix enum value 0 issue for __builtin_preserve_enum_value().
Mar 1 2021, 10:04 AM · Restricted Project

Feb 25 2021

ast accepted D97479: BPF: Implement TTI.getCmpSelInstrCost() properly.

Thanks!

Feb 25 2021, 2:02 PM · Restricted Project

Feb 10 2021

ast accepted D96448: BPF: Implement TTI.IntImmCost() properly.

looks great. thanks

Feb 10 2021, 8:29 PM · Restricted Project

Dec 19 2020

ast added a comment to D93563: BPF: add extern func to data sections if specified.

why the current behavior is not enough?
BTF_KIND_FUNC (foo1) -> BTF_KIND_FUNC_PROTO (foo1)
BTF_KIND_FUNC (foo2) -> BTF_KIND_FUNC_PROTO (foo2)
libbpf can use order to find proper function. foo can be extern as it is right now. Then libbpf will first try to match between multiple elf bpf files. If still not found it will search in vmlinux/mods.
I think using KIND_VAR is incorrect. There is no variable here.

Dec 19 2020, 9:24 AM · Restricted Project

Dec 18 2020

ast edited reviewers for D93563: BPF: add extern func to data sections if specified, added: anakryiko; removed: andriigrynenko.

Does it work already without specifying the section, right?
void foo1(int); works ?
void foo2(int) __ attribute __((section("bar")));
sort-of works, but this one goes into the same section as foo1 ?

Dec 18 2020, 5:18 PM · Restricted Project

Dec 15 2020

ast added a reviewer for D93103: Enable the _ExtInt extension on the BPF Target: yonghong-song.
Dec 15 2020, 5:19 PM · Restricted Project
ast requested changes to D93103: Enable the _ExtInt extension on the BPF Target.

What's a use case?
The test is necessary.

Dec 15 2020, 5:19 PM · Restricted Project

Dec 2 2020

ast accepted D72184: [BPF] support atomic instructions.
Dec 2 2020, 9:34 AM · Restricted Project, Restricted Project

Dec 1 2020

ast added inline comments to D72184: [BPF] support atomic instructions.
Dec 1 2020, 9:42 PM · Restricted Project, Restricted Project
ast added inline comments to D72184: [BPF] support atomic instructions.
Dec 1 2020, 8:54 PM · Restricted Project, Restricted Project
ast accepted D92451: BPF: add a test for selectiondag alias analysis w.r.t. lifetime.
Dec 1 2020, 8:19 PM · Restricted Project

Nov 19 2020

ast added a comment to D72184: [BPF] support atomic instructions.

Looks like the test didn't change. Only commit log... that's fine. I think the diff is ready to land, but let's wait for the kernel patches to be ready as well.

Nov 19 2020, 9:19 PM · Restricted Project, Restricted Project
ast added inline comments to D72184: [BPF] support atomic instructions.
Nov 19 2020, 11:51 AM · Restricted Project, Restricted Project
ast added inline comments to D72184: [BPF] support atomic instructions.
Nov 19 2020, 11:25 AM · Restricted Project, Restricted Project

Nov 18 2020

ast added inline comments to D72184: [BPF] support atomic instructions.
Nov 18 2020, 2:54 PM · Restricted Project, Restricted Project

Nov 17 2020

ast added a comment to D72184: [BPF] support atomic instructions.

looks good. Before landing we need to agree on the full set of instructions that -mcpu=v4 will support.
atomic_fetch_or|xor|and are probably needed as instructions. The kernel JIT will generate x86 cmpxchg for them.
Because if llvm generates bpf cmpxchg insn then we'd need to teach the verifier to recognize infinite loops.

Nov 17 2020, 8:34 PM · Restricted Project, Restricted Project
ast added inline comments to D72184: [BPF] support atomic instructions.
Nov 17 2020, 9:27 AM · Restricted Project, Restricted Project

Nov 15 2020

ast accepted D91489: BPF: make __builtin_btf_type_id() return 64bit int.
Nov 15 2020, 10:21 AM · Restricted Project, Restricted Project

Nov 3 2020

ast added inline comments to D72184: [BPF] support atomic instructions.
Nov 3 2020, 1:56 PM · Restricted Project, Restricted Project
ast added inline comments to D72184: [BPF] support atomic instructions.
Nov 3 2020, 9:39 AM · Restricted Project, Restricted Project

Oct 7 2020

ast accepted D89021: BPF: fix incorrect DAG2DAG load optimization.
Oct 7 2020, 6:31 PM · Restricted Project

Oct 6 2020

ast accepted D88942: BPF: avoid duplicated globals for CORE relocations.
Oct 6 2020, 10:33 PM · Restricted Project
ast accepted D88942: BPF: avoid duplicated globals for CORE relocations.
Oct 6 2020, 10:17 PM · Restricted Project

Oct 5 2020

ast accepted D85570: BPF: add AdjustOpt IR pass to generate verifier friendly codes.
Oct 5 2020, 4:35 PM · Restricted Project

Sep 30 2020

ast added a comment to D88525: BPF: use Source instead of ILP scheduler for selection dag.

looks like x86 64-bit is ILP, so it's not niche.
Looks like Source gets the least amount of testing (judging by archs that use it).
RegPressure is probably 2nd most used after ILP.
It feels that we should fix it inside ILP instead.

Sep 30 2020, 2:04 PM · Restricted Project

Sep 29 2020

ast accepted D88525: BPF: use Source instead of ILP scheduler for selection dag.

ouch. sounds like we don't have much choice. Let's figure out what happened with test_verif_scale3 first, but looks like we have to land regardless.

Sep 29 2020, 9:22 PM · Restricted Project

Sep 28 2020

ast accepted D87153: BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible.
Sep 28 2020, 1:29 PM · Restricted Project, Restricted Project

Sep 21 2020

ast added inline comments to D87153: BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible.
Sep 21 2020, 6:56 PM · Restricted Project, Restricted Project

Sep 10 2020

ast added a comment to D85570: BPF: add AdjustOpt IR pass to generate verifier friendly codes.

is this based on D87153 ?
the passthrough will be removed later, right?

Sep 10 2020, 1:18 PM · Restricted Project
ast added inline comments to D87153: BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible.
Sep 10 2020, 1:16 PM · Restricted Project, Restricted Project

Aug 6 2020

ast accepted D85434: BPF: add a SimplifyCFG IR pass during generic Scalar/IPO optimization.

thanks for detailed analysis.

Aug 6 2020, 10:49 AM · Restricted Project

Aug 3 2020

ast added a comment to D85174: BPF: simplify IR generation for __builtin_btf_type_id().

Is it a cleanup or is it a fix for some bug? If latter there should be a new test for it?

Aug 3 2020, 5:47 PM · Restricted Project, Restricted Project

Jul 17 2020

ast accepted D84002: BPF: generate .rodata BTF datasec for certain initialized local var's.
Jul 17 2020, 9:05 AM · Restricted Project

Jul 15 2020

ast added a comment to D83242: [clang][BPF] support type exist/size and enum exist/value relocations.

lgtm.
curious what happens when type is defined within args, like:
__builtin_preserve_field_info(*(struct { int a; } *)0, 2);

Jul 15 2020, 12:32 PM · Restricted Project, Restricted Project
ast accepted D83878: BPF: support type exist/size and enum exist/value relocations.

lgtm

Jul 15 2020, 12:28 PM · Restricted Project

Jul 10 2020

ast added a comment to D83289: [BPF] Add support for floats and doubles.

'float *var;' in the struct won't be trivial to handle with a skip indeed.
My concern with float->char[] substitute is that the kernel decides on calling convention based on these types.
If there is a function fn(int a, float b); and pahole emits BTF for it as fn(int a, char b[4])
the kernel will let bpf progs to attach to it with wrong register passing.
Currently array is not allowed in btf_distill_func_proto(), so it's a theoretical issue, but still dangerous long term.
I think pahole/clang should either skip generating BTF for anything with float or BTF should be extended to encode it.
I think extending BTF would be easier.
I don't like KIND_INT_FLOATING though. KIND_FLOAT is better. Just like single KIND_INT that represents char/int/long
the KIND_FLOAT should be able to represent float/double/long double.

Jul 10 2020, 3:26 PM · Restricted Project
ast added a comment to D83289: [BPF] Add support for floats and doubles.

does pahole convert float/double to int ? Is it really the case?
I think it's better to skip float/double when they are part of a struct and leave a hole in there.
I worry that representing them as 'char' array may cause backward compatibility issues later.
If pahole is doing such hack now it probably should be fixed too.

Jul 10 2020, 12:24 PM · Restricted Project
ast updated subscribers of D83289: [BPF] Add support for floats and doubles.
Jul 10 2020, 12:20 PM · Restricted Project

Jul 1 2020

ast accepted D82976: [BPF] Fix a BTF gen bug related to a pointer struct member.
Jul 1 2020, 9:42 AM · Restricted Project

Jun 30 2020

ast accepted D82932: [BPF] Fix a bug for __builtin_preserve_field_info() processing.
Jun 30 2020, 11:15 PM · Restricted Project

Jun 17 2020

ast accepted rG89648eb16d01: [BPF] fix a bug for BTF pointee type pruning.
Jun 17 2020, 10:39 PM
ast accepted D82041: [BPF] fix a bug for BTF pointee type pruning.
Jun 17 2020, 1:29 PM · Restricted Project

Jun 15 2020

ast accepted rG4db1878158a3: [BPF] fix incorrect type in BPFISelDAGToDAG readonly load optimization.

that's an important fix to backport

Jun 15 2020, 1:46 PM

Jun 11 2020

ast accepted D81630: [BPF] fix incorrect type in BPFISelDAGToDAG readonly load optimization.
Jun 11 2020, 2:20 PM · Restricted Project

Jun 9 2020

ast added a comment to D81479: [BPF] introduce __builtin_bpf_load_u32_to_ptr() intrinsic.

It feels that the same thing can be represented as inline asm.
What advantage builtin has?

Jun 9 2020, 7:52 PM · Restricted Project, Restricted Project
ast added inline comments to D81479: [BPF] introduce __builtin_bpf_load_u32_to_ptr() intrinsic.
Jun 9 2020, 10:57 AM · Restricted Project, Restricted Project

Jun 4 2020

ast accepted D81131: [DebugInfo] Fix assertion for extern void type.
Jun 4 2020, 11:00 AM · Restricted Project, Restricted Project, debug-info

Jun 2 2020

ast accepted D81048: [BPF] Remove unnecessary MOV_32_64 instructions.
Jun 2 2020, 7:44 PM · Restricted Project