21 May, 2016

1 commit

  • Pull driver core updates from Greg KH:
    "Here's the "big" driver core update for 4.7-rc1.

    Mostly just debugfs changes, the long-known and messy races with
    removing debugfs files should be fixed thanks to the great work of
    Nicolai Stange. We also have some isa updates in here (the x86
    maintainers told me to take it through this tree), a new warning when
    we run out of dynamic char major numbers, and a few other assorted
    changes, details in the shortlog.

    All have been in linux-next for some time with no reported issues"

    * tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits)
    Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case"
    gpio: ws16c48: Utilize the ISA bus driver
    gpio: 104-idio-16: Utilize the ISA bus driver
    gpio: 104-idi-48: Utilize the ISA bus driver
    gpio: 104-dio-48e: Utilize the ISA bus driver
    watchdog: ebc-c384_wdt: Utilize the ISA bus driver
    iio: stx104: Utilize the module_isa_driver and max_num_isa_dev macros
    iio: stx104: Add X86 dependency to STX104 Kconfig option
    Documentation: Add ISA bus driver documentation
    isa: Implement the max_num_isa_dev macro
    isa: Implement the module_isa_driver macro
    pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
    isa: Decouple X86_32 dependency from the ISA Kconfig option
    driver-core: use 'dev' argument in dev_dbg_ratelimited stub
    base: dd: don't remove driver_data in -EPROBE_DEFER case
    kernfs: Move faulting copy_user operations outside of the mutex
    devcoredump: add scatterlist support
    debugfs: unproxify files created through debugfs_create_u32_array()
    debugfs: unproxify files created through debugfs_create_blob()
    debugfs: unproxify files created through debugfs_create_bool()
    ...

    Linus Torvalds
     

