From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: negative seek offsets in VFS Date: 26 May 2005 21:23:32 +0200 Message-ID: <20050526192332.GW86087@muc.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paul Taysom , linux-fsdevel@vger.kernel.org, viro@www.linux.org.uk Return-path: Received: from colin.muc.de ([193.149.48.1]:41222 "EHLO mail.muc.de") by vger.kernel.org with ESMTP id S261704AbVEZTXg (ORCPT ); Thu, 26 May 2005 15:23:36 -0400 Date: Thu, 26 May 2005 21:23:32 +0200 To: Bryan Henderson Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, May 26, 2005 at 10:49:57AM -0700, Bryan Henderson wrote: > >The addresses returned from /proc/kallsyms on the x86_64 are negative and > when > >I print the address of a kernel variable with "%p" it comes out negative. > > Wow. So can someone explain this? Does the x86_64 architecture actually > have a concept of negative addresses? Yes, it has. It has a 48bit address space, and the 48th bit is sign extended to 64bits. So you have a big hole in the middle and positive and negative address spaces. The kernel uses the negative half, user space the positive half. > > Ordinarily, I'd think this was a bug if I saw it, but I don't see how %p > could format a minus sign without it being deliberate. It doesnt, but they are still negative. > In any case, I know POSIX doesn't have a concept of a negative absolute > file offset, so a kmem device cannot represent a negative address as a > negative file offset. A negative loff_t means something else. I dont think POSIX has anything to say about /dev/kmem. -Andi >