10 Jul, 2019

2 commits

  • Pull power management updates from Rafael Wysocki:
    "These update PCI and ACPI power management (improved handling of ACPI
    power resources and PCIe link delays, fixes related to corner cases,
    hibernation handling rework), fix and extend the operating performance
    points (OPP) framework, add new cpufreq drivers for Raspberry Pi and
    imx8m chips, update some other cpufreq drivers, clean up assorted
    pieces of PM code and documentation and update tools.

    Specifics:

    - Improve the handling of shared ACPI power resources in the PCI bus
    type layer (Mika Westerberg).

    - Make the PCI layer take link delays required by the PCIe spec into
    account as appropriate and avoid polling devices in D3cold for PME
    (Mika Westerberg).

    - Fix some corner case issues in ACPI device power management and in
    the PCI bus type layer, optimiza and clean up the handling of
    runtime-suspended PCI devices during system-wide transitions to
    sleep states (Rafael Wysocki).

    - Rework hibernation handling in the ACPI core and the PCI bus type
    to resume runtime-suspended devices before hibernation (which
    allows some functional problems to be avoided) and fix some ACPI
    power management issues related to hiberation (Rafael Wysocki).

    - Extend the operating performance points (OPP) framework to support
    a wider range of devices (Rajendra Nayak, Stehpen Boyd).

    - Fix issues related to genpd_virt_devs and issues with platforms
    using the set_opp() callback in the OPP framework (Viresh Kumar,
    Dmitry Osipenko).

    - Add new cpufreq driver for Raspberry Pi (Nicolas Saenz Julienne).

    - Add new cpufreq driver for imx8m and imx7d chips (Leonard Crestez).

    - Fix and clean up the pcc-cpufreq, brcmstb-avs-cpufreq, s5pv210, and
    armada-37xx cpufreq drivers (David Arcari, Florian Fainelli, Paweł
    Chmiel, YueHaibing).

    - Clean up and fix the cpufreq core (Viresh Kumar, Daniel Lezcano).

    - Fix minor issue in the ACPI system sleep support code and export
    one function from it (Lenny Szubowicz, Dexuan Cui).

    - Clean up assorted pieces of PM code and documentation (Kefeng Wang,
    Andy Shevchenko, Bart Van Assche, Greg Kroah-Hartman, Fuqian Huang,
    Geert Uytterhoeven, Mathieu Malaterre, Rafael Wysocki).

    - Update the pm-graph utility to v5.4 (Todd Brandt).

    - Fix and clean up the cpupower utility (Abhishek Goel, Nick Black)"

    * tag 'pm-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (57 commits)
    ACPI: PM: Make acpi_sleep_state_supported() non-static
    PM: sleep: Drop dev_pm_skip_next_resume_phases()
    ACPI: PM: Unexport acpi_device_get_power()
    Documentation: ABI: power: Add missing newline at end of file
    ACPI: PM: Drop unused function and function header
    ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS
    ACPI: PM: Simplify and fix PM domain hibernation callbacks
    PCI: PM: Simplify bus-level hibernation callbacks
    PM: ACPI/PCI: Resume all devices during hibernation
    cpufreq: Avoid calling cpufreq_verify_current_freq() from handle_update()
    cpufreq: Consolidate cpufreq_update_current_freq() and __cpufreq_get()
    kernel: power: swap: use kzalloc() instead of kmalloc() followed by memset()
    cpufreq: Don't skip frequency validation for has_target() drivers
    PCI: PM/ACPI: Refresh all stale power state data in pci_pm_complete()
    PCI / ACPI: Add _PR0 dependent devices
    ACPI / PM: Introduce concept of a _PR0 dependent device
    PCI / ACPI: Use cached ACPI device state to get PCI device power state
    ACPI: PM: Allow transitions to D0 to occur in special cases
    ACPI: PM: Avoid evaluating _PS3 on transitions from D3hot to D3cold
    cpufreq: Use has_target() instead of !setpolicy
    ...

    Linus Torvalds
     
  • Pull GPIO updates from Linus Walleij:
    "This is the big slew of GPIO changes for the v5.3 kernel cycle. This
    is mostly incremental work this time.

    Three important things:

    - The FMC subsystem is deleted through my tree. This happens through
    GPIO as its demise was discussed in relation to a patch decoupling
    its GPIO implementation from the standard way of handling GPIO. As
    it turns out, that is not the only subsystem it reimplements and
    the authors think it is better do scratch it and start over using
    the proper kernel subsystems than try to polish the rust shiny. See
    the commit (ACKed by the maintainers) for details.

    - Arnd made a small devres patch that was ACKed by Greg and goes into
    the device core.

    - SPDX header change colissions may happen, because at times I've
    seen that quite a lot changed during the -rc:s in regards to SPDX.
    (It is good stuff, tglx has me convinced, and it is worth the
    occasional pain.)

    Apart from this is is nothing controversial or problematic.

    Summary:

    Core:

    - When a gpio_chip request GPIOs from itself, it can now fully
    control the line characteristics, both machine and consumer flags.
    This makes a lot of sense, but took some time before I figured out
    that this is how it has to work.

    - Several smallish documentation fixes.

    New drivers:

    - The PCA953x driver now supports the TI TCA9539.

    - The DaVinci driver now supports the K3 AM654 SoCs.

    Driver improvements:

    - Major overhaul and hardening of the OMAP driver by Russell King.

    - Starting to move some drivers to the new API passing irq_chip along
    with the gpio_chip when adding the gpio_chip instead of adding it
    separately.

    Unrelated:

    - Delete the FMC subsystem"

    * tag 'gpio-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (87 commits)
    Revert "gpio: tegra: Clean-up debugfs initialisation"
    gpiolib: Use spinlock_t instead of struct spinlock
    gpio: stp-xway: allow compile-testing
    gpio: stp-xway: get rid of the #include dependency
    gpio: stp-xway: improve module clock error handling
    gpio: stp-xway: simplify error handling in xway_stp_probe()
    gpiolib: Clarify use of non-sleeping functions
    gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants
    gpiolib: Document new gpio_chip.init_valid_mask field
    Documentation: gpio: Fix reference to gpiod_get_array()
    gpio: pl061: drop duplicate printing of device name
    gpio: altera: Pass irqchip when adding gpiochip
    gpio: siox: Use devm_ managed gpiochip
    gpio: siox: Add struct device *dev helper variable
    gpio: siox: Pass irqchip when adding gpiochip
    drivers: gpio: amd-fch: make resource struct const
    devres: allow const resource arguments
    gpio: ath79: Pass irqchip when adding gpiochip
    gpio: tegra: Clean-up debugfs initialisation
    gpio: siox: Switch to IRQ_TYPE_NONE
    ...

    Linus Torvalds
     

