From owner-svn-src-all@freebsd.org Fri May 1 16:56:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FAE62DA324; Fri, 1 May 2020 16:56:37 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49DJLY1GL7z3K00; Fri, 1 May 2020 16:56:37 +0000 (UTC) (envelope-from bdragon@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21115B5E2; Fri, 1 May 2020 16:56:37 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 041Gua1k027265; Fri, 1 May 2020 16:56:36 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 041Gua1w027264; Fri, 1 May 2020 16:56:36 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005011656.041Gua1w027264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 1 May 2020 16:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360537 - head/stand/powerpc/boot1.chrp X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/stand/powerpc/boot1.chrp X-SVN-Commit-Revision: 360537 X-SVN-Commit-Repository: base 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.29 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, 01 May 2020 16:56:37 -0000 Author: bdragon Date: Fri May 1 16:56:36 2020 New Revision: 360537 URL: https://svnweb.freebsd.org/changeset/base/360537 Log: [PowerPC] Set fixed boot1.elf load address Due to the way claiming works, we need to ensure on AIM OFW machines that we don't have overlapping ranges on any step of the load. Load boot1.elf at 0x38000 so it will not overlap with anything even if the entire PReP partition gets loaded by OFW. Tested on an iBook G4, a PowerBook G4, a PowerMac G5, and qemu pseries. (qemu pseries is broken without this patch due to the high address used by lld10.) Reviewed by: adalava Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D24623 Modified: head/stand/powerpc/boot1.chrp/Makefile Modified: head/stand/powerpc/boot1.chrp/Makefile ============================================================================== --- head/stand/powerpc/boot1.chrp/Makefile Fri May 1 16:47:54 2020 (r360536) +++ head/stand/powerpc/boot1.chrp/Makefile Fri May 1 16:56:36 2020 (r360537) @@ -10,7 +10,20 @@ FILES= boot1.hfs SRCS= boot1.c ashldi3.c syncicache.c CFLAGS+=-I${LDRSRC} -LDFLAGS=-nostdlib -static -Wl,-N +# Load boot1.elf below kernel. +# +# Due to limitiations in the way we load stuff, we have to avoid reusing +# memory until the kernel MMU code has taken over. +# +# 0x38000 is high enough to not interfere with the trap area, but low +# enough that it doesn't bump into the kernel area starting at 0x100000, +# even if the entire partition gets used as the load size by a buggy OFW. +# +# In theory 0xf0000 would work too under the current 64k size limit for +# boot1.elf defined in the HFS template, but sometimes boot1.elf is written +# directly to the PReP partition. +# +LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000 .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR}