linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	sylvain.chouleur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v2 3/3] efi: replace runtime services spinlock with semaphore
Date: Fri, 15 Jul 2016 15:49:29 +0100	[thread overview]
Message-ID: <20160715144929.GC2406@codeblueprint.co.uk> (raw)
In-Reply-To: <1468249165-25523-4-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Mon, 11 Jul, at 04:59:25PM, Ard Biesheuvel wrote:
> The purpose of the efi_runtime_lock is to prevent concurrent calls into
> the firmware. There is no need to use spinlocks here, as long as we ensure
> that runtime service invocations from an atomic context (i.e., EFI pstore)
> cannot block.
> 
> So use a semaphore instead, and use down_trylock() in the nonblocking case.
> We don't use a mutex here because the mutex_trylock() function must not
> be called from interrupt context, whereas the down_trylock() can.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> --
> v2: rebased onto v4.7-rc3
>     handle EFI_ABORT in efi_status_to_err()
> ---
>  drivers/firmware/efi/efi.c              |  3 +
>  drivers/firmware/efi/runtime-wrappers.c | 81 ++++++++++++--------
>  include/linux/efi.h                     |  1 +
>  3 files changed, 53 insertions(+), 32 deletions(-)

This one looks good too.

      parent reply	other threads:[~2016-07-15 14:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 14:59 [PATCH v2 0/3] efi interruptible runtime services Ard Biesheuvel
     [not found] ` <1468249165-25523-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-11 14:59   ` [PATCH v2 1/3] efi: use a file local lock for efivars Ard Biesheuvel
     [not found]     ` <1468249165-25523-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-15 14:04       ` Matt Fleming
2016-07-11 14:59   ` [PATCH v2 2/3] efi: don't use spinlocks for efi vars Ard Biesheuvel
     [not found]     ` <1468249165-25523-3-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-15 14:44       ` Matt Fleming
2016-07-11 14:59   ` [PATCH v2 3/3] efi: replace runtime services spinlock with semaphore Ard Biesheuvel
     [not found]     ` <1468249165-25523-4-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-15 14:49       ` Matt Fleming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160715144929.GC2406@codeblueprint.co.uk \
    --to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=sylvain.chouleur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).