svn commit: r356693 - in head/stand: efi/libefi i386/libi386 libofw uboot/lib

Toomas Soome tsoome at me.com
Mon Jan 13 19:54:43 UTC 2020



> On 13. Jan 2020, at 20:45, Ian Lepore <ian at freebsd.org> wrote:
> 
> On Mon, 2020-01-13 at 20:43 +0200, Toomas Soome wrote:
>>> On 13. Jan 2020, at 20:31, Ian Lepore <ian at freebsd.org> wrote:
>>> 
>>> On Mon, 2020-01-13 at 18:22 +0000, Toomas Soome wrote:
>>>> Author: tsoome
>>>> Date: Mon Jan 13 18:22:54 2020
>>>> New Revision: 356693
>>>> URL: https://svnweb.freebsd.org/changeset/base/356693
>>>> 
>>>> Log:
>>>> loader: allocate properly aligned buffer for network packet
>>>> 
>>>> Use memalign(4, size) to ensure we have properly aligned buffer.
>>>> 
>>>> MFC after:	2 weeks
>>>> 
>>>> Modified:
>>>> head/stand/efi/libefi/efinet.c
>>>> head/stand/i386/libi386/pxe.c
>>>> head/stand/libofw/ofw_net.c
>>>> head/stand/uboot/lib/net.c
>>>> 
>>> 
>>> The malloc implementation in libstand already g'tees minimum
>>> alignment
>>> of 16 bytes on most arches, 64 bytes on arches that use u-boot (see
>>> libsa/zalloc_defs.h).  So how does this change anything?
>>> 
>> 
>> Hi!
>> 
>> Well, given the amount of knobs etc, it does not hurt to be explicit,
>> does it?
>> 
>> rgds,
>> toomas
> 
> I think it does hurt, because now it misleads you into thinking it's 4-
> byte aligned when it's actually 16 or 64.  (That's what made me reply
> at all, my first gut reaction to reading the commit message was "but 4
> is not at all the right alignment on many platforms").
> 

hm, I think you are right. time for backout.

thanks for bringing this into my attention,
toomas





More information about the svn-src-all mailing list