On Tue, Sep 10, 2013 at 06:09:54PM +0300, Konstantin Belousov wrote:
> On Tue, Sep 10, 2013 at 07:29:51AM -0700, Matthew Fleming wrote:
> > I don't know exactly what the stock malloc(9) will return, but memguard(9),
> > under its default mode with vm.memguard.options having MG_GUARD_AROUND set
> > will align the returned pointer to only 16 bytes.  When I added that
> > feature I almost made it 8 bytes, but I think I saw that uma(9) had a
> > 16-byte alignment so I preserved that.  I.e., this code does still work
> > with malloc(9) and memguard(9).
> > 
> > But why does this need 16 byte alignment?  Especially when one of the
> > comments says 4-byte alignment?
> 
> The comment about 4-byte alignment is for VIA.
> 
> For Intel, citing the IA-32 SDM rev. 47, Vol.3, 9.11.6 Microcode Update 
> Loader:
> "The microcode update data requires a 16-byte boundary alignment".
> I.e. CPU takes the linear address of the buffer, which must be aligned
> on 16 bytes.

Sent too fast.  There is at least one more instance of the same use,
see bus_dmamem_alloc() in sys/x86/x86/busdma_machdep.c.

Attachment: pgp_xbvmMXtdw.pgp
Description: PGP signature

Reply via email to