09 Jul, 2019

5 commits

  • Pull cgroup updates from Tejun Heo:
    "Documentation updates and the addition of cgroup_parse_float() which
    will be used by new controllers including blk-iocost"

    * 'for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
    docs: cgroup-v1: convert docs to ReST and rename to *.rst
    cgroup: Move cgroup_parse_float() implementation out of CONFIG_SYSFS
    cgroup: add cgroup_parse_float()

    Linus Torvalds
     
  • Pull RCU updates from Ingo Molnar:
    "The changes in this cycle are:

    - RCU flavor consolidation cleanups and optmizations

    - Documentation updates

    - Miscellaneous fixes

    - SRCU updates

    - RCU-sync flavor consolidation

    - Torture-test updates

    - Linux-kernel memory-consistency-model updates, most notably the
    addition of plain C-language accesses"

    * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (61 commits)
    tools/memory-model: Improve data-race detection
    tools/memory-model: Change definition of rcu-fence
    tools/memory-model: Expand definition of barrier
    tools/memory-model: Do not use "herd" to refer to "herd7"
    tools/memory-model: Fix comment in MP+poonceonces.litmus
    Documentation: atomic_t.txt: Explain ordering provided by smp_mb__{before,after}_atomic()
    rcu: Don't return a value from rcu_assign_pointer()
    rcu: Force inlining of rcu_read_lock()
    rcu: Fix irritating whitespace error in rcu_assign_pointer()
    rcu: Upgrade sync_exp_work_done() to smp_mb()
    rcutorture: Upper case solves the case of the vanishing NULL pointer
    torture: Suppress propagating trace_printk() warning
    rcutorture: Dump trace buffer for callback pipe drain failures
    torture: Add --trust-make to suppress "make clean"
    torture: Make --cpus override idleness calculations
    torture: Run kernel build in source directory
    torture: Add function graph-tracing cheat sheet
    torture: Capture qemu output
    rcutorture: Tweak kvm options
    rcutorture: Add trivial RCU implementation
    ...

    Linus Torvalds
     
  • Pull x86 CPU feature updates from Thomas Gleixner:
    "Updates for x86 CPU features:

    - Support for UMWAIT/UMONITOR, which allows to use MWAIT and MONITOR
    instructions in user space to save power e.g. in HPC workloads
    which spin wait on synchronization points.

    The maximum time a MWAIT can halt in userspace is controlled by the
    kernel and can be adjusted by the sysadmin.

    - Speed up the MTRR handling code on CPUs which support cache
    self-snooping correctly.

    On those CPUs the wbinvd() invocations can be omitted which speeds
    up the MTRR setup by a factor of 50.

    - Support for the new x86 vendor Zhaoxin who develops processors
    based on the VIA Centaur technology.

    - Prevent 'cat /proc/cpuinfo' from affecting isolated NOHZ_FULL CPUs
    by sending IPIs to retrieve the CPU frequency and use the cached
    values instead.

    - The addition and late revert of the FSGSBASE support. The revert
    was required as it turned out that the code still has hard to
    diagnose issues. Yet another engineering trainwreck...

    - Small fixes, cleanups, improvements and the usual new Intel CPU
    family/model addons"

    * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
    x86/fsgsbase: Revert FSGSBASE support
    selftests/x86/fsgsbase: Fix some test case bugs
    x86/entry/64: Fix and clean up paranoid_exit
    x86/entry/64: Don't compile ignore_sysret if 32-bit emulation is enabled
    selftests/x86: Test SYSCALL and SYSENTER manually with TF set
    x86/mtrr: Skip cache flushes on CPUs with cache self-snooping
    x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata
    Documentation/ABI: Document umwait control sysfs interfaces
    x86/umwait: Add sysfs interface to control umwait maximum time
    x86/umwait: Add sysfs interface to control umwait C0.2 state
    x86/umwait: Initialize umwait control values
    x86/cpufeatures: Enumerate user wait instructions
    x86/cpu: Disable frequency requests via aperfmperf IPI for nohz_full CPUs
    x86/acpi/cstate: Add Zhaoxin processors support for cache flush policy in C3
    ACPI, x86: Add Zhaoxin processors support for NONSTOP TSC
    x86/cpu: Create Zhaoxin processors architecture support file
    x86/cpu: Split Tremont based Atoms from the rest
    Documentation/x86/64: Add documentation for GS/FS addressing mode
    x86/elf: Enumerate kernel FSGSBASE capability in AT_HWCAP2
    x86/cpu: Enable FSGSBASE on 64bit by default and add a chicken bit
    ...

    Linus Torvalds
     
  • Pull x86 vsyscall updates from Thomas Gleixner:
    "Further hardening of the legacy vsyscall by providing support for
    execute only mode and switching the default to it.

    This prevents a certain class of attacks which rely on the vsyscall
    page being accessible at a fixed address in the canonical kernel
    address space"

    * 'x86-entry-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    selftests/x86: Add a test for process_vm_readv() on the vsyscall page
    x86/vsyscall: Add __ro_after_init to global variables
    x86/vsyscall: Change the default vsyscall mode to xonly
    selftests/x86/vsyscall: Verify that vsyscall=none blocks execution
    x86/vsyscall: Document odd SIGSEGV error code for vsyscalls
    x86/vsyscall: Show something useful on a read fault
    x86/vsyscall: Add a new vsyscall=xonly mode
    Documentation/admin: Remove the vsyscall=native documentation

    Linus Torvalds
     
  • Pull timer updates from Thomas Gleixner:
    "The timer and timekeeping departement delivers:

    Core:

    - The consolidation of the VDSO code into a generic library including
    the conversion of x86 and ARM64. Conversion of ARM and MIPS are en
    route through the relevant maintainer trees and should end up in
    5.4.

    This gets rid of the unnecessary different copies of the same code
    and brings all architectures on the same level of VDSO
    functionality.

    - Make the NTP user space interface more robust by restricting the
    TAI offset to prevent undefined behaviour. Includes a selftest.

    - Validate user input in the compat settimeofday() syscall to catch
    invalid values which would be turned into valid values by a
    multiplication overflow

    - Consolidate the time accessors

    - Small fixes, improvements and cleanups all over the place

    Drivers:

    - Support for the NXP system counter, TI davinci timer

    - Move the Microsoft HyperV clocksource/events code into the
    drivers/clocksource directory so it can be shared between x86 and
    ARM64.

    - Overhaul of the Tegra driver

    - Delay timer support for IXP4xx

    - Small fixes, improvements and cleanups as usual"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
    time: Validate user input in compat_settimeofday()
    timer: Document TIMER_PINNED
    clocksource/drivers: Continue making Hyper-V clocksource ISA agnostic
    clocksource/drivers: Make Hyper-V clocksource ISA agnostic
    MAINTAINERS: Fix Andy's surname and the directory entries of VDSO
    hrtimer: Use a bullet for the returns bullet list
    arm64: vdso: Fix compilation with clang older than 8
    arm64: compat: Fix __arch_get_hw_counter() implementation
    arm64: Fix __arch_get_hw_counter() implementation
    lib/vdso: Make delta calculation work correctly
    MAINTAINERS: Add entry for the generic VDSO library
    arm64: compat: No need for pre-ARMv7 barriers on an ARMv8 system
    arm64: vdso: Remove unnecessary asm-offsets.c definitions
    vdso: Remove superfluous #ifdef __KERNEL__ in vdso/datapage.h
    clocksource/drivers/davinci: Add support for clocksource
    clocksource/drivers/davinci: Add support for clockevents
    clocksource/drivers/tegra: Set up maximum-ticks limit properly
    clocksource/drivers/tegra: Cycles can't be 0
    clocksource/drivers/tegra: Restore base address before cleanup
    clocksource/drivers/tegra: Add verbose definition for 1MHz constant
    ...

    Linus Torvalds
     

