Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1329504

Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with interrupts enabled

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with interrupts enabled
Date 2016-02-08 20:40 +0100
Message-ID <qZZPd-1iv-27@gated-at.bofh.it> (permalink)
References <qY3ke-QW-15@gated-at.bofh.it> <qYsBY-W2-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Feb 4, 2016 5:58 AM, "Ard Biesheuvel" <ard.biesheuvel@linaro.org> wrote:
>
> OK, since Sai has confirmed that Windows leaves interrupts enabled when
> calling the EFI variable store related runtime services, we should be able
> to do the same for Linux, or at least be slightly more confident that we
> won't have to back out this change later.

Could this use a mutex instead of a spinlock?

Can someone with a mixed mode setup read a variable in a loop and make
sure it doesn't crash and burn?  It should work fine, but explicit
testing would be nice.  (It's interesting mainly because doing a mixed
mode call with interrupts on can result in a non-IST CPL0 to CPL0
exception delivery, which won't result in a stack switch.  This could
easily trigger a stack overflow, logic bug, microcode bug, or
as-yet-unknown CPU "feature".

Hmm.  We should also audit the mixed mode entry code to make sure that
the high bits of RSP are explicitly clear before switching into compat
mode.  If I had to make a guess about how CPUs behave, I'd guess
pessimistically: Intel CPUs clear the high bits of RSP when switching
into long mode due to interrupt delivery, and AMD CPUs leave them set
just to mess with us.

Also, a WARN_ON(in_interrupt()) somewhere might be a good sanity check.

--Andy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 07/14] efi: runtime-wrappers: Run UEFI Runtime Services with interrupts enabled Matt Fleming <matt@codeblueprint.co.uk> - 2016-02-01 23:10 +0100
  Re: [PATCH 07/14] efi: runtime-wrappers: Run UEFI Runtime Services  with interrupts enabled Ingo Molnar <mingo@kernel.org> - 2016-02-03 10:50 +0100
    Re: [PATCH 07/14] efi: runtime-wrappers: Run UEFI Runtime Services  with interrupts enabled Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-02-03 11:00 +0100
      Re: [PATCH 07/14] efi: runtime-wrappers: Run UEFI Runtime Services  with interrupts enabled Ingo Molnar <mingo@kernel.org> - 2016-02-03 12:00 +0100
        Re: [PATCH 07/14] efi: runtime-wrappers: Run UEFI Runtime Services  with interrupts enabled Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-02-03 12:40 +0100
          Re: [PATCH 07/14] efi: runtime-wrappers: Run UEFI Runtime Services  with interrupts enabled Matt Fleming <matt@codeblueprint.co.uk> - 2016-02-03 13:10 +0100
        [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with interrupts enabled Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-02-04 15:00 +0100
          Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with  interrupts enabled Matt Fleming <matt@codeblueprint.co.uk> - 2016-02-08 16:20 +0100
          Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with  interrupts enabled Andy Lutomirski <luto@amacapital.net> - 2016-02-08 20:40 +0100
            Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with  interrupts enabled Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-02-09 18:00 +0100
              Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with  interrupts enabled Matt Fleming <matt@codeblueprint.co.uk> - 2016-02-11 17:10 +0100
            Re: [PATCH] efi: runtime-wrappers: run UEFI Runtime Services with  interrupts enabled Matt Fleming <matt@codeblueprint.co.uk> - 2016-02-11 17:10 +0100

csiph-web