20 May, 2016

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for 4.7. Here's the summary of
    the changes:

    - ATH79: Support for DTB passuing using the UHI boot protocol
    - ATH79: Remove support for builtin DTB.
    - ATH79: Add zboot debug serial support.
    - ATH79: Add initial support for Dragino MS14 (Dragine 2), Onion Omega
    and DPT-Module.
    - ATH79: Update devicetree clock support for AR9132 and AR9331.
    - ATH79: Cleanup the DT code.
    - ATH79: Support newer SOCs in ath79_ddr_ctrl_init.
    - ATH79: Fix regression in PCI window initialization.
    - BCM47xx: Move SPROM driver to drivers/firmware/
    - BCM63xx: Enable partition parser in defconfig.
    - BMIPS: BMIPS5000 has I cache filing from D cache
    - BMIPS: BMIPS: Add cpu-feature-overrides.h
    - BMIPS: Add Whirlwind support
    - BMIPS: Adjust mips-hpt-frequency for BCM7435
    - BMIPS: Remove maxcpus from BCM97435SVMB DTS
    - BMIPS: Add missing 7038 L1 register cells to BCM7435
    - BMIPS: Various tweaks to initialization code.
    - BMIPS: Enable partition parser in defconfig.
    - BMIPS: Cache tweaks.
    - BMIPS: Add UART, I2C and SATA devices to DT.
    - BMIPS: Add BCM6358 and BCM63268support
    - BMIPS: Add device tree example for BCM6358.
    - BMIPS: Improve Improve BCM6328 and BCM6368 device trees
    - Lantiq: Add support for device tree file from boot loader
    - Lantiq: Allow build with no built-in DT.
    - Loongson 3: Reserve 32MB for RS780E integrated GPU.
    - Loongson 3: Fix build error after ld-version.sh modification
    - Loongson 3: Move chipset ACPI code from drivers to arch.
    - Loongson 3: Speedup irq processing.
    - Loongson 3: Add basic Loongson 3A support.
    - Loongson 3: Set cache flush handlers to nop.
    - Loongson 3: Invalidate special TLBs when needed.
    - Loongson 3: Fast TLB refill handler.
    - MT7620: Fallback strategy for invalid syscfg0.
    - Netlogic: Fix CP0_EBASE redefinition warnings
    - Octeon: Initialization fixes
    - Octeon: Add DTS files for the D-Link DSR-1000N and EdgeRouter Lite
    - Octeon: Enable add Octeon-drivers in cavium_octeon_defconfig
    - Octeon: Correctly handle endian-swapped initramfs images.
    - Octeon: Support CN73xx, CN75xx and CN78xx.
    - Octeon: Remove dead code from cvmx-sysinfo.
    - Octeon: Extend number of supported CPUs past 32.
    - Octeon: Remove some code limiting NR_IRQS to 255.
    - Octeon: Simplify octeon_irq_ciu_gpio_set_type.
    - Octeon: Mark some functions __init in smp.c
    - Octeon: Octeon: Add Octeon III CN7xxx interface detection
    - PIC32: Add serial driver and bindings for it.
    - PIC32: Add PIC32 deadman timer driver and bindings.
    - PIC32: Add PIC32 clock timer driver and bindings.
    - Pistachio: Determine SoC revision during boot
    - Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER.
    - Sibyte: Strip redundant comments from bcm1480_regs.h.
    - Panic immediately if panic_on_oops is set.
    - module: fix incorrect IS_ERR_VALUE macro usage.
    - module: Make consistent use of pr_*
    - Remove no longer needed work_on_cpu() call.
    - Remove CONFIG_IPV6_PRIVACY from defconfigs.
    - Fix registers of non-crashing CPUs in dumps.
    - Handle MIPSisms in new vmcore_elf32_check_arch.
    - Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
    - Allow RIXI to be used on non-R2 or R6 cores.
    - Reserve nosave data for hibernation
    - Fix siginfo.h to use strict POSIX types.
    - Don't unwind user mode with EVA.
    - Fix watchpoint restoration
    - Ptrace watchpoints for R6.
    - Sync icache when it fills from dcache
    - I6400 I-cache fills from dcache.
    - Various MSA fixes.
    - Cleanup MIPS_CPU_* definitions.
    - Signal: Move generic copy_siginfo to signal.h
    - Signal: Fix uapi include in exported asm/siginfo.h
    - Timer fixes for sake of KVM.
    - XPA TLB refill fixes.
    - Treat perf counter feature
    - Update John Crispin's email address
    - Add PIC32 watchdog and bindings.
    - Handle R10000 LL/SC bug in set_pte()
    - cpufreq: Various fixes for Longson1.
    - R6: Fix R2 emulation.
    - mathemu: Cosmetic fix to ADDIUPC emulation, plenty of other small fixes
    - ELF: ABI and FP fixes.
    - Allow for relocatable kernel and use that to support KASLR.
    - Fix CPC_BASE_ADDR mask
    - Plenty fo smp-cps, CM, R6 and M6250 fixes.
    - Make reset_control_ops const.
    - Fix kernel command line handling of leading whitespace.
    - Cleanups to cache handling.
    - Add brcm, bcm6345-l1-intc device tree bindings.
    - Use generic clkdev.h header
    - Remove CLK_IS_ROOT usage.
    - Misc small cleanups.
    - CM: Fix compilation error when !MIPS_CM
    - oprofile: Fix a preemption issue
    - Detect DSP ASE v3 support:1"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (275 commits)
    MIPS: pic32mzda: fix getting timer clock rate.
    MIPS: ath79: fix regression in PCI window initialization
    MIPS: ath79: make ath79_ddr_ctrl_init() compatible for newer SoCs
    MIPS: Fix VZ probe gas errors with binutils of MSA context in non-MSA kernels
    MIPS: cevt-r4k: Dynamically calculate min_delta_ns
    MIPS: malta-time: Take seconds into account
    MIPS: malta-time: Start GIC count before syncing to RTC
    MIPS: Force CPUs to lose FP context during mode switches
    ...

    Linus Torvalds
     

19 May, 2016

2 commits

  • Pull iscsi_ibft updates from Konrad Rzeszutek Wilk:
    "The pull has two features - both of them expand the SysFS entries:

    - 'prefix-len' - which is subnet_mask_prefix of the iBFT header.

    - 'acpi_header' dir with: 'iBFT', OEM-ID (whatever it extracts from
    the iBFT header) and OEM_TABLE_ID (also whatever it extracts from
    the iBFT header). This is to help NIC drivers to figure out during
    bootup how to deal with BIOS created iBFT tables (like by TianoCore
    UEFI implemenation)"

    * 'stable/for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft:
    ibft: Expose iBFT acpi header via sysfs
    iscsi_ibft: Add prefix-len attr and display netmask

    Linus Torvalds
     
  • Pull ARM SoC driver updates from Arnd Bergmann:
    "Driver updates for ARM SoCs, these contain various things that touch
    the drivers/ directory but got merged through arm-soc for practical
    reasons.

    For the most part, this is now related to power management
    controllers, which have not yet been abstracted into a separate
    subsystem, and typically require some code in drivers/soc or arch/arm
    to control the power domains.

    Another large chunk here is a rework of the NVIDIA Tegra USB3.0
    support, which was surprisingly tricky and took a long time to get
    done.

    Finally, reset controller handling as always gets merged through here
    as well"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
    arm-ccn: Enable building as module
    soc/tegra: pmc: Add generic PM domain support
    usb: xhci: tegra: Add Tegra210 support
    usb: xhci: Add NVIDIA Tegra XUSB controller driver
    dt-bindings: usb: xhci-tegra: Add Tegra210 XUSB controller support
    dt-bindings: usb: Add NVIDIA Tegra XUSB controller binding
    PCI: tegra: Support per-lane PHYs
    dt-bindings: pci: tegra: Update for per-lane PHYs
    phy: tegra: Add Tegra210 support
    phy: Add Tegra XUSB pad controller support
    dt-bindings: phy: tegra-xusb-padctl: Add Tegra210 support
    dt-bindings: phy: Add NVIDIA Tegra XUSB pad controller binding
    phy: core: Allow children node to be overridden
    clk: tegra: Add interface to enable hardware control of SATA/XUSB PLLs
    drivers: firmware: psci: make two helper functions inline
    soc: renesas: rcar-sysc: Add support for R-Car H3 power areas
    soc: renesas: rcar-sysc: Add support for R-Car E2 power areas
    soc: renesas: rcar-sysc: Add support for R-Car M2-N power areas
    soc: renesas: rcar-sysc: Add support for R-Car M2-W power areas
    soc: renesas: rcar-sysc: Add support for R-Car H2 power areas
    ...

    Linus Torvalds
     

