Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 May 2016 08:59:23 -0700
From:      Adrian Chadd <adrian.chadd@gmail.com>
To:        Allan Jude <allanjude@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>,  "src-committers@freebsd.org" <src-committers@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot
Message-ID:  <CAJ-VmonAeF1AG8kPJE5SY18f=ZEPqCSGY%2Bq-AyDPzwSNUjpjaw@mail.gmail.com>
In-Reply-To: <573F2686.20509@freebsd.org>
References:  <201605200141.u4K1flpV094958@repo.freebsd.org> <1780135.VYYOsNudFi@ralph.baldwin.cx> <573F2686.20509@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Right, but if you hand that malloc() pointer to any BIOS int calls,
it's highly likely it won't work right. :)


-a


On 20 May 2016 at 08:00, Allan Jude <allanjude@freebsd.org> wrote:
> On 2016-05-20 10:48, John Baldwin wrote:
>> On Friday, May 20, 2016 01:41:47 AM Allan Jude wrote:
>>> Author: allanjude
>>> Date: Fri May 20 01:41:47 2016
>>> New Revision: 300257
>>> URL: https://svnweb.freebsd.org/changeset/base/300257
>>>
>>> Log:
>>>   Fixup the geliboot sector rounding code
>>>
>>>   Replace all rounding with the round{up,down}2 macros
>>>   a missing set of braces caused the previous code to be incorrect
>>>
>>>   replace alloca() with malloc() because alloca() can return an allocation
>>>   that is actually invalid, causing boot to fail
>>
>> No, you have to revert the malloc!  malloc() can be anywhere.  The alloca
>> is _on purpose_ to get a bufer below 1MB so that it will work with all
>> devices.  Some BIOSes can only store data in the first 1MB.
>>
>
> to be clear, the alloca() was something I added, not something that was
> there before. And it was breaking, because ZFS was trying to allocate
> too large a block of memory, that wouldn't fit below 1MB.
>
> --
> Allan Jude
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmonAeF1AG8kPJE5SY18f=ZEPqCSGY%2Bq-AyDPzwSNUjpjaw>