04 Apr, 2013

1 commit


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit from the pstore filesystem.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Anton Vorontsov
    Cc: Colin Cross
    Cc: Kees Cook
    Cc: Tony Luck
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Jul, 2012

6 commits

  • 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
    Suggested-by: Tony Luck
    Suggested-by: Colin Cross
    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Headers should really include all the needed prototypes, types, defines
    etc. to be self-contained. This is a long-standing issue, but apparently
    the new tracing code unearthed it (SMP=n is also a prerequisite):

    In file included from fs/pstore/internal.h:4:0,
    from fs/pstore/ftrace.c:21:
    include/linux/pstore.h:43:15: error: field ‘read_mutex’ has incomplete type

    While at it, I also added the following:

    linux/types.h -> size_t, phys_addr_t, uXX and friends
    linux/spinlock.h -> spinlock_t
    linux/errno.h -> Exxxx
    linux/time.h -> struct timespec (struct passed by value)
    struct module and rs_control forward declaration (passed via pointers).

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • The ftrace log size is configurable via ramoops.ftrace_size
    module option, and the log itself is available via
    /ftrace-ramoops file.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Nowadays we can use prz->ecc_size as a flag, no need for the special
    member in the prz struct.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • This is now pretty straightforward: instead of using bool, just pass
    an integer. For backwards compatibility ramoops.ecc=1 means 16 bytes
    ECC (using 1 byte for ECC isn't much of use anyway).

    Suggested-by: Arve Hjønnevåg
    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • The struct members were never used anywhere outside of
    persistent_ram_init_ecc(), so there's actually no need for them
    to be in the struct.

    If we ever want to make polynomial or symbol size configurable,
    it would make more sense to just pass initialized rs_decoder
    to the persistent_ram init functions.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

21 Jun, 2012

1 commit

  • Registering the platform driver before module_init allows us to log oopses
    that happen during device probing.

    This requires changing module_init to postcore_initcall, and switching
    from platform_driver_probe to platform_driver_register because the
    platform device is not registered when the platform driver is registered;
    and because we use driver_register, now can't use create_bundle() (since
    it will try to register the same driver once again), so we have to switch
    to platform_device_register_data().

    Also, some __init -> __devinit changes were needed.

    Overall, the registration logic is now much clearer, since we have only
    one driver registration point, and just an optional dummy device, which
    is created from the module parameters.

    Suggested-by: Colin Cross
    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

14 Jun, 2012

4 commits

  • The code tried to maintain the global list of persistent ram zones,
    which isn't a great idea overall, plus since Android's ram_console
    is no longer there, we can remove some unused functions.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Acked-by: Colin Cross
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • The console log size is configurable via ramoops.console_size
    module option, and the log itself is available via
    /console-ramoops file.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • A handy function that we will use outside of ram_core soon. But
    so far just factor it out and start using it in post_init().

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Without the update, we'll only see the new dmesg buffer after the
    reboot, but previously we could see it right away. Making an oops
    visible in pstore filesystem before reboot is a somewhat dubious
    feature, but removing it wasn't an intentional change, so let's
    restore it.

    For this we have to make persistent_ram_save_old() safe for calling
    multiple times, and also extern it.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

17 May, 2012

2 commits

  • This is now straightforward: just introduce a module parameter and pass
    the needed value to persistent_ram_new().

    Signed-off-by: Anton Vorontsov
    Acked-by: Marco Stornelli
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • This is a first step for adding ECC support for pstore RAM backend: we
    will use the persistent_ram routines, kindly provided by Google.

    Basically, persistent_ram is a set of helper routines to deal with the
    [optionally] ECC-protected persistent ram regions.

    A bit of Makefile, Kconfig and header files adjustments were needed
    because of the move.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

16 May, 2012

1 commit

  • Since ramoops was converted to pstore, it has nothing to do with character
    devices nowadays. Instead, today it is just a RAM backend for pstore.

    The patch just moves things around. There are a few changes were needed
    because of the move:

    1. Kconfig and Makefiles fixups, of course.

    2. In pstore/ram.c we have to play a bit with MODULE_PARAM_PREFIX, this
    is needed to keep user experience the same as with ramoops driver
    (i.e. so that ramoops.foo kernel command line arguments would still
    work).

    Signed-off-by: Anton Vorontsov
    Acked-by: Marco Stornelli
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov