lkml.org 
[lkml]   [2017]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [lkp-robot] [x86/kconfig] 81d3871900: BUG:unable_to_handle_kernel
On Tue, Oct 17, 2017 at 3:33 AM, Joonsoo Kim <iamjoonsoo.kim@lge.com> wrote:
>
> It looks like a compiler bug. The code of slob_units() try to read two
> bytes at ffff88001c4afffe. It's valid. But the compiler generates
> wrong code that try to read four bytes.
>
> static slobidx_t slob_units(slob_t *s)
> {
> if (s->units > 0)
> return s->units;
> return 1;
> }
>
> s->units is defined as two bytes in this setup.
>
> Wrongly generated code for this part.
>
> 'mov 0x0(%rbp), %ebp'
>
> %ebp is four bytes.
>
> I guess that this wrong four bytes read cross over the valid memory
> boundary and this issue happend.

Hmm. I can see why the compiler would do that (16-bit accesses are
slow), but it's definitely wrong.

Does it work ok if that slob_units() code is written as

static slobidx_t slob_units(slob_t *s)
{
int units = READ_ONCE(s->units);

if (units > 0)
return units;
return 1;
}

which might be an acceptable workaround for now?

Linus

\
 
 \ /
  Last update: 2017-10-22 17:12    [W:0.218 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site