From: "Christian Limpach" Subject: Re: [PATCH, updated] i386 linux: eliminate hard coded items from __xen_guest section Date: Mon, 20 Feb 2006 16:04:35 +0000 Message-ID: <3d8eece20602200804y7f00ed55s40706f768fd99ae2@mail.gmail.com> References: <43F35CB6.76F0.0078.0@novell.com> <43F5B633.76F0.0078.0@novell.com> Reply-To: Christian.Limpach@cl.cam.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <43F5B633.76F0.0078.0@novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 2/17/06, Jan Beulich wrote: > To allow the new VMSPLIT_* Kconfig options to work, and to avoid problems= when the position of the hypercall page > changes, this patch eliminates the hard-coded entries in the __xen_guest = section in head.S. > Unfortunately the original version didn't work with gas newer than beginn= ing of August 2005, where in an attempt to fix > another problem a regression was introduced. The calculation doesn't seem to work on 32-bit for PAGE_OFFSET >=3D 2^31, at least not with: cl349@firebug:~/ls/xen-unstable-clean.hg$ as --version GNU assembler 2.15.92.0.2 20040927 I'll checkin the following: .macro bigutoa value utoa (\value) >> 12 .ascii "000" .endm .macro utoa value .if (\value) >=3D 16 =09utoa (\value) >> 4 .endif .if (\value) % 16 < 10 .byte '0' + (\value) % 16 .else .byte 'A' + (\value) % 16 - 10 .endif .endm .section __xen_guest =09.ascii=09"GUEST_OS=3Dlinux,GUEST_VER=3D2.6" =09.ascii=09",XEN_VER=3Dxen-3.0" =09.ascii=09",VIRT_BASE=3D0x"; bigutoa __PAGE_OFFSET =09.ascii=09",HYPERCALL_PAGE=3D0x"; utoa ((__PHYSICAL_START+HYPERCALL_PAGE_OFFSET)>>PAGE_SHIFT) It's a bit gross, maybe there's a neater solution. christian