Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1E6cso-0004RH-HA for mharc-grub-devel@gnu.org; Sat, 20 Aug 2005 19:36:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E6csl-0004Qn-Tp for grub-devel@gnu.org; Sat, 20 Aug 2005 19:36:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E6csN-0004OZ-QI for grub-devel@gnu.org; Sat, 20 Aug 2005 19:36:02 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E6csK-0004Ju-A2 for grub-devel@gnu.org; Sat, 20 Aug 2005 19:35:44 -0400 Received: from [66.163.179.98] (helo=web35304.mail.mud.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1E6cii-0006Oc-A6 for grub-devel@gnu.org; Sat, 20 Aug 2005 19:25:48 -0400 Received: (qmail 78286 invoked by uid 60001); 20 Aug 2005 23:25:32 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=3GO250h334uRp+R0aaNKUM6zk+dMmIkcp9PHaL/NPfp01kgvWIsEGKX33aeJNve70e2XnkbAPskEKPdF2sY8E5KW17eggat0vGsL+IZJ634KCH7whEpNt2LJc/8WpxOJnFQ4J5LOIOz7VAOmUxzx4w0HCsVFkAaG1gc8YpkFN9Y= ; Message-ID: <20050820232532.78284.qmail@web35304.mail.mud.yahoo.com> Received: from [84.53.202.16] by web35304.mail.mud.yahoo.com via HTTP; Sat, 20 Aug 2005 16:25:32 PDT Date: Sat, 20 Aug 2005 16:25:32 -0700 (PDT) From: Ruslan Nikolaev To: grub-devel@gnu.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-625401819-1124580332=:72999" Content-Transfer-Encoding: 8bit Subject: x86_64 imporatant information X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2005 23:36:12 -0000 --0-625401819-1124580332=:72999 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In my previous post I forgot to say about the most imporatant reason to use negative addresses. Take a look on the following information: --------------------------------- /usr/src/linux/vmlinux: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00368c04 ffffffff80100000 ffffffff80100000 00100000 2**6 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 __ex_table 00005470 ffffffff80468c10 ffffffff80468c10 00468c10 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .rodata 000582ea ffffffff8046e080 ffffffff8046e080 0046e080 2**5 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .pci_fixup 000007b0 ffffffff804c6370 ffffffff804c6370 004c6370 2**4 CONTENTS, ALLOC, LOAD, DATA ... ---------------------- It seems that VMA and LMA addresses are the same for Linux ELF under x86_64. I never interested such information for x86 and don't know how it will be for x86. I think it's just because we need to use special memory model "-mcmodel=kernel" that's designed especially for kernel. Does we have problems when LMA != VMA and using this memory model? I can't find such information... From x86_64 ABI: ------------------------ The AMD64 architecture usually does not allow to encode arbitrary 64-bit constants as immediate operand of the instruction. Most instructions accept 32-bit immediates that are sign extended to the 64-bit ones. Additionally the 32-bit operations with register destinations implicitly perform zero extension making loads of 64-bit immediates with upper half set to 0 even cheaper. Additionally the branch instructions accept 32-bit immediate operands that are sign extended and used to adjust instruction pointer. Similarly an instruction pointer relative addressing mode exists for data accesses with equivalent limitations. --------------------------------- Start your day with Yahoo! - make it your home page --0-625401819-1124580332=:72999 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
In my previous post I forgot to say about the most imporatant reason to use negative addresses.
 
Take a look on the following information:
 
---------------------------------
/usr/src/linux/vmlinux:     file format elf64-x86-64
Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00368c04  ffffffff80100000  ffffffff80100000  00100000  2**6
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 __ex_table    00005470  ffffffff80468c10  ffffffff80468c10  00468c10  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .rodata       000582ea  ffffffff8046e080  ffffffff8046e080  0046e080  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .pci_fixup    000007b0  ffffffff804c6370  ffffffff804c6370  004c6370  2**4
                  CONTENTS, ALLOC, LOAD, DATA
...
----------------------
 
It seems that VMA and LMA addresses are the same for Linux ELF under x86_64. I never interested such information for x86 and don't know how it will be for x86.
 
I think it's just because we need to use special memory model "-mcmodel=kernel" that's designed especially for kernel. Does we have problems when LMA != VMA and using this memory model? I can't find such information...
 
From x86_64 ABI:
------------------------

The AMD64 architecture usually does not allow to encode arbitrary 64-bit constants

as immediate operand of the instruction. Most instructions accept 32-bit

immediates that are sign extended to the 64-bit ones. Additionally the 32-bit operations

with register destinations implicitly perform zero extension making loads

of 64-bit immediates with upper half set to 0 even cheaper.

Additionally the branch instructions accept 32-bit immediate operands that

are sign extended and used to adjust instruction pointer. Similarly an instruction

pointer relative addressing mode exists for data accesses with equivalent limitations.


Start your day with Yahoo! - make it your home page --0-625401819-1124580332=:72999--