08 Jul, 2019

1 commit

  • * pm-opp:
    opp: Don't use IS_ERR on invalid supplies
    opp: Make dev_pm_opp_set_rate() handle freq = 0 to drop performance votes
    opp: Don't overwrite rounded clk rate
    opp: Allocate genpd_virt_devs from dev_pm_opp_attach_genpd()
    opp: Attach genpds to devices from within OPP core

    * pm-misc:
    PM / clk: Remove error message on out-of-memory condition
    drivers: base: power: clock_ops: Use of_clk_get_parent_count()

    * pm-avs:
    power: avs: smartreflex: no need to check return value of debugfs_create functions

    * pm-tools:
    cpupower : frequency-set -r option misses the last cpu in related cpu list
    cpupower: correct spelling of interval
    Add README and update pm-graph and sleepgraph docs
    Update to pm-graph 5.4
    Update to pm-graph 5.3

    Rafael J. Wysocki
     

03 Jul, 2019

3 commits

  • This refactors do_unexpected_base() to clean up some code. It also
    fixes the following bugs in test_ptrace_write_gsbase():

    - Incorrect printf() format string caused crashes.

    - Hardcoded 0x7 for the gs selector was not reliably correct.

    It also documents the fact that the test is expected to fail on old
    kernels.

    Fixes: a87730cc3acc ("selftests/x86/fsgsbase: Test ptracer-induced GSBASE write with FSGSBASE")
    Fixes: 1b6858d5a2eb ("selftests/x86/fsgsbase: Test ptracer-induced GSBASE write")
    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Cc: "BaeChang Seok"
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: "H . Peter Anvin"
    Cc: Andi Kleen
    Cc: H. Peter Anvin
    Cc: "BaeChang Seok"
    Link: https://lkml.kernel.org/r/bab29c84f2475e2c30ddb00f1b877fcd7f4f96a8.1562125333.git.luto@kernel.org

    Andy Lutomirski
     
  • so the hyper-v clocksource update can be applied.

    Thomas Gleixner
     
  • Currently KVM_STATE_NESTED_EVMCS is used to signal that eVMCS
    capability is enabled on vCPU.
    As indicated by vmx->nested.enlightened_vmcs_enabled.

    This is quite bizarre as userspace VMM should make sure to expose
    same vCPU with same CPUID values in both source and destination.
    In case vCPU is exposed with eVMCS support on CPUID, it is also
    expected to enable KVM_CAP_HYPERV_ENLIGHTENED_VMCS capability.
    Therefore, KVM_STATE_NESTED_EVMCS is redundant.

    KVM_STATE_NESTED_EVMCS is currently used on restore path
    (vmx_set_nested_state()) only to enable eVMCS capability in KVM
    and to signal need_vmcs12_sync such that on next VMEntry to guest
    nested_sync_from_vmcs12() will be called to sync vmcs12 content
    into eVMCS in guest memory.
    However, because restore nested-state is rare enough, we could
    have just modified vmx_set_nested_state() to always signal
    need_vmcs12_sync.

    From all the above, it seems that we could have just removed
    the usage of KVM_STATE_NESTED_EVMCS. However, in order to preserve
    backwards migration compatibility, we cannot do that.
    (vmx_get_nested_state() needs to signal flag when migrating from
    new kernel to old kernel).

    Returning KVM_STATE_NESTED_EVMCS when just vCPU have eVMCS enabled
    have a bad side-effect of userspace VMM having to send nested-state
    from source to destination as part of migration stream. Even if
    guest have never used eVMCS as it doesn't even run a nested
    hypervisor workload. This requires destination userspace VMM and
    KVM to support setting nested-state. Which make it more difficult
    to migrate from new host to older host.
    To avoid this, change KVM_STATE_NESTED_EVMCS to signal eVMCS is
    not only enabled but also active. i.e. Guest have made some
    eVMCS active via an enlightened VMEntry. i.e. vmcs12 is copied
    from eVMCS and therefore should be restored into eVMCS resident
    in memory (by copy_vmcs12_to_enlightened()).

    Reviewed-by: Vitaly Kuznetsov
    Reviewed-by: Maran Wilson
    Reviewed-by: Krish Sadhukhan
    Signed-off-by: Liran Alon
    Signed-off-by: Paolo Bonzini

    Liran Alon
     

