IBS MSRs are classified as Swap Type C, which requires the hypervisor to save and restore its own IBS state before VMENTRY and after VMEXIT. To support this, set the ibs_op and ibs_fetch PMUs with the PERF_PMU_CAP_MEDIATED_VPMU capability. This ensures that these PMUs are exclusively owned by the guest while it is running, allowing the hypervisor to manage IBS state transitions correctly. Signed-off-by: Manali Shukla --- arch/x86/events/amd/ibs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 67ed9673f1ac..6dc2d1cb8b09 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -793,6 +793,7 @@ static struct perf_ibs perf_ibs_fetch = { .stop = perf_ibs_stop, .read = perf_ibs_read, .check_period = perf_ibs_check_period, + .capabilities = PERF_PMU_CAP_MEDIATED_VPMU, }, .msr = MSR_AMD64_IBSFETCHCTL, .config_mask = IBS_FETCH_MAX_CNT | IBS_FETCH_RAND_EN, @@ -818,6 +819,7 @@ static struct perf_ibs perf_ibs_op = { .stop = perf_ibs_stop, .read = perf_ibs_read, .check_period = perf_ibs_check_period, + .capabilities = PERF_PMU_CAP_MEDIATED_VPMU, }, .msr = MSR_AMD64_IBSOPCTL, .config_mask = IBS_OP_MAX_CNT, -- 2.43.0