17 May, 2016

2 commits

  • Pull power management updates from Rafael Wysocki:
    "The majority of changes go into the cpufreq subsystem this time.

    To me, quite obviously, the biggest ticket item is the new "schedutil"
    governor. Interestingly enough, it's the first new cpufreq governor
    since the beginning of the git era (except for some out-of-the-tree
    ones).

    There are two main differences between it and the existing governors.
    First, it uses the information provided by the scheduler directly for
    making its decisions, so it doesn't have to track anything by itself.
    Second, it can invoke drivers (supporting that feature) to adjust CPU
    performance right away without having to spawn work items to be
    executed in process context or similar. Currently, the acpi-cpufreq
    driver is the only one supporting that mode of operation, but then it
    is used on a large number of systems.

    The "schedutil" governor as included here is very simple and mostly
    regarded as a foundation for future work on the integration of the
    scheduler with CPU power management (in fact, there is work in
    progress on top of it already). Nevertheless it works and the
    preliminary results obtained with it are encouraging.

    There also is some consolidation of CPU frequency management for ARM
    platforms that can add their machine IDs the the new stub dt-platdev
    driver now and that will take care of creating the requisite platform
    device for cpufreq-dt, so it is not necessary to do that in platform
    code any more. Several ARM platforms are switched over to using this
    generic mechanism.

    In addition to that, the intel_pstate driver is now going to respect
    CPU frequency limits set by the platform firmware (or a BMC) and
    provided via the ACPI _PPC object.

    The devfreq subsystem is getting a new "passive" governor for SoCs
    subsystems that will depend on somebody else to manage their voltage
    rails and its support for Samsung Exynos SoCs is consolidated.

    The rest is support for new hardware (Intel Broxton support in
    intel_idle for one example), bug fixes, optimizations and cleanups in
    a number of places.

    Specifics:

    - New cpufreq "schedutil" governor (making decisions based on CPU
    utilization information provided by the scheduler and capable of
    switching CPU frequencies right away if the underlying driver
    supports that) and support for fast frequency switching in the
    acpi-cpufreq driver (Rafael Wysocki)

    - Consolidation of CPU frequency management on ARM platforms allowing
    them to get rid of some platform-specific boilerplate code if they
    are going to use the cpufreq-dt driver (Viresh Kumar, Finley Xiao,
    Marc Gonzalez)

    - Support for ACPI _PPC and CPU frequency limits in the intel_pstate
    driver (Srinivas Pandruvada)

    - Fixes and cleanups in the cpufreq core and generic governor code
    (Rafael Wysocki, Sai Gurrappadi)

    - intel_pstate driver optimizations and cleanups (Rafael Wysocki,
    Philippe Longepe, Chen Yu, Joe Perches)

    - cpufreq powernv driver fixes and cleanups (Akshay Adiga, Shilpasri
    Bhat)

    - cpufreq qoriq driver fixes and cleanups (Jia Hongtao)

    - ACPI cpufreq driver cleanups (Viresh Kumar)

    - Assorted cpufreq driver updates (Ashwin Chaugule, Geliang Tang,
    Javier Martinez Canillas, Paul Gortmaker, Sudeep Holla)

    - Assorted cpufreq fixes and cleanups (Joe Perches, Arnd Bergmann)

    - Fixes and cleanups in the OPP (Operating Performance Points)
    framework, mostly related to OPP sharing, and reorganization of
    OF-dependent code in it (Viresh Kumar, Arnd Bergmann, Sudeep Holla)

    - New "passive" governor for devfreq (for SoC subsystems that will
    rely on someone else for the management of their power resources)
    and consolidation of devfreq support for Exynos platforms, coding
    style and typo fixes for devfreq (Chanwoo Choi, MyungJoo Ham)

    - PM core fixes and cleanups, mostly to make it work better with the
    generic power domains (genpd) framework, and updates for that
    framework (Ulf Hansson, Thierry Reding, Colin Ian King)

    - Intel Broxton support for the intel_idle driver (Len Brown)

    - cpuidle core optimization and fix (Daniel Lezcano, Dave Gerlach)

    - ARM cpuidle cleanups (Jisheng Zhang)

    - Intel Kabylake support for the RAPL power capping driver (Jacob
    Pan)

    - AVS (Adaptive Voltage Switching) rockchip-io driver update (Heiko
    Stuebner)

    - Updates for the cpupower tool (Arjun Sreedharan, Colin Ian King,
    Mattia Dongili, Thomas Renninger)"

    * tag 'pm-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (112 commits)
    intel_pstate: Clean up get_target_pstate_use_performance()
    intel_pstate: Use sample.core_avg_perf in get_avg_pstate()
    intel_pstate: Clarify average performance computation
    intel_pstate: Avoid unnecessary synchronize_sched() during initialization
    cpufreq: schedutil: Make default depend on CONFIG_SMP
    cpufreq: powernv: del_timer_sync when global and local pstate are equal
    cpufreq: powernv: Move smp_call_function_any() out of irq safe block
    intel_pstate: Clean up intel_pstate_get()
    cpufreq: schedutil: Make it depend on CONFIG_SMP
    cpufreq: governor: Fix handling of special cases in dbs_update()
    PM / OPP: Move CONFIG_OF dependent code in a separate file
    cpufreq: intel_pstate: Ignore _PPC processing under HWP
    cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table
    PM / OPP: add non-OF versions of dev_pm_opp_{cpumask_, }remove_table
    cpufreq: tango: Use generic platdev driver
    PM / OPP: pass cpumask by reference
    cpufreq: Fix GOV_LIMITS handling for the userspace governor
    cpupower: fix potential memory leak
    PM / devfreq: style/typo fixes
    PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus
    ..

    Linus Torvalds
     
  • Pull arm64 updates from Will Deacon:

    - virt_to_page/page_address optimisations

    - support for NUMA systems described using device-tree

    - support for hibernate/suspend-to-disk

    - proper support for maxcpus= command line parameter

    - detection and graceful handling of AArch64-only CPUs

    - miscellaneous cleanups and non-critical fixes

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (92 commits)
    arm64: do not enforce strict 16 byte alignment to stack pointer
    arm64: kernel: Fix incorrect brk randomization
    arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str
    arm64: secondary_start_kernel: Remove unnecessary barrier
    arm64: Ensure pmd_present() returns false after pmd_mknotpresent()
    arm64: Replace hard-coded values in the pmd/pud_bad() macros
    arm64: Implement pmdp_set_access_flags() for hardware AF/DBM
    arm64: Fix typo in the pmdp_huge_get_and_clear() definition
    arm64: mm: remove unnecessary EXPORT_SYMBOL_GPL
    arm64: always use STRICT_MM_TYPECHECKS
    arm64: kvm: Fix kvm teardown for systems using the extended idmap
    arm64: kaslr: increase randomization granularity
    arm64: kconfig: drop CONFIG_RTC_LIB dependency
    arm64: make ARCH_SUPPORTS_DEBUG_PAGEALLOC depend on !HIBERNATION
    arm64: hibernate: Refuse to hibernate if the boot cpu is offline
    arm64: kernel: Add support for hibernate/suspend-to-disk
    PM / Hibernate: Call flush_icache_range() on pages restored in-place
    arm64: Add new asm macro copy_page
    arm64: Promote KERNEL_START/KERNEL_END definitions to a header file
    arm64: kernel: Include _AC definition in page.h
    ...

    Linus Torvalds
     

16 May, 2016

3 commits

  • Some ethernet adapter vendors are supplying products which support optional
    (payed license) features. On some adapters this includes a hardware iscsi
    initiator. The same adapters in a normal (no extra licenses) mode of
    operation can be used as a software iscsi initiator. In addition, software
    iscsi boot initiators are becoming a standard part of many vendors uefi
    implementations. This is creating difficulties during early boot/install
    determining the proper configuration method for these adapters when they
    are used as a boot device.

    The attached patch creates sysfs entries to expose information from the
    acpi header of the ibft table. This information allows for a method to
    easily determining if an ibft table was created by a ethernet card's
    firmware or the system uefi/bios. In the case of a hardware initiator this
    information in combination with the pci vendor and device id can be used
    to ascertain any vendor specific behaviors that need to be accommodated.

    Reviewed-by: Lee Duncan
    Signed-off-by: David Bond
    Signed-off-by: Konrad Rzeszutek Wilk

    David Bond
     
  • The iBFT table only specifies a prefix length, not a netmask.
    And the netmask is pretty much pointless for IPv6.
    So introduce a new attribute 'prefix-len'.

    Some older user-space code might rely on the netmask attribute
    being present, so we should always display it.

    Changes from v1:
    - Combined two patches into one

    Changes from v2:
    - Cleaned up/corrected wording for patch description

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Lee Duncan
    Reviewed-by: Mike Christie
    Signed-off-by: Konrad Rzeszutek Wilk

    Hannes Reinecke
     
  • * pm-cpuidle:
    cpuidle: Replace ktime_get() with local_clock()
    drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops
    soc: qcom: spm: Use const and __initconst for qcom_cpuidle_ops
    ARM: cpuidle: constify return value of arm_cpuidle_get_ops()
    ARM: cpuidle: add const qualifier to cpuidle_ops member in structures
    intel_idle: add BXT support
    cpuidle: Indicate when a device has been unregistered

    Rafael J. Wysocki
     

