Files with negative offsets
Posted Jun 7, 2005 7:31 UTC (Tue) by farnz
In reply to: Files with negative offsets
Parent article: Files with negative offsets
Which CPUs currently have a 64-bit virtual address space? To the best of
my knowledge, all AMD64 CPUs to date have a 48-bit virtual address space.
Two files is dangerous in terms of future compatibility, as AMD64
sign-extends addresses; thus, at the moment, I can read from
0xffffxxxxxxxx, where x is any hex digit, and get kernel addresses. In
future, this becomes a userspace address (when the virtual space is
extended to 49 or more bits), and my code suddenly breaks on me.
Linus's current solution works fine for as long as AMD64 processors
have (or use) no more than 52-bits of virtual address space. I think the
only long terms solution is to switch to 128-bit offset types, but that's
going to be painful.
to post comments)