Re: [PATCH] commands: mem: truncate mem device size to fit the loff_t file size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Mittwoch, den 07.11.2018, 16:45 +0300 schrieb Peter Mamonov:
> Hi, Lucas,
> 
> On Tue, Nov 06, 2018 at 05:14:07PM +0100, Lucas Stach wrote:
> > On 64bit arches the file covering the whole address space is larger than
> > what can be represented in the loff_t type (s64) used for the file size.
> > Thus the size of this device is interpreted as negative in a lot of
> > places. Fix this by truncating the size to fit the file size type.
> 
> While this is probably an appropriate solution for some architectures, it will 
> cause problems on MIPS64. The root of evil is MIPS64 address space 
> segmentation: https://docplayer.net/docs-images/25/4553906/images/21-0.png).  
> Most notably your patch prevents access to the xkphys segment, where most 
> peripheral devices of a SoC are accessible.

Isn't this a problem for MIPS64 even before my patch? For example the
"mw" command uses open_and_lseek on the dev/mem file with the address
of the write being the seek offset. As this is a loff_t value, seeking
to something with the highest order bit set won't do what you expect to
happen, right?

Regards,
Lucas

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux