- 07 Mar, 2017 2 commits
-
-
Kees Cook authored
This removes the argument list for the erase() callback and replaces it with a pointer to the backend record details to be removed. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Kees Cook authored
The argument list for the pstore_read() interface is unwieldy. This changes passes the new struct pstore_record instead. The erst backend was already doing something similar internally. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 13 Feb, 2017 1 commit
-
-
Kees Cook authored
Instead of needing additional checks in callers for unallocated przs, perform the check in the walker, which gives us a more universal way to handle the situation. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 09 Feb, 2017 1 commit
-
-
Brian Norris authored
We'll OOPS in ramoops_get_next_prz() if the platform didn't ask for any ftrace zones (i.e., cxt->fprzs will be NULL). Let's just skip this entire FTRACE section if there's no 'fprzs'. Regression seen on a coreboot/depthcharge-based Chromebook. Fixes: 2fbea82b ("pstore: Merge per-CPU ftrace records into one") Cc: Joel Fernandes <joelaf@google.com> Cc: Kees Cook <keescook@chromium.org> Signed-off-by:
Brian Norris <briannorris@chromium.org> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 16 Nov, 2016 7 commits
-
-
Kees Cook authored
This adds a check for a NULL platform data, which should only be possible if a driver incorrectly sets up a probe request without also having defined the platform_data structure. This is based on a patch from Geliang Tang. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Kees Cook authored
Since "przs" (persistent ram zones) is a general name in the code now, so rename the Oops-dump zones to dprzs from przs. Based on a patch from Nobuhiro Iwamatsu. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Kees Cook authored
When setting ramoops record sizes, sometimes it's not clear which parameters contributed to the allocation failure. This adds a per-zone name and expands the failure reports. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Joel Fernandes authored
Up until this patch, each of the per CPU ftrace buffers appear as a separate ftrace-ramoops-N file. In this patch we merge all the zones into one and populate a single ftrace-ramoops-0 file. Signed-off-by:
Joel Fernandes <joelaf@google.com> [kees: clarified variables names, added -ENOMEM handling] Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Joel Fernandes authored
If the RAMOOPS_FLAG_FTRACE_PER_CPU flag is passed to ramoops pdata, split the ftrace space into multiple zones depending on the number of CPUs. This speeds up the performance of function tracing by about 280% in my tests as we avoid the locking. The trade off being lesser space available per CPU. Let the ramoops user decide which option they want based on pdata flag. Signed-off-by:
Joel Fernandes <joelaf@google.com> [kees: added max_ftrace_cnt to track size, added DT logic and docs] Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Kees Cook authored
Currently ramoops_init_przs() is hard wired only for panic dump zone array. In preparation for the ftrace zone array (one zone per-cpu) and pmsg zone array, make the function more generic to be able to handle this case. Heavily based on similar work from Joel Fernandes. Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Joel Fernandes authored
In preparation of not locking at all for certain buffers depending on if there's contention, make locking optional depending on the initialization of the prz. Signed-off-by:
Joel Fernandes <joelaf@google.com> [kees: moved locking flag into prz instead of via caller arguments] Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 11 Nov, 2016 1 commit
-
-
Joel Fernandes authored
PMSG now uses ramoops_pstore_write_buf_user() instead of ...write_buf(). Print a ratelimited warning if gets accidentally called. Signed-off-by:
Joel Fernandes <joelaf@google.com> [kees: adjusted commit log and added -EINVAL return] Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 08 Sep, 2016 5 commits
-
-
Geliang Tang authored
If cxt->pstore.buf allocated failed, no need to initialize cxt->pstore.buf_lock. So this patch moves spin_lock_init() after the error checking. Signed-off-by:
Geliang Tang <geliangtang@gmail.com> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Mark Salyzyn authored
Removing a bounce buffer copy operation in the pmsg driver path is always better. We also gain in overall performance by not requesting a vmalloc on every write as this can cause precious RT tasks, such as user facing media operation, to stall while memory is being reclaimed. Added a write_buf_user to the pstore functions, a backup platform write_buf_user that uses the small buffer that is part of the instance, and implemented a ramoops write_buf_user that only supports PSTORE_TYPE_PMSG. Signed-off-by:
Mark Salyzyn <salyzyn@android.com> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Namhyung Kim authored
The ramoops can be configured to enable each pstore type by setting their size. In that case, it'd be better not to register disabled types in the first place. Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by:
Namhyung Kim <namhyung@kernel.org> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Namhyung Kim authored
This patch adds new PSTORE_FLAGS for each pstore type so that they can be enabled separately. This is a preparation for ongoing virtio-pstore work to support those types flexibly. The PSTORE_FLAGS_FRAGILE is changed to PSTORE_FLAGS_DMESG to preserve the original behavior. Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Len Brown <lenb@kernel.org> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: linux-acpi@vger.kernel.org Cc: linux-efi@vger.kernel.org Signed-off-by:
Namhyung Kim <namhyung@kernel.org> [kees: retained "FRAGILE" for now to make merges easier] Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Sebastian Andrzej Siewior authored
A basic rmmod ramoops segfaults. Let's see why. Since commit 34f0ec82 ("pstore: Correct the max_dump_cnt clearing of ramoops") sets ->max_dump_cnt to zero before looping over ->przs but we didn't use it before that either. And since commit ee1d2674 ("pstore: add pstore unregister") we free that memory on rmmod. But even then, we looped until a NULL pointer or ERR. I don't see where it is ensured that the last member is NULL. Let's try this instead: simply error recovery and free. Clean up in error case where resources were allocated. And then, in the free path, rely on ->max_dump_cnt in the free path. Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Acked-by:
Namhyung Kim <namhyung@kernel.org> Signed-off-by:
Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by:
Kees Cook <keescook@chromium.org> Cc: stable@vger.kernel.org # 4.4.x-
-
- 05 Aug, 2016 2 commits
-
-
Hiraku Toyooka authored
persistent_ram_zone(=prz) structures are allocated by persistent_ram_new(), which includes vmap() or ioremap(). But they are currently freed by kfree(). This uses persistent_ram_free() for correct this asymmetry usage. Signed-off-by:
Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> Signed-off-by:
Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Seiji Aguchi <seiji.aguchi.tr@hitachi.com> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Kees Cook authored
Instead of a ramoops-specific node, use a child node of /reserved-memory. This requires that of_platform_device_create() be explicitly called for the node, though, since "/reserved-memory" does not have its own "compatible" property. Suggested-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Kees Cook <keescook@chromium.org> Acked-by:
Rob Herring <robh@kernel.org>
-
- 14 Jun, 2016 1 commit
-
-
Greg Hackmann authored
ramoops is one of the remaining places where ARM vendors still rely on board-specific shims. Device Tree lets us replace those shims with generic code. These bindings mirror the ramoops module parameters, with two small differences: (1) dump_oops becomes an optional "no-dump-oops" property, since ramoops sets dump_oops=1 by default. (2) mem_type=1 becomes the more self-explanatory "unbuffered" property. Signed-off-by:
Greg Hackmann <ghackmann@google.com> [fixed platform_get_drvdata() crash, thanks to Brian Norris] [switched from u64 to u32 to simplify code, various whitespace fixes] [use dev_of_node() to gain code-elimination for CONFIG_OF=n] Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 02 Jun, 2016 1 commit
-
-
Geliang Tang authored
Like zlib compression in pstore, this patch added lzo and lz4 compression support so that users can have more options and better compression ratio. The original code treats the compressed data together with the uncompressed ECC correction notice by using zlib decompress. The ECC correction notice is missing in the decompression process. The treatment also makes lzo and lz4 not working. So I treat them separately by using pstore_decompress() to treat the compressed data, and memcpy() to treat the uncompressed ECC correction notice. Signed-off-by:
Geliang Tang <geliangtang@163.com> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- 10 Mar, 2016 1 commit
-
-
Wiebe, Wladislav (Nokia - DE/Ulm) authored
Some architectures have their reserved RAM in 64 Bit address space. Therefore convert mem_address module parameter to ullong. Signed-off-by:
Wladislav Wiebe <wladislav.wiebe@nokia.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 22 Oct, 2015 1 commit
-
-
Geliang Tang authored
pstore doesn't support unregistering yet. It was marked as TODO. This patch adds some code to fix it: 1) Add functions to unregister kmsg/console/ftrace/pmsg. 2) Add a function to free compression buffer. 3) Unmap the memory and free it. 4) Add a function to unregister pstore filesystem. Signed-off-by:
Geliang Tang <geliangtang@163.com> Acked-by:
Kees Cook <keescook@chromium.org> [Removed __exit annotation from ramoops_remove(). Reported by Arnd Bergmann] Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 21 May, 2015 3 commits
-
-
Wang Long authored
If we set ramoops.mem_type=1 in command line, the current code can not change mem_type to 1, because it is assigned to 0 in function ramoops_register_dummy. This patch make it possible to change mem_type parameter in command line. Signed-off-by:
Wang Long <long.wanglong@huawei.com> Acked-by:
Tony Lindgren <tony@atomide.com> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
Ben Zhang authored
On some devices the persistent memory contains junk after a cold boot, and /dev/pstore/dmesg-ramoops-* are created with random data which is not the result of a kernel crash. This patch adds a ramoops header check and skips any persistent_ram_zone that does not have a valid header. Signed-off-by:
Ben Zhang <benzh@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
long.wanglong authored
The value of cxt->record_size does not change in the loop, so this patch optimize the assign statement by dropping sz entirely and using cxt->record_size in its place. Signed-off-by:
Wang Long <long.wanglong@huawei.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 16 Mar, 2015 1 commit
-
-
Wang Long authored
In the function ramoops_probe, the console_size, pmsg_size, ftrace_size may be update because the value is not the power of two. We should update the module parameter variables as well so they are visible through /sys/module/ramoops/parameters correctly. Signed-off-by:
Wang Long <long.wanglong@huawei.com> Acked-by:
Mark Salyzyn <salyzyn@android.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 17 Jan, 2015 1 commit
-
-
Mark Salyzyn authored
A secured user-space accessible pstore object. Writes to /dev/pmsg0 are appended to the buffer, on reboot the persistent contents are available in /sys/fs/pstore/pmsg-ramoops-[ID]. One possible use is syslogd, or other daemon, can write messages, then on reboot provides a means to triage user-space activities leading up to a panic as a companion to the pstore dmesg or console logs. Signed-off-by:
Mark Salyzyn <salyzyn@android.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 16 Jan, 2015 2 commits
-
-
Mark Salyzyn authored
ramoops_pstore_read fails to return the next in a prz series after first zero-sized entry, not venturing to the next non-zero entry. Signed-off-by:
Mark Salyzyn <salyzyn@android.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
Mark Salyzyn authored
All previous checks will fail with error if memory size is not sufficient to register a zone, so this legacy check has become redundant. Signed-off-by:
Mark Salyzyn <salyzyn@android.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 11 Dec, 2014 1 commit
-
-
Tony Lindgren authored
On some ARMs the memory can be mapped pgprot_noncached() and still be working for atomic operations. As pointed out by Colin Cross <ccross@android.com>, in some cases you do want to use pgprot_noncached() if the SoC supports it to see a debug printk just before a write hanging the system. On ARMs, the atomic operations on strongly ordered memory are implementation defined. So let's provide an optional kernel parameter for configuring pgprot_noncached(), and use pgprot_writecombine() by default. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Rob Herring <robherring2@gmail.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Olof Johansson <olof@lixom.net> Cc: Russell King <linux@arm.linux.org.uk> Cc: stable@vger.kernel.org Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Lindgren <tony@atomide.com> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 05 Nov, 2014 1 commit
-
-
Ben Zhang authored
pstore compression/decompression was added during 3.12. The ramoops driver prepends a "====timestamp.timestamp-C|D\n" header to the compressed record before handing it over to pstore driver which doesn't know about the header. In pstore_decompress(), the pstore driver reads the first "==" as a zlib header, so the decompression always fails. For example, this causes the driver to write /dev/pstore/dmesg-ramoops-0.enc.z instead of /dev/pstore/dmesg-ramoops-0. This patch makes the ramoops driver remove the header before pstore decompression. Signed-off-by:
Ben Zhang <benzh@chromium.org> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 20 Oct, 2014 1 commit
-
-
Wolfram Sang authored
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 17 Mar, 2014 4 commits
-
-
Liu ShuoX authored
In case that ramoops_init_przs failed, max_dump_cnt won't be reset to zero in error handle path. Signed-off-by:
Liu ShuoX <shuox.liu@intel.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
Liu ShuoX authored
ramoops_get_next_prz get the prz according the paramters. If it get a uninitialized prz, access its members by following persistent_ram_old_size(prz) will cause a NULL pointer crash. Ex: if ftrace_size is 0, fprz will be NULL. Fix it by return NULL in advance. Signed-off-by:
Liu ShuoX <shuox.liu@intel.com> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
Liu ShuoX authored
In ramoops_pstore_read, a valid prz pointer with zero size buffer will break traverse of all persistent ram buffers. The latter buffer might be lost. Signed-off-by:
Liu ShuoX <shuox.liu@intel.com> Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com> Cc: Colin Cross <ccross@android.com> Reviewed-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
Liu ShuoX authored
*_read_cnt in ramoops_context need to be cleared during pstore ->open to support mutli times getting the records. The patch added missed ftrace_read_cnt clearing and removed duplicate clearing in ramoops_probe. Signed-off-by:
Liu ShuoX <shuox.liu@intel.com> Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 30 Aug, 2013 1 commit
-
-
Maxime Bizon authored
Previous attempt to fix was b042e474 Suggested use of is_power_of_2() was bogus because is_power_of_2(0) is false (documented behaviour). Signed-off-by:
Maxime Bizon <mbizon@freebox.fr> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
- 19 Aug, 2013 2 commits
-
-
Aruna Balakrishnaiah authored
In pstore write, add character 'C'(compressed) or 'D'(decompressed) in the header while writing to Ram persistent buffer. In pstore read, read the header and update the 'compressed' flag accordingly. Signed-off-by:
Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-
Aruna Balakrishnaiah authored
Backends will set the flag 'compressed' after reading the log from persistent store to indicate the data being returned to pstore is compressed or not. Signed-off-by:
Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Tony Luck <tony.luck@intel.com>
-