Page MenuHomePhabricator

ast (Alexei Starovoitov)
User

Projects

User does not belong to any projects.

User Details

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

Recent Activity

Wed, Oct 7

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

Tue, Oct 6

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

Mon, Oct 5

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

Wed, Sep 30

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.

Wed, Sep 30, 2:04 PM · Restricted Project

Tue, Sep 29

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.

Tue, Sep 29, 9:22 PM · Restricted Project

Mon, Sep 28

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

Mon, Sep 21

ast added inline comments to D87153: BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible.
Mon, Sep 21, 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] Emit unknown types as byte arrays.

'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] Emit unknown types as byte arrays.

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] Emit unknown types as byte arrays.
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

Feb 10 2020

ast added a comment to D74101: [BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering.

return NumBits1 > NumBits2

Feb 10 2020, 9:25 PM · Restricted Project
ast requested changes to D74101: [BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering.

I suspect isZExtFree() is also necessary.
BPF implementation probably should be similar to aarch64.
In isTruncateFree() do
return NumBits1 > NumBits2;
and in isZExtFree() do:
return NumBits1 == 32 && NumBits2 == 64;

Feb 10 2020, 1:48 PM · Restricted Project

Feb 3 2020

ast accepted D73900: [BPF] use base lvalue type for preserve_{struct,union}_access_index metadata.
Feb 3 2020, 11:00 AM · Restricted Project

Jan 30 2020

ast accepted D73681: [BPF] fix a bug in BPFMISimplifyPatchable pass with -O0.
Jan 30 2020, 7:55 AM · Restricted Project

Jan 17 2020

ast added inline comments to D72787: [BPF] Adjust optimizations to generate kernel verifier friendly codes.
Jan 17 2020, 7:25 PM · Restricted Project

Jan 16 2020

ast accepted D72787: [BPF] Adjust optimizations to generate kernel verifier friendly codes.
Jan 16 2020, 10:32 AM · Restricted Project

Jan 15 2020

ast added a comment to D72787: [BPF] Adjust optimizations to generate kernel verifier friendly codes.

looks fine. could you run it against kernel selftests and check when it triggers? since verifier cannot handle the optimized code there should be almost no cases of reverse transformation.
And if there are then add them as .ll tests?

Jan 15 2020, 1:10 PM · Restricted Project

Dec 22 2019

ast accepted D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables".
Dec 22 2019, 5:39 PM · Restricted Project, Restricted Project

Dec 17 2019

ast accepted D71638: [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs.

lgtm. please don't land it yet. Let me test with corresponding kernel and libbpf changes first.

Dec 17 2019, 7:33 PM · Restricted Project

Dec 10 2019

ast accepted D71290: [BPF] put not-section-attribute externs into BTF ".extern" data section.

lgtm as well

Dec 10 2019, 11:23 AM · Restricted Project

Dec 7 2019

ast accepted D70697: [BPF] Support to emit debugInfo for extern variables.

thanks for adding extra tests

Dec 7 2019, 11:11 AM · Restricted Project
ast accepted D71162: [BPF] Support weak global variables for BTF.

lgtm

Dec 7 2019, 8:42 AM · Restricted Project

Nov 25 2019

ast accepted D70703: [BPF] add "llvm." prefix to BPF internally created globals.
Nov 25 2019, 6:17 PM · Restricted Project
ast accepted D70697: [BPF] Support to emit debugInfo for extern variables.

got it. lgtm

Nov 25 2019, 2:56 PM · Restricted Project
ast added a comment to D70697: [BPF] Support to emit debugInfo for extern variables.

clang side will expose debuginfo for extern variables and functions, while the backend support is for functions only? Or I'm misreading the patch.

Nov 25 2019, 2:37 PM · Restricted Project

Nov 22 2019

ast accepted D70586: [BPF] Fix a recursion bug in BPF Peephole ZEXT optimization.
Nov 22 2019, 12:43 AM · Restricted Project

Nov 20 2019

ast accepted D70511: [BPF] Fix a bug in peephole optimization.
Nov 20 2019, 2:34 PM · Restricted Project

Nov 9 2019

ast added a comment to D69759: [BPF] Add preserve_access_index attribute for record definition.

I've tested this patch on several kernel selftests/bpf/ and it works like magic. Very nice improvement.

Nov 9 2019, 11:26 AM · Restricted Project

Nov 8 2019

ast accepted D69759: [BPF] Add preserve_access_index attribute for record definition.

Great. Looks like inner propagation fix was straighforward. Thanks!

Nov 8 2019, 6:40 PM · Restricted Project
ast added a comment to D69759: [BPF] Add preserve_access_index attribute for record definition.

So what happens in the following case:

struct S1;
struct S2 {
  struct S1 *f;
} relo *s2;
// access s2->f
struct S1 {
  int i;
} relo;
// access s2->f->i

lack of relo on fwd declaration is not going to be sticky 'non-relo' when it's seen later, right?
So all 3 deref will be relocatable?

Nov 8 2019, 10:53 AM · Restricted Project
ast added a comment to D69759: [BPF] Add preserve_access_index attribute for record definition.

Is the attribute sticky with forward delcarations?

struct s __reloc;
Nov 8 2019, 10:08 AM · Restricted Project
ast added a comment to D69759: [BPF] Add preserve_access_index attribute for record definition.

Looks great. This is a big improvement in usability.
Is there a use case to apply that attribute to inner types automatically ?

struct s1 {
  int foo;
};
struct s2 {
   struct s1 *ptr;
} __reloc__ *s2;

s2->ptr->foo -- will both deref be relocatable or only first?

Nov 8 2019, 9:49 AM · Restricted Project

Nov 7 2019

ast accepted D69957: [BPF] turn on -mattr=+alu32 for cpu version v3 and later.
Nov 7 2019, 2:17 PM · Restricted Project

Nov 4 2019

ast accepted D69837: [BPF] Fix CO-RE bugs with bitfields.
Nov 4 2019, 8:00 PM · Restricted Project

Nov 3 2019

ast accepted D69761: [BPF] fix a bug in __builtin_preserve_field_info() with FIELD_BYTE_SIZE.
Nov 3 2019, 8:10 AM · Restricted Project

Oct 25 2019

ast accepted D69438: [BPF] fix a CO-RE issue with -mattr=+alu32.
Oct 25 2019, 11:11 AM · Restricted Project

Oct 24 2019

ast added a comment to D69393: [RFC][DebugInfo] emit user specified address_space in dwarf.

The address spaces envisioned by the Linux kernel appear to be more informational and not descriptive of hardware characteristics.

Oct 24 2019, 8:23 PM · Restricted Project, debug-info

Oct 20 2019

ast accepted D69229: [BPF] fix indirect call assembly code.
Oct 20 2019, 6:23 PM · Restricted Project

Oct 9 2019

ast accepted D68760: [BPF] Remove relocation for patchable externs.
Oct 9 2019, 10:48 PM · Restricted Project

Oct 8 2019

ast accepted D67980: [BPF] do compile-once run-everywhere relocation for bitfields.

perfect. ship it

Oct 8 2019, 10:36 AM · Restricted Project, Restricted Project

Oct 7 2019

ast added a comment to D67980: [BPF] do compile-once run-everywhere relocation for bitfields.

thanks for adding the tests

Oct 7 2019, 12:05 PM · Restricted Project, Restricted Project

Oct 6 2019

ast accepted D67980: [BPF] do compile-once run-everywhere relocation for bitfields.

lgtm. thanks!

Oct 6 2019, 4:23 PM · Restricted Project, Restricted Project

Oct 5 2019

ast added inline comments to D67980: [BPF] do compile-once run-everywhere relocation for bitfields.
Oct 5 2019, 6:48 PM · Restricted Project, Restricted Project

Oct 3 2019

ast accepted D68389: [BPF] Handle offset reloc endpoint ending in the middle of chain properly.

nice cleanup.

Oct 3 2019, 8:56 AM · Restricted Project

Sep 22 2019

ast accepted D67883: [CLANG][BPF] permit any argument type for __builtin_preserve_access_index().

I tested few different examples. Generated code and relocations look good.

Sep 22 2019, 10:11 AM · Restricted Project, Restricted Project

Sep 18 2019

ast accepted D67734: [CLANG-BPF] change __builtin_preserve_access_index() signature.

that's indeed much better. Thanks for adding all the tests.

Sep 18 2019, 4:39 PM · Restricted Project, Restricted Project

Sep 17 2019

ast accepted D67688: [BPF] Permit all user instructed offset relocatiions.

thanks for the quick fix.

Sep 17 2019, 8:21 PM · Restricted Project

Aug 17 2019

ast accepted D66372: [BPF] Fix bpf llvm-objdump issues.
Aug 17 2019, 8:14 AM · Restricted Project

Aug 3 2019

ast accepted D65700: [Transforms] Do not drop !preserve.access.index metadata.

lgtm

Aug 3 2019, 11:31 AM · Restricted Project

Aug 2 2019

ast accepted D65618: [BPF] Handling type conversions correctly for CO-RE.

looks good now. thanks

Aug 2 2019, 4:06 PM · Restricted Project
ast accepted D65664: [BPF] annotate DIType metadata for builtin preseve_array_access_index().
Aug 2 2019, 11:59 AM · Restricted Project, Restricted Project

Aug 1 2019

ast accepted D65615: [BPF] annotate DIType metadata for builtin preseve_array_access_index().

and the diff is shorter now :)

Aug 1 2019, 5:05 PM · Restricted Project
ast added inline comments to D65615: [BPF] annotate DIType metadata for builtin preseve_array_access_index().
Aug 1 2019, 4:04 PM · Restricted Project

Jul 24 2019

ast accepted D65259: fix typedef issue for offset relocation.
Jul 24 2019, 9:14 PM · Restricted Project
ast accepted D65258: fix CO-RE incorrect index access string.
Jul 24 2019, 9:11 PM · Restricted Project

Jul 14 2019

ast accepted D64598: fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic.
Jul 14 2019, 8:04 PM · Restricted Project
ast accepted D64606: [BPF] add unit tests for preserve_{array,union,struct}_access_index intrinsics.
Jul 14 2019, 8:04 PM · Restricted Project

Jun 24 2019

ast accepted D61524: [BPF] Support for compile once and run everywhere.
Jun 24 2019, 12:38 PM · Restricted Project

May 28 2019

ast accepted D61809: [BPF] Preserve debuginfo array/union/struct type/access index.

lgtm

May 28 2019, 5:22 PM · Restricted Project, Restricted Project
ast accepted D61524: [BPF] Support for compile once and run everywhere.
May 28 2019, 5:22 PM · Restricted Project

May 26 2019

ast accepted D62460: [BPF] generate R_BPF_NONE relocation for BTF DataSec variables.
May 26 2019, 7:55 AM · Restricted Project

May 23 2019

ast added inline comments to D61524: [BPF] Support for compile once and run everywhere.
May 23 2019, 7:01 PM · Restricted Project
ast added inline comments to D61524: [BPF] Support for compile once and run everywhere.
May 23 2019, 6:11 PM · Restricted Project
ast accepted D61809: [BPF] Preserve debuginfo array/union/struct type/access index.

from kernel, libbpf, tooling and user experience points of view this approach looks the best to me.

May 23 2019, 6:07 PM · Restricted Project, Restricted Project

May 12 2019

ast accepted D61826: [BPF] emit BTF sections only if debuginfo available.
May 12 2019, 6:59 PM · Restricted Project

Apr 25 2019

ast accepted D61173: [BPF] do not generate predefined macro bpf.

Macro shipit:

Apr 25 2019, 11:22 PM · Restricted Project, Restricted Project
ast added inline comments to D61173: [BPF] do not generate predefined macro bpf.
Apr 25 2019, 11:01 PM · Restricted Project, Restricted Project

Mar 28 2019

ast accepted D59943: [BPF] add proper multi-dimensional array support.
Mar 28 2019, 9:21 AM · Restricted Project

Mar 15 2019

ast accepted D59441: [BPF] Add BTF Var and DataSec Support.
Mar 15 2019, 10:28 PM · Restricted Project

Mar 4 2019

ast accepted D58936: [BPF] Do not generate BTF sections unnecessarily.
Mar 4 2019, 4:51 PM · Restricted Project

Jan 30 2019

ast accepted D57436: gn build: Add BPF target..
In D57436#1377680, @ast wrote:

hmm. so you're saying when we add new file to the normal CMakeFiles, we don't need to touch GN ?

Yes.

Jan 30 2019, 1:18 PM