The Linux Kernel
5.14.0-503.22.1.el9_5.x86_64
  • The Linux kernel user’s and administrator’s guide
  • Kernel Build System
  • The Linux kernel firmware guide
  • Open Firmware and Devicetree
  • The Linux kernel user-space API guide
  • Working with the kernel development community
  • Development tools for the kernel
  • How to write kernel documentation
  • Kernel Hacking Guides
  • Linux Tracing Technologies
  • Kernel Maintainer Handbook
  • fault-injection
  • Kernel Livepatching
  • Rust
  • The Linux driver implementer’s API guide
  • Core API Documentation
  • locking
  • Accounting
  • Block
  • cdrom
  • Linux CPUFreq - CPU frequency and voltage scaling code in the Linux(TM) kernel
  • Integrated Drive Electronics (IDE)
  • Frame Buffer
  • fpga
  • Human Interface Devices (HID)
  • I2C/SMBus Subsystem
  • Industrial I/O
  • ISDN
  • InfiniBand
  • LEDs
  • NetLabel
  • Linux Networking Documentation
  • pcmcia
  • Power Management
  • TCM Virtual Device
  • timers
  • Serial Peripheral Interface (SPI)
  • 1-Wire Subsystem
  • Linux Watchdog Support
  • Linux Virtualization Support
  • The Linux Input Documentation
  • Linux Hardware Monitoring
  • Linux GPU Driver Developer’s Guide
  • Security Documentation
  • Sound Subsystem Documentation
  • Linux Kernel Crypto API
  • Filesystems in the Linux kernel
  • Linux Memory Management Documentation
  • BPF Documentation
    • eBPF verifier
    • libbpf
    • BPF Standardization
      • 1 BPF Instruction Set Specification, v1.0
      • 1 BPF ABI Recommended Conventions and Guidelines v1.0
        • 1.1 Registers and calling convention
    • BPF Type Format (BTF)
    • Frequently asked questions (FAQ)
    • Syscall API
    • Helper functions
    • BPF Kernel Functions (kfuncs)
    • BPF cpumask kfuncs
    • Program Types
    • BPF maps
    • Running BPF programs from userspace
    • Classic BPF vs eBPF
    • BPF Iterators
    • BPF licensing
    • Testing and debugging BPF
    • 1 Clang implementation notes
    • 1 Linux implementation notes
    • Other
    • Redirect
  • USB support
  • Linux PCI Bus Subsystem
  • Linux SCSI Subsystem
  • Assorted Miscellaneous Devices Documentation
  • Linux Scheduler
  • MHI
  • TTY
  • Assembler Annotations
  • CPU Architectures
  • Kernel tools
  • Unsorted Documentation
  • Atomic Types
  • Atomic bitops
  • Memory Barriers
  • General notification mechanism
  • Translations
The Linux Kernel
  • »
  • BPF Documentation »
  • BPF Standardization »
  • 1 BPF ABI Recommended Conventions and Guidelines v1.0
  • View page source

Contents

  • 1 BPF ABI Recommended Conventions and Guidelines v1.0

    • 1.1 Registers and calling convention

1 BPF ABI Recommended Conventions and Guidelines v1.0¶

This is version 1.0 of an informational document containing recommended conventions and guidelines for producing portable BPF program binaries.

1.1 Registers and calling convention¶

BPF has 10 general purpose registers and a read-only frame pointer register, all of which are 64-bits wide.

The BPF calling convention is defined as:

  • R0: return value from function calls, and exit value for BPF programs

  • R1 - R5: arguments for function calls

  • R6 - R9: callee saved registers that function calls will preserve

  • R10: read-only frame pointer to access stack

R0 - R5 are scratch registers and BPF programs needs to spill/fill them if necessary across calls.

Next Previous

© Copyright The kernel development community.

Built with Sphinx using a theme provided by Read the Docs.