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

4 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
     
  • 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

3 commits

  • - Instead of exploiting unsigned overflows (which doesn't work for all
    sizes), use straightforward checking for ECC total size not exceeding
    initial buffer size;

    - Printing overflowed buffer_size is not informative. Instead, print
    ecc_size and buffer_size;

    - No need for buffer_size argument in persistent_ram_init_ecc(),
    we can address prz->buffer_size directly.

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

    Anton Vorontsov
     
  • We will implement variable-sized ECC buffers soon, so post_init routine
    might fail much more likely, so we'd better check for its errors.

    To make error handling simple, modify persistent_ram_free() to it be safe
    at all times.

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

    Anton Vorontsov
     
  • 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

5 commits


17 May, 2012

1 commit

  • 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