Subject: Re: UBC problems
To: Matthias Drochner <M.Drochner@fz-juelich.de>
From: Chuck Silvers <chuq@chuq.com>
List: port-alpha
Date: 01/15/2005 07:19:08
hi,

On Fri, Jan 14, 2005 at 10:59:59PM +0100, Matthias Drochner wrote:
> 
> just two comments:
> 
> -I can easily reproduce the problem with a simple patch to
>  copyin() on i386, a patch which models the prefetch needed
>  by architectures which don't like unaligned memory accesses.
>  I'll append it. WARNING: it might cause data corruption.
>  So I'd say this is not alpha specific; it is just a question
>  of copyout() implementation. (btw, i386 might benefit from
>  using an optimized memcpy() within copyin()/copyout())

alpha is the only platform I know of that can't access individual bytes.
I would say that any copyin() that reads from the kernel side that doesn't
have to is broken, so it's only an issue on alpha.


> -I now believe that the best way to deal with this would be to
>  have UBC reads just return zero filled pages if the file is
>  not backed with real data, and let upper layers (above the
>  trap handler) check whether the read is legal. Just commenting
>  out the range check in genfs_getpages() isn't enough,
>  unfortunately. That's a pretty complex matter...

creating pages for offsets past EOF is to be avoided in general, since
it's pretty nonsensical.  I checked in a different fix for this issue,
update uvm_bio.c.

thanks for investigating this.

-Chuck