Den 2013-08-16 21:44, skrev Richard Weinberger:
> +long probe_kernel_read(void *dst, const void *src, size_t size)
> +{
> + void *psrc = (void *)rounddown((u64)src, PAGE_SIZE);
Should not size be increased if psrc is moved down?
Example:
src = 0x0; // pointed to the very end of a page
On Sat, Aug 17, 2013 at 9:44 AM, wrote:
> Den 2013-08-16 21:44, skrev Richard Weinberger:
>> +long probe_kernel_read(void *dst, const void *src, size_t size)
>> +{
>> + void *psrc = (void *)rounddown((u64)src, PAGE_SIZE);
> Should not size be increased if psrc is moved down?
>
> Example:
>
UML needs it's own probe_kernel_read() to handle kernel
mode faults correctly.
The implementation uses mincore() on the host side to detect
whether a page is owned by the UML kernel process.
This fixes also a possible crash when sysrq-t is used.
Starting with 3.10 sysrq-t calls probe_kernel_read()
UML's block device driver does not support write barriers,
to support this this patch adds REQ_FLUSH suppport.
Every time the block layer sends a REQ_FLUSH we fsync() now
our backing file to guarantee data consistency.
Cc: rjo...@redhat.com
Signed-off-by: Richard Weinberger
---
arch/um/drivers/u