the following patch was just integrated into master:
commit 90499e669fd3ee76514a81e0fdfeb7386c6b8848
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 19:34:01 2013 +0200
Update replayer for new output format
Output line format was changed. This brings replayer script
up-to-date with new output.
Change-Id: Icc65240e619ade9687253f87fd0c2168852ae018
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2512
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Feb 25 20:46:57 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Feb 25 21:23:56 2013, giving +2
See http://review.coreboot.org/2512 for details.
-gerrit
the following patch was just integrated into master:
commit fd9fe2426d71257f2e47c2642a038a668a4eacd4
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 19:33:44 2013 +0200
Unify output line format
Serialice log had obscure format with characters like "#!*" appearing
at different positions, this patch makes the output lines more readable.
First number pair is a running index that could be used to group and indent the lines
to improve readability. Doesn't work flawlessly yet.
Second string is combination of flags telling how action got processed:
I Info -- informational line only
R Raw -- raw IO/MEMORY/CPU operation
H Hardware -- action was sent to target
Q Qemu -- action was sent to qemu
U Undefined -- action hit the fallback filter
D Dropped -- filter prevented sending action to target or qemu
F Faked -- filter modified the action on-the-fly
Third field is the instruction pointer [CS:EIP]. At the moment EIP is not reported
accurately at all.
Remaining of the line describes the action.
A few examples:
Memory access, Raw + Qemu. Following is read of vector stored in the BIOS image file.
0000.0001 RQ.. [ffff000:fff0] MEM,ROM_HI: readb fffffff0 => ea
0000.0002 RQ.. [ffff000:fff0] MEM,ROM_HI: readw fffffff1 => e05b
0000.0003 RQ.. [ffff000:fff0] MEM,ROM_HI: readw fffffff3 => f000
PCI config read, Hardware. This is composed from either IO accesses to 0xcf8-0xcff or
memory access to a specific PCI-e MM config region. Thus it is not Raw but a composed
action.
0044.0046 .H.. [f000:f764] PCI: 0:1e.0 [004] => 00
CPUID, Raw + Hard + Faked. CPUID was executed on the target, but the returned
value was modified. In this case, it fakes CPU has a single core.
000d.000e RH.F [f000:e814] CPUID: eax: 00000001; ecx: 00000000 => 00000f4a.00010800.0000649d.bfebfbff
RDMSR Raw + Hard and WRMSR Raw + Dropped. In this case, requst to do microcode update
in target CPU is dropped as our serialice.rom image doesn't contain that binary.
0019.001a RH.. [f000:e869] CPU MSR: [00000017] => 00120000.00000000
001c.001d R..D [f000:e88e] CPU MSR: [00000079] <= 00000000.fffdfc10
Change-Id: I99308636c6a997ac82740c7d715617a1564aba81
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2511
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Feb 25 20:41:01 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Feb 25 21:23:47 2013, giving +2
See http://review.coreboot.org/2511 for details.
-gerrit
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2512
-gerrit
commit 2455451f840637eb14d5864752fa6e0d81620f91
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 19:34:01 2013 +0200
Update replayer for new output format
Output line format was changed. This brings replayer script
up-to-date with new output.
Change-Id: Icc65240e619ade9687253f87fd0c2168852ae018
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
SerialICE/simba/replay.lua | 88 ++++++++++++++++++++++++++-----------------
SerialICE/simba/serialice.lua | 2 +-
2 files changed, 54 insertions(+), 36 deletions(-)
diff --git a/SerialICE/simba/replay.lua b/SerialICE/simba/replay.lua
index ec98149..1f17f00 100644
--- a/SerialICE/simba/replay.lua
+++ b/SerialICE/simba/replay.lua
@@ -1,4 +1,5 @@
+local verbose_log = false
function SerialICE_register_physical()
end
@@ -9,7 +10,7 @@ end
SerialICE_mainboard = "undetected"
regs = { eax, ebc, ecx, edx, cs=0, eip=0, ds, es, ss, gs, fs, }
-ids = { parent, this, }
+ids = { parent, this, flags}
function pci_bdf_noext(bus, dev, func, reg)
return bus*65536 + dev*2048 + func*256 + reg
@@ -35,24 +36,11 @@ function replay_unknown(str)
local dummy = {}
pre_action(dummy, false, 0, 0, 0)
post_action(dummy, 0)
- print_address(ids.parent, ids.this, "...", regs.cs, regs.eip)
+ print_address(ids.parent, ids.this, ids.flags, regs.cs, regs.eip)
printf(str)
printf("\n")
end
-function parse_cpu(line)
- if string.find(line, "CPUID") then
- replay_unknown(line)
- return true
- end
- if string.find(line, "CPU MSR") then
- replay_unknown(line)
- return true
- end
- return false
-end
-
-
function parse_io(line)
local io_op = "IO[^:]*:?%s+%a+%s+(%x+)%s+(<?=>?)%s+(%x+)"
local found, addr, dir, data
@@ -125,10 +113,10 @@ function parse_headers()
found, _, board = string.find(line, "SerialICE: Mainboard...:%s+(.+)")
if found then
SerialICE_mainboard = board
+ io.write(line)
+ io.write("\n")
end
end
--- io.write(line)
--- io.write("\n")
if string.find(line, "LUA script initialized.") then
return
end
@@ -139,43 +127,73 @@ function parse_file()
while true do
local iplog = false
local found = false
- local line, str, cs, eip, a, b
+ local line, str, cs, eip, a, b, f
line = io.read("*line")
if not line then
return
end
- regs.cs = 0
- regs.eip = 0
- ids.parent = 0
- ids.this = 0
- iplog, _, cs, eip, a, b, str = string.find(line, "%[(%x+):(%x+)%]%s+(%x+)[%.:](%x+)...(.*)")
+ if not iplog then
+ iplog, _, a, b, f, cs, eip, str =
+ string.find(line, "(%x+)[%.:](%x+)%s+([^ ]*)%s+%[(%x+):(%x+)%]...(.*)")
+ if iplog and not f then
+ f = "R###"
+ end
+ end
+
+ -- Output format of 1st modular scripts
+ if not iplog then
+ iplog, _, cs, eip, a, b, str =
+ string.find(line, "%[(%x+):(%x+)%]%s+(%x+)[%.:](%x+)...(.*)")
+ if iplog and str then
+ if string.find(str,"IO[,:]") or string.find(str,"MEM[,:]") or string.find(str,"CPU") then
+ f = "R..."
+ else
+ f = "...."
+ end
+ end
+ end
+
+ -- Parse logfiles from before modular scripts
+ if not iplog then
+ regs.cs = 0
+ regs.eip = 0
+ ids.parent = 0
+ ids.this = 0
+ str = line
+ if string.find(str,"IO:") or string.find(str,"MEM:") or string.find(str,"CPU") then
+ f = "R..."
+ else
+ f = "...."
+ end
+ ids.flags = f
+ found = parse_pci(str)
+ end
+
if iplog then
regs.cs = tonumber(cs, 16)
regs.eip = tonumber(eip, 16)
ids.parent = tonumber(a, 16)
ids.this = tonumber(b, 16)
+ ids.flags = f
end
- if not iplog then
- str = line
+ -- Drop rows that are not raw input
+ if not string.find(ids.flags,"R.*") then
+ found = true
+ --printf("%s --- deleted\n", line)
end
if not found then
found = parse_io(str)
end
if not found then
- found = parse_pci(str)
- end
- if not found then
found = parse_mem(str)
end
+ -- TODO: replay CPU MSR and CPUID lines
if not found then
- found = parse_cpu(str)
- end
- if not found then
- --replay_unknown(str)
+ found = replay_unknown(str)
end
end
end
@@ -184,8 +202,8 @@ parse_headers()
dofile("serialice.lua")
-parse_file()
-
-
+-- set logging
+log_everything = verbose_log
+parse_file()
diff --git a/SerialICE/simba/serialice.lua b/SerialICE/simba/serialice.lua
index 406c900..61e2fd1 100644
--- a/SerialICE/simba/serialice.lua
+++ b/SerialICE/simba/serialice.lua
@@ -39,7 +39,7 @@ hide_smbus_io = true
hide_mainboard_io = true
-- Set to "true" to log every memory and IO access
-log_everything = false
+log_everything = true
-- Use lua table for NVram
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2511
-gerrit
commit 3a7357a106fd94b1ae14271c349dcf20a36995c0
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 19:33:44 2013 +0200
Unify output line format
Serialice log had obscure format with characters like "#!*" appearing
at different positions, this patch makes the output lines more readable.
First number pair is a running index that could be used to group and indent the lines
to improve readability. Doesn't work flawlessly yet.
Second string is combination of flags telling how action got processed:
I Info -- informational line only
R Raw -- raw IO/MEMORY/CPU operation
H Hardware -- action was sent to target
Q Qemu -- action was sent to qemu
U Undefined -- action hit the fallback filter
D Dropped -- filter prevented sending action to target or qemu
F Faked -- filter modified the action on-the-fly
Third field is the instruction pointer [CS:EIP]. At the moment EIP is not reported
accurately at all.
Remaining of the line describes the action.
A few examples:
Memory access, Raw + Qemu. Following is read of vector stored in the BIOS image file.
0000.0001 RQ.. [ffff000:fff0] MEM,ROM_HI: readb fffffff0 => ea
0000.0002 RQ.. [ffff000:fff0] MEM,ROM_HI: readw fffffff1 => e05b
0000.0003 RQ.. [ffff000:fff0] MEM,ROM_HI: readw fffffff3 => f000
PCI config read, Hardware. This is composed from either IO accesses to 0xcf8-0xcff or
memory access to a specific PCI-e MM config region. Thus it is not Raw but a composed
action.
0044.0046 .H.. [f000:f764] PCI: 0:1e.0 [004] => 00
CPUID, Raw + Hard + Faked. CPUID was executed on the target, but the returned
value was modified. In this case, it fakes CPU has a single core.
000d.000e RH.F [f000:e814] CPUID: eax: 00000001; ecx: 00000000 => 00000f4a.00010800.0000649d.bfebfbff
RDMSR Raw + Hard and WRMSR Raw + Dropped. In this case, requst to do microcode update
in target CPU is dropped as our serialice.rom image doesn't contain that binary.
0019.001a RH.. [f000:e869] CPU MSR: [00000017] => 00120000.00000000
001c.001d R..D [f000:e88e] CPU MSR: [00000079] <= 00000000.fffdfc10
Change-Id: I99308636c6a997ac82740c7d715617a1564aba81
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
SerialICE/simba/core_io.lua | 12 ++++--------
SerialICE/simba/output.lua | 44 ++++++++++++++++++++++++++++++++------------
SerialICE/simba/replay.lua | 5 +++--
3 files changed, 39 insertions(+), 22 deletions(-)
diff --git a/SerialICE/simba/core_io.lua b/SerialICE/simba/core_io.lua
index 5781b5a..37db0ea 100644
--- a/SerialICE/simba/core_io.lua
+++ b/SerialICE/simba/core_io.lua
@@ -54,21 +54,17 @@ function mem_post(f, action)
local size = size_data(action.size, action.data)
if not f.decode or f.decode == F_FIXED then
if (action.write) then
- printk(f, action, "write%s %08x <= %s", size_suffix(action.size), action.addr, size)
+ printk(f, action, "write%s %08x <= %s\n", size_suffix(action.size), action.addr, size)
else
- printk(f, action, " read%s %08x => %s", size_suffix(action.size), action.addr, size)
+ printk(f, action, " read%s %08x => %s\n", size_suffix(action.size), action.addr, size)
end
elseif f.decode == F_RANGE then
if (action.write) then
- printk(f, action, "[%08x] <= %s", bit32.band(action.addr, (f.size - 1)), size)
+ printk(f, action, "[%08x] <= %s\n", bit32.band(action.addr, (f.size - 1)), size)
else
- printk(f, action, "[%08x] => %s", bit32.band(action.addr, (f.size - 1)), size)
+ printk(f, action, "[%08x] => %s\n", bit32.band(action.addr, (f.size - 1)), size)
end
end
- if action.to_hw then
- printf(" *")
- end
- printf("\n")
return true
end
diff --git a/SerialICE/simba/output.lua b/SerialICE/simba/output.lua
index 41210da..c006248 100644
--- a/SerialICE/simba/output.lua
+++ b/SerialICE/simba/output.lua
@@ -17,31 +17,51 @@ function printf(s,...)
return io.write(s:format(...))
end
-function printk(f, action, fmt, ...)
- printf("[%04x:%04x] ", action.cs, action.eip)
- printf("%04x.%04x ", action.parent_id, action.my_id)
+function print_address(pid, id, flags, cs, eip)
+ printf("%04x.%04x %s [%04x:%04x] ",pid,id,flags,cs,eip)
+end
- local str = " "
- if action.dropped or action.faked then
- str = "!"
+function printk(f, action, fmt, ...)
+ local str = ""
+ if action.undefined or action.f or action == cpu_action then
+ str = str .. "R"
+ else
+ str = str .. "."
+ end
+ if action.to_hw then
+ str = str .. "H"
+ elseif action.to_qemu then
+ str = str .. "Q"
+ else
+ str = str .. "."
end
if action.undefined then
- str = "#"
+ str = str .. "U"
+ else
+ str = str .. "."
end
+ if action.dropped then
+ str = str .. "D"
+ elseif action.faked then
+ str = str .. "F"
+ else
+ str = str .. "."
+ end
+
+ print_address(action.parent_id, action.my_id, str, action.cs, action.eip)
if action.f then
- printf("%s %s,%s: ", str, f.name, action.f.name)
+ printf("%s,%s: ", f.name, action.f.name)
printf(fmt, ...)
else
- printf("%s %s: ", str, f.name)
+ printf("%s: ", f.name)
printf(fmt, ...)
end
end
function printks(f, fmt, ...)
- printf("[%04x:%04x] ", 0, 0)
- printf("%04x.%04x ", 0, 0)
- printf(" %s: ", f.name)
+ print_address(0,0,"I...",0,0)
+ printf("%s: ", f.name)
printf(fmt, ...)
end
diff --git a/SerialICE/simba/replay.lua b/SerialICE/simba/replay.lua
index f3ba17f..ec98149 100644
--- a/SerialICE/simba/replay.lua
+++ b/SerialICE/simba/replay.lua
@@ -35,8 +35,9 @@ function replay_unknown(str)
local dummy = {}
pre_action(dummy, false, 0, 0, 0)
post_action(dummy, 0)
- io.write(string.format("[%04x:%04x] %04x.%04x %s\n",
- regs.cs, regs.eip, ids.parent, ids.this, str))
+ print_address(ids.parent, ids.this, "...", regs.cs, regs.eip)
+ printf(str)
+ printf("\n")
end
function parse_cpu(line)
the following patch was just integrated into master:
commit fc91d65aefb95900153277849949822d2f065677
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 14:50:06 2013 +0200
Drop io_base_post
Add a field .decode in filter to control if it operates on
a set of fixed addresses or a range.
Change-Id: I56a1403dcd0fd887dec6ff9cb3b2b603ed1ce285
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2507
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Feb 25 19:15:24 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Feb 25 19:26:05 2013, giving +2
See http://review.coreboot.org/2507 for details.
-gerrit
the following patch was just integrated into master:
commit 899e7c1b4da9e38a6e5c3b4b56cc5b6bc5d6dd21
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 14:49:52 2013 +0200
Drop mem_base_post
Add a field .decode in filter to control if it operates on
a set of fixed addresses or a range.
Change-Id: I7bf7c323a339427357b3fc69dc2e2a84c14c3dd8
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2506
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Feb 25 19:21:26 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Feb 25 19:25:55 2013, giving +2
See http://review.coreboot.org/2506 for details.
-gerrit
the following patch was just integrated into master:
commit 40e3541f6d10108191b0bd24631125e6005ffd70
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 14:53:13 2013 +0200
Add Intel i845 filter
Catch access to RCOMP bar registers on i845 northbridge.
Change-Id: If73fb787da491b7c22327debc6034dbc30d6e43f
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2505
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov(a)gmail.com>
Build-Tested: build bot (Jenkins) at Mon Feb 25 14:04:46 2013, giving +1
See http://review.coreboot.org/2505 for details.
-gerrit
the following patch was just integrated into master:
commit cce3a63bb0ca6631576b2acdfb58836c2d294740
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Feb 25 03:05:13 2013 +0200
Fix replay of old logfiles
Old serialice logfiles had removed I/O accesses of PCI configuration
register accesses. Replayer script needs to inject those lines back in.
This was broken, as pci_bdf() no longer converts to the format
required for I/O 0xcf8 register.
Change-Id: I9ba2b76a8353895ac431eaaa355e0d8ec8381e02
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2503
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Feb 25 02:19:05 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Feb 25 18:44:18 2013, giving +2
See http://review.coreboot.org/2503 for details.
-gerrit