From 401c747eeed513b1a61604e4c3bcf79fe6a48974 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Thu, 28 Sep 2017 10:48:30 +0100 Subject: [PATCH] Count instructions --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ qemu | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b09834..838e1a8 100644 --- a/README.md +++ b/README.md @@ -562,6 +562,45 @@ says: (EE) Failed to load module "modesetting" (module does not exist, 0) +## Count instructions + +- +- +- + +Naive attempt: add to `S99`: + + poweroff + +Then run as: + + time ./runqemu -n -- -trace exec_tb,file=trace + wc -l trace + +This requires the simple QEMU patch mentioned at: + +Possible improvements: + +- replace init with our own C program that immediately does a `shutdown` system call + +- disable networking. Is replacing `init` enough? + +- logging greatly slows down the CPU, and leads to this: + + All QSes seen, last rcu_sched kthread activity 5252 (4294901421-4294896169), jiffies_till_next_fqs=1, root ->qsmask 0x0 + swapper/0 R running task 0 1 0 0x00000008 + ffff880007c03ef8 ffffffff8107aa5d ffff880007c16b40 ffffffff81a3b100 + ffff880007c03f60 ffffffff810a41d1 0000000000000000 0000000007c03f20 + fffffffffffffedc 0000000000000004 fffffffffffffedc ffffffff00000000 + Call Trace: + [] sched_show_task+0xcd/0x130 + [] rcu_check_callbacks+0x871/0x880 + [] update_process_times+0x2f/0x60 + + Is it harmless, or does it change timings considerably. + +- Confirm that the kernel enters at `0x1000000`. + ## Table of contents 1. [Introduction](introduction.md) diff --git a/qemu b/qemu index 019bbe5..93203c1 160000 --- a/qemu +++ b/qemu @@ -1 +1 @@ -Subproject commit 019bbe59d603cb3470f65d4a4a5e3a72a41d823b +Subproject commit 93203c1d8b7bd5c12896157802c89447d7d6a499