diff options
author | Christoffer Dall <christoffer.dall@linaro.org> | 2016-01-06 17:05:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-29 10:34:36 +0300 |
commit | 2f3be88237a301ab83b8ba4a0fdf0381bbb3f6ac (patch) | |
tree | 29b820efbe18f7c7cf0916e6de0d535c798f0cd0 /Documentation/devicetree/bindings/goldfish | |
parent | 23c5ee21c46ba694681e2378e64a475b5c68f02c (diff) | |
download | linux-2f3be88237a301ab83b8ba4a0fdf0381bbb3f6ac.tar.xz |
goldfish_pipe: Pin pages to memory while copying and other cleanups
The existing code had a troubling TODO statement concerning the fact
that it just did a check if the page that the QEMU backend was going to
read from / write to was there before the call to the QEMU backend and
then relying on the fact that the page stayed around, even in a
preemptible SMP kernel. Obviously the page could go away or be
reassigned, and strange things may happen.
Further, writes were not tracked, so any use of COW or KSM-like
features would break completely. Probably that was never used by adbd
(the only current active user of the pipe), but could prove much more
dangerous for the GPU passthrough mechanism.
Instead, use get_user_pages() as the comment suggested and cleanup the
error path and add the set_page_dirt() call on a successful read
operation.
Also clarify the count used to return from successful read/write calls
and use Linux style commentary in various places of the file.
Note: The "just ignore error and return whatever we read so far" error
handling is really quite horrific. I cannot change it without a more
careful study of all user space ABIs reliance on this 'feature'.
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/devicetree/bindings/goldfish')
0 files changed, 0 insertions, 0 deletions