Commit Graph

11 Commits

Author SHA1 Message Date
qctecmdr
95929f9308 Merge "soc: qcom: Fix memcpy operations in ramdump_read" 2020-10-14 04:23:02 -07:00
Mukesh Ojha
75ae7139bd soc: qcom: ramdump: Fix the missed unmap of mapped memory
Before copying dump to userspace, memory is mapped and then the
content get copied to userspace and later that memory should be
unmapped.

Let's unmap the memory after the content get copied to
userspace.

Change-Id: I03d53ebd1cdb743e1820f226a49d46136eca4874
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2020-10-13 23:22:46 -07:00
Neeraj Upadhyay
cc1b31a0b9 soc: qcom: Fix memcpy operations in ramdump_read
Currently, for device memory addresses, which are not
aligned on 8 byte boundary, ramdump_read() copies the
bytes till the start of next aligned address. However,
this calculation does not take into account the case,
where copy_size is less that the number of bytes till
next alignment. This causes memcpy to copy device
memory to region, which is outside of the allocated
buffer. Fix this by copying only the copy_size buffer
for this case.

Change-Id: I918ab5886d664f89c0eebd99972f5b9960e1ae00
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2020-10-12 09:45:39 +05:30
Raghavendra Rao Ananta
21eaad120e soc: qcom: ramdump: Fix 'complete ramdump' collection
The PIL driver sets up the mappings for the segments' address
based on the size of the segments. However, for the case of
'complete ramdump' collection, the ramdump driver re-sizes the
segments, thus causing a mismatch in the mappings created by
PIL driver. Hence, fix this by only initializing the physical
address in the PIL driver and let the ramdump driver take
care of the re-sizing and mapping.

Change-Id: Ia07eae2b1873f1fc9d3e9a1c8089f14ffd37dcd3
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-08-25 13:16:41 -07:00
Raghavendra Rao Ananta
aec59fab94 soc: qcom: ramdump: Abort user-space read if timed-out
It's possible that the user-space process can be woken up
very late to collect the ramdumps by which time, the ramdump
collection timer would have expired. Following this, the PIL
driver unmaps the memory and continues. The user-space process
has no way to know about this and can make an attempt to read
the unmapped memory, thus resulting in a data abort.

Hence, notify the user-space process that the ramdump timer
has expired such that it can reset its state machine.

Also add the srcu related symbols to the allowed-list and update
the ABI snapshot accordingly.

Change-Id: Idb92d98406a9032c999c82e2089213883c5a65eb
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-08-20 10:10:42 -07:00
Jitendra Sharma
becade6094 soc: qcom: Reset string table index for each dump collection request
Section name should be placed in String table.
Currently, we used static version for string table
index to update subsequent section names.

Due to this string table index keeps on increasing
during every new dump(subsystem restart) request.
This ultimately will result in buffer overflow,
leading to Redzone overwritten.

Hence, as a fix now reset, this string table
index once dump capture is complete.

Change-Id: Ibc2446ae4011db5291044eacdc1a1119597d862a
Signed-off-by: Jitendra Sharma <shajit@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2020-08-03 10:55:02 -07:00
Neeraj Upadhyay
d7b8ff66af soc: qcom: pil: Do not do complete ramdump for minidump elf32
If minidump is configured to be ELF32, avoid using complete
ramdump property, so that only the required segments area is
dumped.

Change-Id: I34fe359204309fda47d0a665ca641cb042d87054
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2020-07-25 00:23:57 +05:30
qctecmdr
848163af61 Merge "pil: Fix minidump collection during SSR" 2020-07-03 22:59:57 -07:00
Raghavendra Rao Ananta
a0a9abc9fc pil: Fix minidump collection during SSR
By default, the ramdump driver expects the virtual address of the
segments to be set in order to collect the dumps. However, the
minidump collection path in the PIL driver doesn't honor this
requirement. Hence, generate a mapping on the physical address
and use that to collect the minidumps.

Change-Id: Icb7b20dc5f31daab6d1f1be5b7046e4c18dea31a
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-06-24 15:11:15 -07:00
Rishabh Bhatnagar
11af58274d drivers: soc: Add devcoredump based ramdump APIs
Introduce elf/non-elf dump APIs using devcoredump. These APIs
can be utilized by kernel clients to dump their memory regions
independently.

Change-Id: If4f5bcc0d4954b6f47a6893668d6a2a857bb0057
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2020-06-17 11:39:20 -07:00
Raghavendra Rao Ananta
4fcd37a470 soc: qcom: Add snapshot of SSR, PIL, Sysmon, and PDR drivers
Add snapshot for Subsystem Restart (SSR), Peripheral Image
Loader framework (PIL), Secure PIL driver, System Monitor
(sysmon), and Protection Domain Restart (PDR) drivers from
msm-4.19 as of commit <61502d56cb5f9b1> (Merge "drivers:
llcc_perfmon: support for dual memory controller added").

Change-Id: Id06c338121486705dfd716567244650b4dd1742c
[rananta@codeaurora.org: Make changes to make the drivers modular]
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-08-14 12:52:37 -07:00