2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2011-07-29 17:11:32 +04:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
pstore/ram: Make tracing log versioned
Decoding the binary trace w/ a different kernel might be troublesome
since we convert addresses to symbols. For kernels with minimal changes,
the mappings would probably match, but it's not guaranteed at all.
(But still we could convert the addresses by hand, since we do print
raw addresses.)
If we use modules, the symbols could be loaded at different addresses
from the previously booted kernel, and so this would also fail, but
there's nothing we can do about it.
Also, the binary data format that pstore/ram is using in its ringbuffer
may change between the kernels, so here we too must ensure that we're
running the same kernel.
So, there are two questions really:
1. How to compute the unique kernel tag;
2. Where to store it.
In this patch we're using LINUX_VERSION_CODE, just as hibernation
(suspend-to-disk) does. This way we are protecting from the kernel
version mismatch, making sure that we're running the same kernel
version and patch level. We could use CRC of a symbol table (as
suggested by Tony Luck), but for now let's not be that strict.
And as for storing, we are using a small trick here. Instead of
allocating a dedicated buffer for the tag (i.e. another prz), or
hacking ram_core routines to "reserve" some control data in the
buffer, we are just encoding the tag into the buffer signature
(and XOR'ing it with the actual signature value, so that buffers
not needing a tag can just pass zero, which will result into the
plain old PRZ signature).
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Tony Luck <tony.luck@intel.com>
Suggested-by: Colin Cross <ccross@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17 12:11:12 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
2012-07-17 19:49:37 -07:00
|
|
|
|
2012-05-16 05:43:08 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2011-07-26 16:08:59 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2011-07-26 16:08:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:03:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:34 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
2011-07-26 16:08:58 -07:00
|
|
|
|
2012-07-09 17:03:19 -07:00
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
efi_pstore: Add a sequence counter to a variable name
[Issue]
Currently, a variable name, which identifies each entry, consists of type, id and ctime.
But if multiple events happens in a short time, a second/third event may fail to log because
efi_pstore can't distinguish each event with current variable name.
[Solution]
A reasonable way to identify all events precisely is introducing a sequence counter to
the variable name.
The sequence counter has already supported in a pstore layer with "oopscount".
So, this patch adds it to a variable name.
Also, it is passed to read/erase callbacks of platform drivers in accordance with
the modification of the variable name.
<before applying this patch>
a variable name of first event: dump-type0-1-12345678
a variable name of second event: dump-type0-1-12345678
type:0
id:1
ctime:12345678
If multiple events happen in a short time, efi_pstore can't distinguish them because
variable names are same among them.
<after applying this patch>
it can be distinguishable by adding a sequence counter as follows.
a variable name of first event: dump-type0-1-1-12345678
a variable name of Second event: dump-type0-1-2-12345678
type:0
id:1
sequence counter: 1(first event), 2(second event)
ctime:12345678
In case of a write callback executed in pstore_console_write(), "0" is added to
an argument of the write callback because it just logs all kernel messages and
doesn't need to care about multiple events.
Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2012-11-26 16:07:44 -08:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:22 -07:00
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-19 10:26:16 -08:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
|
|
|
|
|
2012-11-19 10:26:16 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-11-19 10:26:16 -08:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-17 19:49:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
2012-12-11 17:49:24 -08:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:43 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-12 16:59:29 -08:00
|
|
|
|
2012-01-12 17:20:11 -08:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2011-01-12 16:59:29 -08:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2011-07-26 16:08:58 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-12-11 17:49:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:43 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
efi_pstore: Add a sequence counter to a variable name
[Issue]
Currently, a variable name, which identifies each entry, consists of type, id and ctime.
But if multiple events happens in a short time, a second/third event may fail to log because
efi_pstore can't distinguish each event with current variable name.
[Solution]
A reasonable way to identify all events precisely is introducing a sequence counter to
the variable name.
The sequence counter has already supported in a pstore layer with "oopscount".
So, this patch adds it to a variable name.
Also, it is passed to read/erase callbacks of platform drivers in accordance with
the modification of the variable name.
<before applying this patch>
a variable name of first event: dump-type0-1-12345678
a variable name of second event: dump-type0-1-12345678
type:0
id:1
ctime:12345678
If multiple events happen in a short time, efi_pstore can't distinguish them because
variable names are same among them.
<after applying this patch>
it can be distinguishable by adding a sequence counter as follows.
a variable name of first event: dump-type0-1-1-12345678
a variable name of Second event: dump-type0-1-2-12345678
type:0
id:1
sequence counter: 1(first event), 2(second event)
ctime:12345678
In case of a write callback executed in pstore_console_write(), "0" is added to
an argument of the write callback because it just logs all kernel messages and
doesn't need to care about multiple events.
Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2012-11-26 16:07:44 -08:00
|
|
|
|
efi_pstore: Add ctime to argument of erase callback
[Issue]
Currently, a variable name, which is used to identify each log entry, consists of type,
id and ctime. But an erase callback does not use ctime.
If efi_pstore supported just one log, type and id were enough.
However, in case of supporting multiple logs, it doesn't work because
it can't distinguish each entry without ctime at erasing time.
<Example>
As you can see below, efi_pstore can't differentiate first event from second one without ctime.
a variable name of first event: dump-type0-1-12345678
a variable name of second event: dump-type0-1-23456789
type:0
id:1
ctime:12345678, 23456789
[Solution]
This patch adds ctime to an argument of an erase callback.
It works across reboots because ctime of pstore means the date that the record was originally stored.
To do this, efi_pstore saves the ctime to variable name at writing time and passes it to pstore
at reading time.
Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Acked-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2012-11-14 20:27:28 +00:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:43 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-18 19:15:51 -07:00
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 15:02:05 -08:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-11 17:49:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pstore/ram: Make tracing log versioned
Decoding the binary trace w/ a different kernel might be troublesome
since we convert addresses to symbols. For kernels with minimal changes,
the mappings would probably match, but it's not guaranteed at all.
(But still we could convert the addresses by hand, since we do print
raw addresses.)
If we use modules, the symbols could be loaded at different addresses
from the previously booted kernel, and so this would also fail, but
there's nothing we can do about it.
Also, the binary data format that pstore/ram is using in its ringbuffer
may change between the kernels, so here we too must ensure that we're
running the same kernel.
So, there are two questions really:
1. How to compute the unique kernel tag;
2. Where to store it.
In this patch we're using LINUX_VERSION_CODE, just as hibernation
(suspend-to-disk) does. This way we are protecting from the kernel
version mismatch, making sure that we're running the same kernel
version and patch level. We could use CRC of a symbol table (as
suggested by Tony Luck), but for now let's not be that strict.
And as for storing, we are using a small trick here. Instead of
allocating a dedicated buffer for the tag (i.e. another prz), or
hacking ram_core routines to "reserve" some control data in the
buffer, we are just encoding the tag into the buffer signature
(and XOR'ing it with the actual signature value, so that buffers
not needing a tag can just pass zero, which will result into the
plain old PRZ signature).
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Tony Luck <tony.luck@intel.com>
Suggested-by: Colin Cross <ccross@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17 12:11:12 -07:00
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 15:02:05 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-11 17:49:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-12-11 17:49:24 -08:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
pstore/ram: Make tracing log versioned
Decoding the binary trace w/ a different kernel might be troublesome
since we convert addresses to symbols. For kernels with minimal changes,
the mappings would probably match, but it's not guaranteed at all.
(But still we could convert the addresses by hand, since we do print
raw addresses.)
If we use modules, the symbols could be loaded at different addresses
from the previously booted kernel, and so this would also fail, but
there's nothing we can do about it.
Also, the binary data format that pstore/ram is using in its ringbuffer
may change between the kernels, so here we too must ensure that we're
running the same kernel.
So, there are two questions really:
1. How to compute the unique kernel tag;
2. Where to store it.
In this patch we're using LINUX_VERSION_CODE, just as hibernation
(suspend-to-disk) does. This way we are protecting from the kernel
version mismatch, making sure that we're running the same kernel
version and patch level. We could use CRC of a symbol table (as
suggested by Tony Luck), but for now let's not be that strict.
And as for storing, we are using a small trick here. Instead of
allocating a dedicated buffer for the tag (i.e. another prz), or
hacking ram_core routines to "reserve" some control data in the
buffer, we are just encoding the tag into the buffer signature
(and XOR'ing it with the actual signature value, so that buffers
not needing a tag can just pass zero, which will result into the
plain old PRZ signature).
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Tony Luck <tony.luck@intel.com>
Suggested-by: Colin Cross <ccross@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17 12:11:12 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 15:02:05 -08:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2011-07-26 16:08:59 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2012-10-22 11:19:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
|
|
|
|
|
2011-07-26 16:08:59 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
2011-07-26 16:08:58 -07:00
|
|
|
|
2012-07-09 17:03:19 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pstore/ram: Make tracing log versioned
Decoding the binary trace w/ a different kernel might be troublesome
since we convert addresses to symbols. For kernels with minimal changes,
the mappings would probably match, but it's not guaranteed at all.
(But still we could convert the addresses by hand, since we do print
raw addresses.)
If we use modules, the symbols could be loaded at different addresses
from the previously booted kernel, and so this would also fail, but
there's nothing we can do about it.
Also, the binary data format that pstore/ram is using in its ringbuffer
may change between the kernels, so here we too must ensure that we're
running the same kernel.
So, there are two questions really:
1. How to compute the unique kernel tag;
2. Where to store it.
In this patch we're using LINUX_VERSION_CODE, just as hibernation
(suspend-to-disk) does. This way we are protecting from the kernel
version mismatch, making sure that we're running the same kernel
version and patch level. We could use CRC of a symbol table (as
suggested by Tony Luck), but for now let's not be that strict.
And as for storing, we are using a small trick here. Instead of
allocating a dedicated buffer for the tag (i.e. another prz), or
hacking ram_core routines to "reserve" some control data in the
buffer, we are just encoding the tag into the buffer signature
(and XOR'ing it with the actual signature value, so that buffers
not needing a tag can just pass zero, which will result into the
plain old PRZ signature).
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Tony Luck <tony.luck@intel.com>
Suggested-by: Colin Cross <ccross@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17 12:11:12 -07:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pstore/ram: Make tracing log versioned
Decoding the binary trace w/ a different kernel might be troublesome
since we convert addresses to symbols. For kernels with minimal changes,
the mappings would probably match, but it's not guaranteed at all.
(But still we could convert the addresses by hand, since we do print
raw addresses.)
If we use modules, the symbols could be loaded at different addresses
from the previously booted kernel, and so this would also fail, but
there's nothing we can do about it.
Also, the binary data format that pstore/ram is using in its ringbuffer
may change between the kernels, so here we too must ensure that we're
running the same kernel.
So, there are two questions really:
1. How to compute the unique kernel tag;
2. Where to store it.
In this patch we're using LINUX_VERSION_CODE, just as hibernation
(suspend-to-disk) does. This way we are protecting from the kernel
version mismatch, making sure that we're running the same kernel
version and patch level. We could use CRC of a symbol table (as
suggested by Tony Luck), but for now let's not be that strict.
And as for storing, we are using a small trick here. Instead of
allocating a dedicated buffer for the tag (i.e. another prz), or
hacking ram_core routines to "reserve" some control data in the
buffer, we are just encoding the tag into the buffer signature
(and XOR'ing it with the actual signature value, so that buffers
not needing a tag can just pass zero, which will result into the
plain old PRZ signature).
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Tony Luck <tony.luck@intel.com>
Suggested-by: Colin Cross <ccross@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17 12:11:12 -07:00
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-03 17:02:48 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
pstore/ram: Fix possible NULL dereference
We can dereference 'cxt->cprz' if console and dump logging are disabled
(which is unlikely, but still possible to do). This patch fixes the issue
by changing the code so that we don't dereference przs at all, we can
just calculate bufsize from console_size and record_size values.
Plus, while at it, the patch improves the buffer size calculation.
After Kay's printk rework, we know the optimal buffer size for console
logging -- it is LOG_LINE_MAX (defined privately in printk.c). Previously,
if only console logging was enabled, we would allocate unnecessary large
buffer in pstore, while we only need LOG_LINE_MAX. (Pstore console logging
is still capable of handling buffers > LOG_LINE_MAX, it will just do
multiple calls to psinfo->write).
Note that I don't export the constant, since we will do even a better
thing soon: we will switch console logging to a new write_buf API, which
will eliminate the need for the additional buffer; and so we won't need
the constant.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
2012-07-19 15:47:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
pstore/ram: Fix possible NULL dereference
We can dereference 'cxt->cprz' if console and dump logging are disabled
(which is unlikely, but still possible to do). This patch fixes the issue
by changing the code so that we don't dereference przs at all, we can
just calculate bufsize from console_size and record_size values.
Plus, while at it, the patch improves the buffer size calculation.
After Kay's printk rework, we know the optimal buffer size for console
logging -- it is LOG_LINE_MAX (defined privately in printk.c). Previously,
if only console logging was enabled, we would allocate unnecessary large
buffer in pstore, while we only need LOG_LINE_MAX. (Pstore console logging
is still capable of handling buffers > LOG_LINE_MAX, it will just do
multiple calls to psinfo->write).
Note that I don't export the constant, since we will do even a better
thing soon: we will switch console logging to a new write_buf API, which
will eliminate the need for the additional buffer; and so we won't need
the constant.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
2012-07-19 15:47:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2012-05-17 00:15:18 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2012-01-12 17:20:59 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:03:19 -07:00
|
|
|
|
2012-05-03 15:45:03 +10:00
|
|
|
|
2012-07-09 17:03:19 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:23 -07:00
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:21 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-26 06:20:20 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2012-05-03 15:45:02 +10:00
|
|
|
|
|
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
|
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
|
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 17:10:44 -07:00
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
2012-07-09 17:03:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
|
|
|
|
|
2012-06-18 19:15:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-20 14:58:26 +08:00
|
|
|
|
2011-07-26 16:08:57 -07:00
|
|
|
|
2010-10-27 15:34:52 -07:00
|
|
|
|
2010-05-26 14:43:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|