02 Jul, 2019

1 commit

  • Make sure that both variants of the nasty TF-in-compat-syscall are
    exercised regardless of what vendor's CPU is running the tests.

    Also change the intentional signal after SYSCALL to use ud2, which
    is a lot more comprehensible.

    This crashes the kernel due to an FSGSBASE bug right now.

    This test *also* detects a bug in KVM when run on an Intel host. KVM
    people, feel free to use it to help debug. There's a bunch of code in this
    test to warn instead of going into an infinite looping when the bug gets
    triggered.

    Reported-by: Vegard Nossum
    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Cc: "BaeChang Seok"
    Cc: Borislav Petkov
    Cc: Peter Zijlstra
    Cc: Paolo Bonzini
    Cc: kvm@vger.kernel.org
    Cc: "Bae, Chang Seok"
    Link: https://lkml.kernel.org/r/5f5de10441ab2e3005538b4c33be9b1965d1bb63.1562035429.git.luto@kernel.org

    Andy Lutomirski
     

29 Jun, 2019

3 commits

  • Pull perf fixes from Ingo Molnar:
    "Various fixes, most of them related to bugs perf fuzzing found in the
    x86 code"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/regs: Use PERF_REG_EXTENDED_MASK
    perf/x86: Remove pmu->pebs_no_xmm_regs
    perf/x86: Clean up PEBS_XMM_REGS
    perf/x86/regs: Check reserved bits
    perf/x86: Disable extended registers for non-supported PMUs
    perf/ioctl: Add check for the sample_period value
    perf/core: Fix perf_sample_regs_user() mm check

    Linus Torvalds
     
  • Pull XArray fixes from Matthew Wilcox:

    - Account XArray nodes for the page cache to the appropriate cgroup
    (Johannes Weiner)

    - Fix idr_get_next() when called under the RCU lock (Matthew Wilcox)

    - Add a test for xa_insert() (Matthew Wilcox)

    * tag 'xarray-5.2-rc6' of git://git.infradead.org/users/willy/linux-dax:
    XArray tests: Add check_insert
    idr: Fix idr_get_next race with idr_remove
    mm: fix page cache convergence regression

    Linus Torvalds
     
  • …k/linux-rcu into core/rcu

    Pull rcu/next + tools/memory-model changes from Paul E. McKenney:

    - RCU flavor consolidation cleanups and optmizations
    - Documentation updates
    - Miscellaneous fixes
    - SRCU updates
    - RCU-sync flavor consolidation
    - Torture-test updates
    - Linux-kernel memory-consistency-model updates, most notably the addition of plain C-language accesses

    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

