lkml.org 
[lkml]   [2019]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 02/24] EDAC, ghes: Fix grain calculation
Date
On 12.08.19 09:32:22, Borislav Petkov wrote:
> On Mon, Aug 12, 2019 at 06:42:00AM +0000, Robert Richter wrote:

> > With the grain_bits calculation the mask is rounded up to the next
> > power of 2 value.
>
> mask = 0xffffffffff00ff00

grain = ~mask + 1

> ~mask = 0x0000000000ff00ff
> ~mask + 1 = 0x0000000000ff0100

grain_bits = fls_long(e->grain - 1);
grain_bits = 24

grain = 1 << grain_bits
grain = 0x1000000

So for masks in the range from 0xffffffffff000000 to
0xffffffffff7fffff we have grain_bits set to 24, which corresponds to
a grain of 0x1000000. Looks good to me.

>
> Your "trick" of adding a 1 to get to the most significant bit simply
> doesn't work here. Thus:
>
> "I guess we can leave it like that for now until some "inventive"
> firmware actually does it."

Fine to me.

-Robert

\
 
 \ /
  Last update: 2019-08-12 14:07    [W:0.506 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site