Skip to content

Commit

Permalink
pstore/ram: Use memcpy_toio instead of memcpy
Browse files Browse the repository at this point in the history
persistent_ram_update uses vmap / iomap based on whether the buffer is in
memory region or reserved region. However, both map it as non-cacheable
memory. For armv8 specifically, non-cacheable mapping requests use a
memory type that has to be accessed aligned to the request size. memcpy()
doesn't guarantee that.

Signed-off-by: Furquan Shaikh <[email protected]>
Signed-off-by: Enric Balletbo Serra <[email protected]>
Reviewed-by: Aaron Durbin <[email protected]>
Reviewed-by: Olof Johansson <[email protected]>
Tested-by: Furquan Shaikh <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Cc: [email protected]
  • Loading branch information
furquan-goog authored and kees committed Sep 8, 2016
1 parent 5bf6d1b commit 7e75678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/pstore/ram_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static void notrace persistent_ram_update(struct persistent_ram_zone *prz,
const void *s, unsigned int start, unsigned int count)
{
struct persistent_ram_buffer *buffer = prz->buffer;
memcpy(buffer->data + start, s, count);
memcpy_toio(buffer->data + start, s, count);
persistent_ram_update_ecc(prz, start, count);
}

Expand Down

0 comments on commit 7e75678

Please sign in to comment.