← Lab /Security & privacy

Hardware performance counters enable control-flow attestation on commodity CPUs

HPCCFA can provide runtime control-flow attestation using hardware performance counters in TEEs

Security & privacy arXiv 31 Mar 2026 Method Prototype evidence

Published as “HPCCFA: Leveraging Hardware Performance Counters for Control Flow Attestation”

Why it matters

HPCCFA shows that on-device CFA using HPCs is feasible but only practical for workloads that can be split into many short measurement segments, otherwise the performance cost may be prohibitive.

Summary

HPCCFA can achieve near-perfect reliability for control-flow attestation when many measurement points (ecalls) or additional hardware performance counters are added, but the basic design only reliably detects attacks on short or simple programs and incurs high performance overhead (up to 14.44× slower). The evidence comes from experiments on two enclaves (hello-tracee and tweetnacl-tracee) showing low detection for long sequences and large slowdowns when many ecalls are inserted.

What they found 3

  1. Basic HPCCFA provides high detection for short programs but almost no protection for longer, complex workloads.

    “For the hello-tracee enclave most deviations from the control flow are detected, while the results for the tweetnacl-tracee enclave show that HPCCFA provides barely any protection.”

  2. Adding many hardware performance counters raises reliability for the simple enclave to near-100%.

    “With over 99% reliability for all deviations for the hello-tracee enclave this experiment shows that HPCCFA works.”

  3. Inserting additional ecalls (measurement points) yields perfect reliability for both enclaves.

    “Added ecalls tweetnacl-tracee 1.000, 1.000”

Caveats 6

  • HPCCFA provides barely any protection.
  • the execution time of the tracee increases by a factor of 14.44.
  • Our evaluation shows that the concept works effectively for shorter or less complex program sequences, although it also shows a low detection rate for long and complex program sequences.
  • The verification adds another significant amount of overhead that surpasses execution time of the enclave with measurements enabled.
  • Our proof-of-concept implementation is not optimized for performance, especially the communication between the tracer and tracee enclave introduces avoidable overhead.
  • The Visionfive 2 board only allows two configurable performance counters, limiting our approach to measure three counters in total.

What’s new here 4

  • Uses existing hardware performance counters to generate control-flow traces without any hardware modifications.
  • Separates the traced enclave from the attestation enclave, preventing a fully compromised enclave from tampering with its own trace.
  • Performs attestation on-device, avoiding network latency and enabling immediate detection of attacks.
  • Demonstrates that adding measurement points can dramatically improve reliability even for complex workloads.