- 16 11月, 2016 5 次提交
-
-
由 Kees Cook 提交于
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: NKees Cook <keescook@chromium.org>
-
由 Joel Fernandes 提交于
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: NJoel Fernandes <joelaf@google.com> [kees: clarified variables names, added -ENOMEM handling] Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Joel Fernandes 提交于
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: NJoel Fernandes <joelaf@google.com> [kees: added max_ftrace_cnt to track size, added DT logic and docs] Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
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: NKees Cook <keescook@chromium.org>
-
由 Joel Fernandes 提交于
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: NJoel Fernandes <joelaf@google.com> [kees: moved locking flag into prz instead of via caller arguments] Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 12 11月, 2016 1 次提交
-
-
由 Joel Fernandes 提交于
PMSG now uses ramoops_pstore_write_buf_user() instead of ...write_buf(). Print a ratelimited warning if gets accidentally called. Signed-off-by: NJoel Fernandes <joelaf@google.com> [kees: adjusted commit log and added -EINVAL return] Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 09 9月, 2016 5 次提交
-
-
由 Geliang Tang 提交于
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: NGeliang Tang <geliangtang@gmail.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Mark Salyzyn 提交于
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: NMark Salyzyn <salyzyn@android.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Namhyung Kim 提交于
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: NNamhyung Kim <namhyung@kernel.org> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Namhyung Kim 提交于
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: NNamhyung Kim <namhyung@kernel.org> [kees: retained "FRAGILE" for now to make merges easier] Signed-off-by: NKees Cook <keescook@chromium.org>
-
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: NNamhyung Kim <namhyung@kernel.org> Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: NKees Cook <keescook@chromium.org> Cc: stable@vger.kernel.org # 4.4.x-
-
- 06 8月, 2016 2 次提交
-
-
由 Hiraku Toyooka 提交于
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: NHiraku Toyooka <hiraku.toyooka.gu@hitachi.com> Signed-off-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Seiji Aguchi <seiji.aguchi.tr@hitachi.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
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: NRob Herring <robh@kernel.org> Signed-off-by: NKees Cook <keescook@chromium.org> Acked-by: NRob Herring <robh@kernel.org>
-
- 15 6月, 2016 1 次提交
-
-
由 Greg Hackmann 提交于
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: NGreg 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: NKees Cook <keescook@chromium.org>
-
- 03 6月, 2016 1 次提交
-
-
由 Geliang Tang 提交于
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: NGeliang Tang <geliangtang@163.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 11 3月, 2016 1 次提交
-
-
Some architectures have their reserved RAM in 64 Bit address space. Therefore convert mem_address module parameter to ullong. Signed-off-by: NWladislav Wiebe <wladislav.wiebe@nokia.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 22 10月, 2015 1 次提交
-
-
由 Geliang Tang 提交于
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: NGeliang Tang <geliangtang@163.com> Acked-by: NKees Cook <keescook@chromium.org> [Removed __exit annotation from ramoops_remove(). Reported by Arnd Bergmann] Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 22 5月, 2015 3 次提交
-
-
由 Wang Long 提交于
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: NWang Long <long.wanglong@huawei.com> Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Ben Zhang 提交于
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: NBen Zhang <benzh@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 long.wanglong 提交于
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: NWang Long <long.wanglong@huawei.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 17 3月, 2015 1 次提交
-
-
由 Wang Long 提交于
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: NWang Long <long.wanglong@huawei.com> Acked-by: NMark Salyzyn <salyzyn@android.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 17 1月, 2015 3 次提交
-
-
由 Mark Salyzyn 提交于
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: NMark Salyzyn <salyzyn@android.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Mark Salyzyn 提交于
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: NMark Salyzyn <salyzyn@android.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Mark Salyzyn 提交于
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: NMark Salyzyn <salyzyn@android.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 12 12月, 2014 1 次提交
-
-
由 Tony Lindgren 提交于
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: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 06 11月, 2014 1 次提交
-
-
由 Ben Zhang 提交于
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: NBen Zhang <benzh@chromium.org> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 20 10月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 18 3月, 2014 4 次提交
-
-
由 Liu ShuoX 提交于
In case that ramoops_init_przs failed, max_dump_cnt won't be reset to zero in error handle path. Signed-off-by: NLiu ShuoX <shuox.liu@intel.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Liu ShuoX 提交于
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: NLiu ShuoX <shuox.liu@intel.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Liu ShuoX 提交于
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: NLiu ShuoX <shuox.liu@intel.com> Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com> Cc: Colin Cross <ccross@android.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Liu ShuoX 提交于
*_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: NLiu 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: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 31 8月, 2013 1 次提交
-
-
由 Maxime Bizon 提交于
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: NMaxime Bizon <mbizon@freebox.fr> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 20 8月, 2013 3 次提交
-
-
由 Aruna Balakrishnaiah 提交于
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: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
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: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
Addition of new argument 'compressed' in the write call back will help the backend to know if the data passed from pstore is compressed or not (In case where compression fails.). If compressed, the backend can add a tag indicating the data is compressed while writing to persistent store. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 01 7月, 2013 1 次提交
-
-
由 Aruna Balakrishnaiah 提交于
Header size is needed to distinguish between header and the dump data. Incorporate the addition of new argument (hsize) in the pstore write callback. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
-
- 15 6月, 2013 1 次提交
-
-
由 Rob Herring 提交于
There doesn't appear to be any reason for the overall pstore RAM buffer to be a power of 2 size, so remove it. The individual console, ftrace and oops buffers are still a power of 2 size. Signed-off-by: NRob Herring <rob.herring@calxeda.com> Acked-by: NAnton Vorontsov <anton@enomsg.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 09 5月, 2013 1 次提交
-
-
由 Wei Yongjun 提交于
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 04 4月, 2013 2 次提交
-
-
由 Arve Hjønnevåg 提交于
This was lost when proc/last_kmsg moved to pstore/console-ramoops. Signed-off-by: NArve Hjønnevåg <arve@android.com> Signed-off-by: NJohn Stultz <john.stultz@linaro.org> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NAnton Vorontsov <anton@enomsg.org>
-
由 Arve Hjønnevåg 提交于
Allow specifying ecc parameters in platform data Signed-off-by: NArve Hjønnevåg <arve@android.com> [jstultz: Tweaked commit subject & add commit message] Signed-off-by: NJohn Stultz <john.stultz@linaro.org> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NAnton Vorontsov <anton@enomsg.org>
-