13 May, 2016

1 commit

  • Broadcom ARM home routers store SPROM content in NVRAM just like MIPS
    ones. To share SPROM code we need to move it out of arch/mips/ to some
    common place. We already have bcm47xx_nvram in firmware path and SPROM
    should fit there as well.
    This driver is responsible for parsing SoC configuration data into a
    struct shared between ssb and bcma buses.
    This was tested with BCM4706 & BCM5357C0 (BCM47XX) and BCM4708A0
    (ARCH_BCM_5301X).

    Signed-off-by: Rafał Miłecki
    Cc: Hauke Mehrtens
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12210/
    Signed-off-by: Ralf Baechle

    Rafał Miłecki
     

07 May, 2016

5 commits

  • The parameters atomic and duplicates of efivar_init always have opposite
    values. Drop the parameter atomic, replace the uses of !atomic with
    duplicates, and update the call sites accordingly.

    The code using duplicates is slightly reorganized with an 'else', to avoid
    duplicating the lock code.

    Signed-off-by: Julia Lawall
    Signed-off-by: Matt Fleming
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Jeremy Kerr
    Cc: Linus Torvalds
    Cc: Matthew Garrett
    Cc: Peter Zijlstra
    Cc: Saurabh Sengar
    Cc: Thomas Gleixner
    Cc: Vaishali Thakkar
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462570771-13324-5-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Julia Lawall
     
  • Dan Carpenter reports that passing the address of the pointer to the
    kmalloc()'d memory for 'capsule' is dangerous:

    "drivers/firmware/efi/capsule.c:109 efi_capsule_supported()
    warn: did you mean to pass the address of 'capsule'

    108
    109 status = efi.query_capsule_caps(&capsule, 1, &max_size, reset);
    ^^^^^^^^
    If we modify capsule inside this function call then at the end of the
    function we aren't freeing the original pointer that we allocated."

    Ard Biesheuvel noted that we don't even need to call kmalloc() since the
    object we allocate isn't very big and doesn't need to persist after the
    function returns.

    Place 'capsule' on the stack instead.

    Suggested-by: Ard Biesheuvel
    Reported-by: Dan Carpenter
    Signed-off-by: Matt Fleming
    Acked-by: Ard Biesheuvel
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Bryan O'Donoghue
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Kweh Hock Leong
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: joeyli
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462570771-13324-4-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • GCC complains about a newly added file for the EFI Bootloader Control:

    drivers/firmware/efi/efibc.c: In function 'efibc_set_variable':
    drivers/firmware/efi/efibc.c:53:1: error: the frame size of 2272 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

    The problem is the declaration of a local variable of type struct
    efivar_entry, which is by itself larger than the warning limit of 1024
    bytes.

    Use dynamic memory allocation instead of stack memory for the entry
    object.

    This patch also fixes a potential buffer overflow.

    Reported-by: Ingo Molnar
    Reported-by: Arnd Bergmann
    Signed-off-by: Jeremy Compostella
    [ Updated changelog to include GCC error ]
    Signed-off-by: Matt Fleming
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462570771-13324-3-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Jeremy Compostella
     
  • Taking a mutex in the reboot path is bogus because we cannot sleep
    with interrupts disabled, such as when rebooting due to panic(),

    BUG: sleeping function called from invalid context at kernel/locking/mutex.c:97
    in_atomic(): 0, irqs_disabled(): 1, pid: 7, name: rcu_sched
    Call Trace:
    dump_stack+0x63/0x89
    ___might_sleep+0xd8/0x120
    __might_sleep+0x49/0x80
    mutex_lock+0x20/0x50
    efi_capsule_pending+0x1d/0x60
    native_machine_emergency_restart+0x59/0x280
    machine_emergency_restart+0x19/0x20
    emergency_restart+0x18/0x20
    panic+0x1ba/0x217

    In this case all other CPUs will have been stopped by the time we
    execute the platform reboot code, so 'capsule_pending' cannot change
    under our feet. We wouldn't care even if it could since we cannot wait
    for it complete.

    Also, instead of relying on the external 'system_state' variable just
    use a reboot notifier, so we can set 'stop_capsules' while holding
    'capsule_mutex', thereby avoiding a race where system_state is updated
    while we're in the middle of efi_capsule_update_locked() (since CPUs
    won't have been stopped at that point).

    Signed-off-by: Matt Fleming
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Bryan O'Donoghue
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Kweh Hock Leong
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: joeyli
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1462570771-13324-2-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     