28 Jun, 2019

3 commits

  • get_gate_page() is a piece of somewhat alarming code to make
    get_user_pages() work on the vsyscall page. Test it via
    process_vm_readv().

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kees Cook
    Cc: Florian Weimer
    Cc: Jann Horn
    Cc: Borislav Petkov
    Cc: Kernel Hardening
    Cc: Peter Zijlstra
    Link: https://lkml.kernel.org/r/0fe34229a9330e8f9de9765967939cc4f1cf26b1.1561610354.git.luto@kernel.org

    Andy Lutomirski
     
  • If vsyscall=none accidentally still allowed vsyscalls, the test wouldn't
    fail. Fix it.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kees Cook
    Cc: Florian Weimer
    Cc: Jann Horn
    Cc: Borislav Petkov
    Cc: Kernel Hardening
    Cc: Peter Zijlstra
    Link: https://lkml.kernel.org/r/b413397c804265f8865f3e70b14b09485ea7c314.1561610354.git.luto@kernel.org

    Andy Lutomirski
     
  • Even if vsyscall=none, user page faults on the vsyscall page are reported
    as though the PROT bit in the error code was set. Add a comment explaining
    why this is probably okay and display the value in the test case.

    While at it, explain why the behavior is correct with respect to PKRU.

    Modify also the selftest to print the odd error code so that there is a
    way to demonstrate the odd behaviour.

    If anyone really cares about more accurate emulation, the behaviour could
    be changed. But that needs a real good justification.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kees Cook
    Cc: Florian Weimer
    Cc: Jann Horn
    Cc: Borislav Petkov
    Cc: Kernel Hardening
    Cc: Peter Zijlstra
    Link: https://lkml.kernel.org/r/75c91855fd850649ace162eec5495a1354221aaa.1561610354.git.luto@kernel.org

    Andy Lutomirski
     

