15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

11 Dec, 2014

2 commits

  • Pull tracing updates from Steven Rostedt:
    "There was a lot of clean ups and minor fixes. One of those clean ups
    was to the trace_seq code. It also removed the return values to the
    trace_seq_*() functions and use trace_seq_has_overflowed() to see if
    the buffer filled up or not. This is similar to work being done to
    the seq_file code as well in another tree.

    Some of the other goodies include:

    - Added some "!" (NOT) logic to the tracing filter.

    - Fixed the frame pointer logic to the x86_64 mcount trampolines

    - Added the logic for dynamic trampolines on !CONFIG_PREEMPT systems.
    That is, the ftrace trampoline can be dynamically allocated and be
    called directly by functions that only have a single hook to them"

    * tag 'trace-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (55 commits)
    tracing: Truncated output is better than nothing
    tracing: Add additional marks to signal very large time deltas
    Documentation: describe trace_buf_size parameter more accurately
    tracing: Allow NOT to filter AND and OR clauses
    tracing: Add NOT to filtering logic
    ftrace/fgraph/x86: Have prepare_ftrace_return() take ip as first parameter
    ftrace/x86: Get rid of ftrace_caller_setup
    ftrace/x86: Have save_mcount_regs macro also save stack frames if needed
    ftrace/x86: Add macro MCOUNT_REG_SIZE for amount of stack used to save mcount regs
    ftrace/x86: Simplify save_mcount_regs on getting RIP
    ftrace/x86: Have save_mcount_regs store RIP in %rdi for first parameter
    ftrace/x86: Rename MCOUNT_SAVE_FRAME and add more detailed comments
    ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file
    ftrace/x86: Have static tracing also use ftrace_caller_setup
    ftrace/x86: Have static function tracing always test for function graph
    kprobes: Add IPMODIFY flag to kprobe_ftrace_ops
    ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict
    kprobes/ftrace: Recover original IP if pre_handler doesn't change it
    tracing/trivial: Fix typos and make an int into a bool
    tracing: Deletion of an unnecessary check before iput()
    ...

    Linus Torvalds
     
  • Pull EFI updates from Ingo Molnar:
    "Changes in this cycle are:

    - support module unload for efivarfs (Mathias Krause)

    - another attempt at moving x86 to libstub taking advantage of the
    __pure attribute (Ard Biesheuvel)

    - add EFI runtime services section to ptdump (Mathias Krause)"

    * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, ptdump: Add section for EFI runtime services
    efi/x86: Move x86 back to libstub
    efivarfs: Allow unloading when build as module

    Linus Torvalds
     

20 Nov, 2014

1 commit


12 Nov, 2014

1 commit

  • This reverts commit 84be880560fb, which itself reverted my original
    attempt to move x86 from #include'ing .c files from across the tree
    to using the EFI stub built as a static library.

    The issue that affected the original approach was that splitting
    the implementation into several .o files resulted in the variable
    'efi_early' becoming a global with external linkage, which under
    -fPIC implies that references to it must go through the GOT. However,
    dealing with this additional GOT entry turned out to be troublesome
    on some EFI implementations. (GCC's visibility=hidden attribute is
    supposed to lift this requirement, but it turned out not to work on
    the 32-bit build.)

    Instead, use a pure getter function to get a reference to efi_early.
    This approach results in no additional GOT entries being generated,
    so there is no need for any changes in the early GOT handling.

    Tested-by: Maarten Lankhorst
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming

    Ard Biesheuvel
     

05 Nov, 2014

