Re: [PATCH v5 09/44] perf/x86: Switch LVTPC to/from mediated PMI vector on guest load/put context

Peter Zijlstra
2025-08-15T13:04:47Z

On Wed, Aug 06, 2025 at 12:56:31PM -0700, Sean Christopherson wrote:

> @@ -2727,6 +2739,21 @@ static struct pmu pmu = {
> .filter = x86_pmu_filter,
> };
>
> +void arch_perf_load_guest_context(unsigned long data)
> +{
> + u32 masked = data & APIC_LVT_MASKED;
> +
> + apic_write(APIC_LVTPC,
> + APIC_DM_FIXED | PERF_GUEST_MEDIATED_PMI_VECTOR | masked);
> + this_cpu_write(x86_guest_ctx_loaded, true);
> +}

I'm further confused, why would this ever be masked?