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: <5F5B4CCA07D939BE+1a8b7985-b0c6-4b03-8c31-d1281f7b56e4@shingroup.cn>
Date: Wed, 3 Jul 2024 15:39:09 +0800
From: Yang Jialong 杨佳龙 <jialong.yang@...ngroup.cn>
To: rostedt@...dmis.org, mhiramat@...nel.org,
 Karol Herbst <karolherbst@...il.com>, Pekka Paalanen <ppaalanen@...il.com>,
 mathieu.desnoyers@...icios.com
Cc: Michael Ellerman <mpe@...erman.id.au>, linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH v1 1/2] powerpc/mmiotrace: Add MMIO Tracing tool for
 PowerPC

Hello, mmiotrace maintainers.

Here is a first version patch used to support mmiotrace function on 
powerpc platform. When I copy mmiotrace to powerpc archtecture, we found 
that there are many code are general, such as code in kmmio.c and 
mmio-mod.c in arch/x86/mm/.  But we have file trace_mmiotrace.c as a low 
layer to finish the function. Whether we can abstract out one layer 
again or not?






-------- 转发的消息 --------
主题: 	Re: [PATCH v1 1/2] powerpc/mmiotrace: Add MMIO Tracing tool for 
PowerPC
日期: 	Fri, 28 Jun 2024 16:21:34 +0800
From: 	Yang Jialong 杨佳龙 <jialong.yang@...ngroup.cn>
收件人: 	Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin 
<npiggin@...il.com>, Christophe Leroy <christophe.leroy@...roup.eu>, 
Naveen N. Rao <naveen.n.rao@...ux.ibm.com>
抄送: 	luming.yu@...ngroup.cn, shenghui.qu@...ngroup.cn, 
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org, Steven 
Rostedt <rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>, 
Karol Herbst <karolherbst@...il.com>, Pekka Paalanen 
<ppaalanen@...il.com>, nouveau@...ts.freedesktop.org




在 2024/6/28 15:02, Michael Ellerman 写道:
> Jialong Yang <jialong.yang@...ngroup.cn> writes:
>> mmiotrace is a useful tool to trace MMIO accesses. Nowadays, it only
>> supported on x86 and x86_64 platforms.
> I've never used mmiotrace, and don't know it well.
>
> I'm not necessarily opposed to merging it, but AFAIK it was mostly used
> for reverse engineering proprietary drivers, where the driver itself
> couldn't be easily instrumented. Is that what you're using it for?

Yes. Just like you think. We have used it for network stack debug in 
ppc64le.


>
> For drivers where we have the source wouldn't it be easier to just use
> tracepoints in the MMIO accessors?


Tracepoints need pre-defined. And in some big driver, it's not easy to 
overwrite

all points where access registers in io area. And tracepoint is C 
function level filter.

mmiotrace is similar to set tracepoints in writel/readl... But it can do 
deeperly.

mmiotrace is a asm level filter tool. It doesn't care what have done in 
C level. It will

only find what have done by asm, such as stw(store word)/lw(load word),  
just like standing

in the view of device.


>
> Is it still in-use/maintained on the x86 side?


Here is some core file patches number in x86:

|      | mmio_mod.c | kmmio.c | pf_in.* | testmmiotrace.c |
|------+------------+---------+---------+-----------------|
| 2022 |               1 |            3 | |                  |
| 2021 |               2 |            1 |               | |
| 2020 |               4 |            4 | |               1 |
| 2019 |               2 |            1 |            1 |               4 |
| 2018 |                  |            2 |               |        |
| 2017 |               2 |            2 | |               1 |
| 2016 |               1 |            2 |            1 |        |
| 2014 |                  |            1 |               |        |
| 2013 |               1 |               |               |        |
| 2012 |               1 |               | |                  |
| 2011 |               3 |               |            1 | |
| 2010 |               1 |            3 |            2 |               1 |
| 2009 |               4 |          19 | |               3 |
| 2008 |             13 |            5 |            2 |               3 |

>
>> Here is a support for powerpc.
>> The manual is located at Documentation/trace/mmiotrace.rst which means
>> I have not changed user API. People will be easy to use it.
>> Almost all files are copied from x86/mm, there are only some
>> differences from hardware and architectures software.
>>
>> LINK: 
>> https://lore.kernel.org/lkml/20080127195536.50809974@daedalus.pq.iki.fi/
>>
>> Signed-off-by: Jialong Yang <jialong.yang@...ngroup.cn>
>> ---
>> arch/powerpc/Kconfig.debug | 3 +
>> arch/powerpc/mm/Makefile | 1 +
>> arch/powerpc/mm/kmmio.c | 649 +++++++++++++++++++++++++++++++
>> arch/powerpc/mm/mmio-mod.c | 414 ++++++++++++++++++++
>> arch/powerpc/mm/mmiotrace_arch.c | 149 +++++++
>> arch/powerpc/mm/mmiotrace_arch.h | 25 ++
>> arch/powerpc/mm/pf_in.c | 185 +++++++++
>> arch/powerpc/mm/pf_in.h | 33 ++
>> 8 files changed, 1459 insertions(+)
> At a glance most of that code could be shared between arches. I don't
> think I can merge that as-is, without some attempt to split the generic
> parts out.


Right.

I just copy them from arch/x86/mm. There are many code not arch specific.


> cheers
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