1. 18 Oct, 2018 2 commits
    • Rafael J. Wysocki's avatar
      cpuidle: menu: Avoid computations when result will be discarded · f1c8e410
      Rafael J. Wysocki authored
      If the minimum interval taken into account in the average computation
      loop in get_typical_interval() is less than the expected idle
      duration determined so far, the resultant average cannot be greater
      than that value as well and the entire return result of the function
      is going to be discarded anyway going forward.
      
      In that case, it is a waste of time to carry out the remaining
      computations in get_typical_interval(), so avoid that by returning
      early if the minimum interval is not below the expected idle duration.
      
      No intentional changes of behavior.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f1c8e410
    • Rafael J. Wysocki's avatar
      cpuidle: menu: Drop redundant comparison · 12b65ead
      Rafael J. Wysocki authored
      Since the correction factor cannot be greater than RESOLUTION * DECAY,
      the result of the predicted_us computation in menu_select() cannot be
      greater than data->next_timer_us, so it is not necessary to compare
      the "typical interval" value coming from get_typical_interval() with
      data->next_timer_us separately.
      
      It is sufficient to copmare predicted_us with the return value of
      get_typical_interval() directly, so do that and drop the now
      redundant expected_interval variable.
      
      No intentional changes of behavior.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      12b65ead
  2. 12 Oct, 2018 1 commit
    • Rafael J. Wysocki's avatar
      cpuidle: menu: Simplify checks related to the polling state · bde091ec
      Rafael J. Wysocki authored
      After some recent menu governor changes, the promotion of the
      "polling" state to a physical one is mostly controlled by the
      latency limit (resulting from the "interactivity" factor) and
      not by the time to the closest timer event, so it should be
      sufficient to check the exit latency of that state for this
      purpose (of course, its target residency still needs to be
      within the next timer event range for energy-efficiency).
      
      Also, the physical state the "polling" one is promoted to need not
      be the next one in principle (in case the next state is disabled,
      for example).
      
      For these reasons, simplify the checks made to decide whether or
      not to promote the "polling" state to a physical one and update
      the target idle duration when it is promoted in case the residency
      of the new state turns out to be above the tick boundary (in which
      case there is no reason to stop the tick).
      Tested-by: default avatarDoug Smythies <dsmythies@telus.net>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bde091ec
  3. 04 Oct, 2018 7 commits
  4. 03 Oct, 2018 1 commit
  5. 18 Sep, 2018 2 commits
    • Fieah Lim's avatar
      cpuidle: enter_state: Don't needlessly calculate diff time · 7037b43e
      Fieah Lim authored
      Currently, ktime_us_delta() is invoked unconditionally to compute the
      idle residency of the CPU, but it only makes sense to do that if a
      valid idle state has been entered, so move the ktime_us_delta()
      invocation after the entered_state >= 0 check.
      
      While at it, merge two comment blocks in there into one and drop
      a space between type casting of diff.
      
      This patch has no functional changes.
      Signed-off-by: default avatarFieah Lim <kw@fieahl.im>
      [ rjw: Changelog cleanup, comment format fix ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7037b43e
    • Fieah Lim's avatar
      cpuidle: Remove unnecessary wrapper cpuidle_get_last_residency() · 6a5f95b5
      Fieah Lim authored
      cpuidle_get_last_residency() is just a wrapper for retrieving
      the last_residency member of struct cpuidle_device.  It's also
      weirdly the only wrapper function for accessing cpuidle_* struct
      member (by my best guess is it could be a leftover from v2.x).
      
      Anyhow, since the only two users (the ladder and menu governors)
      can access dev->last_residency directly, and it's more intuitive to
      do it that way, let's just get rid of the wrapper.
      
      This patch tidies up CPU idle code a bit without functional changes.
      Signed-off-by: default avatarFieah Lim <kw@fieahl.im>
      [ rjw: Changelog cleanup ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6a5f95b5
  6. 10 Sep, 2018 2 commits
  7. 09 Sep, 2018 7 commits
  8. 08 Sep, 2018 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · f8f65382
      Linus Torvalds authored
      Pull KVM fixes from Radim Krčmář:
       "ARM:
         - Fix a VFP corruption in 32-bit guest
         - Add missing cache invalidation for CoW pages
         - Two small cleanups
      
        s390:
         - Fallout from the hugetlbfs support: pfmf interpretion and locking
         - VSIE: fix keywrapping for nested guests
      
        PPC:
         - Fix a bug where pages might not get marked dirty, causing guest
           memory corruption on migration
         - Fix a bug causing reads from guest memory to use the wrong guest
           real address for very large HPT guests (>256G of memory), leading
           to failures in instruction emulation.
      
        x86:
         - Fix out of bound access from malicious pv ipi hypercalls
           (introduced in rc1)
         - Fix delivery of pending interrupts when entering a nested guest,
           preventing arbitrarily late injection
         - Sanitize kvm_stat output after destroying a guest
         - Fix infinite loop when emulating a nested guest page fault and
           improve the surrounding emulation code
         - Two minor cleanups"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits)
        KVM: LAPIC: Fix pv ipis out-of-bounds access
        KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2
        arm64: KVM: Remove pgd_lock
        KVM: Remove obsolete kvm_unmap_hva notifier backend
        arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD
        KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW
        KVM: s390: Properly lock mm context allow_gmap_hpage_1m setting
        KVM: s390: vsie: copy wrapping keys to right place
        KVM: s390: Fix pfmf and conditional skey emulation
        tools/kvm_stat: re-animate display of dead guests
        tools/kvm_stat: indicate dead guests as such
        tools/kvm_stat: handle guest removals more gracefully
        tools/kvm_stat: don't reset stats when setting PID filter for debugfs
        tools/kvm_stat: fix updates for dead guests
        tools/kvm_stat: fix handling of invalid paths in debugfs provider
        tools/kvm_stat: fix python3 issues
        KVM: x86: Unexport x86_emulate_instruction()
        KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction()
        KVM: x86: Do not re-{try,execute} after failed emulation in L2
        KVM: x86: Default to not allowing emulation retry in kvm_mmu_page_fault
        ...
      f8f65382
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 0f3aa48a
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "A few more fixes who have trickled in:
      
         - MMC bus width fixup for some Allwinner platforms
      
         - Fix for NULL deref in ti-aemif when no platform data is passed in
      
         - Fix div by 0 in SCMI code
      
         - Add a missing module alias in a new RPi driver"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        memory: ti-aemif: fix a potential NULL-pointer dereference
        firmware: arm_scmi: fix divide by zero when sustained_perf_level is zero
        hwmon: rpi: add module alias to raspberrypi-hwmon
        arm64: allwinner: dts: h6: fix Pine H64 MMC bus width
      0f3aa48a
    • Olof Johansson's avatar
      Merge tag 'sunxi-fixes-for-4.19' of... · a132bb90
      Olof Johansson authored
      Merge tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into fixes
      
      Allwinner fixes for 4.19
      
      Just one fix for H6 mmc on the Pine H64: the mmc bus width was missing
      from the device tree. This was added in 4.19-rc1.
      
      * tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
        arm64: allwinner: dts: h6: fix Pine H64 MMC bus width
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      a132bb90
    • Nadav Amit's avatar
      x86/mm: Use WRITE_ONCE() when setting PTEs · 9bc4f28a
      Nadav Amit authored
      When page-table entries are set, the compiler might optimize their
      assignment by using multiple instructions to set the PTE. This might
      turn into a security hazard if the user somehow manages to use the
      interim PTE. L1TF does not make our lives easier, making even an interim
      non-present PTE a security hazard.
      
      Using WRITE_ONCE() to set PTEs and friends should prevent this potential
      security hazard.
      
      I skimmed the differences in the binary with and without this patch. The
      differences are (obviously) greater when CONFIG_PARAVIRT=n as more
      code optimizations are possible. For better and worse, the impact on the
      binary with this patch is pretty small. Skimming the code did not cause
      anything to jump out as a security hazard, but it seems that at least
      move_soft_dirty_pte() caused set_pte_at() to use multiple writes.
      Signed-off-by: default avatarNadav Amit <namit@vmware.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20180902181451.80520-1-namit@vmware.com
      9bc4f28a
    • Thomas Gleixner's avatar
      x86/apic/vector: Make error return value negative · 47b7360c
      Thomas Gleixner authored
      activate_managed() returns EINVAL instead of -EINVAL in case of
      error. While this is unlikely to happen, the positive return value would
      cause further malfunction at the call site.
      
      Fixes: 2db1f959 ("x86/vector: Handle managed interrupts proper")
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      47b7360c
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · d7b686eb
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
      
       - bugfixes for uniphier, i801, and xiic drivers
      
       - ID removal (never produced) for imx
      
       - one MAINTAINER addition
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: xiic: Record xilinx i2c with Zynq fragment
        i2c: xiic: Make the start and the byte count write atomic
        i2c: i801: fix DNV's SMBCTRL register offset
        i2c: imx-lpi2c: Remove mx8dv compatible entry
        dt-bindings: imx-lpi2c: Remove mx8dv compatible entry
        i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP
        i2c: uniphier: issue STOP only for last message or I2C_M_STOP
      d7b686eb
  9. 07 Sep, 2018 12 commits