3 commits

  • In the absence of a DTB configuration table, the EFI stub will happily
    continue attempting to boot a kernel, despite the fact that this kernel
    may not function without a description of the hardware. In this case, as
    with a typo'd "dtb=" option (e.g. "dbt=") or many other possible
    failures, the only output seen by the user will be the rather terse
    output from the EFI stub:

    EFI stub: Booting Linux Kernel...

    To aid those attempting to debug such failures, this patch adds a notice
    when no DTB is found, making the output more helpful:

    EFI stub: Booting Linux Kernel...
    EFI stub: Generating empty DTB

    Additionally, a positive acknowledgement is added when a user-specified
    DTB is in use:

    EFI stub: Booting Linux Kernel...
    EFI stub: Using DTB from command line

    Similarly, a positive acknowledgement is added when a DTB from a
    configuration table is in use:

    EFI stub: Booting Linux Kernel...
    EFI stub: Using DTB from configuration table

    Signed-off-by: Mark Rutland
    Acked-by: Leif Lindholm
    Acked-by: Ard Biesheuvel
    Acked-by: Roy Franz
    Acked-by: Matt Fleming
    Signed-off-by: Ard Biesheuvel

    Mark Rutland
     
  • The DMTF SMBIOS reference spec v3.0.0 defines a new 64-bit entry point,
    which enables support for SMBIOS structure tables residing at a physical
    offset over 4 GB. This is especially important for upcoming arm64
    platforms whose system RAM resides entirely above the 4 GB boundary.

    For the UEFI case, this code attempts to detect the new SMBIOS 3.0
    header magic at the offset passed in the SMBIOS3_TABLE_GUID UEFI
    configuration table. If this configuration table is not provided, or
    if we fail to parse the header, we fall back to using the legacy
    SMBIOS_TABLE_GUID configuration table. This is in line with the spec,
    that allows both configuration tables to be provided, but mandates that
    they must point to the same structure table, unless the version pointed
    to by the 64-bit entry point is a superset of the 32-bit one.

    For the non-UEFI case, the detection logic is modified to look for the
    SMBIOS 3.0 header magic before it looks for the legacy header magic.

    Note that this patch is based on version 3.0.0d [draft] of the
    specification, which is expected not to deviate from the final version
    in ways that would affect the correctness of this implementation.

    Tested-by: Suravee Suthikulpanit
    Acked-by: Leif Lindholm
    Tested-by: Leif Lindholm
    Cc: Andrew Morton
    Cc: Tony Luck
    Acked-by: Matt Fleming
    Signed-off-by: Ard Biesheuvel

    Ard Biesheuvel
     
  • This adds support to the UEFI side for detecting the presence of
    a SMBIOS 3.0 64-bit entry point. This allows the actual SMBIOS
    structure table to reside at a physical offset over 4 GB, which
    cannot be supported by the legacy SMBIOS 32-bit entry point.

    Since the firmware can legally provide both entry points, store
    the SMBIOS 3.0 entry point in a separate variable, and let the
    DMI decoding layer decide which one will be used.

    Tested-by: Suravee Suthikulpanit
    Acked-by: Leif Lindholm
    Acked-by: Matt Fleming
    Signed-off-by: Ard Biesheuvel

    Ard Biesheuvel
     

04 Nov, 2014

1 commit


24 Oct, 2014

1 commit

  • Pull x86 EFI updates from Peter Anvin:
    "This patchset falls under the "maintainers that grovel" clause in the
    v3.18-rc1 announcement. We had intended to push it late in the merge
    window since we got it into the -tip tree relatively late.

    Many of these are relatively simple things, but there are a couple of
    key bits, especially Ard's and Matt's patches"

    * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
    rtc: Disable EFI rtc for x86
    efi: rtc-efi: Export platform:rtc-efi as module alias
    efi: Delete the in_nmi() conditional runtime locking
    efi: Provide a non-blocking SetVariable() operation
    x86/efi: Adding efi_printks on memory allocationa and pci.reads
    x86/efi: Mark initialization code as such
    x86/efi: Update comment regarding required phys mapped EFI services
    x86/efi: Unexport add_efi_memmap variable
    x86/efi: Remove unused efi_call* macros
    efi: Resolve some shadow warnings
    arm64: efi: Format EFI memory type & attrs with efi_md_typeattr_format()
    ia64: efi: Format EFI memory type & attrs with efi_md_typeattr_format()
    x86: efi: Format EFI memory type & attrs with efi_md_typeattr_format()
    efi: Introduce efi_md_typeattr_format()
    efi: Add macro for EFI_MEMORY_UCE memory attribute
    x86/efi: Clear EFI_RUNTIME_SERVICES if failing to enter virtual mode
    arm64/efi: Do not enter virtual mode if booting with efi=noruntime or noefi
    arm64/efi: uefi_init error handling fix
    efi: Add kernel param efi=noruntime
    lib: Add a generic cmdline parse function parse_option_str
    ...

    Linus Torvalds
     

20 Oct, 2014

1 commit


10 Oct, 2014

