Re: [GIT PULL] EDAC fix for 5.17

From: Linus Torvalds
Date: Sun Feb 20 2022 - 15:39:38 EST


On Sun, Feb 20, 2022 at 12:25 PM Borislav Petkov <bp@xxxxxxx> wrote:
>
> Yah, where do I start... so, about this, I think I can simplify it by
> simply unconditionally aligning to 8.

Sounds good.

Then you could just do something like

void *ptr = (void *)ALIGN_UP((unsigned long)*p, 8);
*p = ptr + size*n_memb;
return ptr;

and that would be a lot simpler.

> My gut feeling is telling me
> 8-bytes alignment should simply work on everything. Because if it does,
> all that crap becomes a lot simpler. But maybe I'm being too simplistic
> here and there might be a corner-case where 8-bytes alignment just
> doesn't work...

Well, if 8-byte alignment doesn't work, then the existing code (with
the fix) doesn't work either, so..

Linus