05 May, 2016

1 commit


29 Apr, 2016

2 commits

  • Pull EFI fix from Ingo Molnar:
    "This fixes a bug in the efivars code"

    * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    efi: Fix out-of-bounds read in variable_matches()

    Linus Torvalds
     
  • Currently, our KASLR implementation randomizes the placement of the core
    kernel at 2 MB granularity. This is based on the arm64 kernel boot
    protocol, which mandates that the kernel is loaded TEXT_OFFSET bytes above
    a 2 MB aligned base address. This requirement is a result of the fact that
    the block size used by the early mapping code may be 2 MB at the most (for
    a 4 KB granule kernel)

    But we can do better than that: since a KASLR kernel needs to be relocated
    in any case, we can tolerate a physical misalignment as long as the virtual
    misalignment relative to this 2 MB block size is equal in size, and code to
    deal with this is already in place.

    Since we align the kernel segments to 64 KB, let's randomize the physical
    offset at 64 KB granularity as well (unless CONFIG_DEBUG_ALIGN_RODATA is
    enabled). This way, the page table and TLB footprint is not affected.

    The higher granularity allows for 5 bits of additional entropy to be used.

    Reviewed-by: Matt Fleming
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Will Deacon

    Ard Biesheuvel
     

28 Apr, 2016