27 Jun, 2019

1 commit


25 Jun, 2019

3 commits

  • Use the macro defined in kernel ABI header to replace the local name.

    No functional change.

    Signed-off-by: Kan Liang
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Link: https://lkml.kernel.org/r/1559081314-9714-5-git-send-email-kan.liang@linux.intel.com
    Signed-off-by: Ingo Molnar

    Kan Liang
     
  • Paul E. McKenney
     
  • Herbert Xu recently reported a problem concerning RCU and compiler
    barriers. In the course of discussing the problem, he put forth a
    litmus test which illustrated a serious defect in the Linux Kernel
    Memory Model's data-race-detection code [1].

    The defect was that the LKMM assumed visibility and executes-before
    ordering of plain accesses had to be mediated by marked accesses. In
    Herbert's litmus test this wasn't so, and the LKMM claimed the litmus
    test was allowed and contained a data race although neither is true.

    In fact, plain accesses can be ordered by fences even in the absence
    of marked accesses. In most cases this doesn't matter, because most
    fences only order accesses within a single thread. But the rcu-fence
    relation is different; it can order (and induce visibility between)
    accesses in different threads -- events which otherwise might be
    concurrent. This makes it relevant to data-race detection.

    This patch makes two changes to the memory model to incorporate the
    new insight:

    If a store is separated by a fence from another access,
    the store is necessarily visible to the other access (as
    reflected in the ww-vis and wr-vis relations). Similarly,
    if a load is separated by a fence from another access then
    the load necessarily executes before the other access (as
    reflected in the rw-xbstar relation).

    If a store is separated by a strong fence from a marked access
    then it is necessarily visible to any access that executes
    after the marked access (as reflected in the ww-vis and wr-vis
    relations).

    With these changes, the LKMM gives the desired result for Herbert's
    litmus test and other related ones [2].

    [1] https://lore.kernel.org/lkml/Pine.LNX.4.44L0.1906041026570.1731-100000@iolanthe.rowland.org/

    [2] https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-1.litmus
    https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-2.litmus
    https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-3.litmus
    https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-4.litmus
    https://github.com/paulmckrcu/litmus/blob/master/manual/plain/strong-vis.litmus

    Reported-by: Herbert Xu
    Signed-off-by: Alan Stern
    Acked-by: Andrea Parri
    Signed-off-by: Paul E. McKenney
    Tested-by: Akira Yokosawa

    Alan Stern
     

