[Ce-android-mainline] [PATCH 04/10] android: ram_console: split out persistent ram

Kees Cook keescook at chromium.org
Tue Feb 21 21:10:13 UTC 2012


On Mon, Feb 20, 2012 at 2:45 PM, Colin Cross <ccross at android.com> wrote:
> On Mon, Feb 20, 2012 at 2:24 PM, john stultz <johnstul at us.ibm.com> wrote:
>> On Sun, 2012-02-19 at 16:44 -0800, Colin Cross wrote:
>>> Split ram_console into two halves.
>>>
>>> persistent_ram is a set of apis that handle a block of memory
>>> that does not get erased across a reboot.  It provides functions
>>> to fill it as a single buffer or a ring buffer, and to extract
>>> the old data after a reboot.  It handles ecc on the data to
>>> correct bit errors introduced during reboot.
>>>
>>> ram_console is now a small wrapper around persistent_ram that
>>> feeds console data into the ringbuffer, and exports the old
>>> data to /proc/last_kmsg after a reboot.
>>
>> This looks very cool (esp the ftrace bit), although have you looked at
>> all into the pstore work to see how it might be able to be integrated?
>>
>> Kees (cc'ed) has apparently been working to get the ramoops driver
>> (which writes oops and panic messages to a similar in-ram circular
>> buffer) working with pstore and there seems like there is some overlap
>> here.
>>
>> I'm not saying this should block this code going into staging, but just
>> wanted to know if you had looked into the similar works and if so, could
>> articulate why they couldn't be reused (so others can try to help
>> integrate things if necessary).
>>
>> thanks
>> -john
>>
>>
>
> pstore is just an interface to write to a persistent storage, with a
> tiny driver on it to dump console messages after a panic.  With the
> number of crashes we see on ARM cpus that are not panics (mostly
> watchdog resets), logging only after a panic is not appropriate, so it
> can't replace ramconsole.  persistent_ram could easily be a pstore
> driver, but that would not give any new useful functionality, since
> ramconsole is better for us than pstore_dump.
>
> Looking at ramoops, it is exactly the same as pstore on ioremapped
> ram, but was originally implemented separately.  I see patches now
> that convert it to a pstore backend, which leaves us in the same state
> as above - only logging panics.

Right -- it was currently only designed for panic logging. The pstore
changes are finally landing in upstream for 3.4, IIUC.

-Kees

-- 
Kees Cook
ChromeOS Security


More information about the Ce-android-mainline mailing list