22 commits

  • Now that arm, arm64, and x86 all provide ARCH_EFI_IRQ_FLAGS_MASK, we can
    get rid of the trivial and now unused implementation of
    efi_call_virt_check_flags().

    Signed-off-by: Mark Rutland
    Signed-off-by: Matt Fleming
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-41-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Mark Rutland
     
  • The UEFI spec allows runtime services to be called with interrupts
    masked or unmasked, and if a runtime service function needs to mask
    interrupts, it must restore the mask to its original state before
    returning (i.e. from the PoV of the OS, this does not change across a
    call). Firmware should never unmask exceptions, as these may then be
    taken by the OS unexpectedly.

    Unfortunately, some firmware has been seen to unmask IRQs (and
    potentially other maskable exceptions) across runtime services calls,
    leaving IRQ flags corrupted after returning from a runtime services
    function call. This may be detected by the IRQ tracing code, but often
    goes unnoticed, leaving a potentially disastrous bug hidden.

    This patch detects when the IRQ flags are corrupted by an EFI runtime
    services call, logging the call and specific corruption to the console.
    While restoring the expected value of the flags is insufficient to avoid
    problems, we do so to avoid redundant warnings from elsewhere (e.g. IRQ
    tracing).

    The set of bits in flags which we want to check is architecture-specific
    (e.g. we want to check FIQ on arm64, but not the zero flag on x86), so
    each arch must provide ARCH_EFI_IRQ_FLAGS_MASK to describe those. In the
    absence of this mask, the check is a no-op, and we redundantly save the
    flags twice, but that will be short-lived as subsequent patches
    will implement this and remove the scaffolding.

    Signed-off-by: Mark Rutland
    Signed-off-by: Matt Fleming
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Peter Zijlstra
    Cc: Robin Murphy
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-37-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Mark Rutland
     
  • Now that all users of the EFI runtime wrappers (arm,arm64,x86) have been
    migrated to the new setup/teardown macros, we don't need to support
    overridden {__,}efi_call_virt() implementations.

    This patch removes the unnecessary #ifdefs.

    Signed-off-by: Mark Rutland
    Signed-off-by: Matt Fleming
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-36-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Mark Rutland
     
  • Currently each architecture must implement two macros, efi_call_virt() and
    __efi_call_virt(), which only differ by the presence or absence of a
    return type. Otherwise, the logic surrounding the call is identical.

    As each architecture must define the entire body of each, we can't place
    any generic manipulation (e.g. irq flag validation) in the middle.

    This patch adds template implementations of these macros. With these,
    arch code can implement three template macros, avoiding reptition for
    the void/non-void return cases:

    * arch_efi_call_virt_setup()

    Sets up the environment for the call (e.g. switching page tables,
    allowing kernel-mode use of floating point, if required).

    * arch_efi_call_virt()

    Performs the call. The last expression in the macro must be the call
    itself, allowing the logic to be shared by the void and non-void
    cases.

    * arch_efi_call_virt_teardown()

    Restores the usual kernel environment once the call has returned.

    While the savings from repition are minimal, we additionally gain the
    ability to add common code around the call with the call environment set
    up. This can be used to detect common firmware issues (e.g. bad irq mask
    management).

    Signed-off-by: Mark Rutland
    Signed-off-by: Matt Fleming
    Reviewed-by: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-32-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Mark Rutland
     
  • Now that ARM has a fully functional memremap() implementation, there is
    no longer a need to remove the UEFI memory map from the linear mapping
    in order to be able to create a permanent mapping for it using generic
    code.

    So remove the 'IS_ENABLED(CONFIG_ARM)' conditional we added in:

    7cc8cbcf82d1 ("efi/arm64: Don't apply MEMBLOCK_NOMAP to UEFI memory map mapping")

    ... and revert to using memblock_reserve() for both ARM and arm64.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Leif Lindholm
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-31-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • This patch introduces a kernel module to expose a capsule loader
    interface (misc char device file note) for users to upload capsule
    binaries.

    Example:

    cat firmware.bin > /dev/efi_capsule_loader

    Any upload error will be returned while doing "cat" through file
    operation write() function call.

    Signed-off-by: Kweh, Hock Leong
    [ Update comments and Kconfig text ]
    Signed-off-by: Matt Fleming
    Reviewed-by: Bryan O'Donoghue
    Acked-by: Greg Kroah-Hartman
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Sam Protsenko
    Cc: Thomas Gleixner
    Cc: joeyli
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-30-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Kweh, Hock Leong
     
  • The EFI capsule mechanism allows data blobs to be passed to the EFI
    firmware. A common use case is performing firmware updates. This patch
    just introduces the main infrastructure for interacting with the
    firmware, and a driver that allows users to upload capsules will come
    in a later patch.

    Once a capsule has been passed to the firmware, the next reboot must
    be performed using the ResetSystem() EFI runtime service, which may
    involve overriding the reboot type specified by reboot=. This ensures
    the reset value returned by QueryCapsuleCapabilities() is used to
    reset the system, which is required for the capsule to be processed.
    efi_capsule_pending() is provided for this purpose.

    At the moment we only allow a single capsule blob to be sent to the
    firmware despite the fact that UpdateCapsule() takes a 'CapsuleCount'
    parameter. This simplifies the API and shouldn't result in any
    downside since it is still possible to send multiple capsules by
    repeatedly calling UpdateCapsule().

    Signed-off-by: Matt Fleming
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Bryan O'Donoghue
    Cc: Kweh Hock Leong
    Cc: Mark Salter
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: joeyli
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-28-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • Move efi_status_to_err() to the architecture independent code as it's
    generally useful in all bits of EFI code where there is a need to
    convert an efi_status_t to a kernel error value.

    Signed-off-by: Matt Fleming
    Acked-by: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Kweh Hock Leong
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: joeyli
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-27-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • This module installs a reboot callback, such that if reboot() is invoked
    with a string argument NNN, "NNN" is copied to the "LoaderEntryOneShot"
    EFI variable, to be read by the bootloader.

    If the string matches one of the boot labels defined in its configuration,
    the bootloader will boot once to that label. The "LoaderEntryRebootReason"
    EFI variable is set with the reboot reason: "reboot", "shutdown".

    The bootloader reads this reboot reason and takes particular action
    according to its policy.

    There are reboot implementations that do "reboot ", such as
    Android's reboot command and Upstart's reboot replacement, which pass
    the reason as an argument to the reboot syscall. There is no
    platform-agnostic way how those could be modified to pass the reason
    to the bootloader, regardless of platform or bootloader.

    Signed-off-by: Jeremy Compostella
    Signed-off-by: Matt Fleming
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: Stefan Stanacar
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-26-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Compostella, Jeremy
     
  • This adds code to the ARM and arm64 EFI init routines to expose a platform
    device of type 'efi-framebuffer' if 'struct screen_info' has been populated
    appropriately from the GOP protocol by the stub. Since the framebuffer may
    potentially be located in system RAM, make sure that the region is reserved
    and marked MEMBLOCK_NOMAP.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: David Herrmann
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-24-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • This adds the code to the ARM and arm64 versions of the UEFI stub to
    populate struct screen_info based on the information received from the
    firmware via the GOP protocol.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: David Herrmann
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-23-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • In order to hand over the framebuffer described by the GOP protocol and
    discovered by the UEFI stub, make struct screen_info accessible by the
    stub. This involves allocating a loader data buffer and passing it to the
    kernel proper via a UEFI Configuration Table, since the UEFI stub executes
    in the context of the decompressor, and cannot access the kernel's copy of
    struct screen_info directly.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: David Herrmann
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-22-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • The Graphics Output Protocol code executes in the stub, so create a generic
    version based on the x86 version in libstub so that we can move other archs
    to it in subsequent patches. The new source file gop.c is added to the
    libstub build for all architectures, but only wired up for x86.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: David Herrmann
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-18-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • Call into the generic memory attributes table support code at the
    appropriate times during the init sequence so that the UEFI Runtime
    Services region are mapped according to the strict permissions it
    specifies.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Sai Praneeth Prakhya
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-15-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • This implements shared support for discovering the presence of the
    Memory Attributes table, and for parsing and validating its contents.

    The table is validated against the construction rules in the UEFI spec.
    Since this is a new table, it makes sense to complain if we encounter
    a table that does not follow those rules.

    The parsing and validation routine takes a callback that can be specified
    per architecture, that gets passed each unique validated region, with the
    virtual address retrieved from the ordinary memory map.

    Signed-off-by: Ard Biesheuvel
    [ Trim pr_*() strings to 80 cols and use EFI consistently. ]
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Sai Praneeth Prakhya
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-14-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • This declares the GUID and struct typedef for the new memory attributes
    table which contains the permissions that can be used to apply stricter
    permissions to UEFI Runtime Services memory regions.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Leif Lindholm
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Sai Praneeth Prakhya
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-13-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • Instead of using ioremap_cache(), which is slightly inappropriate for
    mapping firmware tables, and is not even allowed on ARM for mapping
    regions that are covered by a struct page, use memremap(), which was
    invented for this purpose, and will also reuse the existing kernel
    direct mapping if the requested region is covered by it.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-10-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • Our efi_memory_desc_t type is based on EFI_MEMORY_DESCRIPTOR version 1 in
    the UEFI spec. No version updates are expected, but since we are about to
    introduce support for new firmware tables that use the same descriptor
    type, it makes sense to at least warn if we encounter other versions.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-9-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • Abolish the poorly named EFI memory map, 'memmap'. It is shadowed by a
    bunch of local definitions in various files and having two ways to
    access the EFI memory map ('efi.memmap' vs. 'memmap') is rather
    confusing.

    Furthermore, IA64 doesn't even provide this global object, which has
    caused issues when trying to write generic EFI memmap code.

    Replace all occurrences with efi.memmap, and convert the remaining
    iterator code to use for_each_efi_mem_desc().

    Signed-off-by: Matt Fleming
    Reviewed-by: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Luck, Tony
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-8-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • Most of the users of for_each_efi_memory_desc() are equally happy
    iterating over the EFI memory map in efi.memmap instead of 'memmap',
    since the former is usually a pointer to the latter.

    For those users that want to specify an EFI memory map other than
    efi.memmap, that can be done using for_each_efi_memory_desc_in_map().
    One such example is in the libstub code where the firmware is queried
    directly for the memory map, it gets iterated over, and then freed.

    This change goes part of the way toward deleting the global 'memmap'
    variable, which is not universally available on all architectures
    (notably IA64) and is rather poorly named.

    Signed-off-by: Matt Fleming
    Reviewed-by: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Leif Lindholm
    Cc: Mark Salter
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-7-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • According to the UEFI specification (version 2.5 Errata A, page 87):

    The platform firmware is operating in secure boot mode if the value of
    the SetupMode variable is 0 and the SecureBoot variable is set to 1. A
    platform cannot operate in secure boot mode if the SetupMode variable
    is set to 1.

    Check the value of the SetupMode variable when determining the state of
    Secure Boot.

    Plus also do minor cleanup, change sizeof() use to match kernel style guidelines.

    Signed-off-by: Linn Crosetto
    Signed-off-by: Matt Fleming
    Reviewed-by: Ard Biesheuvel
    Acked-by: Mark Rutland
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: Roy Franz
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-6-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Linn Crosetto
     
  • Certain code in the boot path may require the ability to determine whether
    UEFI Secure Boot is definitely enabled, for example printing status to the
    console. Other code may need to know when UEFI Secure Boot is definitely
    disabled, for example restricting use of kernel parameters.

    If an unexpected error is returned from GetVariable() when querying the
    status of UEFI Secure Boot, return an error to the caller. This allows the
    caller to determine the definite state, and to take appropriate action if
    an expected error is returned.

    Signed-off-by: Linn Crosetto
    Signed-off-by: Matt Fleming
    Reviewed-by: Ard Biesheuvel
    Acked-by: Mark Rutland
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: Roy Franz
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-5-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Linn Crosetto