Changing Paravirt Lock-ops for a Changing World
summary
Kernel can switch between native and paravirt spinlock ops at runtime by patching call sites with a single-byte breakpoint-based 0xCC patching that funnels execution into a handler that emulates old or new ops. v1 uses a stop-the-world approach that disables interrupts and stalls vCPUs (risking NMI deadlocks). v2 introduces site-local barriers and a global barrier counting slow-path lock ops (via breakpoint/NMI handler) so transition waits until no active queued slow-path locks before flipping to new ops.
AI-written summary · about
chapters (13)
- 0:00Introducción
- 0:52Guests should be more dynamic
- 2:37pv_lock_ops state-machine Queued spinlocks are based on MCS locks
- 4:34Why don't we just use paravirt locks all the time
- 7:56What does switching pv_lock_ops involve? cont
- 8:26Active users while we are patching
- 10:32Mechanism: INT3
- 12:41V1: approach
- 14:59V1: state-machine
- 19:16V2 design: global barrier
- 23:04V2 design: more on counting
- 25:24Show me the code
- 25:41Questions?
related talks
59mMultithreading 101: Concurrency Primitives From Scratch
27mTuning in-kernel routines on RISC-V
01h 06mTrue parallelism, with no concept of threads
39mSecure Path Operations and Libpathrs
22mHypervisor-less Virtio for Real-time and Safety
30mFearless concurrency in your microcontroller
45mSecuring Confidential VMs with COCONUT-SVSM
59mThreads and Locks must Go
