RE: [PATCH 2/5] efi: Introduce a Runtime Services lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +#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-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux