Messages in this thread | | | Date | Wed, 09 Nov 2011 14:18:27 -0800 | From | "H. Peter Anvin" <> | Subject | Re: /dev/mem "unbounded?" |
| |
On 11/09/2011 01:01 PM, Andrei Warkentin wrote: > Dear LKML, > > In the previous kernels, valid_phys_addr_range was not > defined for x86, and used the static variant which > returned 0 if access went above __pa(high_memory). > > Current behavior, though, relies on the x86 variant > of valid_phys_addr_range, defined in arch/x86/include/asm/io.h, > that always returns 1, hence, reading will never end since there > won't be any condition (barring an MCE on physical hardware) that > would say "Bad Address". Is this supposed to be by design? > > How about exposing the "top" allocated resource address from > linux/kernel/resource.c? That way /dev/mem will know when > all the "interesting" bits end, and can return -EFAULT for > everything above that. >
That would be incorrect behavior, though, except perhaps for the range that cannot be addressed by the processor. It is explicitly permitted to address ranges that does not have addresses mapped to it.
-EFAULT would also be wrong. If anything it should be -EIO.
-hpa
| |