[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A5ED84D3BB3A384992CBB9C77DEDA4D443EF85DC@USINDEM103.corp.hds.com>
Date: Wed, 16 Oct 2013 23:36:54 +0000
From: Seiji Aguchi <seiji.aguchi@....com>
To: Matt Fleming <matt@...sole-pimps.org>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
"x86@...nel.org" <x86@...nel.org>,
Matt Fleming <matt.fleming@...el.com>,
Leif Lindholm <leif.lindholm@...aro.org>
Subject: RE: [PATCH 2/5] efi: Introduce a Runtime Services lock
> +#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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists