lkml.org 
[lkml]   [2013]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 2/5] efi: Introduce a Runtime Services lock
Date
> +#define efi_call_reset_virt(f, args...)					\
> +({ \
> + unsigned long __flags; \
> + bool __nmi = in_nmi(); \
> + \
> + if (__nmi) \
> + spin_lock_irqsave(&efi_runtime_lock, __flags); \

If the lock is not held in the nmi context, runtime service may run concurrently
in non-nmi context as follows.
- In nmi context, cpu0 calls a runtime service (no lock is held.)
- In non-nmi context, cpu1 call can take the lock and call the runtime service.

To avoid this, using try_lock in nmi context is better..

If(in_nmi())
try_spin_lock_irqsave();
else
spin_lock_irqsave();

Please see the commit abd4d5587be911f63592537284dad78766d97d62,
which is introduced to pstore by Don Zickus.

Seiji





\
 
 \ /
  Last update: 2013-10-17 02:01    [W:0.078 / U:2.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site