You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think your code can refer to the surrounding kernel code however: the only visible thing is the value of the registers.
4479
4477
4480
4478
You can then hack it up to read the stack and read argument values, but do you really want to?
4481
4479
4482
4480
There is also a kprobes + ftrace based mechanism with `CONFIG_KPROBE_EVENTS=y` which does read the memory for us based on format strings that indicate type... https://github.com/torvalds/linux/blob/v4.16/Documentation/trace/kprobetrace.txt Horrendous. Used by: https://github.com/brendangregg/perf-tools/blob/98d42a2a1493d2d1c651a5c396e015d4f082eb20/execsnoop
You may not get this error because this depends on `strlen` overflowing at least until the next page: if a random `\0` appears soon enough, it won't blow up as desired.
4625
+
4626
+
I did observe this at link:http://github.com/cirosantilli/linux-kernel-module-cheat/commit/1b451a70d46a5c4619992ad4dd2e4b8f5a84c252[1b451a70d46a5c4619992ad4dd2e4b8f5a84c252] but not at link:http://github.com/cirosantilli/linux-kernel-module-cheat/commit/9b4c1984fc2cb04de0b4d62749cc1f8eabf26c6f[9b4c1984fc2cb04de0b4d62749cc1f8eabf26c6f] TODO: find a more reproducible failure.
I once got link:https://en.wikipedia.org/wiki/User-mode_Linux[UML] running on a minimal Buildroot setup at: https://unix.stackexchange.com/questions/73203/how-to-create-rootfs-for-user-mode-linux-on-fedora-18/372207#372207
@@ -5337,7 +5371,7 @@ This section documents:
5337
5371
For the more complex interfaces, we focus on simplified educational devices, either:
5338
5372
5339
5373
* present in the QEMU upstream:
5340
-
** <<edu>>
5374
+
** <<qemu-edu>>
5341
5375
* added in link:https://github.com/cirosantilli/qemu[our fork of QEMU]:
5342
5376
** <<pci_min>>
5343
5377
** <<platform_device>>
@@ -5386,22 +5420,22 @@ Works because we add to our default QEMU CLI:
5386
5420
5387
5421
Probe already does a MMIO write, which generates an IRQ and tests everything.
5388
5422
5389
-
[[edu]]
5423
+
[[qemu-edu]]
5390
5424
===== QEMU edu PCI device
5391
5425
5392
5426
Small upstream educational PCI device:
5393
5427
5394
5428
....
5395
-
/pci.sh
5429
+
/qemu_edu.sh
5396
5430
....
5397
5431
5398
5432
This tests a lot of features of the edu device, to understand the results, compare the inputs with the documentation of the hardware: https://github.com/qemu/qemu/blob/v2.12.0/docs/specs/edu.txt
When in <<graphic-mode,non graphic mode>>, using `-D` makes Ctrl-C not get passed to the QEMU guest anymore: it is instead captured by GDB itself, so allow breaking. So e.g. you won't be able to easily quit from a guest progra like:
@@ -7440,6 +7474,8 @@ Lets try to understand some stats better.
7440
7474
7441
7475
==== rdtsc
7442
7476
7477
+
link:https://en.wikipedia.org/wiki/Time_Stamp_Counter[x86 instruction] that returns the cycle count since reset:
7478
+
7443
7479
....
7444
7480
./build -kg && ./run -E '/rdtsc.out;m5 exit;' -g
7445
7481
./gem5-stat
@@ -7463,7 +7499,7 @@ See also:
7463
7499
7464
7500
===== pmccntr
7465
7501
7466
-
Unfortunately-we didn't manage to find an ARM analogue: link:kernel_module/pmccntr.c[] is oopsing, and even it if weren't, it likely won't give the cycle count since boot since it needs to be activate before it starts counting anything:
7502
+
TODO We didn't manage to find a working ARM analogue to <<rdtsc>>: link:kernel_module/pmccntr.c[] is oopsing, and even it if weren't, it likely won't give the cycle count since boot since it needs to be activate before it starts counting anything:
0 commit comments