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:	Tue, 25 Nov 2008 10:25:14 +0000
From:	"Metzger, Markus T" <markus.t.metzger@...el.com>
To:	Andi Kleen <andi@...stfloor.org>
CC:	"hpa@...or.com" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"markus.t.metzger@...il.com" <markus.t.metzger@...il.com>,
	"roland@...hat.com" <roland@...hat.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"mtk.manpages@...il.com" <mtk.manpages@...il.com>,
	"eranian@...glemail.com" <eranian@...glemail.com>,
	"Villacis, Juan" <juan.villacis@...el.com>
Subject: RE: [patch 9/9] x86, bts, ftrace: a BTS ftrace plug-in prototype

>-----Original Message-----
>From: Andi Kleen [mailto:andi@...stfloor.org] 
>Sent: Dienstag, 25. November 2008 11:13
>To: Metzger, Markus T

>Markus Metzger <markus.t.metzger@...el.com> writes:
>
>Basic idea looks very useful. Thanks.
>
>> +static void bts_trace_cpuinit(struct cpuinfo_x86 *c)
>
>That should be somewhere generic I think. Doesn't ptrace have it too?

It does. All the BTS bits currently live in ptrace.c - that had been the only user, so far. I will move them into ds.c, but this will take a few patches.

Ingo said its important to have an early prototype. So I did the first version with very restricted functionality and some duplicate code.


regards,
markus.

>
>-Andi
>
>
>> +{
>> +	switch (c->x86) {
>> +	case 0x6:
>> +		switch (c->x86_model) {
>> +		case 0x0 ... 0xC:
>> +			break;
>> +		case 0xD:
>> +		case 0xE: /* Pentium M */
>> +			sizeof_field = sizeof(long);
>> +			debugctl_mask = (1<<6)|(1<<7);
>> +			break;
>> +		default:
>> +			sizeof_field = 8;
>> +			debugctl_mask = (1<<6)|(1<<7);
>> +			break;
>> +		}
>> +		break;
>> +	case 0xF:
>> +		switch (c->x86_model) {
>> +		case 0x0:
>> +		case 0x1:
>> +		case 0x2: /* Netburst */
>> +			sizeof_field = sizeof(long);
>> +			debugctl_mask = (1<<2)|(1<<3);
>> +			break;
>> +		default:
>> +			/* sorry, don't know about them */
>> +			break;
>> +		}
>> +		break;
>> +	default:
>> +		/* sorry, don't know about them */
>> +		break;
>> +	}
>> +}
>> +
>> +static inline void bts_enable(void)
>> +{
>> +	unsigned long debugctl;
>> +
>> +	rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl);
>> +	wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | debugctl_mask);
>> +}
>> +
>> +static inline void bts_disable(void)
>> +{
>> +	unsigned long debugctl;
>> +
>> +	rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl);
>> +	wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl & ~debugctl_mask);
>> +}
>> +
>> +static void bts_trace_reset(struct trace_array *tr)
>> +{
>> +	int cpu;
>> +
>> +	tr->time_start = ftrace_now(tr->cpu);
>> +
>
>-- 
>ak@...ux.intel.com
>
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists