lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d5da733d-f45a-702d-a8eb-57dd0c596659@linux.intel.com>
Date:   Fri, 15 Nov 2019 13:42:41 -0500
From:   "Liang, Kan" <kan.liang@...ux.intel.com>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     Peter Zijlstra <peterz@...radead.org>, acme@...hat.com,
        mingo@...nel.org, linux-kernel@...r.kernel.org, eranian@...gle.com
Subject: Re: [PATCH] perf/x86/intel: Avoid PEBS_ENABLE MSR access in PMI



On 11/15/2019 1:33 PM, Andi Kleen wrote:
>> @@ -2620,6 +2624,15 @@ static int handle_pmi_common(struct pt_regs *regs,
>> u64 status)
>>                  handled++;
>>                  x86_pmu.drain_pebs(regs);
>>                  status &= x86_pmu.intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI;
>> +
>> +               /*
>> +                * PMI may land after cpuc->enabled=0 in x86_pmu_disable()
>> and
>> +                * PMI throttle may be triggered for the PMI.
>> +                * For this rare case, intel_pmu_pebs_disable() will not
>> touch
>> +                * MSR_IA32_PEBS_ENABLE. Explicitly disable the PEBS here.
>> +                */
>> +               if (unlikely(!cpuc->enabled && !cpuc->pebs_enabled))
>> +                       wrmsrl(MSR_IA32_PEBS_ENABLE, 0);
> 
> How does the enable_all() code know to reenable it in this case?

For this case, we know that perf is disabling the PMU. The PMI handler 
will not restore PMU state when it's inactive. The enable_all() will not 
be called.

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