From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aUM1C-0005Ux-8K for mharc-grub-devel@gnu.org; Fri, 12 Feb 2016 17:16:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUM19-0005Tc-Sl for grub-devel@gnu.org; Fri, 12 Feb 2016 17:16:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUM18-0002pb-UF for grub-devel@gnu.org; Fri, 12 Feb 2016 17:16:47 -0500 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUM18-0002pA-Ip for grub-devel@gnu.org; Fri, 12 Feb 2016 17:16:46 -0500 Received: by mail-wm0-x22f.google.com with SMTP id p63so39618586wmp.1 for ; Fri, 12 Feb 2016 14:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=fEdtnT1G2xKgmlh5Iswsbm21lqzZDGq2/uMV1y1utik=; b=s3vO9Qtv6dMf3sWMWeBB2zWMRyIfmyVqJBhqavnFjKuTamErq0YUG4Puajz6iDlimF 5BP1vOgN8TxfpG3vYANU5WKoJ6Y6oTrpDF574gNtY65gQNqBtfIRxwboRByBZKfeaVQ/ nuq742FYNAK3kNop9u1br7oWueTBAzqJQXkhQjGOZZ/BKs86BmNaV+svgixunXZKFOdm PEiIgPFr04TgaFSbf5ccU2KqIaK3+GdTv/ZOZdBOpB8zn0O3hT3ga5mzRW+mUrPp+r4m ZcdBCXGAEeHsUzzq4rzNS/jNV+57vg3hz4Aq8bWrbGtPtLnuTYEuYmvr4mUu7AtjDPjo CFhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=fEdtnT1G2xKgmlh5Iswsbm21lqzZDGq2/uMV1y1utik=; b=EgwyQxeVUPnU3qk84/vLss+Um6szrHEtPsm7ygq3Ctjd5FCU6AbZjnFlfRgKLz4SKO GuB0H064gc3ZInW/qmcC4/7gZbcX2tUF4Su29iX0KF7sBBfBqwE5Rc4tnV7BQRhKe+ap 4XUAa5F4SbIRKMc1QEahnqAsNTgzcinh+ZJ7crF2ksA+18hJ3BcqKFhnithi5ZpWwDBE YfYhgtFCxBvOKtdB9NZ1tQWD24VKemPaP04KZEIMCLoMz8QG/+4iDwE4naSwgJseVjVC hMZTxzDmRBI+HF/Vokr25e6+cOhH9on+qvwlvQymr9q7lc95gC1c/mPWOFCBDacvtq2O VMRQ== X-Gm-Message-State: AG10YOREHFBkZHioemrzVzre0ZvxJSw7BLnonFGwHAgwG63fWOmKeihVYuNbLBhk3PqtWg== X-Received: by 10.194.109.232 with SMTP id hv8mr3858667wjb.161.1455315405811; Fri, 12 Feb 2016 14:16:45 -0800 (PST) Received: from ?IPv6:2a02:120b:2c41:63f0:a2a8:cdff:fe64:b3b5? ([2a02:120b:2c41:63f0:a2a8:cdff:fe64:b3b5]) by smtp.gmail.com with ESMTPSA id n9sm13604551wjy.5.2016.02.12.14.16.44 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 14:16:44 -0800 (PST) Subject: Re: [PATCH] sparc64: OBP available region contains grub. Start at grub_phys_end To: grub-devel@gnu.org References: <1455312923-166743-1-git-send-email-eric.snowberg@oracle.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <56BE59C6.9050005@gmail.com> Date: Fri, 12 Feb 2016 23:16:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1455312923-166743-1-git-send-email-eric.snowberg@oracle.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HmOTErxpVpTuev7UUJNscJvoVDHt0QLK5" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 22:16:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HmOTErxpVpTuev7UUJNscJvoVDHt0QLK5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Committed, thanks On 12.02.2016 22:35, Eric Snowberg wrote: > OBP available region contains grub. Start at grub_phys_end. >=20 > This prevents a problem where grub was being overwritten since > grub_phys_start does not start at a zero offset within the memory > map. >=20 > Signed-off-by: Eric Snowberg > --- > grub-core/loader/sparc64/ieee1275/linux.c | 16 ++++++++-------- > 1 files changed, 8 insertions(+), 8 deletions(-) >=20 > diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/load= er/sparc64/ieee1275/linux.c > index d44d7a1..67ef048 100644 > --- a/grub-core/loader/sparc64/ieee1275/linux.c > +++ b/grub-core/loader/sparc64/ieee1275/linux.c > @@ -203,20 +203,20 @@ alloc_phys_choose (grub_uint64_t addr, grub_uint6= 4_t len, > if (addr + ctx->size >=3D end) > return 0; > =20 > - if (addr >=3D grub_phys_start && addr < grub_phys_end) > - { > - addr =3D ALIGN_UP (grub_phys_end, FOUR_MB); > - if (addr + ctx->size >=3D end) > - return 0; > - } > - if ((addr + ctx->size) >=3D grub_phys_start > - && (addr + ctx->size) < grub_phys_end) > + /* OBP available region contains grub. Start at grub_phys_end. */ > + /* grub_phys_start does not start at the beginning of the memory reg= ion */ > + if ((grub_phys_start >=3D addr && grub_phys_end < end) || > + (addr > grub_phys_start && addr < grub_phys_end)) > { > addr =3D ALIGN_UP (grub_phys_end, FOUR_MB); > if (addr + ctx->size >=3D end) > return 0; > } > =20 > + grub_dprintf("loader", > + "addr =3D 0x%lx grub_phys_start =3D 0x%lx grub_phys_end =3D 0x%lx\= n", > + addr, grub_phys_start, grub_phys_end); > + > if (loaded) > { > grub_addr_t linux_end =3D ALIGN_UP (linux_paddr + linux_size, FO= UR_MB); >=20 --HmOTErxpVpTuev7UUJNscJvoVDHt0QLK5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAla+WcYACgkQmBXlbbo5nOtNfQD/WTUBR64UhUtbSKeBoucY/GAH fps0v1Su27mVaQBF33YA/30asMQLTn78wqeeI05vRdoFVJGweNn8Z5nsaXiNPSfa =e1gT -----END PGP SIGNATURE----- --HmOTErxpVpTuev7UUJNscJvoVDHt0QLK5--