---
title: "Inside the eBPF machine"
---

> Documentation Index
> Fetch the complete documentation index at: https://example.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inside the eBPF machine

The eBPF [virtual machine](https://example.com/ebpf-field-guide/glossary/#virtual-machine) defines eleven 64-bit registers (`R0`–`R10`), a 32-bit sub-register mode, and a strict 512-byte stack. `R1` receives the hook context pointer; `R0` holds the return code.

Programs cannot call arbitrary kernel functions. They invoke stable [BPF helpers](https://example.com/ebpf-field-guide/glossary/#bpf-helpers) (like `bpf_ktime_get_ns` or `bpf_map_lookup_elem`) and modern typed [kfuncs](https://example.com/ebpf-field-guide/glossary/#kfuncs) exposed by kernel subsystems.

## Register calling convention

| Register | Role in eBPF VM |
| --- | --- |
| R0 | Return value from helpers & program exit |
| R1 – R5 | Hook context (R1) & helper arguments |
| R6 – R9 | Callee-saved scratch registers |
| R10 | Read-only frame pointer (512B stack) |

Source: https://example.com/ebpf-field-guide/core-architecture/kernel-and-vm/the-vm/index.mdx
