lkml.org 
[lkml]   [2014]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 4/6] x86-mce: Add spinlocks to prevent duplicated MCP and CMCI reports.
From
On Thu, Jul 10, 2014 at 11:44 AM, Borislav Petkov <bp@alien8.de> wrote:
> if (atomic_dec_and_test(&mce_banks[i].poll))
> m.status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));
>
> atomic_add_unless(&mce_banks[i].poll, 1, 1);
>
> so that you have only one CPU read the status register of mce_banks[i].
>
> For non-shared banks, this will always work because no other CPU will
> dec that variable anyway.

You don't know if the bank is shared or not. If it is not shared, then the
above code might skip reading the bank because some other cpu is busy
reading that bank number - and seeing its own private bank.

-Tony


\
 
 \ /
  Last update: 2014-07-10 22:01    [W:0.124 / U:7.712 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site