Revert^2: Improve spinlock implementation for ARMv8.0

Current implementation of spinlocks using C11 atomics compiles into an
LDAXR/STXR pair which we observe does not always make forward progress
on Cortex A72 (concurrent_save_restore test livelocks).

This patch inserts a WFE instruction when the LDAXR returns that the
lock is currently taken, pausing the thread until an event is
triggered and easing off the contention. This is observed to help
forward progress on A72 and should also improve power consumption
of our spinlocks.

Note that there is still no guarantee of forward progress and threads
can be shown to livelock on the A72 if the loops are extremely tight.
This should be revisited in the future, possibly by leveraging ARMv8.1
LSE atomics.

This reverts commit c4dfdb789421c7658ce59e24eb60cda38335c2f2.

Test: vcpu_state.concurrent_save_restore
Bug: 141087046
Change-Id: I0435632e4994e74457102ae7133bf77b47c0283f
4 files changed
tree: 500123257432cbdad469d6796a4e9e65b554b021
  1. .vscode/
  2. build/
  3. docs/
  4. driver/
  5. inc/
  6. kokoro/
  7. project/
  8. src/
  9. test/
  10. third_party/
  11. .clang-format
  12. .clang-tidy
  13. .gitignore
  14. .gitmodules
  15. .gn
  16. AUTHORS
  17. BUILD.gn
  18. CONTRIBUTING.md
  19. LICENSE
  20. Makefile
  21. README.md
README.md

Hafnium

Hafnium is a hypervisor, initially supporting aarch64 (64-bit ARMv8 CPUs).

Get in touch and keep up-to-date at hafnium-discuss@googlegroups.com.

Getting started

To jump in and build Hafnium, follow the getting started instructions.

If you want to contribute to the project, see details of how we accept contributions.

Documentation

More documentation is available on: