Page MenuHomePhabricator

ast (Alexei Starovoitov)
User

Projects

User does not belong to any projects.

User Details

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

Recent Activity

Thu, May 12

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

good catch.

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

Wed, May 11

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

Tue, May 10

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

a test got lost?

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

lgtm as well.

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

Tue, Apr 19

ast accepted D123883: [BPF] Fix a bug in BPFMISimplifyPatchable pass.
Tue, Apr 19, 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!

Tue, Apr 19, 1:30 PM · Restricted Project, Restricted Project
ast added inline comments to D123883: [BPF] Fix a bug in BPFMISimplifyPatchable pass.
Tue, Apr 19, 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?

Tue, Apr 19, 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

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

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 · 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

May 18 2020

ast accepted D80157: [BPF] Return fail if disassembled insn registers out of range.
May 18 2020, 2:39 PM · Restricted Project
ast accepted D80156: [BPF] Prevent disassembly segfault for NOP insn.
May 18 2020, 2:39 PM · Restricted Project

Apr 20 2020

ast accepted D78466: BPF: fix a CORE optimization bug.

lgtm

Apr 20 2020, 7:00 PM · Restricted Project

Apr 8 2020

ast added a comment to D73985: [bpf] zero extension is required in BPF implementaiton so remove <<=32 >>=32.

@yonghong-song @ast Now we have proper alu32 fixes in kernel side how about we add this. We've been running with it for a couple months now?

Apr 8 2020, 9:12 AM · Restricted Project

Mar 27 2020

ast accepted D76587: [BPF] support 128bit int explicitly in layout spec.
Mar 27 2020, 7:51 PM · Restricted Project

Feb 20 2020

ast accepted D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id().
Feb 20 2020, 8:30 AM · debug-info, Restricted Project, Restricted Project

Feb 19 2020

ast accepted D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id().
Feb 19 2020, 9:50 PM · debug-info, Restricted Project, Restricted Project
ast added inline comments to D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id().
Feb 19 2020, 6:34 PM · debug-info, Restricted Project, Restricted Project
ast accepted D74668: [Clang][BPF] implement __builtin_btf_type_id() builtin function.

lgtm. Thanks for explaining lvalue/value trick.

Feb 19 2020, 6:34 PM · debug-info, Restricted Project, Restricted Project

Feb 12 2020

ast accepted D74521: [BPF] explicit warning of not supporting dynamic stack allocation.
Feb 12 2020, 8:25 PM · Restricted Project

Feb 11 2020

ast accepted D74101: [BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering.

Looks like more canonical implementation now. Thanks.
Please double check that all selftests/bpf still pass with and without alu32 before landing.

Feb 11 2020, 9:12 AM · Restricted Project