From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 15:15:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CD4FEAC; Fri, 16 Jan 2015 15:15:31 +0000 (UTC) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBA1E51; Fri, 16 Jan 2015 15:15:31 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id hi2so4503051wib.2; Fri, 16 Jan 2015 07:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=uR/IE2/WUSG0vgXh6UQJJfpgQYkL9JjSsfvdlH8eRe4=; b=PWcs9/CJy9HiwRM+n01wI+O7C3TOhnswz12ZreSsVkImOdPj74Lon8Pix4P/gPj/6j EcWPJt292szzzMj91ERU7JQIHaVJi9bIzvv2eJYBu3t7blQGeUB+8b9zDr7X/bYb8pn/ Z8vXh7jE/Gn+4Z/XVlsWVeipo3YZgLUmeLa4UcPNbZ12/kfs9slXc/+9yGUVi74nfYkj SeW+gNi/W0xSqLy4hTO5FTk7PUGf86LSYGRq9HZwv7I08lvF/GXFH1rD992CnPJPcNYU m/L4N8jIi3BoSdJknAqRMRHm8XA9CP0mGSgeI8a1/Drvm1YHj6ahZ/UoNZSIFY1GFdHb XPkw== X-Received: by 10.180.104.9 with SMTP id ga9mr7332034wib.9.1421421329196; Fri, 16 Jan 2015 07:15:29 -0800 (PST) Received: from [172.16.1.30] (243.Red-2-137-76.dynamicIP.rima-tde.net. [2.137.76.243]) by mx.google.com with ESMTPSA id l6sm6432104wjx.33.2015.01.16.07.15.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 07:15:28 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <54B92B0A.1020108@FreeBSD.org> Date: Fri, 16 Jan 2015 16:15:22 +0100 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r277215 - in head/sys: amd64/include boot/common boot/fdt boot/forth boot/i386/libi386 boot/i386/loader i386/include x86/xen References: <201501151627.t0FGRLY2062439@svn.freebsd.org> <1421362982.14601.280.camel@freebsd.org> In-Reply-To: <1421362982.14601.280.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2015 15:15:31 -0000 El 16/01/15 a les 0.03, Ian Lepore ha escrit: > On Thu, 2015-01-15 at 16:27 +0000, Roger Pau Monné wrote: >> Author: royger >> Date: Thu Jan 15 16:27:20 2015 >> New Revision: 277215 >> URL: https://svnweb.freebsd.org/changeset/base/277215 >> >> Log: >> loader: implement multiboot support for Xen Dom0 >> [...] >> >> Added: >> head/sys/boot/i386/libi386/multiboot.c (contents, props changed) >> head/sys/boot/i386/libi386/multiboot.h (contents, props changed) >> head/sys/boot/i386/libi386/multiboot_tramp.S (contents, props changed) >> Modified: >> head/sys/amd64/include/metadata.h >> head/sys/boot/common/bootstrap.h >> head/sys/boot/common/load_elf.c >> head/sys/boot/common/load_elf_obj.c >> head/sys/boot/common/module.c >> head/sys/boot/fdt/fdt_loader_cmd.c >> head/sys/boot/forth/beastie.4th >> head/sys/boot/forth/loader.4th >> head/sys/boot/forth/support.4th >> head/sys/boot/i386/libi386/Makefile >> head/sys/boot/i386/libi386/bootinfo64.c >> head/sys/boot/i386/libi386/elf64_freebsd.c >> head/sys/boot/i386/libi386/libi386.h >> head/sys/boot/i386/loader/conf.c >> head/sys/i386/include/metadata.h >> head/sys/x86/xen/pv.c > > Something about this change breaks ubldr on arm (it works @ r277214). > Now on an RPi I get this: > > /boot/kernel/kernel data=0x4cf8a4+0x3475c syms=[0x4+0x91650+0x4+0x53354] > panic: Address offset 0x40000000 bigger than size 0x1E000000 > > There is a single physical extent of ram from 0-0x1e000000. Sorry for this, the above patch solved the problem for me. I'm currently running a tinderbox with it to make sure nothing else breaks, but the fix is quite straightforward. --- diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index 6860815..4c801e9 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -77,7 +77,7 @@ static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p, void *val, size_t len); static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, - u_int64_t p_start, u_int64_t p_end); + Elf_Addr p_start, Elf_Addr p_end); static symaddr_fn __elfN(symaddr); static char *fake_modname(const char *name); @@ -300,7 +300,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) Elf_Size size; u_int fpcopy; Elf_Sym sym; - u_int64_t p_start, p_end; + Elf_Addr p_start, p_end; dp = NULL; shdr = NULL; @@ -712,7 +712,7 @@ __elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest) Elf_Shdr *sh_data[2]; char *shstrtab = NULL; size_t size; - u_int64_t p_start, p_end; + Elf_Addr p_start, p_end; bzero(&ef, sizeof(struct elf_file)); ef.fd = -1; @@ -820,7 +820,7 @@ out: int __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef, - u_int64_t p_start, u_int64_t p_end) + Elf_Addr p_start, Elf_Addr p_end) { struct mod_metadata md; #if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64