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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Nov 2016 09:41:40 +0200
From:   Alexander Shishkin <alexander.shishkin@...el.com>
To:     Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org
Cc:     Andi Kleen <ak@...ux.intel.com>, tom.zanussi@...ux.intel.com,
        rostedt@...dmis.org, peterz@...radead.org,
        alexander.shishkin@...ux.intel.com
Subject: Re: [PATCH] Add support for disabling Intel PT trace in ftrace

Andi Kleen <andi@...stfloor.org> writes:

> +/*
> + * Disable the PT trace for debugging purposes.
> + */
> +void pt_disable(void)
> +{
> +	u64 val;
> +
> +	if (!boot_cpu_has(X86_FEATURE_INTEL_PT))
> +		return;
> +
> +	rdmsrl_safe(MSR_IA32_RTIT_CTL, &val);
> +	val &= ~RTIT_CTL_TRACEEN;
> +	wrmsrl_safe(MSR_IA32_RTIT_CTL, val);
> +}
> +EXPORT_SYMBOL(pt_disable);

This will create unexplainable gaps in the trace, at least we should
output RECORD_AUX when this happens, maybe add a flag for "had to stop
the trace for reasons external to perf".

Also, I can't tell if this is called from an atomic context.

But I'd suggest something more generic like perf_pmu_off($pmu):
 - we already have the code to stop the output;
 - this won't be a driver-specific api then;
 - this will be reflected in the event hw state;
 - it will also go through the driver's callbacks, so its internal
 states will actually match the reality;
 - will work equally well for intel_bts or the ARM/Coresight tracers.

Regards,
--
Alex

Powered by blists - more mailing lists