* Support for the pseudo-C BPF assembler syntax in GAS @ 2023-04-26 17:37 Jose E. Marchesi 2023-04-26 18:28 ` Yonghong Song 0 siblings, 1 reply; 9+ messages in thread From: Jose E. Marchesi @ 2023-04-26 17:37 UTC (permalink / raw) To: bpf; +Cc: James Hilliard, gmartinezq07 Just a heads up, we just committed support for the assembly syntax used by clang to the GNU assembler [1]. Salud! [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-26 17:37 Support for the pseudo-C BPF assembler syntax in GAS Jose E. Marchesi @ 2023-04-26 18:28 ` Yonghong Song 2023-04-26 19:26 ` Jose E. Marchesi 0 siblings, 1 reply; 9+ messages in thread From: Yonghong Song @ 2023-04-26 18:28 UTC (permalink / raw) To: Jose E. Marchesi, bpf; +Cc: James Hilliard, gmartinezq07 On 4/26/23 10:37 AM, Jose E. Marchesi wrote: > > Just a heads up, we just committed support for the assembly syntax used > by clang to the GNU assembler [1]. Thanks! Do you which gcc release is expected to contain these changes? > > Salud! > > [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-26 18:28 ` Yonghong Song @ 2023-04-26 19:26 ` Jose E. Marchesi 2023-04-26 20:05 ` Alexei Starovoitov 2023-04-28 8:52 ` Jose E. Marchesi 0 siblings, 2 replies; 9+ messages in thread From: Jose E. Marchesi @ 2023-04-26 19:26 UTC (permalink / raw) To: Yonghong Song; +Cc: bpf, James Hilliard, gmartinezq07 > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: >> Just a heads up, we just committed support for the assembly syntax >> used >> by clang to the GNU assembler [1]. > > Thanks! Do you which gcc release is expected to contain these changes? This is the assembler, i.e. binutils. We don't need to update the compiler. >> Salud! >> [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-26 19:26 ` Jose E. Marchesi @ 2023-04-26 20:05 ` Alexei Starovoitov 2023-04-27 10:14 ` Jose E. Marchesi 2023-04-28 8:52 ` Jose E. Marchesi 1 sibling, 1 reply; 9+ messages in thread From: Alexei Starovoitov @ 2023-04-26 20:05 UTC (permalink / raw) To: Jose E. Marchesi, Eddy Z; +Cc: Yonghong Song, bpf, James Hilliard, gmartinezq07 On Wed, Apr 26, 2023 at 12:35 PM Jose E. Marchesi <jose.marchesi@oracle.com> wrote: > > > > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: > >> Just a heads up, we just committed support for the assembly syntax > >> used > >> by clang to the GNU assembler [1]. > > > > Thanks! Do you which gcc release is expected to contain these changes? > > This is the assembler, i.e. binutils. > We don't need to update the compiler. > > >> Salud! > >> [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html This is awesome! We recently converted tens of thousands of lines of bpf asm from macros to inline asm in C. See tools/testing/selftests/bpf/progs/verifier_*.c I wonder how gas-bpf can deal with that. We had to fix several inline asm issues in clang to get to this point and probably more to come. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-26 20:05 ` Alexei Starovoitov @ 2023-04-27 10:14 ` Jose E. Marchesi 2023-04-27 15:22 ` Eduard Zingerman 2023-04-27 15:33 ` Alexei Starovoitov 0 siblings, 2 replies; 9+ messages in thread From: Jose E. Marchesi @ 2023-04-27 10:14 UTC (permalink / raw) To: Alexei Starovoitov Cc: Eddy Z, Yonghong Song, bpf, James Hilliard, gmartinezq07 Odd. I replied to this yesterday, but somehow it wasn't sent. > On Wed, Apr 26, 2023 at 12:35 PM Jose E. Marchesi > <jose.marchesi@oracle.com> wrote: >> >> >> > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: >> >> Just a heads up, we just committed support for the assembly syntax >> >> used >> >> by clang to the GNU assembler [1]. >> > >> > Thanks! Do you which gcc release is expected to contain these changes? >> >> This is the assembler, i.e. binutils. >> We don't need to update the compiler. >> >> >> Salud! >> >> [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html > > This is awesome! > We recently converted tens of thousands of lines of bpf asm from macros > to inline asm in C. > See tools/testing/selftests/bpf/progs/verifier_*.c > I wonder how gas-bpf can deal with that. Inline assembly shall work. > We had to fix several inline asm issues in clang to get to this point > and probably more to come. We will give these tests a try and fix problems as we find them :) We actually came with some ambiguities, undefined stuff, and other issues with the syntax while doing the implementation. We hope to discuss some of that during the LSF/MM/BPF next week, so we can consolidate the language in both toolchains. Speaking of which, we are preparing the material for the "compiled BPF" activity during LSF/MM/BPF. I think the BPF track hasn't been scheduled yet, but how much time will we have to discuss about the topic? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-27 10:14 ` Jose E. Marchesi @ 2023-04-27 15:22 ` Eduard Zingerman 2023-04-27 16:35 ` Jose E. Marchesi 2023-04-27 15:33 ` Alexei Starovoitov 1 sibling, 1 reply; 9+ messages in thread From: Eduard Zingerman @ 2023-04-27 15:22 UTC (permalink / raw) To: Jose E. Marchesi, Alexei Starovoitov Cc: Yonghong Song, bpf, James Hilliard, gmartinezq07 On Thu, 2023-04-27 at 12:14 +0200, Jose E. Marchesi wrote: > Odd. I replied to this yesterday, but somehow it wasn't sent. > > > On Wed, Apr 26, 2023 at 12:35 PM Jose E. Marchesi > > <jose.marchesi@oracle.com> wrote: > > > > > > > > > > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: > > > > > Just a heads up, we just committed support for the assembly syntax > > > > > used > > > > > by clang to the GNU assembler [1]. > > > > > > > > Thanks! Do you which gcc release is expected to contain these changes? > > > > > > This is the assembler, i.e. binutils. > > > We don't need to update the compiler. > > > > > > > > Salud! > > > > > [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html > > > > This is awesome! > > We recently converted tens of thousands of lines of bpf asm from macros > > to inline asm in C. > > See tools/testing/selftests/bpf/progs/verifier_*.c > > I wonder how gas-bpf can deal with that. > > Inline assembly shall work. There is also an LLVM testcase [1] where most of the instructions are covered, but you probably have something similar. Just of the curiosity, is the state machine generated by some tool or is it "pen and paper" exercise? [1] https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/BPF/assembler-disassembler.s > > > We had to fix several inline asm issues in clang to get to this point > > and probably more to come. > > We will give these tests a try and fix problems as we find them :) > > We actually came with some ambiguities, undefined stuff, and other > issues with the syntax while doing the implementation. We hope to > discuss some of that during the LSF/MM/BPF next week, so we can > consolidate the language in both toolchains. > > Speaking of which, we are preparing the material for the "compiled BPF" > activity during LSF/MM/BPF. I think the BPF track hasn't been scheduled > yet, but how much time will we have to discuss about the topic? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-27 15:22 ` Eduard Zingerman @ 2023-04-27 16:35 ` Jose E. Marchesi 0 siblings, 0 replies; 9+ messages in thread From: Jose E. Marchesi @ 2023-04-27 16:35 UTC (permalink / raw) To: Eduard Zingerman Cc: Alexei Starovoitov, Yonghong Song, bpf, James Hilliard, gmartinezq07 > On Thu, 2023-04-27 at 12:14 +0200, Jose E. Marchesi wrote: >> Odd. I replied to this yesterday, but somehow it wasn't sent. >> >> > On Wed, Apr 26, 2023 at 12:35 PM Jose E. Marchesi >> > <jose.marchesi@oracle.com> wrote: >> > > >> > > >> > > > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: >> > > > > Just a heads up, we just committed support for the assembly syntax >> > > > > used >> > > > > by clang to the GNU assembler [1]. >> > > > >> > > > Thanks! Do you which gcc release is expected to contain these changes? >> > > >> > > This is the assembler, i.e. binutils. >> > > We don't need to update the compiler. >> > > >> > > > > Salud! >> > > > > [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html >> > >> > This is awesome! >> > We recently converted tens of thousands of lines of bpf asm from macros >> > to inline asm in C. >> > See tools/testing/selftests/bpf/progs/verifier_*.c >> > I wonder how gas-bpf can deal with that. >> >> Inline assembly shall work. > > There is also an LLVM testcase [1] where most of the instructions are covered, > but you probably have something similar. Yes we have extensive instruction testing in the assembler. > Just of the curiosity, is the state machine generated by some tool or > is it "pen and paper" exercise? It is the later :) But I plan to turn that function into a recursive-descend, for maintainability. > [1] https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/BPF/assembler-disassembler.s > >> >> > We had to fix several inline asm issues in clang to get to this point >> > and probably more to come. >> >> We will give these tests a try and fix problems as we find them :) >> >> We actually came with some ambiguities, undefined stuff, and other >> issues with the syntax while doing the implementation. We hope to >> discuss some of that during the LSF/MM/BPF next week, so we can >> consolidate the language in both toolchains. >> >> Speaking of which, we are preparing the material for the "compiled BPF" >> activity during LSF/MM/BPF. I think the BPF track hasn't been scheduled >> yet, but how much time will we have to discuss about the topic? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-27 10:14 ` Jose E. Marchesi 2023-04-27 15:22 ` Eduard Zingerman @ 2023-04-27 15:33 ` Alexei Starovoitov 1 sibling, 0 replies; 9+ messages in thread From: Alexei Starovoitov @ 2023-04-27 15:33 UTC (permalink / raw) To: Jose E. Marchesi, Daniel Borkmann, Martin KaFai Lau Cc: Eddy Z, Yonghong Song, bpf, James Hilliard, gmartinezq07 On Thu, Apr 27, 2023 at 3:14 AM Jose E. Marchesi <jose.marchesi@oracle.com> wrote: > > > Odd. I replied to this yesterday, but somehow it wasn't sent. > > > On Wed, Apr 26, 2023 at 12:35 PM Jose E. Marchesi > > <jose.marchesi@oracle.com> wrote: > >> > >> > >> > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: > >> >> Just a heads up, we just committed support for the assembly syntax > >> >> used > >> >> by clang to the GNU assembler [1]. > >> > > >> > Thanks! Do you which gcc release is expected to contain these changes? > >> > >> This is the assembler, i.e. binutils. > >> We don't need to update the compiler. > >> > >> >> Salud! > >> >> [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html > > > > This is awesome! > > We recently converted tens of thousands of lines of bpf asm from macros > > to inline asm in C. > > See tools/testing/selftests/bpf/progs/verifier_*.c > > I wonder how gas-bpf can deal with that. > > Inline assembly shall work. > > > We had to fix several inline asm issues in clang to get to this point > > and probably more to come. > > We will give these tests a try and fix problems as we find them :) > > We actually came with some ambiguities, undefined stuff, and other > issues with the syntax while doing the implementation. We hope to > discuss some of that during the LSF/MM/BPF next week, so we can > consolidate the language in both toolchains. > > Speaking of which, we are preparing the material for the "compiled BPF" > activity during LSF/MM/BPF. I think the BPF track hasn't been scheduled > yet, but how much time will we have to discuss about the topic? Awesome. I'd love to participate. Martin, Daniel, What is the schedule for bpf track ? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Support for the pseudo-C BPF assembler syntax in GAS 2023-04-26 19:26 ` Jose E. Marchesi 2023-04-26 20:05 ` Alexei Starovoitov @ 2023-04-28 8:52 ` Jose E. Marchesi 1 sibling, 0 replies; 9+ messages in thread From: Jose E. Marchesi @ 2023-04-28 8:52 UTC (permalink / raw) To: Yonghong Song; +Cc: bpf, James Hilliard, gmartinezq07 >> On 4/26/23 10:37 AM, Jose E. Marchesi wrote: >>> Just a heads up, we just committed support for the assembly syntax >>> used >>> by clang to the GNU assembler [1]. >> >> Thanks! Do you which gcc release is expected to contain these changes? > > This is the assembler, i.e. binutils. > We don't need to update the compiler. Turns out we do indeed have to update GCC. Otherwise non-trivial inline asm ends in mixed syntaxes within an instruction (like r2 = %r3). We are looking into this. Oh well. > >>> Salud! >>> [1] https://sourceware.org/pipermail/binutils/2023-April/127222.html ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-04-28 8:53 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-04-26 17:37 Support for the pseudo-C BPF assembler syntax in GAS Jose E. Marchesi 2023-04-26 18:28 ` Yonghong Song 2023-04-26 19:26 ` Jose E. Marchesi 2023-04-26 20:05 ` Alexei Starovoitov 2023-04-27 10:14 ` Jose E. Marchesi 2023-04-27 15:22 ` Eduard Zingerman 2023-04-27 16:35 ` Jose E. Marchesi 2023-04-27 15:33 ` Alexei Starovoitov 2023-04-28 8:52 ` Jose E. Marchesi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox