1. 27 Jun, 2016 6 commits
    • Alex Thorlton's avatar
      x86/uv: Update uv_bios_call() to use efi_call_virt_pointer() · d1be84a2
      Alex Thorlton authored
      Now that the efi_call_virt() macro has been generalized to be able to
      use EFI system tables besides efi.systab, we are able to convert our
      uv_bios_call() wrapper to use this standard EFI callback mechanism.
      
      This simple change is part of a much larger effort to recover from some
      issues with the way we were mapping in some of our MMRs, and the way
      that we were doing our BIOS callbacks, which were uncovered by commit
      67a9108e ("x86/efi: Build our own page table structures").
      
      The first issue that this uncovered was that we were relying on the EFI
      memory mapping mechanism to map in our MMR space for us, which, while
      reliable, was technically a bug, as it relied on "undefined" behavior in
      the mapping code.
      
      The reason we were able to piggyback on the EFI memory mapping code to
      map in our MMRs was because, previously, EFI code used the
      trampoline_pgd, which shares a few entries with the main kernel pgd.  It
      just so happened, that the memory range containing our MMRs was inside
      one of those shared regions, which kept our code working without issue
      for quite a while.
      
      Anyways, once we discovered this problem, we brought back our original
      code to map in the MMRs with commit:
      
        08914f43 ("x86/platform/UV: Bring back the call to map_low_mmrs in uv_system_init")
      
      This got our systems a little further along, but we were still running
      into trouble with our EFI callbacks, which prevented us from booting
      all the way up.
      
      Our first step towards fixing the BIOS callbacks was to get our
      uv_bios_call() wrapper updated to use efi_call_virt() instead of the plain
      efi_call().  The previous patch took care of the effort needed to make
      that possible.  Along the way, we hit a major issue with some confusion
      about how to properly pull arguments higher than number 6 off the stack
      in the efi_call() code, which resulted in the following commit from Linus:
      
        683ad809 ("x86/efi: Fix 7-parameter efi_call()s")
      
      Now that all of those issues are out of the way, we're able to make this
      simple change to use the new efi_call_virt_pointer() in uv_bios_call()
      which gets our machines booting, running properly, and able to execute our
      callbacks with 6+ arguments.
      
      Note that, since we are now using the EFI page table when we make our
      function call, we are no longer able to make the call using the __va()
      of our function pointer, since the memory range containing that address
      isn't mapped into the EFI page table.  For now, we will use the physical
      address of the function directly, since that is mapped into the EFI page
      table.  In the near future, we're going to get some code added in to
      properly update our function pointer to its virtual address during
      SetVirtualAddressMap.
      Signed-off-by: default avatarAlex Thorlton <athorlton@sgi.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Dimitri Sivanich <sivanich@sgi.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Roy Franz <roy.franz@linaro.org>
      Cc: Russ Anderson <rja@sgi.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1466839230-12781-6-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      d1be84a2
    • Alex Thorlton's avatar
      efi: Convert efi_call_virt() to efi_call_virt_pointer() · 80e75596
      Alex Thorlton authored
      This commit makes a few slight modifications to the efi_call_virt() macro
      to get it to work with function pointers that are stored in locations
      other than efi.systab->runtime, and renames the macro to
      efi_call_virt_pointer().  The majority of the changes here are to pull
      these macros up into header files so that they can be accessed from
      outside of drivers/firmware/efi/runtime-wrappers.c.
      
      The most significant change not directly related to the code move is to
      add an extra "p" argument into the appropriate efi_call macros, and use
      that new argument in place of the, formerly hard-coded,
      efi.systab->runtime pointer.
      
      The last piece of the puzzle was to add an efi_call_virt() macro back into
      drivers/firmware/efi/runtime-wrappers.c to wrap around the new
      efi_call_virt_pointer() macro - this was mainly to keep the code from
      looking too cluttered by adding a bunch of extra references to
      efi.systab->runtime everywhere.
      
      Note that I also broke up the code in the efi_call_virt_pointer() macro a
      bit in the process of moving it.
      Signed-off-by: default avatarAlex Thorlton <athorlton@sgi.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Dimitri Sivanich <sivanich@sgi.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Roy Franz <roy.franz@linaro.org>
      Cc: Russ Anderson <rja@sgi.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1466839230-12781-5-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      80e75596
    • Colin Ian King's avatar
      x86/efi: Remove unused variable 'efi' · f6d1747f
      Colin Ian King authored
      Remove unused variable 'efi', it is never used. This fixes the following
      clang build warning:
      
        arch/x86/boot/compressed/eboot.c:803:2: warning: Value stored to 'efi' is never read
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1466839230-12781-4-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f6d1747f
    • Peter Jones's avatar
      efi: Document #define FOO_PROTOCOL_GUID layout · 54fd11fe
      Peter Jones authored
      Add a comment documenting why EFI GUIDs are laid out like they are.
      
      Ideally I'd like to change all the ", " to "," too, but right now the
      format is such that checkpatch won't complain with new ones, and staring
      at checkpatch didn't get me anywhere towards making that work.
      Signed-off-by: default avatarPeter Jones <pjones@redhat.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1466839230-12781-3-git-send-email-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      54fd11fe
    • Compostella, Jeremy's avatar
      efibc: Report more information in the error messages · 5356c327
      Compostella, Jeremy authored
      Report the name of the EFI variable if the value size is too large,
      or if efibc_set_variable() fails to allocate the 'struct efivar_entry'
      object.
      
      If efibc_set_variable() fails because the 'size' value is too
      large, it also reports this value in the error message.
      Reported-by: default avatarRobert Elliott <elliott@hpe.com>
      Signed-off-by: default avatarJeremy Compostella <jeremy.compostella@intel.com>
      Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1466839230-12781-2-git-send-email-matt@codeblueprint.co.uk
      [ Minor readability edits. ]
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5356c327
    • Linus Torvalds's avatar
      Linux 4.7-rc5 · 4c2e07c6
      Linus Torvalds authored
      4c2e07c6
  2. 26 Jun, 2016 1 commit
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 2ac9b973
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two straightforward fixes.
      
        One is a concurrency issue only affecting SAS connected SATA drives,
        but which could hang the storage subsystem if it triggers (because the
        outstanding command count on error never goes back to zero) and the
        other is a NO_TAG fallout from the switch to hostwide tags which
        causes the system to crash on module insertion (we've checked
        carefully and only the 53c700 family of drivers is vulnerable to this
        issue)"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        53c700: fix BUG on untagged commands
        scsi: fix race between simultaneous decrements of ->host_failed
      2ac9b973
  3. 25 Jun, 2016 33 commits