linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: matt@console-pimps.org (Matt Fleming)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] efi: implement mandatory locking for UEFI Runtime Services
Date: Thu, 10 Jul 2014 19:14:49 +0100	[thread overview]
Message-ID: <20140710181449.GI15932@console-pimps.org> (raw)
In-Reply-To: <CAKv+Gu86W0hBEZhz_Aw07TmRHv8kgQN7JeRMC0Qs6FL0m6BrOQ@mail.gmail.com>

On Tue, 08 Jul, at 01:23:55PM, Ard Biesheuvel wrote:
> On 8 July 2014 13:21, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > According to section 7.1 of the UEFI spec, Runtime Services are not fully
> > reentrant, and there are particular combinations of calls that need to be
> > serialized.
> >
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > ---
> >
> > So this is v2 of the UEFI Runtime Services serialization patch: this time, I use
> > a single spinlock rather than a set of mutexes, resulting in all services to be
> > serialized with respect to all others. Also added handling of NMI state, as this
> > results in some of the restrictions being lifted (x86, ia64 only)
> >
> > One question remains: with the NMI deadlock handling in place, is it really
> > necessary to disable interrupts in all cases?
> >
> 
> I omitted this hunk from the patch by accident:

I'm seeing the following build warning with this patch,

In file included from include/linux/seqlock.h:35:0,
                 from include/linux/time.h:5,
                 from include/linux/efi.h:16,
                 from drivers/firmware/efi/runtime-wrappers.c:18:
drivers/firmware/efi/runtime-wrappers.c: In function ?virt_efi_query_capsule_caps?:
include/linux/spinlock.h:358:2: warning: ?flags? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/firmware/efi/runtime-wrappers.c:275:16: note: ?flags? was declared here

You'll need to cache the value of efi_in_nmi() in a local variable.

That should be safe, since if we're not executing in NMI context when we
enter the function we won't be executing in NMI context at any point in
during function. It's just that gcc can't infer that information.

-- 
Matt Fleming, Intel Open Source Technology Center

      reply	other threads:[~2014-07-10 18:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 11:21 [PATCH v2] efi: implement mandatory locking for UEFI Runtime Services Ard Biesheuvel
2014-07-08 11:23 ` Ard Biesheuvel
2014-07-10 18:14   ` 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=20140710181449.GI15932@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=linux-arm-kernel@lists.infradead.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).