1. 16 Nov, 2017 1 commit
    • Michael Holzheu's avatar
      s390: Remove CONFIG_HARDENED_USERCOPY · 6470c0cc
      Michael Holzheu authored
      When running the crash tool on a s390 live system we get a kernel panic
      for reading memory within the kernel image:
      
       # uname -a
         Linux r3545011 4.14.0-rc8-00066-g1c9dbd46 #45 SMP PREEMPT Fri Nov 10 16:16:22 CET 2017 s390x s390x s390x GNU/Linux
       # crash /boot/vmlinux-devel /dev/mem
       # crash> rd 0x100000
      
       usercopy: kernel memory exposure attempt detected from 0000000000100000 (<kernel text>) (8 bytes)
       ------------[ cut here ]------------
       kernel BUG at mm/usercopy.c:72!
       illegal operation: 0001 ilc:1 [#1] PREEMPT SMP.
       Modules linked in:
       CPU: 0 PID: 1461 Comm: crash Not tainted 4.14.0-rc8-00066-g1c9dbd46-dirty #46
       Hardware name: IBM 2827 H66 706 (z/VM 6.3.0)
       task: 000000001ad10100 task.stack: 000000001df78000
       Krnl PSW : 0704d00180000000 000000000038165c (__check_object_size+0x164/0x1d0)
                  R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3
       Krnl GPRS: 0000000012440e1d 0000000080000000 0000000000000061 00000000001cabc0
                  00000000001cc6d6 0000000000000000 0000000000cc4ed2 0000000000001000
                  000003ffc22fdd20 0000000000000008 0000000000100008 0000000000000001
                  0000000000000008 0000000000100000 0000000000381658 000000001df7bc90
       Krnl Code: 000000000038164c: c020004a1c4a        larl    %r2,cc4ee0
                  0000000000381652: c0e5fff2581b        brasl   %r14,1cc688
                 #0000000000381658: a7f40001            brc     15,38165a
                 >000000000038165c: eb42000c000c        srlg    %r4,%r2,12
                  0000000000381662: eb32001c000c        srlg    %r3,%r2,28
                  0000000000381668: c0110003ffff        lgfi    %r1,262143
                  000000000038166e: ec31ff752065        clgrj   %r3,%r1,2,381558
                  0000000000381674: a7f4ff67            brc     15,381542
       Call Trace:
       ([<0000000000381658>] __check_object_size+0x160/0x1d0)
        [<000000000082263a>] read_mem+0xaa/0x130.
        [<0000000000386182>] __vfs_read+0x42/0x168.
        [<000000000038632e>] vfs_read+0x86/0x140.
        [<0000000000386a26>] SyS_read+0x66/0xc0.
        [<0000000000ace6a4>] system_call+0xc4/0x2b0.
       INFO: lockdep is turned off.
       Last Breaking-Event-Address:
        [<0000000000381658>] __check_object_size+0x160/0x1d0
      
       Kernel panic - not syncing: Fatal exception: panic_on_oops
      
      With CONFIG_HARDENED_USERCOPY copy_to_user() checks in __check_object_size()
      if the source address is within the kernel image. When the crash tool reads
      from 0x100000, this check leads to the kernel BUG().
      
      So disable the kernel config option until this bug is fixed.
      
      Corresponding bug report on LKML: https://lkml.org/lkml/2017/11/10/341Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      6470c0cc
  2. 14 Nov, 2017 30 commits
    • Heiko Carstens's avatar
      s390: enable CPU alternatives unconditionally · 049a2c2d
      Heiko Carstens authored
      Remove the CPU_ALTERNATIVES config option and enable the code
      unconditionally. The config option was only added to avoid a conflict
      with the named saved segment support. Since that code is gone there is
      no reason to keep the CPU_ALTERNATIVES config option.
      
      Just enable it unconditionally to also reduce the number of config
      options and make it less likely that something breaks.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      049a2c2d
    • Heiko Carstens's avatar
      s390/nmi: remove unused code · a6de0a91
      Heiko Carstens authored
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      a6de0a91
    • Heiko Carstens's avatar
      s390/mm: remove unused code · 2be1da8d
      Heiko Carstens authored
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      2be1da8d
    • Heiko Carstens's avatar
      s390/spinlock: fix indentation · 78ca4fe3
      Heiko Carstens authored
      checkpatch:
          WARNING: Statements should start on a tabstop
          #9499: FILE: arch/s390/lib/spinlock.c:231:
          +                          return;
      
      sparse:
      arch/s390/lib/spinlock.c:81 arch_load_niai4()
          warn: inconsistent indenting
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      78ca4fe3
    • Heiko Carstens's avatar
      s390/vdso: add missing boot_vdso_data declaration · 3c6153e8
      Heiko Carstens authored
      sparse says:
      arch/s390/kernel/vdso.c:150:18:
       warning: symbol 'boot_vdso_data' was not declared. Should it be static?
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      3c6153e8
    • Vasily Gorbik's avatar
      s390/kbuild: get rid of a warning when compiling with KCOV · dfd4c493
      Vasily Gorbik authored
      This change fixes the following warning:
      warning: (KCOV) selects GCC_PLUGINS which has unmet direct dependencies
      (HAVE_GCC_PLUGINS && !COMPILE_TEST)
      Signed-off-by: default avatarVasily Gorbik <gor@linux.vnet.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      dfd4c493
    • Vasily Gorbik's avatar
      s390: correct some inline assembly constraints · 11776eaa
      Vasily Gorbik authored
      Inline assembly code changed in this patch should really use "Q"
      constraint "Memory reference without index register and with short
      displacement". The kernel does not compile with kasan support enabled
      otherwise (due to stack instrumentation).
      Signed-off-by: default avatarVasily Gorbik <gor@linux.vnet.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      11776eaa
    • Martin Schwidefsky's avatar
      s390: remove all code using the access register mode · 0aaba41b
      Martin Schwidefsky authored
      The vdso code for the getcpu() and the clock_gettime() call use the access
      register mode to access the per-CPU vdso data page with the current code.
      
      An alternative to the complicated AR mode is to use the secondary space
      mode. This makes the vdso faster and quite a bit simpler. The downside is
      that the uaccess code has to be changed quite a bit.
      
      Which instructions are used depends on the machine and what kind of uaccess
      operation is requested. The instruction dictates which ASCE value needs
      to be loaded into %cr1 and %cr7.
      
      The different cases:
      
      * User copy with MVCOS for z10 and newer machines
        The MVCOS instruction can copy between the primary space (aka user) and
        the home space (aka kernel) directly. For set_fs(KERNEL_DS) the kernel
        ASCE is loaded into %cr1. For set_fs(USER_DS) the user space is already
        loaded in %cr1.
      
      * User copy with MVCP/MVCS for older machines
        To be able to execute the MVCP/MVCS instructions the kernel needs to
        switch to primary mode. The control register %cr1 has to be set to the
        kernel ASCE and %cr7 to either the kernel ASCE or the user ASCE dependent
        on set_fs(KERNEL_DS) vs set_fs(USER_DS).
      
      * Data access in the user address space for strnlen / futex
        To use "normal" instruction with data from the user address space the
        secondary space mode is used. The kernel needs to switch to primary mode,
        %cr1 has to contain the kernel ASCE and %cr7 either the user ASCE or the
        kernel ASCE, dependent on set_fs.
      
      To load a new value into %cr1 or %cr7 is an expensive operation, the kernel
      tries to be lazy about it. E.g. for multiple user copies in a row with
      MVCP/MVCS the replacement of the vdso ASCE in %cr7 with the user ASCE is
      done only once. On return to user space a CPU bit is checked that loads the
      vdso ASCE again.
      
      To enable and disable the data access via the secondary space two new
      functions are added, enable_sacf_uaccess and disable_sacf_uaccess. The fact
      that a context is in secondary space uaccess mode is stored in the
      mm_segment_t value for the task. The code of an interrupt may use set_fs
      as long as it returns to the previous state it got with get_fs with another
      call to set_fs. The code in finish_arch_post_lock_switch simply has to do a
      set_fs with the current mm_segment_t value for the task.
      
      For CPUs with MVCOS:
      
      CPU running in                        | %cr1 ASCE | %cr7 ASCE |
      --------------------------------------|-----------|-----------|
      user space                            |  user     |  vdso     |
      kernel, USER_DS, normal-mode          |  user     |  vdso     |
      kernel, USER_DS, normal-mode, lazy    |  user     |  user     |
      kernel, USER_DS, sacf-mode            |  kernel   |  user     |
      kernel, KERNEL_DS, normal-mode        |  kernel   |  vdso     |
      kernel, KERNEL_DS, normal-mode, lazy  |  kernel   |  kernel   |
      kernel, KERNEL_DS, sacf-mode          |  kernel   |  kernel   |
      
      For CPUs without MVCOS:
      
      CPU running in                        | %cr1 ASCE | %cr7 ASCE |
      --------------------------------------|-----------|-----------|
      user space                            |  user     |  vdso     |
      kernel, USER_DS, normal-mode          |  user     |  vdso     |
      kernel, USER_DS, normal-mode lazy     |  kernel   |  user     |
      kernel, USER_DS, sacf-mode            |  kernel   |  user     |
      kernel, KERNEL_DS, normal-mode        |  kernel   |  vdso     |
      kernel, KERNEL_DS, normal-mode, lazy  |  kernel   |  kernel   |
      kernel, KERNEL_DS, sacf-mode          |  kernel   |  kernel   |
      
      The lines with "lazy" refer to the state after a copy via the secondary
      space with a delayed reload of %cr1 and %cr7.
      
      There are three hardware address spaces that can cause a DAT exception,
      primary, secondary and home space. The exception can be related to
      four different fault types: user space fault, vdso fault, kernel fault,
      and the gmap faults.
      
      Dependent on the set_fs state and normal vs. sacf mode there are a number
      of fault combinations:
      
      1) user address space fault via the primary ASCE
      2) gmap address space fault via the primary ASCE
      3) kernel address space fault via the primary ASCE for machines with
         MVCOS and set_fs(KERNEL_DS)
      4) vdso address space faults via the secondary ASCE with an invalid
         address while running in secondary space in problem state
      5) user address space fault via the secondary ASCE for user-copy
         based on the secondary space mode, e.g. futex_ops or strnlen_user
      6) kernel address space fault via the secondary ASCE for user-copy
         with secondary space mode with set_fs(KERNEL_DS)
      7) kernel address space fault via the primary ASCE for user-copy
         with secondary space mode with set_fs(USER_DS) on machines without
         MVCOS.
      8) kernel address space fault via the home space ASCE
      
      Replace user_space_fault() with a new function get_fault_type() that
      can distinguish all four different fault types.
      
      With these changes the futex atomic ops from the kernel and the
      strnlen_user will get a little bit slower, as well as the old style
      uaccess with MVCP/MVCS. All user accesses based on MVCOS will be as
      fast as before. On the positive side, the user space vdso code is a
      lot faster and Linux ceases to use the complicated AR mode.
      Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      0aaba41b
    • Martin Schwidefsky's avatar
      s390/mm,kvm: improve detection of KVM guest faults · c771320e
      Martin Schwidefsky authored
      The identification of guest fault currently relies on the PF_VCPU flag.
      This is set in guest_entry_irqoff and cleared in guest_exit_irqoff.
      Both functions are called by __vcpu_run, the PF_VCPU flag is set for
      quite a lot of kernel code outside of the guest execution.
      
      Replace the PF_VCPU scheme with the PIF_GUEST_FAULT in the pt_regs and
      make the program check handler code in entry.S set the bit only for
      exception that occurred between the .Lsie_gmap and .Lsie_done labels.
      Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      c771320e
    • Kees Cook's avatar
      s390/ap_bus: Convert timers to use timer_setup() · cefbeb5d
      Kees Cook authored
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      
      Cc: Harald Freudenberger <freude@de.ibm.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      cefbeb5d
    • Kees Cook's avatar
      s390/sclp: Convert timers to use timer_setup() · c9602ee7
      Kees Cook authored
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly. Instead of creating an external static
      data variable, just define a separate callback which encodes the "force
      restart" desire.
      
      Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      [heiko.carstens@de.ibm.com: get rid of compile warning]
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      c9602ee7
    • Kees Cook's avatar
      s390/cio: Convert timers to use timer_setup() · 846d0c6f
      Kees Cook authored
      In preparation for unconditionally passing the struct timer_list
      pointer to all timer callbacks, switch to using the new timer_setup()
      and from_timer() to pass the timer pointer explicitly.
      
      Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
      Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      846d0c6f
    • Kees Cook's avatar
      s390: qdio: Convert timers to use timer_setup() · cb9f780a
      Kees Cook authored
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      
      Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      [sebott: fixed compile error due to invalid struct member]
      Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      cb9f780a
    • Linus Torvalds's avatar
      Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 894025f2
      Linus Torvalds authored
      Pull USB/PHY updates from Greg KH:
       "Here is the big set of USB and PHY driver updates for 4.15-rc1.
      
        There is the usual amount of gadget and xhci driver updates, along
        with phy and chipidea enhancements. There's also a lot of SPDX tags
        and license boilerplate cleanups as well, which provide some churn in
        the diffstat.
      
        Other major thing is the typec code that moved out of staging and into
        the "real" part of the drivers/usb/ tree, which was nice to see
        happen.
      
        All of these have been in linux-next with no reported issues for a
        while"
      
      * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits)
        usb: gadget: f_fs: Fix use-after-free in ffs_free_inst
        USB: usbfs: compute urb->actual_length for isochronous
        usb: core: message: remember to reset 'ret' to 0 when necessary
        USB: typec: Remove remaining redundant license text
        USB: typec: add SPDX identifiers to some files
        USB: renesas_usbhs: rcar?.h: add SPDX tags
        USB: chipidea: ci_hdrc_tegra.c: add SPDX line
        USB: host: xhci-debugfs: add SPDX lines
        USB: add SPDX identifiers to all remaining Makefiles
        usb: host: isp1362-hcd: remove a couple of redundant assignments
        USB: adutux: remove redundant variable minor
        usb: core: add a new usb_get_ptm_status() helper
        usb: core: add a 'type' parameter to usb_get_status()
        usb: core: introduce a new usb_get_std_status() helper
        usb: core: rename usb_get_status() 'type' argument to 'recip'
        usb: core: add Status Type definitions
        USB: gadget: Remove redundant license text
        USB: gadget: function: Remove redundant license text
        USB: gadget: udc: Remove redundant license text
        USB: gadget: legacy: Remove redundant license text
        ...
      894025f2
    • Linus Torvalds's avatar
      Merge tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · fb0255fb
      Linus Torvalds authored
      Pull tty/serial updates from Greg KH:
       "Here is the big tty/serial driver pull request for 4.15-rc1.
      
        Lots of serial driver updates in here, some small vt cleanups, and a
        raft of SPDX and license boilerplate cleanups, messing up the diffstat
        a bit.
      
        Nothing major, with no realy functional changes except better hardware
        support for some platforms.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (110 commits)
        tty: ehv_bytechan: fix spelling mistake
        tty: serial: meson: allow baud-rates lower than 9600
        serial: 8250_fintek: Fix crash with baud rate B0
        serial: 8250_fintek: Disable delays for ports != 0
        serial: 8250_fintek: Return -EINVAL on invalid configuration
        tty: Remove redundant license text
        tty: serdev: Remove redundant license text
        tty: hvc: Remove redundant license text
        tty: serial: Remove redundant license text
        tty: add SPDX identifiers to all remaining files in drivers/tty/
        tty: serial: jsm: remove redundant pointer ts
        tty: serial: jsm: add space before the open parenthesis '('
        tty: serial: jsm: fix coding style
        tty: serial: jsm: delete space between function name and '('
        tty: serial: jsm: add blank line after declarations
        tty: serial: jsm: change the type of local variable
        tty: serial: imx: remove dead code imx_dma_rxint
        tty: serial: imx: disable ageing timer interrupt if dma in use
        serial: 8250: fix potential deadlock in rs485-mode
        serial: m32r_sio: Drop redundant .data assignment
        ...
      fb0255fb
    • Linus Torvalds's avatar
      Merge tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 449fcf3a
      Linus Torvalds authored
      Pull staging and IIO updates from Greg KH:
       "Here is the "big" staging and IIO driver update for 4.15-rc1.
      
        Lots and lots of little changes, almost all minor code cleanups as the
        Outreachy application process happened during this development cycle.
        Also happened was a lot of IIO driver activity, and the typec USB code
        moving out of staging to drivers/usb (same commits are in the USB tree
        on a persistent branch to not cause merge issues.)
      
        Overall, it's a wash, I think we added a few hundred more lines than
        removed, but really only a few thousand were modified at all.
      
        All of these have been in linux-next for a while. There might be a
        merge issue with Al's vfs tree in the pi433 driver (take his changes,
        they are always better), and the media tree with some of the odd
        atomisp cleanups (take the media tree's version)"
      
      * tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (507 commits)
        staging: lustre: add SPDX identifiers to all lustre files
        staging: greybus: Remove redundant license text
        staging: greybus: add SPDX identifiers to all greybus driver files
        staging: ccree: simplify ioread/iowrite
        staging: ccree: simplify registers access
        staging: ccree: simplify error handling logic
        staging: ccree: remove dead code
        staging: ccree: handle limiting of DMA masks
        staging: ccree: copy IV to DMAable memory
        staging: fbtft: remove redundant initialization of buf
        staging: sm750fb: Fix parameter mistake in poke32
        staging: wilc1000: Fix bssid buffer offset in Txq
        staging: fbtft: fb_ssd1331: fix mirrored display
        staging: android: Fix checkpatch.pl error
        staging: greybus: loopback: convert loopback to use generic async operations
        staging: greybus: operation: add private data with get/set accessors
        staging: greybus: loopback: Fix iteration count on async path
        staging: greybus: loopback: Hold per-connection mutex across operations
        staging: greybus/loopback: use ktime_get() for time intervals
        staging: fsl-dpaa2/eth: Extra headroom in RX buffers
        ...
      449fcf3a
    • Linus Torvalds's avatar
      Merge tag 'devprop-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3c073991
      Linus Torvalds authored
      Pull device properties framework updates from Rafael Wysocki:
       "These make the fwnode_handle_get() function return a pointer to the
        target fwnode object, which reflects the of_node_get() behavior, and
        add a macro for iterating over graph endpoints (Sakari Ailus)"
      
      * tag 'devprop-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        device property: Add a macro for interating over graph endpoints
        device property: Make fwnode_handle_get() return the fwnode
      3c073991
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 04ed5109
      Linus Torvalds authored
      Pull ACPI updates from Rafael Wysocki:
       "These update ACPICA to upstream revision 20170831, fix APEI to use the
        fixmap instead of ioremap_page_range(), add an operation region driver
        for TI PMIC TPS68470, add support for PCC subspace IDs to the ACPI
        CPPC driver, fix a few assorted issues and clean up some code.
      
        Specifics:
      
         - Update the ACPICA code to upstream revision 20170831 including
            * PDTT table header support (Bob Moore).
            * Cleanup and extension of internal string-to-integer conversion
              functions (Bob Moore).
            * Support for 64-bit hardware accesses (Lv Zheng).
            * ACPI PM Timer code adjustment to deal with 64-bit return values
              of acpi_hw_read() (Bob Moore).
            * Support for deferred table verification in acpiexec (Lv Zheng).
      
         - Fix APEI to use the fixmap instead of ioremap_page_range() which
           cannot work correctly the way the code in there attempted to use it
           and drop some code that's not necessary any more after that change
           (James Morse).
      
         - Clean up the APEI support code and make it use 64-bit timestamps
           (Arnd Bergmann, Dongjiu Geng, Jan Beulich).
      
         - Add operation region driver for TI PMIC TPS68470 (Rajmohan Mani).
      
         - Add support for PCC subspace IDs to the ACPI CPPC driver (George
           Cherian).
      
         - Fix an ACPI EC driver regression related to the handling of EC
           events during the "noirq" phases of system suspend/resume (Lv
           Zheng).
      
         - Delay the initialization of the lid state in the ACPI button driver
           to fix issues appearing on some systems (Hans de Goede).
      
         - Extend the KIOX000A "device always present" quirk to cover all
           affected BIOS versions (Hans de Goede).
      
         - Clean up some code in the ACPI core and drivers (Colin Ian King,
           Gustavo Silva)"
      
      * tag 'acpi-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (24 commits)
        ACPI: Mark expected switch fall-throughs
        ACPI / LPSS: Remove redundant initialization of clk
        ACPI / CPPC: Make CPPC ACPI driver aware of PCC subspace IDs
        mailbox: PCC: Move the MAX_PCC_SUBSPACES definition to header file
        ACPI / sysfs: Make function param_set_trace_method_name() static
        ACPI / button: Delay acpi_lid_initialize_state() until first user space open
        ACPI / EC: Fix regression related to triggering source of EC event handling
        APEI / ERST: use 64-bit timestamps
        ACPI / APEI: Remove arch_apei_flush_tlb_one()
        arm64: mm: Remove arch_apei_flush_tlb_one()
        ACPI / APEI: Remove ghes_ioremap_area
        ACPI / APEI: Replace ioremap_page_range() with fixmap
        ACPI / APEI: remove the unused dead-code for SEA/NMI notification type
        ACPI / x86: Extend KIOX000A quirk to cover all affected BIOS versions
        ACPI / APEI: adjust a local variable type in ghes_ioremap_pfn_irq()
        ACPICA: Update version to 20170831
        ACPICA: Update acpi_get_timer for 64-bit interface to acpi_hw_read
        ACPICA: String conversions: Update to add new behaviors
        ACPICA: String conversions: Cleanup/format comments. No functional changes
        ACPICA: Restructure/cleanup all string-to-integer conversion functions
        ...
      04ed5109
    • Linus Torvalds's avatar
      Merge tag 'pm-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · bd2cd7d5
      Linus Torvalds authored
      Pull power management updates from Rafael Wysocki:
       "There are no real big ticket items here this time.
      
        The most noticeable change is probably the relocation of the OPP
        (Operating Performance Points) framework to its own directory under
        drivers/ as it has grown big enough for that. Also Viresh is now going
        to maintain it and send pull requests for it to me, so you will see
        this change in the git history going forward (but still not right
        now).
      
        Another noticeable set of changes is the modifications of the PM core,
        the PCI subsystem and the ACPI PM domain to allow of more integration
        between system-wide suspend/resume and runtime PM. For now it's just a
        way to avoid resuming devices from runtime suspend unnecessarily
        during system suspend (if the driver sets a flag to indicate its
        readiness for that) and in the works is an analogous mechanism to
        allow devices to stay suspended after system resume.
      
        In addition to that, we have some changes related to supporting
        frequency-invariant CPU utilization metrics in the scheduler and in
        the schedutil cpufreq governor on ARM and changes to add support for
        device performance states to the generic power domains (genpd)
        framework.
      
        The rest is mostly fixes and cleanups of various sorts.
      
        Specifics:
      
         - Relocate the OPP (Operating Performance Points) framework to its
           own directory under drivers/ and add support for power domain
           performance states to it (Viresh Kumar).
      
         - Modify the PM core, the PCI bus type and the ACPI PM domain to
           support power management driver flags allowing device drivers to
           specify their capabilities and preferences regarding the handling
           of devices with enabled runtime PM during system suspend/resume and
           clean up that code somewhat (Rafael Wysocki, Ulf Hansson).
      
         - Add frequency-invariant accounting support to the task scheduler on
           ARM and ARM64 (Dietmar Eggemann).
      
         - Fix PM QoS device resume latency framework to prevent "no
           restriction" requests from overriding requests with specific
           requirements and drop the confusing PM_QOS_FLAG_REMOTE_WAKEUP
           device PM QoS flag (Rafael Wysocki).
      
         - Drop legacy class suspend/resume operations from the PM core and
           drop legacy bus type suspend and resume callbacks from ARM/locomo
           (Rafael Wysocki).
      
         - Add min/max frequency support to devfreq and clean it up somewhat
           (Chanwoo Choi).
      
         - Rework wakeup support in the generic power domains (genpd)
           framework and update some of its users accordingly (Geert
           Uytterhoeven).
      
         - Convert timers in the PM core to use timer_setup() (Kees Cook).
      
         - Add support for exposing the SLP_S0 (Low Power S0 Idle) residency
           counter based on the LPIT ACPI table on Intel platforms (Srinivas
           Pandruvada).
      
         - Add per-CPU PM QoS resume latency support to the ladder cpuidle
           governor (Ramesh Thomas).
      
         - Fix a deadlock between the wakeup notify handler and the notifier
           removal in the ACPI core (Ville Syrjälä).
      
         - Fix a cpufreq schedutil governor issue causing it to use stale
           cached frequency values sometimes (Viresh Kumar).
      
         - Fix an issue in the system suspend core support code causing wakeup
           events detection to fail in some cases (Rajat Jain).
      
         - Fix the generic power domains (genpd) framework to prevent the PM
           core from using the direct-complete optimization with it as that is
           guaranteed to fail (Ulf Hansson).
      
         - Fix a minor issue in the cpuidle core and clean it up a bit (Gaurav
           Jindal, Nicholas Piggin).
      
         - Fix and clean up the intel_idle and ARM cpuidle drivers (Jason
           Baron, Len Brown, Leo Yan).
      
         - Fix a couple of minor issues in the OPP framework and clean it up
           (Arvind Yadav, Fabio Estevam, Sudeep Holla, Tobias Jordan).
      
         - Fix and clean up some cpufreq drivers and fix a minor issue in the
           cpufreq statistics code (Arvind Yadav, Bhumika Goyal, Fabio
           Estevam, Gautham Shenoy, Gustavo Silva, Marek Szyprowski, Masahiro
           Yamada, Robert Jarzmik, Zumeng Chen).
      
         - Fix minor issues in the system suspend and hibernation core, in
           power management documentation and in the AVS (Adaptive Voltage
           Scaling) framework (Helge Deller, Himanshu Jha, Joe Perches, Rafael
           Wysocki).
      
         - Fix some issues in the cpupower utility and document that Shuah
           Khan is going to maintain it going forward (Prarit Bhargava, Shuah
           Khan)"
      
      * tag 'pm-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (88 commits)
        tools/power/cpupower: add libcpupower.so.0.0.1 to .gitignore
        tools/power/cpupower: Add 64 bit library detection
        intel_idle: Graceful probe failure when MWAIT is disabled
        cpufreq: schedutil: Reset cached_raw_freq when not in sync with next_freq
        freezer: Fix typo in freezable_schedule_timeout() comment
        PM / s2idle: Clear the events_check_enabled flag
        cpufreq: stats: Handle the case when trans_table goes beyond PAGE_SIZE
        cpufreq: arm_big_little: make cpufreq_arm_bL_ops structures const
        cpufreq: arm_big_little: make function arguments and structure pointer const
        cpuidle: Avoid assignment in if () argument
        cpuidle: Clean up cpuidle_enable_device() error handling a bit
        ACPI / PM: Fix acpi_pm_notifier_lock vs flush_workqueue() deadlock
        PM / Domains: Fix genpd to deal with drivers returning 1 from ->prepare()
        cpuidle: ladder: Add per CPU PM QoS resume latency support
        PM / QoS: Fix device resume latency framework
        PM / domains: Rework governor code to be more consistent
        PM / Domains: Remove gpd_dev_ops.active_wakeup() callback
        soc: rockchip: power-domain: Use GENPD_FLAG_ACTIVE_WAKEUP
        soc: mediatek: Use GENPD_FLAG_ACTIVE_WAKEUP
        ARM: shmobile: pm-rmobile: Use GENPD_FLAG_ACTIVE_WAKEUP
        ...
      bd2cd7d5
    • Rafael J. Wysocki's avatar
      x86 / CPU: Avoid unnecessary IPIs in arch_freq_get_on_cpu() · b29c6ef7
      Rafael J. Wysocki authored
      Even though aperfmperf_snapshot_khz() caches the samples.khz value to
      return if called again in a sufficiently short time, its caller,
      arch_freq_get_on_cpu(), still uses smp_call_function_single() to run it
      which may allow user space to trigger an IPI storm by reading from the
      scaling_cur_freq cpufreq sysfs file in a tight loop.
      
      To avoid that, move the decision on whether or not to return the cached
      samples.khz value to arch_freq_get_on_cpu().
      
      This change was part of commit 941f5f0f ("x86: CPU: Fix up "cpu MHz"
      in /proc/cpuinfo"), but it was not the reason for the revert and it
      remains applicable.
      
      Fixes: 4815d3c5 (cpufreq: x86: Make scaling_cur_freq behave more as expected)
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarWANG Chao <chao.wang@ucloud.cn>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b29c6ef7
    • Linus Torvalds's avatar
      Merge branch 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 99306dfc
      Linus Torvalds authored
      Pull x86 timer updates from Thomas Gleixner:
       "These updates are related to TSC handling:
      
         - Support platforms which have synchronized TSCs but the boot CPU has
           a non zero TSC_ADJUST value, which is considered a firmware bug on
           normal systems.
      
           This applies to HPE/SGI UV platforms where the platform firmware
           uses TSC_ADJUST to ensure TSC synchronization across a huge number
           of sockets, but due to power on timings the boot CPU cannot be
           guaranteed to have a zero TSC_ADJUST register value.
      
         - Fix the ordering of udelay calibration and kvmclock_init()
      
         - Cleanup the udelay and calibration code"
      
      * 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/tsc: Mark cyc2ns_init() and detect_art() __init
        x86/platform/UV: Mark tsc_check_sync as an init function
        x86/tsc: Make CONFIG_X86_TSC=n build work again
        x86/platform/UV: Add check of TSC state set by UV BIOS
        x86/tsc: Provide a means to disable TSC ART
        x86/tsc: Drastically reduce the number of firmware bug warnings
        x86/tsc: Skip TSC test and error messages if already unstable
        x86/tsc: Add option that TSC on Socket 0 being non-zero is valid
        x86/timers: Move simple_udelay_calibration() past kvmclock_init()
        x86/timers: Make recalibrate_cpu_khz() void
        x86/timers: Move the simple udelay calibration to tsc.h
      99306dfc
    • Linus Torvalds's avatar
      Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3643b7e0
      Linus Torvalds authored
      Pull x86 cache resource updates from Thomas Gleixner:
       "This update provides updates to RDT:
      
        - A diagnostic framework for the Resource Director Technology (RDT)
          user interface (sysfs). The failure modes of the user interface are
          hard to diagnose from the error codes. An extra last command status
          file provides now sensible textual information about the failure so
          its simpler to use.
      
        - A few minor cleanups and updates in the RDT code"
      
      * 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/intel_rdt: Fix a silent failure when writing zero value schemata
        x86/intel_rdt: Fix potential deadlock during resctrl mount
        x86/intel_rdt: Fix potential deadlock during resctrl unmount
        x86/intel_rdt: Initialize bitmask of shareable resource if CDP enabled
        x86/intel_rdt: Remove redundant assignment
        x86/intel_rdt/cqm: Make integer rmid_limbo_count static
        x86/intel_rdt: Add documentation for "info/last_cmd_status"
        x86/intel_rdt: Add diagnostics when making directories
        x86/intel_rdt: Add diagnostics when writing the cpus file
        x86/intel_rdt: Add diagnostics when writing the tasks file
        x86/intel_rdt: Add diagnostics when writing the schemata file
        x86/intel_rdt: Add framework for better RDT UI diagnostics
      3643b7e0
    • Linus Torvalds's avatar
      Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b18d6289
      Linus Torvalds authored
      Pull x86 APIC updates from Thomas Gleixner:
       "This update provides a major overhaul of the APIC initialization and
        vector allocation code:
      
         - Unification of the APIC and interrupt mode setup which was
           scattered all over the place and was hard to follow. This also
           distangles the timer setup from the APIC initialization which
           brings a clear separation of functionality.
      
           Great detective work from Dou Lyiang!
      
         - Refactoring of the x86 vector allocation mechanism. The existing
           code was based on nested loops and rather convoluted APIC callbacks
           which had a horrible worst case behaviour and tried to serve all
           different use cases in one go. This led to quite odd hacks when
           supporting the new managed interupt facility for multiqueue devices
           and made it more or less impossible to deal with the vector space
           exhaustion which was a major roadblock for server hibernation.
      
           Aside of that the code dealing with cpu hotplug and the system
           vectors was disconnected from the actual vector management and
           allocation code, which made it hard to follow and maintain.
      
           Utilizing the new bitmap matrix allocator core mechanism, the new
           allocator and management code consolidates the handling of system
           vectors, legacy vectors, cpu hotplug mechanisms and the actual
           allocation which needs to be aware of system and legacy vectors and
           hotplug constraints into a single consistent entity.
      
           This has one visible change: The support for multi CPU targets of
           interrupts, which is only available on a certain subset of
           CPUs/APIC variants has been removed in favour of single interrupt
           targets. A proper analysis of the multi CPU target feature revealed
           that there is no real advantage as the vast majority of interrupts
           end up on the CPU with the lowest APIC id in the set of target CPUs
           anyway. That change was agreed on by the relevant folks and allowed
           to simplify the implementation significantly and to replace rather
           fragile constructs like the vector cleanup IPI with straight
           forward and solid code.
      
           Furthermore this allowed to cleanly separate the allocation details
           for legacy, normal and managed interrupts:
      
            * Legacy interrupts are not longer wasting 16 vectors
              unconditionally
      
            * Managed interrupts have now a guaranteed vector reservation, but
              the actual vector assignment happens when the interrupt is
              requested. It's guaranteed not to fail.
      
            * Normal interrupts no longer allocate vectors unconditionally
              when the interrupt is set up (IO/APIC init or MSI(X) enable).
              The mechanism has been switched to a best effort reservation
              mode. The actual allocation happens when the interrupt is
              requested. Contrary to managed interrupts the request can fail
              due to vector space exhaustion, but drivers must handle a fail
              of request_irq() anyway. When the interrupt is freed, the vector
              is handed back as well.
      
              This solves a long standing problem with large unconditional
              vector allocations for a certain class of enterprise devices
              which prevented server hibernation due to vector space
              exhaustion when the unused allocated vectors had to be migrated
              to CPU0 while unplugging all non boot CPUs.
      
           The code has been equipped with trace points and detailed debugfs
           information to aid analysis of the vector space"
      
      * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits)
        x86/vector/msi: Select CONFIG_GENERIC_IRQ_RESERVATION_MODE
        PCI/MSI: Set MSI_FLAG_MUST_REACTIVATE in core code
        genirq: Add config option for reservation mode
        x86/vector: Use correct per cpu variable in free_moved_vector()
        x86/apic/vector: Ignore set_affinity call for inactive interrupts
        x86/apic: Fix spelling mistake: "symmectic" -> "symmetric"
        x86/apic: Use dead_cpu instead of current CPU when cleaning up
        ACPI/init: Invoke early ACPI initialization earlier
        x86/vector: Respect affinity mask in irq descriptor
        x86/irq: Simplify hotplug vector accounting
        x86/vector: Switch IOAPIC to global reservation mode
        x86/vector/msi: Switch to global reservation mode
        x86/vector: Handle managed interrupts proper
        x86/io_apic: Reevaluate vector configuration on activate()
        iommu/amd: Reevaluate vector configuration on activate()
        iommu/vt-d: Reevaluate vector configuration on activate()
        x86/apic/msi: Force reactivation of interrupts at startup time
        x86/vector: Untangle internal state from irq_cfg
        x86/vector: Compile SMP only code conditionally
        x86/apic: Remove unused callbacks
        ...
      b18d6289
    • Linus Torvalds's avatar
      Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7d58e1c9
      Linus Torvalds authored
      Pull smp/hotplug updates from Thomas Gleixner:
       "No functional changes, just removal of obsolete and outdated defines,
        macros and documentation"
      
      * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        cpu/hotplug: Get rid of CPU hotplug notifier leftovers
        cpu/hotplug: Remove obsolete notifier macros
      7d58e1c9
    • Linus Torvalds's avatar
      Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2bcc6731
      Linus Torvalds authored
      Pull timer updates from Thomas Gleixner:
       "Yet another big pile of changes:
      
         - More year 2038 work from Arnd slowly reaching the point where we
           need to think about the syscalls themself.
      
         - A new timer function which allows to conditionally (re)arm a timer
           only when it's either not running or the new expiry time is sooner
           than the armed expiry time. This allows to use a single timer for
           multiple timeout requirements w/o caring about the first expiry
           time at the call site.
      
         - A new NMI safe accessor to clock real time for the printk timestamp
           work. Can be used by tracing, perf as well if required.
      
         - A large number of timer setup conversions from Kees which got
           collected here because either maintainers requested so or they
           simply got ignored. As Kees pointed out already there are a few
           trivial merge conflicts and some redundant commits which was
           unavoidable due to the size of this conversion effort.
      
         - Avoid a redundant iteration in the timer wheel softirq processing.
      
         - Provide a mechanism to treat RTC implementations depending on their
           hardware properties, i.e. don't inflict the write at the 0.5
           seconds boundary which originates from the PC CMOS RTC to all RTCs.
           No functional change as drivers need to be updated separately.
      
         - The usual small updates to core code clocksource drivers. Nothing
           really exciting"
      
      * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits)
        timers: Add a function to start/reduce a timer
        pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday()
        timer: Prepare to change all DEFINE_TIMER() callbacks
        netfilter: ipvs: Convert timers to use timer_setup()
        scsi: qla2xxx: Convert timers to use timer_setup()
        block/aoe: discover_timer: Convert timers to use timer_setup()
        ide: Convert timers to use timer_setup()
        drbd: Convert timers to use timer_setup()
        mailbox: Convert timers to use timer_setup()
        crypto: Convert timers to use timer_setup()
        drivers/pcmcia: omap1: Fix error in automated timer conversion
        ARM: footbridge: Fix typo in timer conversion
        drivers/sgi-xp: Convert timers to use timer_setup()
        drivers/pcmcia: Convert timers to use timer_setup()
        drivers/memstick: Convert timers to use timer_setup()
        drivers/macintosh: Convert timers to use timer_setup()
        hwrng/xgene-rng: Convert timers to use timer_setup()
        auxdisplay: Convert timers to use timer_setup()
        sparc/led: Convert timers to use timer_setup()
        mips: ip22/32: Convert timers to use timer_setup()
        ...
      2bcc6731
    • Linus Torvalds's avatar
      Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 670310df
      Linus Torvalds authored
      Pull irq core updates from Thomas Gleixner:
       "A rather large update for the interrupt core code and the irq chip drivers:
      
         - Add a new bitmap matrix allocator and supporting changes, which is
           used to replace the x86 vector allocator which comes with separate
           pull request. This allows to replace the convoluted nested loop
           allocation function in x86 with a facility which supports the
           recently added property of managed interrupts proper and allows to
           switch to a best effort vector reservation scheme, which addresses
           problems with vector exhaustion.
      
         - A large update to the ARM GIC-V3-ITS driver adding support for
           range selectors.
      
         - New interrupt controllers:
             - Meson and Meson8 GPIO
             - BCM7271 L2
             - Socionext EXIU
      
           If you expected that this will stop at some point, I have to
           disappoint you. There are new ones posted already. Sigh!
      
         - STM32 interrupt controller support for new platforms.
      
         - A pile of fixes, cleanups and updates to the MIPS GIC driver
      
         - The usual small fixes, cleanups and updates all over the place.
           Most visible one is to move the irq chip drivers Kconfig switches
           into a separate Kconfig menu"
      
      * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
        genirq: Fix type of shifting literal 1 in __setup_irq()
        irqdomain: Drop pointless NULL check in virq_debug_show_one
        genirq/proc: Return proper error code when irq_set_affinity() fails
        irq/work: Use llist_for_each_entry_safe
        irqchip: mips-gic: Print warning if inherited GIC base is used
        irqchip/mips-gic: Add pr_fmt and reword pr_* messages
        irqchip/stm32: Move the wakeup on interrupt mask
        irqchip/stm32: Fix initial values
        irqchip/stm32: Add stm32h7 support
        dt-bindings/interrupt-controllers: Add compatible string for stm32h7
        irqchip/stm32: Add multi-bank management
        irqchip/stm32: Select GENERIC_IRQ_CHIP
        irqchip/exiu: Add support for Socionext Synquacer EXIU controller
        dt-bindings: Add description of Socionext EXIU interrupt controller
        irqchip/gic-v3-its: Fix VPE activate callback return value
        irqchip: mips-gic: Make IPI bitmaps static
        irqchip: mips-gic: Share register writes in gic_set_type()
        irqchip: mips-gic: Remove gic_vpes variable
        irqchip: mips-gic: Use num_possible_cpus() to reserve IPIs
        irqchip: mips-gic: Configure EIC when CPUs come online
        ...
      670310df
    • Linus Torvalds's avatar
      Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 43ff2f4d
      Linus Torvalds authored
      Pull x86 platform updates from Ingo Molnar:
       "The main changes in this cycle were:
      
         - a refactoring of the early virt init code by merging 'struct
           x86_hyper' into 'struct x86_platform' and 'struct x86_init', which
           allows simplifications and also the addition of a new
           ->guest_late_init() callback. (Juergen Gross)
      
         - timer_setup() conversion of the UV code (Kees Cook)"
      
      * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/virt/xen: Use guest_late_init to detect Xen PVH guest
        x86/virt, x86/platform: Add ->guest_late_init() callback to hypervisor_x86 structure
        x86/virt, x86/acpi: Add test for ACPI_FADT_NO_VGA
        x86/virt: Add enum for hypervisors to replace x86_hyper
        x86/virt, x86/platform: Merge 'struct x86_hyper' into 'struct x86_platform' and 'struct x86_init'
        x86/platform/UV: Convert timers to use timer_setup()
      43ff2f4d
    • Linus Torvalds's avatar
      Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 13e57da4
      Linus Torvalds authored
      Pull x86 debug update from Ingo Molnar:
       "A single change enhancing stack traces by hiding wrapper function
        entries"
      
      * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/stacktrace: Avoid recording save_stack_trace() wrappers
      13e57da4
    • Linus Torvalds's avatar
      Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · eb4d47c8
      Linus Torvalds authored
      Pull x86 cleanups from Ingo Molnar:
       "Two changes: Propagate const/__initconst, and use ARRAY_SIZE() some
        more"
      
      * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/events/amd/iommu: Make iommu_pmu const and __initconst
        x86: Use ARRAY_SIZE
      eb4d47c8
    • Linus Torvalds's avatar
      Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6a9f70b0
      Linus Torvalds authored
      Pull x86 boot updates from Ingo Molnar:
       "Three smaller changes:
      
         - clang fix
      
         - boot message beautification
      
         - unnecessary header inclusion removal"
      
      * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot: Disable Clang warnings about GNU extensions
        x86/boot: Remove unnecessary #include <generated/utsrelease.h>
        x86/boot: Spell out "boot CPU" for BP
      6a9f70b0
  3. 13 Nov, 2017 9 commits
    • Linus Torvalds's avatar
      Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d6ec9d9a
      Linus Torvalds authored
      Pull x86 core updates from Ingo Molnar:
       "Note that in this cycle most of the x86 topics interacted at a level
        that caused them to be merged into tip:x86/asm - but this should be a
        temporary phenomenon, hopefully we'll back to the usual patterns in
        the next merge window.
      
        The main changes in this cycle were:
      
        Hardware enablement:
      
         - Add support for the Intel UMIP (User Mode Instruction Prevention)
           CPU feature. This is a security feature that disables certain
           instructions such as SGDT, SLDT, SIDT, SMSW and STR. (Ricardo Neri)
      
           [ Note that this is disabled by default for now, there are some
             smaller enhancements in the pipeline that I'll follow up with in
             the next 1-2 days, which allows this to be enabled by default.]
      
         - Add support for the AMD SEV (Secure Encrypted Virtualization) CPU
           feature, on top of SME (Secure Memory Encryption) support that was
           added in v4.14. (Tom Lendacky, Brijesh Singh)
      
         - Enable new SSE/AVX/AVX512 CPU features: AVX512_VBMI2, GFNI, VAES,
           VPCLMULQDQ, AVX512_VNNI, AVX512_BITALG. (Gayatri Kammela)
      
        Other changes:
      
         - A big series of entry code simplifications and enhancements (Andy
           Lutomirski)
      
         - Make the ORC unwinder default on x86 and various objtool
           enhancements. (Josh Poimboeuf)
      
         - 5-level paging enhancements (Kirill A. Shutemov)
      
         - Micro-optimize the entry code a bit (Borislav Petkov)
      
         - Improve the handling of interdependent CPU features in the early
           FPU init code (Andi Kleen)
      
         - Build system enhancements (Changbin Du, Masahiro Yamada)
      
         - ... plus misc enhancements, fixes and cleanups"
      
      * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (118 commits)
        x86/build: Make the boot image generation less verbose
        selftests/x86: Add tests for the STR and SLDT instructions
        selftests/x86: Add tests for User-Mode Instruction Prevention
        x86/traps: Fix up general protection faults caused by UMIP
        x86/umip: Enable User-Mode Instruction Prevention at runtime
        x86/umip: Force a page fault when unable to copy emulated result to user
        x86/umip: Add emulation code for UMIP instructions
        x86/cpufeature: Add User-Mode Instruction Prevention definitions
        x86/insn-eval: Add support to resolve 16-bit address encodings
        x86/insn-eval: Handle 32-bit address encodings in virtual-8086 mode
        x86/insn-eval: Add wrapper function for 32 and 64-bit addresses
        x86/insn-eval: Add support to resolve 32-bit address encodings
        x86/insn-eval: Compute linear address in several utility functions
        resource: Fix resource_size.cocci warnings
        X86/KVM: Clear encryption attribute when SEV is active
        X86/KVM: Decrypt shared per-cpu variables when SEV is active
        percpu: Introduce DEFINE_PER_CPU_DECRYPTED
        x86: Add support for changing memory encryption attribute in early boot
        x86/io: Unroll string I/O when SEV is active
        x86/boot: Add early boot support when running with SEV active
        ...
      d6ec9d9a
    • Linus Torvalds's avatar
      Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3e201463
      Linus Torvalds authored
      Pull scheduler updates from Ingo Molnar:
       "The main updates in this cycle were:
      
         - Group balancing enhancements and cleanups (Brendan Jackman)
      
         - Move CPU isolation related functionality into its separate
           kernel/sched/isolation.c file, with related 'housekeeping_*()'
           namespace and nomenclature et al. (Frederic Weisbecker)
      
         - Improve the interactive/cpu-intense fairness calculation (Josef
           Bacik)
      
         - Improve the PELT code and related cleanups (Peter Zijlstra)
      
         - Improve the logic of pick_next_task_fair() (Uladzislau Rezki)
      
         - Improve the RT IPI based balancing logic (Steven Rostedt)
      
         - Various micro-optimizations:
      
         - better !CONFIG_SCHED_DEBUG optimizations (Patrick Bellasi)
      
         - better idle loop (Cheng Jian)
      
         - ... plus misc fixes, cleanups and updates"
      
      * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (54 commits)
        sched/core: Optimize sched_feat() for !CONFIG_SCHED_DEBUG builds
        sched/sysctl: Fix attributes of some extern declarations
        sched/isolation: Document isolcpus= boot parameter flags, mark it deprecated
        sched/isolation: Add basic isolcpus flags
        sched/isolation: Move isolcpus= handling to the housekeeping code
        sched/isolation: Handle the nohz_full= parameter
        sched/isolation: Introduce housekeeping flags
        sched/isolation: Split out new CONFIG_CPU_ISOLATION=y config from CONFIG_NO_HZ_FULL
        sched/isolation: Rename is_housekeeping_cpu() to housekeeping_cpu()
        sched/isolation: Use its own static key
        sched/isolation: Make the housekeeping cpumask private
        sched/isolation: Provide a dynamic off-case to housekeeping_any_cpu()
        sched/isolation, watchdog: Use housekeeping_cpumask() instead of ad-hoc version
        sched/isolation: Move housekeeping related code to its own file
        sched/idle: Micro-optimize the idle loop
        sched/isolcpus: Fix "isolcpus=" boot parameter handling when !CONFIG_CPUMASK_OFFSTACK
        x86/tsc: Append the 'tsc=' description for the 'tsc=unstable' boot parameter
        sched/rt: Simplify the IPI based RT balancing logic
        block/ioprio: Use a helper to check for RT prio
        sched/rt: Add a helper to test for a RT task
        ...
      3e201463
    • Linus Torvalds's avatar
      Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f2be8bd5
      Linus Torvalds authored
      Pull RAS updates from Ingo Molnar:
       "Two minor updates to AMD SMCA support, plus a timer_setup() conversion"
      
      * 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/MCE/AMD: Fix mce_severity_amd_smca() signature
        x86/MCE/AMD: Always give panic severity for UC errors in kernel context
        x86/mce: Convert timers to use timer_setup()
      f2be8bd5
    • Linus Torvalds's avatar
      Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 31486372
      Linus Torvalds authored
      Pull perf updates from Ingo Molnar:
       "The main changes in this cycle were:
      
        Kernel:
      
         - kprobes updates: use better W^X patterns for code modifications,
           improve optprobes, remove jprobes. (Masami Hiramatsu, Kees Cook)
      
         - core fixes: event timekeeping (enabled/running times statistics)
           fixes, perf_event_read() locking fixes and cleanups, etc. (Peter
           Zijlstra)
      
         - Extend x86 Intel free-running PEBS support and support x86
           user-register sampling in perf record and perf script. (Andi Kleen)
      
        Tooling:
      
         - Completely rework the way inline frames are handled. Instead of
           querying for the inline nodes on-demand in the individual tools, we
           now create proper callchain nodes for inlined frames. (Milian
           Wolff)
      
         - 'perf trace' updates (Arnaldo Carvalho de Melo)
      
         - Implement a way to print formatted output to per-event files in
           'perf script' to facilitate generate flamegraphs, elliminating the
           need to write scripts to do that separation (yuzhoujian, Arnaldo
           Carvalho de Melo)
      
         - Update vendor events JSON metrics for Intel's Broadwell, Broadwell
           Server, Haswell, Haswell Server, IvyBridge, IvyTown, JakeTown,
           Sandy Bridge, Skylake, SkyLake Server - and Goldmont Plus V1 (Andi
           Kleen, Kan Liang)
      
         - Multithread the synthesizing of PERF_RECORD_ events for
           pre-existing threads in 'perf top', speeding up that phase, greatly
           improving the user experience in systems such as Intel's Knights
           Mill (Kan Liang)
      
         - Introduce the concept of weak groups in 'perf stat': try to set up
           a group, but if it's not schedulable fallback to not using a group.
           That gives us the best of both worlds: groups if they work, but
           still a usable fallback if they don't. E.g: (Andi Kleen)
      
         - perf sched timehist enhancements (David Ahern)
      
         - ... various other enhancements, updates, cleanups and fixes"
      
      * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (139 commits)
        kprobes: Don't spam the build log with deprecation warnings
        arm/kprobes: Remove jprobe test case
        arm/kprobes: Fix kretprobe test to check correct counter
        perf srcline: Show correct function name for srcline of callchains
        perf srcline: Fix memory leak in addr2inlines()
        perf trace beauty kcmp: Beautify arguments
        perf trace beauty: Implement pid_fd beautifier
        tools include uapi: Grab a copy of linux/kcmp.h
        perf callchain: Fix double mapping al->addr for children without self period
        perf stat: Make --per-thread update shadow stats to show metrics
        perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats
        perf tools: Add perf_data_file__write function
        perf tools: Add struct perf_data_file
        perf tools: Rename struct perf_data_file to perf_data
        perf script: Print information about per-event-dump files
        perf trace beauty prctl: Generate 'option' string table from kernel headers
        tools include uapi: Grab a copy of linux/prctl.h
        perf script: Allow creating per-event dump files
        perf evsel: Restore evsel->priv as a tool private area
        perf script: Use event_format__fprintf()
        ...
      31486372
    • Linus Torvalds's avatar
      Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8e9a2dba
      Linus Torvalds authored
      Pull core locking updates from Ingo Molnar:
       "The main changes in this cycle are:
      
         - Another attempt at enabling cross-release lockdep dependency
           tracking (automatically part of CONFIG_PROVE_LOCKING=y), this time
           with better performance and fewer false positives. (Byungchul Park)
      
         - Introduce lockdep_assert_irqs_enabled()/disabled() and convert
           open-coded equivalents to lockdep variants. (Frederic Weisbecker)
      
         - Add down_read_killable() and use it in the VFS's iterate_dir()
           method. (Kirill Tkhai)
      
         - Convert remaining uses of ACCESS_ONCE() to
           READ_ONCE()/WRITE_ONCE(). Most of the conversion was Coccinelle
           driven. (Mark Rutland, Paul E. McKenney)
      
         - Get rid of lockless_dereference(), by strengthening Alpha atomics,
           strengthening READ_ONCE() with smp_read_barrier_depends() and thus
           being able to convert users of lockless_dereference() to
           READ_ONCE(). (Will Deacon)
      
         - Various micro-optimizations:
      
              - better PV qspinlocks (Waiman Long),
              - better x86 barriers (Michael S. Tsirkin)
              - better x86 refcounts (Kees Cook)
      
         - ... plus other fixes and enhancements. (Borislav Petkov, Juergen
           Gross, Miguel Bernal Marin)"
      
      * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
        locking/x86: Use LOCK ADD for smp_mb() instead of MFENCE
        rcu: Use lockdep to assert IRQs are disabled/enabled
        netpoll: Use lockdep to assert IRQs are disabled/enabled
        timers/posix-cpu-timers: Use lockdep to assert IRQs are disabled/enabled
        sched/clock, sched/cputime: Use lockdep to assert IRQs are disabled/enabled
        irq_work: Use lockdep to assert IRQs are disabled/enabled
        irq/timings: Use lockdep to assert IRQs are disabled/enabled
        perf/core: Use lockdep to assert IRQs are disabled/enabled
        x86: Use lockdep to assert IRQs are disabled/enabled
        smp/core: Use lockdep to assert IRQs are disabled/enabled
        timers/hrtimer: Use lockdep to assert IRQs are disabled/enabled
        timers/nohz: Use lockdep to assert IRQs are disabled/enabled
        workqueue: Use lockdep to assert IRQs are disabled/enabled
        irq/softirqs: Use lockdep to assert IRQs are disabled/enabled
        locking/lockdep: Add IRQs disabled/enabled assertion APIs: lockdep_assert_irqs_enabled()/disabled()
        locking/pvqspinlock: Implement hybrid PV queued/unfair locks
        locking/rwlocks: Fix comments
        x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized
        block, locking/lockdep: Assign a lock_class per gendisk used for wait_for_completion()
        workqueue: Remove now redundant lock acquisitions wrt. workqueue flushes
        ...
      8e9a2dba
    • Linus Torvalds's avatar
      Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6098850e
      Linus Torvalds authored
      Pull RCU updates from Ingo Molnar:
       "The main changes in this cycle are:
      
         - Documentation updates
      
         - RCU CPU stall-warning updates
      
         - Torture-test updates
      
         - Miscellaneous fixes
      
        Size wise the biggest updates are to documentation. Excluding
        documentation most of the code increase comes from a single commit
        which expands debugging"
      
      * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
        srcu: Add parameters to SRCU docbook comments
        doc: Rewrite confusing statement about memory barriers
        memory-barriers.txt: Fix typo in pairing example
        rcu/segcblist: Include rcupdate.h
        rcu: Add extended-quiescent-state testing advice
        rcu: Suppress lockdep false-positive ->boost_mtx complaints
        rcu: Do not include rtmutex_common.h unconditionally
        torture: Provide TMPDIR environment variable to specify tmpdir
        rcutorture: Dump writer stack if stalled
        rcutorture: Add interrupt-disable capability to stall-warning tests
        rcu: Suppress RCU CPU stall warnings while dumping trace
        rcu: Turn off tracing before dumping trace
        rcu: Make RCU CPU stall warnings check for irq-disabled CPUs
        sched,rcu: Make cond_resched() provide RCU quiescent state
        sched: Make resched_cpu() unconditional
        irq_work: Map irq_work_on_queue() to irq_work_on() in !SMP
        rcu: Create call_rcu_tasks() kthread at boot time
        rcu: Fix up pending cbs check in rcu_prepare_for_idle
        memory-barriers: Rework multicopy-atomicity section
        memory-barriers: Replace uses of "transitive"
        ...
      6098850e
    • Linus Torvalds's avatar
      Merge tag 'please-pull-gettime_vsyscall_update' of... · f08d8bcc
      Linus Torvalds authored
      Merge tag 'please-pull-gettime_vsyscall_update' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
      
      Pull ia64 update from Tony Luck:
       "Stop ia64 being the last holdout using GENERIC_TIME_VSYSCALL_OLD so
        that John Stultz can drop that code"
      
      * tag 'please-pull-gettime_vsyscall_update' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
        ia64: Update fsyscall gettime to use modern vsyscall_update
      f08d8bcc
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/openrisc/linux · f3573b8f
      Linus Torvalds authored
      Pull OpenRISC updates from Stafford Horne:
       "The OpenRISC work is a bit more interesting this time, adding SMP
        support and a few general cleanups.
      
        Small Things:
      
         - Move OpenRISC docs into Documentation and clean them up
      
         - Document previously undocumented devicetree bindings
      
         - Update the or1ksim dts to use stdout-path
      
        OpenRISC SMP support details:
      
         - First the "use shadow registers" and "define CPU_BIG_ENDIAN as
           true" get the architecture ready for SMP.
      
         - The "add 1 and 2 byte cmpxchg support" and "use qspinlocks and
           qrwlocks" add the SMP locking infrastructure as needed. Using the
           qspinlocks and qrwlocks as suggested by Peter Z while reviewing the
           original spinlocks implementation.
      
         - The "support for ompic" adds a new irqchip device which is used for
           IPI communication to support SMP.
      
         - The "initial SMP support" adds smp.c and makes changes to all of
           the necessary data-structures to be per-cpu.
      
        The remaining patches are bug fixes and debug helpers which I wanted
        to keep separate from the "initial SMP support" in order to allow them
        to be reviewed on their own. This includes:
      
         - add cacheflush support to fix icache aliasing
      
         - fix initial preempt state for secondary cpu tasks
      
         - sleep instead of spin on secondary wait
      
         - support framepointers and STACKTRACE_SUPPORT
      
         - enable LOCKDEP_SUPPORT and irqflags tracing
      
         - timer sync: Add tick timer sync logic
      
         - fix possible deadlock in timer sync, pointed out by mips guys
      
        Note: the irqchip patch was reviewed with Marc and we agreed to push
        it together with these patches"
      
      * tag 'for-linus' of git://github.com/openrisc/linux:
        openrisc: fix possible deadlock scenario during timer sync
        openrisc: pass endianness info to sparse
        openrisc: add tick timer multi-core sync logic
        openrisc: enable LOCKDEP_SUPPORT and irqflags tracing
        openrisc: support framepointers and STACKTRACE_SUPPORT
        openrisc: add simple_smp dts and defconfig for simulators
        openrisc: add cacheflush support to fix icache aliasing
        openrisc: sleep instead of spin on secondary wait
        openrisc: fix initial preempt state for secondary cpu tasks
        openrisc: initial SMP support
        irqchip: add initial support for ompic
        dt-bindings: add openrisc to vendor prefixes list
        openrisc: use qspinlocks and qrwlocks
        openrisc: add 1 and 2 byte cmpxchg support
        openrisc: use shadow registers to save regs on exception
        dt-bindings: openrisc: Add OpenRISC platform SoC
        Documentation: openrisc: Updates to README
        Documentation: Move OpenRISC docs out of arch/
        MAINTAINERS: Add OpenRISC pic maintainer
        openrisc: dts: or1ksim: Add stdout-path
      f3573b8f
    • Linus Torvalds's avatar
      Merge tag 'm68k-for-v4.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k · 9e09d05c
      Linus Torvalds authored
      Pull m68k updates from Geert Uytterhoeven:
      
        - more printk modernization
      
        - various cleanups and fixes (incl. a race condition) for Mac
      
        - defconfig updates
      
      * tag 'm68k-for-v4.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
        m68k/defconfig: Update defconfigs for v4.14-rc7
        m68k/mac: Add mutual exclusion for IOP interrupt polling
        m68k/mac: Disentangle VIA/RBV and NuBus initialization
        m68k/mac: Disentangle VIA and OSS initialization
        m68k/mac: More printk modernization
      9e09d05c