24 Jun, 2019

1 commit

  • Pull powerpc fixes from Michael Ellerman:
    "One fix for a bug in our context id handling on 64-bit hash CPUs,
    which can lead to unrelated processes being able to read/write to each
    other's virtual memory. See the commit for full details.

    That is the fix for CVE-2019-12817.

    This also adds a kernel selftest for the bug"

    * tag 'powerpc-5.2-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    selftests/powerpc: Add test of fork with mapping above 512TB
    powerpc/mm/64s/hash: Reallocate context ids on fork

    Linus Torvalds
     

22 Jun, 2019

8 commits

  • Pick up upstream fixes for pending changes.

    Thomas Gleixner
     
  • This validates that GS and GSBASE are independently preserved in
    ptracer commands.

    Suggested-by: Andy Lutomirski
    Signed-off-by: Chang S. Bae
    Signed-off-by: Thomas Gleixner
    Cc: Andi Kleen
    Cc: Ravi Shankar
    Cc: H. Peter Anvin
    Link: https://lkml.kernel.org/r/1557309753-24073-16-git-send-email-chang.seok.bae@intel.com

    Chang S. Bae
     
  • This validates that GS and GSBASE are independently preserved across
    context switches.

    [ chang: Use FSGSBASE instructions directly instead of .byte ]

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Chang S. Bae
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Andi Kleen
    Cc: Ravi Shankar
    Cc: H. Peter Anvin
    Link: https://lkml.kernel.org/r/1557309753-24073-15-git-send-email-chang.seok.bae@intel.com

    Andy Lutomirski
     
  • The test validates that the selector is not changed when a ptracer writes
    the ptracee's GSBASE.

    Suggested-by: Andy Lutomirski
    Signed-off-by: Chang S. Bae
    Signed-off-by: Thomas Gleixner
    Cc: "H . Peter Anvin"
    Cc: Andi Kleen
    Cc: Ravi Shankar
    Cc: H. Peter Anvin
    Link: https://lkml.kernel.org/r/1557309753-24073-3-git-send-email-chang.seok.bae@intel.com

    Chang S. Bae
     
  • PTI has a significant impact on precision of the MONOTONIC_RAW clock,
    which prevents a lot of computers from running the freq-step test.
    Increase the maximum acceptable precision for the test to not be skipped
    to 500 nanoseconds.

    After commit 78b98e3c5a66 ("timekeeping/ntp: Determine the multiplier
    directly from NTP tick length") the frequency and time errors should be
    much smaller. Reduce the maximum acceptable values for the test to pass
    to 0.02 ppm and 50 nanoseconds respectively.

    Signed-off-by: Miroslav Lichvar
    Signed-off-by: Thomas Gleixner
    Cc: John Stultz
    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190618160612.21957-1-mlichvar@redhat.com

    Miroslav Lichvar
     
  • The rcu-fence relation in the Linux Kernel Memory Model is not well
    named. It doesn't act like any other fence relation, in that it does
    not relate events before a fence to events after that fence. All it
    does is relate certain RCU events to one another (those that are
    ordered by the RCU Guarantee); this induces an actual
    strong-fence-like relation linking events preceding the first RCU
    event to those following the second.

    This patch renames rcu-fence, now called rcu-order. It adds a new
    definition of rcu-fence, something which should have been present all
    along because it is used in the rb relation. And it modifies the
    fence and strong-fence relations by making them incorporate the new
    rcu-fence.

    As a result of this change, there is no longer any need to define
    full-fence in the section for detecting data races. It can simply be
    replaced by the updated strong-fence relation.

    This change should have no effect on the operation of the memory model.

    Signed-off-by: Alan Stern
    Acked-by: Andrea Parri
    Signed-off-by: Paul E. McKenney

    Alan Stern
     
  • Commit 66be4e66a7f4 ("rcu: locking and unlocking need to always be at
    least barriers") added compiler barriers back into rcu_read_lock() and
    rcu_read_unlock(). Furthermore, srcu_read_lock() and
    srcu_read_unlock() have always contained compiler barriers.

    The Linux Kernel Memory Model ought to know about these barriers.
    This patch adds them into the memory model.

    Signed-off-by: Alan Stern
    Acked-by: Andrea Parri
    Signed-off-by: Paul E. McKenney

    Alan Stern
     
  • Pull still more SPDX updates from Greg KH:
    "Another round of SPDX updates for 5.2-rc6

    Here is what I am guessing is going to be the last "big" SPDX update
    for 5.2. It contains all of the remaining GPLv2 and GPLv2+ updates
    that were "easy" to determine by pattern matching. The ones after this
    are going to be a bit more difficult and the people on the spdx list
    will be discussing them on a case-by-case basis now.

    Another 5000+ files are fixed up, so our overall totals are:
    Files checked: 64545
    Files with SPDX: 45529

    Compared to the 5.1 kernel which was:
    Files checked: 63848
    Files with SPDX: 22576

    This is a huge improvement.

    Also, we deleted another 20000 lines of boilerplate license crud,
    always nice to see in a diffstat"

    * tag 'spdx-5.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: (65 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 507
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 506
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 504
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 503
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 502
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 501
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 499
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 498
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 496
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 495
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 491
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 490
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 489
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 488
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 487
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 486
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 485
    ...

    Linus Torvalds
     

21 Jun, 2019

2 commits

  • Pull kvm fixes from Paolo Bonzini:
    "Fixes for ARM and x86, plus selftest patches and nicer structs for
    nested state save/restore"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: nVMX: reorganize initial steps of vmx_set_nested_state
    KVM: arm/arm64: Fix emulated ptimer irq injection
    tests: kvm: Check for a kernel warning
    kvm: tests: Sort tests in the Makefile alphabetically
    KVM: x86/mmu: Allocate PAE root array when using SVM's 32-bit NPT
    KVM: x86: Modify struct kvm_nested_state to have explicit fields for data
    KVM: fix typo in documentation
    KVM: nVMX: use correct clean fields when copying from eVMCS
    KVM: arm/arm64: vgic: Fix kvm_device leak in vgic_its_destroy
    KVM: arm64: Filter out invalid core register IDs in KVM_GET_REG_LIST
    KVM: arm64: Implement vq_present() as a macro

    Linus Torvalds
     
  • Commit 332d079735f5 ("KVM: nVMX: KVM_SET_NESTED_STATE - Tear down old EVMCS
    state before setting new state", 2019-05-02) broke evmcs_test because the
    eVMCS setup must be performed even if there is no VMXON region defined,
    as long as the eVMCS bit is set in the assist page.

    While the simplest possible fix would be to add a check on
    kvm_state->flags & KVM_STATE_NESTED_EVMCS in the initial "if" that
    covers kvm_state->hdr.vmx.vmxon_pa == -1ull, that is quite ugly.

    Instead, this patch moves checks earlier in the function and
    conditionalizes them on kvm_state->hdr.vmx.vmxon_pa, so that
    vmx_set_nested_state always goes through vmx_leave_nested
    and nested_enable_evmcs.

    Fixes: 332d079735f5 ("KVM: nVMX: KVM_SET_NESTED_STATE - Tear down old EVMCS state before setting new state")
    Cc: Aaron Lewis
    Reviewed-by: Vitaly Kuznetsov
    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     

20 Jun, 2019

3 commits


19 Jun, 2019

4 commits

  • Based on 1 normalized pattern(s):

    gplv2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 58 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081207.556988620@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this work is licensed under the terms of the gnu gpl version 2 see
    the copying file in the top level directory

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 35 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.797835076@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it would be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Enrico Weigelt
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081204.982710800@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner