Topics

BPF Virtual Machine Runtime

Brendan Gregg
 

Following on from the call... Does this sound even better? (mapping
from the JVM for comparison):

The JVM is a specification of a virtual machine that runs Java
bytecode. It is implemented by a Java Runtime Environment, such as
OpenJDK, which includes an interpreter and a JIT compiler.

The BPF VM (BVM?) is a specification of a virtual machine that runs
BPF instructions (defined in filter.h, etc). It is implemented by the
Linux kernel BPF runtime, which includes an interpreter and a JIT
compiler. Most of the work for the past 5 years has been developing
the BPF runtime.

Brendan

Daniel Borkmann
 

On 06/12/2019 09:52 PM, Brendan Gregg wrote:
Following on from the call... Does this sound even better? (mapping
from the JVM for comparison):

The JVM is a specification of a virtual machine that runs Java
bytecode. It is implemented by a Java Runtime Environment, such as
OpenJDK, which includes an interpreter and a JIT compiler.

The BPF VM (BVM?) is a specification of a virtual machine that runs
BPF instructions (defined in filter.h, etc). It is implemented by the
Linux kernel BPF runtime, which includes an interpreter and a JIT
compiler. Most of the work for the past 5 years has been developing
the BPF runtime.
I'd probably drop the '(defined in filter.h, etc)' part, but otherwise
I think it's fine.

Thanks,
Daniel

Fulvio Risso
 

Just a personal comment.

Talking about "BPF VM" to students raises a lot of confusion, as they expect a full fledged VM and do not undestand what "VM" means in this case. Comparing to Java does not help, as most people think about Java as a language, not as a VM.

So, in my classes I started to present BPF it as a virtual CPU, which is not that far from the reality; this improves the way people quicly understand the concept.

Cheers,

fulvio

On 12/06/2019 23:36, Daniel Borkmann wrote:
On 06/12/2019 09:52 PM, Brendan Gregg wrote:
Following on from the call... Does this sound even better? (mapping
from the JVM for comparison):

The JVM is a specification of a virtual machine that runs Java
bytecode. It is implemented by a Java Runtime Environment, such as
OpenJDK, which includes an interpreter and a JIT compiler.

The BPF VM (BVM?) is a specification of a virtual machine that runs
BPF instructions (defined in filter.h, etc). It is implemented by the
Linux kernel BPF runtime, which includes an interpreter and a JIT
compiler. Most of the work for the past 5 years has been developing
the BPF runtime.
I'd probably drop the '(defined in filter.h, etc)' part, but otherwise
I think it's fine.
Thanks,
Daniel

Panagiotis Moustafellos
 



On Thu, Jun 13, 2019 at 10:37 AM Fulvio Risso <fulvio.risso@...> wrote:
Just a personal comment.

Talking about "BPF VM" to students raises a lot of confusion, as they
expect a full fledged VM and do not undestand what "VM" means in this
case. Comparing to Java does not help, as most people think about Java
as a language, not as a VM.

FWIW - I don't share the same consideration, and I'd be inclined to say that clear documentation helps educate folks, whereas inventing new terminology just because there's a wall of confusion, would only lead to a greater wall longterm.

That said we can be a bit more explicit. Would framing it as "the BPF VM is a specification of an in-kernel virtual machine that runs BPF instructions" help here? The extra "in-kernel" prefix would make people understand there's a some distinction here, while still being very true to reality.


So, in my classes I started to present BPF it as a virtual CPU, which is
not that far from the reality; this improves the way people quicly
understand the concept.

Cheers,

        fulvio


On 12/06/2019 23:36, Daniel Borkmann wrote:
> On 06/12/2019 09:52 PM, Brendan Gregg wrote:
>> Following on from the call... Does this sound even better? (mapping
>> from the JVM for comparison):
>>
>> The JVM is a specification of a virtual machine that runs Java
>> bytecode. It is implemented by a Java Runtime Environment, such as
>> OpenJDK, which includes an interpreter and a JIT compiler.
>>
>> The BPF VM (BVM?) is a specification of a virtual machine that runs
>> BPF instructions (defined in filter.h, etc). It is implemented by the
>> Linux kernel BPF runtime, which includes an interpreter and a JIT
>> compiler. Most of the work for the past 5 years has been developing
>> the BPF runtime.
>
> I'd probably drop the '(defined in filter.h, etc)' part, but otherwise
> I think it's fine.
>
> Thanks,
> Daniel
>
>
>





--
Panagiotis Moustafellos
SRE Tech Lead @ Elastic