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]
Message-Id: <1234498509.26036.35.camel@pasglop>
Date:	Fri, 13 Feb 2009 15:15:09 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	linuxppc-dev@...abs.org, Paul Mackerras <paulus@...ba.org>,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer
 with dynamic tracing


> @@ -55,8 +56,9 @@ static unsigned char *ftrace_call_replace(unsigned
> long ip, unsigned long addr)
>  	 */
>  	addr = GET_ADDR(addr);
>  
> -	/* Set to "bl addr" */
> -	op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> +	/* if (link) set op to 'bl' else 'b' */
> +	op = 0x48000000 | (link ? 1 : 0);
> +	op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);

Any reason why you aren't using the code in
arch/powerpc/lib/code-patching.c here ?

> 	new = ftrace_call_replace(ip, stub, 0);
> +	memcpy(old, new, MCOUNT_INSN_SIZE);
> +	new = ftrace_call_replace(ip, addr, 0);
> +
> +	return ftrace_modify_code(ip, old, new);
> +}

Heh, memcpy of 4 bytes :-) I hope gcc is smart enough to turn that into
a simple load/store ..

Cheers,
Ben.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