[PATCH RFC v3 1/3] cpuidle: export cpuidle_devices for KVM C-state policy enforcement

From: Anthony Harivel

Date: Mon Sep 14 2026 - 10:52:11 EST


Export the per-CPU cpuidle_devices symbol so that KVM can access
cpuidle device and driver state to temporarily constrain idle state
selection when enforcing per-VM C-state policies.

This is needed by the upcoming KVM_CAP_CSTATE_POLICY capability,
which disables deep C-states on the current pCPU before a vCPU
blocks in kvm_vcpu_block().

Signed-off-by: Anthony Harivel <aharivel@xxxxxxxxxx>
---
drivers/cpuidle/cpuidle.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 2d2f40a2cb81..13f8acde31a4 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -31,6 +31,7 @@
#include "cpuidle.h"

DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
+EXPORT_PER_CPU_SYMBOL_GPL(cpuidle_devices);
DEFINE_PER_CPU(struct cpuidle_device, cpuidle_dev);

DEFINE_MUTEX(cpuidle_lock);
--
2.55.0