1. 19 7月, 2014 1 次提交
    • A
      efi: efistub: Convert into static library · f4f75ad5
      Ard Biesheuvel 提交于
      This patch changes both x86 and arm64 efistub implementations
      from #including shared .c files under drivers/firmware/efi to
      building shared code as a static library.
      
      The x86 code uses a stub built into the boot executable which
      uncompresses the kernel at boot time. In this case, the library is
      linked into the decompressor.
      
      In the arm64 case, the stub is part of the kernel proper so the library
      is linked into the kernel proper as well.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      f4f75ad5
  2. 08 7月, 2014 3 次提交
    • A
      efi: efistub: Refactor stub components · bd669475
      Ard Biesheuvel 提交于
      In order to move from the #include "../../../xxxxx.c" anti-pattern used
      by both the x86 and arm64 versions of the stub to a static library
      linked into either the kernel proper (arm64) or a separate boot
      executable (x86), there is some prepatory work required.
      
      This patch does the following:
      - move forward declarations of functions shared between the arch
        specific and the generic parts of the stub to include/linux/efi.h
      - move forward declarations of functions shared between various .c files
        of the generic stub code to a new local header file called "efistub.h"
      - add #includes to all .c files which were formerly relying on the
        #includor to include the correct header files
      - remove all static modifiers from functions which will need to be
        externally visible once we move to a static library
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      bd669475
    • A
      efi/x86: Move UEFI Runtime Services wrappers to generic code · 022ee6c5
      Ard Biesheuvel 提交于
      In order for other archs (such as arm64) to be able to reuse the virtual
      mode function call wrappers, move them to drivers/firmware/efi/runtime-wrappers.c.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      022ee6c5
    • A
      efi/arm64: efistub: remove local copy of linux_banner · f49182ec
      Ard Biesheuvel 提交于
      The shared efistub code for ARM and arm64 contains a local copy of
      linux_banner, allowing it to be referenced from separate executables
      such as the ARM decompressor. However, this introduces a dependency on
      generated header files, causing unnecessary rebuilds of the stub itself
      and, in case of arm64, vmlinux which contains it.
      
      On arm64, the copy is not actually needed since we can reference the
      original symbol directly, and as it turns out, there may be better ways
      to deal with this for ARM as well, so let's remove it from the shared
      code. If it still needs to be reintroduced for ARM later, it should live
      under arch/arm anyway and not in shared code.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      f49182ec
  3. 14 5月, 2014 1 次提交
  4. 01 5月, 2014 4 次提交
  5. 17 4月, 2014 7 次提交
  6. 15 4月, 2014 2 次提交
  7. 11 4月, 2014 1 次提交
    • M
      efi: Pass correct file handle to efi_file_{read,close} · 47514c99
      Matt Fleming 提交于
      We're currently passing the file handle for the root file system to
      efi_file_read() and efi_file_close(), instead of the file handle for the
      file we wish to read/close.
      
      While this has worked up until now, it seems that it has only been by
      pure luck. Olivier explains,
      
       "The issue is the UEFI Fat driver might return the same function for
        'fh->read()' and 'h->read()'. While in our case it does not work with
        a different implementation of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. In our
        case, we return a different pointer when reading a directory and
        reading a file."
      
      Fixing this actually clears up the two functions because we can drop one
      of the arguments, and instead only pass a file 'handle' argument.
      Reported-by: NOlivier Martin <olivier.martin@arm.com>
      Reviewed-by: NOlivier Martin <olivier.martin@arm.com>
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      47514c99
  8. 27 3月, 2014 1 次提交
  9. 05 3月, 2014 3 次提交
  10. 16 2月, 2014 2 次提交
  11. 14 2月, 2014 1 次提交
  12. 28 1月, 2014 1 次提交
  13. 24 1月, 2014 1 次提交
  14. 22 1月, 2014 1 次提交
    • S
      drivers/firmware/memmap.c: use memblock apis for early memory allocations · 4fc0bc58
      Santosh Shilimkar 提交于
      Switch to memblock interfaces for early memory allocator instead of
      bootmem allocator.  No functional change in beahvior than what it is in
      current code from bootmem users points of view.
      
      Archs already converted to NO_BOOTMEM now directly use memblock
      interfaces instead of bootmem wrappers build on top of memblock.  And
      the archs which still uses bootmem, these new apis just fallback to
      exiting bootmem APIs.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4fc0bc58
  15. 21 12月, 2013 3 次提交
  16. 20 12月, 2013 1 次提交
  17. 09 12月, 2013 2 次提交
    • B
      firmware: dmi-sysfs: Remove "dmi" directory on module exit · d0f80f9a
      Bjorn Helgaas 提交于
      With CONFIG_DEBUG_KOBJECT_RELEASE=y, removing and immediately reloading the
      dmi-sysfs module causes the following warning:
      
        sysfs: cannot create duplicate filename '/firmware/dmi'
        kobject_add_internal failed for dmi with -EEXIST, don't try to register things with the same name in the same directory.
      
      The "dmi" directory stays in sysfs until the dmi_kobj is released, and
      DEBUG_KOBJECT_RELEASE delays that.
      
      I don't think we can hit this problem in normal usage because dmi_kobj is
      static and nothing outside dmi-sysfs can get a reference to it, so the
      only way to delay the "dmi" release is with DEBUG_KOBJECT_RELEASE.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0f80f9a
    • B
      firmware: dmi-sysfs: Don't remove dmi-sysfs "raw" file explicitly · a61aca28
      Bjorn Helgaas 提交于
      Removing the dmi-sysfs module causes the following warning:
      
        # modprobe -r dmi_sysfs
        WARNING: CPU: 11 PID: 6785 at fs/sysfs/inode.c:325 sysfs_hash_and_remove+0xa9/0xb0()
        sysfs: can not remove 'raw', no directory
      
      This is because putting the entry kobject, e.g., for
      "/sys/firmware/dmi/entries/19-0", removes the directory and all its
      contents.  By the time dmi_sysfs_entry_release() runs, the "raw" file
      inside ".../19-0/" has already been removed.
      
      Therefore, we don't need to remove the "raw" bin file at all in
      dmi_sysfs_entry_release().
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a61aca28
  18. 07 12月, 2013 1 次提交
    • L
      ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module · 9d24622c
      Lv Zheng 提交于
      To avoid build problems and breaking dependencies between ACPI header
      files, <acpi/acpi.h> should not be included directly by code outside
      of the ACPI core subsystem, but this is done by the ACPI iSCSI
      Boot Firmware code.
      
      The iBFT specification doesn't mention whether or not it can appear
      on a non-ACPI platform, but is says that ACPI 3.0b defines the
      mechanism.  The current CONFIG_ISCSI_IBFT_FIND code doesn't use the
      ACPI tables API to locate the table, so it doesn't rely on CONFIG_ACPI
      directly.
      
      However, since iBFT is is an ACPI-based mechanism (please refer to
      the documentation link below for more information), it should be
      correct to make CONFIG_ISCSI_IBFT_FIND depend on CONFIG_ACPI (even
      though the table location can be implemented without using ACPI
      tables API).
      
      After that change, include/linux/iscsi_ibft.h can be modified to
      include <linux/acpi.h> instead of <acpi/acpi.h> as appropriate.
      
      References: http://www.microsoft.com/whdc/system/platform/firmware/ibft.mspx
      Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
      Cc: Peter Jones <pjones@redhat.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      [rjw: Subject and changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9d24622c
  19. 29 11月, 2013 2 次提交
    • M
      efi-pstore: Make efi-pstore return a unique id · fdeadb43
      Madper Xie 提交于
      Pstore fs expects that backends provide a unique id which could avoid
      pstore making entries as duplication or denominating entries the same
      name. So I combine the timestamp, part and count into id.
      Signed-off-by: NMadper Xie <cxie@redhat.com>
      Cc: Seiji Aguchi <seiji.aguchi@hds.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      fdeadb43
    • S
      efivars, efi-pstore: Hold off deletion of sysfs entry until the scan is completed · e0d59733
      Seiji Aguchi 提交于
      Currently, when mounting pstore file system, a read callback of
      efi_pstore driver runs mutiple times as below.
      
      - In the first read callback, scan efivar_sysfs_list from head and pass
        a kmsg buffer of a entry to an upper pstore layer.
      - In the second read callback, rescan efivar_sysfs_list from the entry
        and pass another kmsg buffer to it.
      - Repeat the scan and pass until the end of efivar_sysfs_list.
      
      In this process, an entry is read across the multiple read function
      calls. To avoid race between the read and erasion, the whole process
      above is protected by a spinlock, holding in open() and releasing in
      close().
      
      At the same time, kmemdup() is called to pass the buffer to pstore
      filesystem during it. And then, it causes a following lockdep warning.
      
      To make the dynamic memory allocation runnable without taking spinlock,
      holding off a deletion of sysfs entry if it happens while scanning it
      via efi_pstore, and deleting it after the scan is completed.
      
      To implement it, this patch introduces two flags, scanning and deleting,
      to efivar_entry.
      
      On the code basis, it seems that all the scanning and deleting logic is
      not needed because __efivars->lock are not dropped when reading from the
      EFI variable store.
      
      But, the scanning and deleting logic is still needed because an
      efi-pstore and a pstore filesystem works as follows.
      
      In case an entry(A) is found, the pointer is saved to psi->data.  And
      efi_pstore_read() passes the entry(A) to a pstore filesystem by
      releasing  __efivars->lock.
      
      And then, the pstore filesystem calls efi_pstore_read() again and the
      same entry(A), which is saved to psi->data, is used for resuming to scan
      a sysfs-list.
      
      So, to protect the entry(A), the logic is needed.
      
      [    1.143710] ------------[ cut here ]------------
      [    1.144058] WARNING: CPU: 1 PID: 1 at kernel/lockdep.c:2740 lockdep_trace_alloc+0x104/0x110()
      [    1.144058] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
      [    1.144058] Modules linked in:
      [    1.144058] CPU: 1 PID: 1 Comm: systemd Not tainted 3.11.0-rc5 #2
      [    1.144058]  0000000000000009 ffff8800797e9ae0 ffffffff816614a5 ffff8800797e9b28
      [    1.144058]  ffff8800797e9b18 ffffffff8105510d 0000000000000080 0000000000000046
      [    1.144058]  00000000000000d0 00000000000003af ffffffff81ccd0c0 ffff8800797e9b78
      [    1.144058] Call Trace:
      [    1.144058]  [<ffffffff816614a5>] dump_stack+0x54/0x74
      [    1.144058]  [<ffffffff8105510d>] warn_slowpath_common+0x7d/0xa0
      [    1.144058]  [<ffffffff8105517c>] warn_slowpath_fmt+0x4c/0x50
      [    1.144058]  [<ffffffff8131290f>] ? vsscanf+0x57f/0x7b0
      [    1.144058]  [<ffffffff810bbd74>] lockdep_trace_alloc+0x104/0x110
      [    1.144058]  [<ffffffff81192da0>] __kmalloc_track_caller+0x50/0x280
      [    1.144058]  [<ffffffff815147bb>] ? efi_pstore_read_func.part.1+0x12b/0x170
      [    1.144058]  [<ffffffff8115b260>] kmemdup+0x20/0x50
      [    1.144058]  [<ffffffff815147bb>] efi_pstore_read_func.part.1+0x12b/0x170
      [    1.144058]  [<ffffffff81514800>] ? efi_pstore_read_func.part.1+0x170/0x170
      [    1.144058]  [<ffffffff815148b4>] efi_pstore_read_func+0xb4/0xe0
      [    1.144058]  [<ffffffff81512b7b>] __efivar_entry_iter+0xfb/0x120
      [    1.144058]  [<ffffffff8151428f>] efi_pstore_read+0x3f/0x50
      [    1.144058]  [<ffffffff8128d7ba>] pstore_get_records+0x9a/0x150
      [    1.158207]  [<ffffffff812af25c>] ? selinux_d_instantiate+0x1c/0x20
      [    1.158207]  [<ffffffff8128ce30>] ? parse_options+0x80/0x80
      [    1.158207]  [<ffffffff8128ced5>] pstore_fill_super+0xa5/0xc0
      [    1.158207]  [<ffffffff811ae7d2>] mount_single+0xa2/0xd0
      [    1.158207]  [<ffffffff8128ccf8>] pstore_mount+0x18/0x20
      [    1.158207]  [<ffffffff811ae8b9>] mount_fs+0x39/0x1b0
      [    1.158207]  [<ffffffff81160550>] ? __alloc_percpu+0x10/0x20
      [    1.158207]  [<ffffffff811c9493>] vfs_kern_mount+0x63/0xf0
      [    1.158207]  [<ffffffff811cbb0e>] do_mount+0x23e/0xa20
      [    1.158207]  [<ffffffff8115b51b>] ? strndup_user+0x4b/0xf0
      [    1.158207]  [<ffffffff811cc373>] SyS_mount+0x83/0xc0
      [    1.158207]  [<ffffffff81673cc2>] system_call_fastpath+0x16/0x1b
      [    1.158207] ---[ end trace 61981bc62de9f6f4 ]---
      Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com>
      Tested-by: NMadper Xie <cxie@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      e0d59733
  20. 03 11月, 2013 1 次提交
  21. 01 11月, 2013 1 次提交