From owner-svn-src-all@freebsd.org Tue Feb 9 09:39:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24889AA2B46; Tue, 9 Feb 2016 09:39:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E78B917B5; Tue, 9 Feb 2016 09:39:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u199dUhJ058389; Tue, 9 Feb 2016 09:39:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u199dUnl058388; Tue, 9 Feb 2016 09:39:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201602090939.u199dUnl058388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Feb 2016 09:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295429 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Tue, 09 Feb 2016 09:39:32 -0000 Author: andrew Date: Tue Feb 9 09:39:30 2016 New Revision: 295429 URL: https://svnweb.freebsd.org/changeset/base/295429 Log: Don't set the offset when loading the kernel on the arm loader.efi. The copyin and copyout code handle virtual addresses such that they will take a virtual address and convert it into a valid physical address. It may also mean we fail to boot as the elf files load address could be 0. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/common/load_elf.c Modified: head/sys/boot/common/load_elf.c ============================================================================== --- head/sys/boot/common/load_elf.c Tue Feb 9 09:38:05 2016 (r295428) +++ head/sys/boot/common/load_elf.c Tue Feb 9 09:39:30 2016 (r295429) @@ -353,7 +353,7 @@ __elfN(loadimage)(struct preloaded_file #endif } else off = 0; -#elif defined(__arm__) +#elif defined(__arm__) && !defined(EFI) /* * The elf headers in arm kernels specify virtual addresses in all * header fields, even the ones that should be physical addresses. @@ -364,6 +364,11 @@ __elfN(loadimage)(struct preloaded_file * translates it to a physical address. We do the va->pa conversion on * the entry point address in the header now, so that later we can * launch the kernel by just jumping to that address. + * + * When booting from UEFI the copyin and copyout functions handle + * adjusting the location relative to the first virtual address. + * Because of this there is no need to adjust the offset or entry + * point address as these will both be handled by the efi code. */ off -= ehdr->e_entry & ~PAGE_MASK; ehdr->e_entry += off;