Is it possible to set a hardware breakpoint on a memory write in Linux on the i.MX6ULL?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Is it possible to set a hardware breakpoint on a memory write in Linux on the i.MX6ULL?

756件の閲覧回数
JohnKlug
Senior Contributor I
		attr.bp_addr = (unsigned long)&mydata;
		attr.bp_len = HW_BREAKPOINT_LEN_4;
		attr.bp_type = HW_BREAKPOINT_W;
		bps = register_wide_hw_breakpoint(&attr, gpio_dump_stack, NULL);
		if(IS_ERR(bps)) {
		    pr_err("Failed to register hardware breakpoint: %ld\n",PTR_ERR(bps));
		    bps = NULL;
NULL);
		}

This prints:
Failed to register hardware breakpoint: -19

 

-19 is ENODEV.


I have the following flags added to the kernel:
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_KPROBES=y


I am using kernel:
https://github.com/nxp-imx/linux-imx.git

With branch lf-5.15.y

0 件の賞賛
返信
4 返答(返信)

728件の閲覧回数
JohnKlug
Senior Contributor I

Unfortunately the sample fails in symbol_get:



bash# modprobe databrkpt
[ 3868.245139] failing symbol_get of non-GPLONLY symbol jiffies.
modprobe: ERROR: could not insert 'databrkpt': No such device or address

I shortened the driver name to databrkpt.


This error is found in the code here:

Symbol not found error 

 

0 件の賞賛
返信

720件の閲覧回数
JohnKlug
Senior Contributor I
Maybe this code is obsolete that you sent?

jiffies probably is no longer a symbol.

Here is a symbol:

bash# modprobe databrkpt ksym=pm_power_off_prepare
[ 1405.440261] Failed to register hardware breakpoint: -19
[ 1405.445552] Breakpoint registration failed
modprobe: ERROR: could not insert 'databrkpt': No such device


pm_poweroff_prepare is found here:


kernel/reboot.c:EXPORT_SYMBOL_GPL(pm_power_off_prepare);

So the question remains, how does one set a hardware breakpoint? Are there kernel configuration parameters that I have not set?
0 件の賞賛
返信

750件の閲覧回数
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

You can base the usage of HW BP in the next sample.

It should support any transaction of SDMA memory bus and the core.

Regards

0 件の賞賛
返信

607件の閲覧回数
JohnKlug
Senior Contributor I
We happen to have the Technexion PICO-PI-IMX8M with four cores. The driver you suggests works fine on the i.MX8 CPU on this board. So I will have to move my driver to this platform to debug it.
0 件の賞賛
返信