1 commit

  • By the following commits, we prevented from allocating firmware_map_entry
    of same memory range:
    f0093ede: drivers/firmware/memmap.c: don't allocate firmware_map_entry
    of same memory range
    49c8b24d: drivers/firmware/memmap.c: pass the correct argument to
    firmware_map_find_entry_bootmem()

    But it's not enough. When PNP0C80 device is added by acpi_scan_init(),
    memmap sysfses of same firmware_map_entry are created twice as follows:

    # cat /sys/firmware/memmap/*/start
    0x40000000000
    0x60000000000
    0x4a837000
    0x4a83a000
    0x4a8b5000
    ...
    0x40000000000
    0x60000000000
    ...

    The flows of the issues are as follows:

    1. e820_reserve_resources() allocates firmware_map_entrys of all
    memory ranges defined in e820. And, these firmware_map_entrys
    are linked with map_entries list.

    map_entries -> entry 1 -> ... -> entry N

    2. When PNP0C80 device is limited by mem= boot option, acpi_scan_init()
    added the memory device. In this case, firmware_map_add_hotplug()
    allocates firmware_map_entry and creates memmap sysfs.

    map_entries -> entry 1 -> ... -> entry N -> entry N+1
    |
    memmap 1

    3. firmware_memmap_init() creates memmap sysfses of firmware_map_entrys
    linked with map_entries.

    map_entries -> entry 1 -> ... -> entry N -> entry N+1
    | | |
    memmap 2 memmap N+1 memmap 1
    memmap N+2

    So while hot removing the PNP0C80 device, kernel panic occurs as follows:

    BUG: unable to handle kernel paging request at 00000001003e000b
    IP: sysfs_open_file+0x46/0x2b0
    PGD 203a89fe067 PUD 0
    Oops: 0000 [#1] SMP
    ...
    Call Trace:
    do_dentry_open+0x1ef/0x2a0
    finish_open+0x31/0x40
    do_last+0x57c/0x1220
    path_openat+0xc2/0x4c0
    do_filp_open+0x4b/0xb0
    do_sys_open+0xf3/0x1f0
    SyS_open+0x1e/0x20
    system_call_fastpath+0x16/0x1b

    The patch adds a check of confirming whether memmap sysfs of
    firmware_map_entry has been created, and does not create memmap
    sysfs of same firmware_map_entry.

    Signed-off-by: Yasuaki Ishimatsu
    Cc: Santosh Shilimkar
    Cc: Toshi Kani
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasuaki Ishimatsu
     

04 Oct, 2014

9 commits

  • Conflicts:
    arch/x86/boot/compressed/eboot.c

    Matt Fleming
     
  • commit 5dc3826d9f08 ("efi: Implement mandatory locking for UEFI Runtime
    Services") implemented some conditional locking when accessing variable
    runtime services that Ingo described as "pretty disgusting".

    The intention with the !efi_in_nmi() checks was to avoid live-locks when
    trying to write pstore crash data into an EFI variable. Such lockless
    accesses are allowed according to the UEFI specification when we're in a
    "non-recoverable" state, but whether or not things are implemented
    correctly in actual firmware implementations remains an unanswered
    question, and so it would seem sensible to avoid doing any kind of
    unsynchronized variable accesses.

    Furthermore, the efi_in_nmi() tests are inadequate because they don't
    account for the case where we call EFI variable services from panic or
    oops callbacks and aren't executing in NMI context. In other words,
    live-locking is still possible.

    Let's just remove the conditional locking altogether. Now we've got the
    ->set_variable_nonblocking() EFI variable operation we can abort if the
    runtime lock is already held. Aborting is by far the safest option.

    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Ard Biesheuvel
    Cc: Matthew Garrett
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • There are some circumstances that call for trying to write an EFI
    variable in a non-blocking way. One such scenario is when writing pstore
    data in efi_pstore_write() via the pstore_dump() kdump callback.

    Now that we have an EFI runtime spinlock we need a way of aborting if
    there is contention instead of spinning, since when writing pstore data
    from the kdump callback, the runtime lock may already be held by the CPU
    that's running the callback if we crashed in the middle of an EFI
    variable operation.

    The situation is sufficiently special that a new EFI variable operation
    is warranted.

    Introduce ->set_variable_nonblocking() for this use case. It is an
    optional EFI backend operation, and need only be implemented by those
    backends that usually acquire locks to serialize access to EFI
    variables, as is the case for virt_efi_set_variable() where we now grab
    the EFI runtime spinlock.

    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Ard Biesheuvel
    Cc: Matthew Garrett
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • It is a really bad idea to declare variables or parameters that
    have the same name as common types. It is valid C, but it gets
    surprising if a macro expansion attempts to declare an inner
    local with that type. Change the local names to eliminate the
    hazard.

    Change s16 => str16, s8 => str8.

    This resolves warnings seen when using W=2 during make, for instance:

    drivers/firmware/efi/vars.c: In function ‘dup_variable_bug’:
    drivers/firmware/efi/vars.c:324:44: warning: declaration of ‘s16’ shadows a global declaration [-Wshadow]
    static void dup_variable_bug(efi_char16_t *s16, efi_guid_t *vendor_guid,

    drivers/firmware/efi/vars.c:328:8: warning: declaration of ‘s8’ shadows a global declaration [-Wshadow]
    char *s8;

    Signed-off-by: Mark Rustad
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Matt Fleming

    Mark Rustad
     
  • At the moment, there are three architectures debug-printing the EFI memory
    map at initialization: x86, ia64, and arm64. They all use different format
    strings, plus the EFI memory type and the EFI memory attributes are
    similarly hard to decode for a human reader.

    Introduce a helper __init function that formats the memory type and the
    memory attributes in a unified way, to a user-provided character buffer.

    The array "memory_type_name" is copied from the arm64 code, temporarily
    duplicating it. The (otherwise optional) braces around each string literal
    in the initializer list are dropped in order to match the kernel coding
    style more closely. The element size is tightened from 32 to 20 bytes
    (maximum actual string length + 1) so that we can derive the field width
    from the element size.

    Signed-off-by: Laszlo Ersek
    Tested-by: Ard Biesheuvel
    Acked-by: Ard Biesheuvel
    [ Dropped useless 'register' keyword, which compiler will ignore ]
    Signed-off-by: Matt Fleming

    Laszlo Ersek
     
  • noefi kernel param means actually disabling efi runtime, Per suggestion
    from Leif Lindholm efi=noruntime should be better. But since noefi is
    already used in X86 thus just adding another param efi=noruntime for
    same purpose.

    Signed-off-by: Dave Young
    Signed-off-by: Matt Fleming

    Dave Young
     
  • noefi param can be used for arches other than X86 later, thus move it
    out of x86 platform code.

    Signed-off-by: Dave Young
    Signed-off-by: Matt Fleming

    Dave Young
     
  • We need a way to customize the behaviour of the EFI boot stub, in
    particular, we need a way to disable the "chunking" workaround, used
    when reading files from the EFI System Partition.

    One of my machines doesn't cope well when reading files in 1MB chunks to
    a buffer above the 4GB mark - it appears that the "chunking" bug
    workaround triggers another firmware bug. This was only discovered with
    commit 4bf7111f5016 ("x86/efi: Support initrd loaded above 4G"), and
    that commit is perfectly valid. The symptom I observed was a corrupt
    initrd rather than any kind of crash.

    efi= is now used to specify EFI parameters in two very different
    execution environments, the EFI boot stub and during kernel boot.

    There is also a slight performance optimization by enabling efi=nochunk,
    but that's offset by the fact that you're more likely to run into
    firmware issues, at least on x86. This is the rationale behind leaving
    the workaround enabled by default.

    Also provide some documentation for EFI_READ_CHUNK_SIZE and why we're
    using the current value of 1MB.

    Tested-by: Ard Biesheuvel
    Cc: Roy Franz
    Cc: Maarten Lankhorst
    Cc: Leif Lindholm
    Cc: Borislav Petkov
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • 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. Use a spinlock to serialize all Runtime Services with respect
    to all others, even if this is more than strictly needed.

    We've managed to get away without requiring a runtime services lock
    until now because most of the interactions with EFI involve EFI
    variables, and those operations are already serialised with
    __efivars->lock.

    Some of the assumptions underlying the decision whether locks are
    needed or not (e.g., SetVariable() against ResetSystem()) may not
    apply universally to all [new] architectures that implement UEFI.
    Rather than try to reason our way out of this, let's just implement at
    least what the spec requires in terms of locking.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming

    Ard Biesheuvel
     

24 Sep, 2014

1 commit

  • This reverts commit f23cf8bd5c1f ("efi/x86: efistub: Move shared
    dependencies to ") as well as the x86 parts of commit
    f4f75ad5741f ("efi: efistub: Convert into static library").

    The road leading to these two reverts is long and winding.

    The above two commits were merged during the v3.17 merge window and
    turned the common EFI boot stub code into a static library. This
    necessitated making some symbols global in the x86 boot stub which
    introduced new entries into the early boot GOT.

    The problem was that we weren't fixing up the newly created GOT entries
    before invoking the EFI boot stub, which sometimes resulted in hangs or
    resets. This failure was reported by Maarten on his Macbook pro.

    The proposed fix was commit 9cb0e394234d ("x86/efi: Fixup GOT in all
    boot code paths"). However, that caused issues for Linus when booting
    his Sony Vaio Pro 11. It was subsequently reverted in commit
    f3670394c29f.

    So that leaves us back with Maarten's Macbook pro not booting.

    At this stage in the release cycle the least risky option is to revert
    the x86 EFI boot stub to the pre-merge window code structure where we
    explicitly #include efi-stub-helper.c instead of linking with the static
    library. The arm64 code remains unaffected.

    We can take another swing at the x86 parts for v3.18.

    Conflicts:
    arch/x86/include/asm/efi.h

    Tested-by: Josh Boyer
    Tested-by: Maarten Lankhorst
    Tested-by: Leif Lindholm [arm64]
    Tested-by: Linus Torvalds
    Cc: H. Peter Anvin
    Cc: Ard Biesheuvel ,
    Cc: Ingo Molnar
    Signed-off-by: Matt Fleming

    Matt Fleming
     

09 Sep, 2014

1 commit

  • Commit 86c8b27a01cf:
    "arm64: ignore DT memreserve entries when booting in UEFI mode

    prevents early_init_fdt_scan_reserved_mem() from being called for
    arm64 kernels booting via UEFI. This was done because the kernel
    will use the UEFI memory map to determine reserved memory regions.
    That approach has problems in that early_init_fdt_scan_reserved_mem()
    also reserves the FDT itself and any node-specific reserved memory.
    By chance of some kernel configs, the FDT may be overwritten before
    it can be unflattened and the kernel will fail to boot. More subtle
    problems will result if the FDT has node specific reserved memory
    which is not really reserved.

    This patch has the UEFI stub remove the memory reserve map entries
    from the FDT as it does with the memory nodes. This allows
    early_init_fdt_scan_reserved_mem() to be called unconditionally
    so that the other needed reservations are made.

    Signed-off-by: Mark Salter
    Acked-by: Ard Biesheuvel
    Acked-by: Mark Rutland
    Signed-off-by: Matt Fleming

    Mark Salter
     

22 Aug, 2014

1 commit


09 Aug, 2014

1 commit

  • This patch does two things. It passes EFI run time mappings to second
    kernel in bootparams efi_info. Second kernel parse this info and create
    new mappings in second kernel. That means mappings in first and second
    kernel will be same. This paves the way to enable EFI in kexec kernel.

    This patch also prepares and passes EFI setup data through bootparams.
    This contains bunch of information about various tables and their
    addresses.

    These information gathering and passing has been written along the lines
    of what current kexec-tools is doing to make kexec work with UEFI.

    [akpm@linux-foundation.org: s/get_efi/efi_get/g, per Matt]
    Signed-off-by: Vivek Goyal
    Cc: Borislav Petkov
    Cc: Michael Kerrisk
    Cc: Yinghai Lu
    Cc: Eric Biederman
    Cc: H. Peter Anvin
    Cc: Matthew Garrett
    Cc: Greg Kroah-Hartman
    Cc: Dave Young
    Cc: WANG Chao
    Cc: Baoquan He
    Cc: Andy Lutomirski
    Cc: Matt Fleming
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     

07 Aug, 2014

4 commits

  • Merge incoming from Andrew Morton:
    - Various misc things.
    - arch/sh updates.
    - Part of ocfs2. Review is slow.
    - Slab updates.
    - Most of -mm.
    - printk updates.
    - lib/ updates.
    - checkpatch updates.

    * emailed patches from Andrew Morton : (226 commits)
    checkpatch: update $declaration_macros, add uninitialized_var
    checkpatch: warn on missing spaces in broken up quoted
    checkpatch: fix false positives for --strict "space after cast" test
    checkpatch: fix false positive MISSING_BREAK warnings with --file
    checkpatch: add test for native c90 types in unusual order
    checkpatch: add signed generic types
    checkpatch: add short int to c variable types
    checkpatch: add for_each tests to indentation and brace tests
    checkpatch: fix brace style misuses of else and while
    checkpatch: add --fix option for a couple OPEN_BRACE misuses
    checkpatch: use the correct indentation for which()
    checkpatch: add fix_insert_line and fix_delete_line helpers
    checkpatch: add ability to insert and delete lines to patch/file
    checkpatch: add an index variable for fixed lines
    checkpatch: warn on break after goto or return with same tab indentation
    checkpatch: emit a warning on file add/move/delete
    checkpatch: add test for commit id formatting style in commit log
    checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings
    checkpatch: improve "no space after cast" test
    checkpatch: allow multiple const * types
    ...

    Linus Torvalds
     
  • Pull ACPI and power management updates from Rafael Wysocki:
    "Again, ACPICA leads the pack (47 commits), followed by cpufreq (18
    commits) and system suspend/hibernation (9 commits).

    From the new code perspective, the ACPICA update brings ACPI 5.1 to
    the table, including a new device configuration object called _DSD
    (Device Specific Data) that will hopefully help us to operate device
    properties like Device Trees do (at least to some extent) and changes
    related to supporting ACPI on ARM.

    Apart from that we have hibernation changes making it use radix trees
    to store memory bitmaps which should speed up some operations carried
    out by it quite significantly. We also have some power management
    changes related to suspend-to-idle (the "freeze" sleep state) support
    and more preliminary changes needed to support ACPI on ARM (outside of
    ACPICA).

    The rest is fixes and cleanups pretty much everywhere.

    Specifics:

    - ACPICA update to upstream version 20140724. That includes ACPI 5.1
    material (support for the _CCA and _DSD predefined names, changes
    related to the DMAR and PCCT tables and ARM support among other
    things) and cleanups related to using ACPICA's header files. A
    major part of it is related to acpidump and the core code used by
    that utility. Changes from Bob Moore, David E Box, Lv Zheng,
    Sascha Wildner, Tomasz Nowicki, Hanjun Guo.

    - Radix trees for memory bitmaps used by the hibernation core from
    Joerg Roedel.

    - Support for waking up the system from suspend-to-idle (also known
    as the "freeze" sleep state) using ACPI-based PCI wakeup signaling
    (Rafael J Wysocki).

    - Fixes for issues related to ACPI button events (Rafael J Wysocki).

    - New device ID for an ACPI-enumerated device included into the
    Wildcat Point PCH from Jie Yang.

    - ACPI video updates related to backlight handling from Hans de Goede
    and Linus Torvalds.

    - Preliminary changes needed to support ACPI on ARM from Hanjun Guo
    and Graeme Gregory.

    - ACPI PNP core cleanups from Arjun Sreedharan and Zhang Rui.

    - Cleanups related to ACPI_COMPANION() and ACPI_HANDLE() macros
    (Rafael J Wysocki).

    - ACPI-based device hotplug cleanups from Wei Yongjun and Rafael J
    Wysocki.

    - Cleanups and improvements related to system suspend from Lan
    Tianyu, Randy Dunlap and Rafael J Wysocki.

    - ACPI battery cleanup from Wei Yongjun.

    - cpufreq core fixes from Viresh Kumar.

    - Elimination of a deadband effect from the cpufreq ondemand governor
    and intel_pstate driver cleanups from Stratos Karafotis.

    - 350MHz CPU support for the powernow-k6 cpufreq driver from Mikulas
    Patocka.

    - Fix for the imx6 cpufreq driver from Anson Huang.

    - cpuidle core and governor cleanups from Daniel Lezcano, Sandeep
    Tripathy and Mohammad Merajul Islam Molla.

    - Build fix for the big_little cpuidle driver from Sachin Kamat.

    - Configuration fix for the Operation Performance Points (OPP)
    framework from Mark Brown.

    - APM cleanup from Jean Delvare.

    - cpupower utility fixes and cleanups from Peter Senna Tschudin,
    Andrey Utkin, Himangi Saraogi, Rickard Strandqvist, Thomas
    Renninger"

    * tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (118 commits)
    ACPI / LPSS: add LPSS device for Wildcat Point PCH
    ACPI / PNP: Replace faulty is_hex_digit() by isxdigit()
    ACPICA: Update version to 20140724.
    ACPICA: ACPI 5.1: Update for PCCT table changes.
    ACPICA/ARM: ACPI 5.1: Update for GTDT table changes.
    ACPICA/ARM: ACPI 5.1: Update for MADT changes.
    ACPICA/ARM: ACPI 5.1: Update for FADT changes.
    ACPICA: ACPI 5.1: Support for the _CCA predifined name.
    ACPICA: ACPI 5.1: New notify value for System Affinity Update.
    ACPICA: ACPI 5.1: Support for the _DSD predefined name.
    ACPICA: Debug object: Add current value of Timer() to debug line prefix.
    ACPICA: acpihelp: Add UUID support, restructure some existing files.
    ACPICA: Utilities: Fix local printf issue.
    ACPICA: Tables: Update for DMAR table changes.
    ACPICA: Remove some extraneous printf arguments.
    ACPICA: Update for comments/formatting. No functional changes.
    ACPICA: Disassembler: Add support for the ToUUID opererator (macro).
    ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro.
    ACPICA: Work around an ancient GCC bug.
    ACPI / processor: Make it possible to get local x2apic id via _MAT
    ...

    Linus Torvalds
     
  • When limiting memory by mem= and ACPI DSDT table has PNP0C80,
    firmware_map_entrys of same memory range are allocated and memmap X
    sysfses which have same memory range are created as follows:

    # cat /sys/firmware/memmap/0/*
    0x407ffffffff
    0x40000000000
    System RAM
    # cat /sys/firmware/memmap/33/*
    0x407ffffffff
    0x40000000000
    System RAM
    # cat /sys/firmware/memmap/35/*
    0x407ffffffff
    0x40000000000
    System RAM

    In this case, when hot-removing memory, kernel panic occurs, showing
    following call trace:

    BUG: unable to handle kernel paging request at 00000001003e000b
    IP: sysfs_open_file+0x46/0x2b0
    PGD 203a89fe067 PUD 0
    Oops: 0000 [#1] SMP
    ...
    Call Trace:
    do_dentry_open+0x1ef/0x2a0
    finish_open+0x31/0x40
    do_last+0x57c/0x1220
    path_openat+0xc2/0x4c0
    do_filp_open+0x4b/0xb0
    do_sys_open+0xf3/0x1f0
    SyS_open+0x1e/0x20
    system_call_fastpath+0x16/0x1b

    The problem occurs as follows:

    When calling e820_reserve_resources(), firmware_map_entrys of all e820
    memory map are allocated. And all firmware_map_entrys is added
    map_entries list as follows:

    map_entries
    -> +--- entry A --------+ -> ...
    | start 0x407ffffffff|
    | end 0x40000000000|
    | type System RAM |
    +--------------------+

    After that, if ACPI DSDT table has PNP0C80 and the memory range is
    limited by mem=, the PNP0C80 is hot-added. Then firmware_map_entry of
    PNP0C80 is allocated and added map_entries list as follows:

    map_entries
    -> +--- entry A --------+ -> ... -> +--- entry B --------+
    | start 0x407ffffffff| | start 0x407ffffffff|
    | end 0x40000000000| | end 0x40000000000|
    | type System RAM | | type System RAM |
    +--------------------+ +--------------------+

    Then memmap 0 sysfs for entry B is created.

    After that, firmware_memmap_init() creates memmap sysfses of all
    firmware_map_entrys in map_entries list. As a result, memmap 33 sysfs
    for entry A and memmap 35 sysfs for entry B are created. But kobject of
    entry B has been used by memmap 0 sysfs. So when creating memmap 35
    sysfs, the kobject is broken.

    If hot-removing memory, memmap 0 sysfs is destroyed and kobject of
    memmap 0 sysfs is freed. But the kobject can be accessed via memmap 35
    sysfs. So when open memmap 35 sysfs, kernel panic occurs.

    This patch checks whether there is firmware_map_entry of same memory
    range in map_entries list and don't allocate firmware_map_entry of same
    memroy range.

    Signed-off-by: Yasuaki Ishimatsu
    Cc: Santosh Shilimkar
    Cc: Toshi Kani
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasuaki Ishimatsu
     
  • firmware_map_add_hotplug() calls firmware_map_find_entry_bootmem() to
    get free firmware_map_entry. But end arguments is not correct. So
    firmware_map_find_entry_bootmem() cannot not find firmware_map_entry.

    The patch passes the correct end argument to firmware_map_find_entry_bootmem().

    Signed-off-by: Yasuaki Ishimatsu
    Cc: Santosh Shilimkar
    Cc: Toshi Kani
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasuaki Ishimatsu
     

05 Aug, 2014

2 commits

  • Pull RAS updates from Ingo Molnar:
    "The main changes in this cycle are:

    - RAS tracing/events infrastructure, by Gong Chen.

    - Various generalizations of the APEI code to make it available to
    non-x86 architectures, by Tomasz Nowicki"

    * 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/ras: Fix build warnings in
    acpi, apei, ghes: Factor out ioremap virtual memory for IRQ and NMI context.
    acpi, apei, ghes: Make NMI error notification to be GHES architecture extension.
    apei, mce: Factor out APEI architecture specific MCE calls.
    RAS, extlog: Adjust init flow
    trace, eMCA: Add a knob to adjust where to save event log
    trace, RAS: Add eMCA trace event interface
    RAS, debugfs: Add debugfs interface for RAS subsystem
    CPER: Adjust code flow of some functions
    x86, MCE: Robustify mcheck_init_device
    trace, AER: Move trace into unified interface
    trace, RAS: Add basic RAS trace event
    x86, MCE: Kill CPU_POST_DEAD

    Linus Torvalds
     
  • Pull EFI changes from Ingo Molnar:
    "Main changes in this cycle are:

    - arm64 efi stub fixes, preservation of FP/SIMD registers across
    firmware calls, and conversion of the EFI stub code into a static
    library - Ard Biesheuvel

    - Xen EFI support - Daniel Kiper

    - Support for autoloading the efivars driver - Lee, Chun-Yi

    - Use the PE/COFF headers in the x86 EFI boot stub to request that
    the stub be loaded with CONFIG_PHYSICAL_ALIGN alignment - Michael
    Brown

    - Consolidate all the x86 EFI quirks into one file - Saurabh Tangri

    - Additional error logging in x86 EFI boot stub - Ulf Winkelvos

    - Support loading initrd above 4G in EFI boot stub - Yinghai Lu

    - EFI reboot patches for ACPI hardware reduced platforms"

    * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits)
    efi/arm64: Handle missing virtual mapping for UEFI System Table
    arch/x86/xen: Silence compiler warnings
    xen: Silence compiler warnings
    x86/efi: Request desired alignment via the PE/COFF headers
    x86/efi: Add better error logging to EFI boot stub
    efi: Autoload efivars
    efi: Update stale locking comment for struct efivars
    arch/x86: Remove efi_set_rtc_mmss()
    arch/x86: Replace plain strings with constants
    xen: Put EFI machinery in place
    xen: Define EFI related stuff
    arch/x86: Remove redundant set_bit(EFI_MEMMAP) call
    arch/x86: Remove redundant set_bit(EFI_SYSTEM_TABLES) call
    efi: Introduce EFI_PARAVIRT flag
    arch/x86: Do not access EFI memory map if it is not available
    efi: Use early_mem*() instead of early_io*()
    arch/ia64: Define early_memunmap()
    x86/reboot: Add EFI reboot quirk for ACPI Hardware Reduced flag
    efi/reboot: Allow powering off machines using EFI
    efi/reboot: Add generic wrapper around EfiResetSystem()
    ...

    Linus Torvalds
     

31 Jul, 2014

1 commit

  • APEI is currently implemented so that it depends on x86 hardware.
    The primary dependency is that GHES uses the x86 NMI for hardware
    error notification and MCE for memory error handling. These patches
    remove that dependency.

    Other APEI features such as error reporting via external IRQ, error
    serialization, or error injection, do not require changes to use them
    on non-x86 architectures.

    The following patch set eliminates the APEI Kconfig x86 dependency
    by making these changes:
    - treat NMI notification as GHES architecture - HAVE_ACPI_APEI_NMI
    - group and wrap around #ifdef CONFIG_HAVE_ACPI_APEI_NMI code which
    is used only for NMI path
    - identify architectural boxes and abstract it accordingly (tlb flush and MCE)
    - rework ioremap for both IRQ and NMI context

    NMI code is kept in ghes.c file since NMI and IRQ context are tightly coupled.

    Note, these patches introduce no functional changes for x86. The NMI notification
    feature is hard selected for x86. Architectures that want to use this
    feature should also provide NMI code infrastructure.

    H. Peter Anvin
     

28 Jul, 2014

1 commit

  • * acpica: (30 commits)
    ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake.
    ACPICA: GPEs: Do not allow enable for GPEs that have no handler(s).
    ACPICA: Fix a regression for deletion of Alias() objects.
    ACPICA: Update version to 20140627
    ACPICA: Tables: Merge DMAR table structure updates
    ACPICA: Hardware: back port of a recursive locking fix
    ACPICA: utprint/oslibcfs: cleanup - no functional change
    ACPICA: Executer: Fix trivial issues in acpi_get_serial_access_bytes()
    ACPICA: OSL: Update acpidump to reduce source code differences
    ACPICA: acpidump: Reduce freopen() invocations to improve portability
    ACPICA: acpidump: Replace file IOs with new APIs to improve portability
    ACPICA: acpidump: Remove exit() from generic layer to improve portability
    ACPICA: acpidump: Add memory/string OSL usage to improve portability
    ACPICA: Common: Enhance acpi_getopt() to improve portability
    ACPICA: Common: Enhance cm_get_file_size() to improve portability
    ACPICA: Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with acpi_os_printf() to improve portability
    ACPICA: Utilities: Introduce acpi_log_error() to improve portability
    ACPICA: Utilities: Add formatted printing APIs
    ACPICA: OSL: Add portable file IO to improve portability
    ACPICA: OSL: Clean up acpi_os_printf()/acpi_os_vprintf() stubs
    ...

    Rafael J. Wysocki
     

19 Jul, 2014

7 commits

  • The original patch is from Ben Hutchings's contribution to debian
    kernel. Got Ben's permission to remove the code of efi-pstore.c and
    send to linux-efi:
    https://github.com/BlankOn/linux-debian/blob/master/debian/patches/features/all/efi-autoload-efivars.patch

    efivars is generally useful to have on EFI systems, and in some cases
    it may be impossible to load it after a kernel upgrade in order to
    complete a boot loader update. At the same time we don't want to waste
    memory on non-EFI systems by making them built-in.

    Instead, give them module aliases as if they are platform drivers, and
    register a corresponding platform device whenever EFI runtime services
    are available. This should trigger udev to load them.

    Signed-off-by: Lee, Chun-Yi
    Cc: Ben Hutchings
    Tested-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming

    Lee, Chun-Yi
     
  • Introduce EFI_PARAVIRT flag. If it is set then kernel runs
    on EFI platform but it has not direct control on EFI stuff
    like EFI runtime, tables, structures, etc. If not this means
    that Linux Kernel has direct access to EFI infrastructure
    and everything runs as usual.

    This functionality is used in Xen dom0 because hypervisor
    has full control on EFI stuff and all calls from dom0 to
    EFI must be requested via special hypercall which in turn
    executes relevant EFI code in behalf of dom0.

    Signed-off-by: Daniel Kiper
    Signed-off-by: Matt Fleming

    Daniel Kiper
     
  • Use early_mem*() instead of early_io*() because all mapped EFI regions
    are memory (usually RAM but they could also be ROM, EPROM, EEPROM, flash,
    etc.) not I/O regions. Additionally, I/O family calls do not work correctly
    under Xen in our case. early_ioremap() skips the PFN to MFN conversion
    when building the PTE. Using it for memory will attempt to map the wrong
    machine frame. However, all artificial EFI structures created under Xen
    live in dom0 memory and should be mapped/unmapped using early_mem*() family
    calls which map domain memory.

    Signed-off-by: Daniel Kiper
    Cc: Leif Lindholm
    Cc: Mark Salter
    Signed-off-by: Matt Fleming

    Daniel Kiper
     
  • It appears that the BayTrail-T class of hardware requires EFI in order
    to powerdown and reboot and no other reliable method exists.

    This quirk is generally applicable to all hardware that has the ACPI
    Hardware Reduced bit set, since usually ACPI would be the preferred
    method.

    Cc: Len Brown
    Cc: Mark Salter
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • Not only can EfiResetSystem() be used to reboot, it can also be used to
    power down machines.

    By and large, this functionality doesn't work very well across the range
    of EFI machines in the wild, so it should definitely only be used as a
    last resort. In an ideal world, this wouldn't be needed at all.

    Unfortunately, we're starting to see machines where EFI is the *only*
    reliable way to power down, and nothing else, not PCI, not ACPI, works.

    efi_poweroff_required() should be implemented on a per-architecture
    basis, since exactly when we should be using EFI runtime services is a
    platform-specific decision. There's no analogue for reboot because each
    architecture handles reboot very differently - the x86 code in
    particular is pretty complex.

    Patches to enable this for specific classes of hardware will be
    submitted separately.

    Tested-by: Mark Salter
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • Implement efi_reboot(), which is really just a wrapper around the
    EfiResetSystem() EFI runtime service, but it does at least allow us to
    funnel all callers through a single location.

    It also simplifies the callsites since users no longer need to check to
    see whether EFI_RUNTIME_SERVICES are enabled.

    Cc: Tony Luck
    Tested-by: Mark Salter
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • 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: Ard Biesheuvel
    Signed-off-by: Matt Fleming

    Ard Biesheuvel