Skip to content

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented Oct 29, 2025

kvm: RSEQ: Add RSEQ support

This change adds RSEQ support for platform/kvm.

To support this, the KVM platform must provide two key capabilities:
(1) A stable, unique CPU ID.
(2) A way to detect when a thread as been preempted.

This implementation provides the necessary support as follows:
CPU ID:

  • platform/kvm now advertises the KVM vCPU ID as the cpu_id

Preemption Detection:

  • Compares the last context the CPU ran against the current context being
    scheduled.
  • Compares the context's rseqCPU and CPU ID retrieved by the platform

To facilitate this, several new methods are introduced to the platform
interface and implemented by platform/kvm:

  • HasCpuNumbers()
  • NumCPUs()
  • DetectsCPUPreemption()
  • PreemptCpu()
  • PreemptAllCpus()

@copybara-service copybara-service bot added the exported Issue was exported automatically label Oct 29, 2025
@copybara-service copybara-service bot force-pushed the test/cl823228013 branch 6 times, most recently from b5bfb42 to d9ddb14 Compare November 3, 2025 19:28
This change adds RSEQ support for platform/kvm.

To support this, the KVM platform must provide two key capabilities:
 (1) A stable, unique CPU ID.
 (2) A way to detect when a thread as been preempted.

This implementation provides the necessary support as follows:
CPU ID:
  - platform/kvm now advertises the KVM vCPU ID as the cpu_id

Preemption Detection:
  - Compares the last context the CPU ran against the current context being
 scheduled.
  - Compares the context's rseqCPU and CPU ID retrieved by the platform

To facilitate this, several new methods are introduced to the platform
interface and implemented by platform/kvm:
 - HasCpuNumbers()
 - NumCPUs()
 - DetectsCPUPreemption()
 - PreemptCpu()
 - PreemptAllCpus()

PiperOrigin-RevId: 823228013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants