20 Sep, 2015

1 commit

  • Pull ARM fixes from Russell King:
    "Three fixes and a resulting cleanup for -rc2:

    - Andre Przywara reported that he was seeing a warning with the new
    cast inside DMA_ERROR_CODE's definition, and fixed the incorrect
    use.

    - Doug Anderson noticed that kgdb causes a "scheduling while atomic"
    bug.

    - OMAP5 folk noticed that their Thumb-2 compiled X servers crashed
    when enabling support to cover ARMv6 CPUs due to a kernel bug
    leaking some conditional context into the signal handler"

    * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    ARM: 8425/1: kgdb: Don't try to stop the machine when setting breakpoints
    ARM: 8437/1: dma-mapping: fix build warning with new DMA_ERROR_CODE definition
    ARM: get rid of needless #if in signal handling code
    ARM: fix Thumb2 signal handling when ARMv6 is enabled

    Linus Torvalds
     

19 Sep, 2015

1 commit

  • Pull KVM fixes from Paolo Bonzini:
    "Mostly stable material, a lot of ARM fixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (22 commits)
    sched: access local runqueue directly in single_task_running
    arm/arm64: KVM: Remove 'config KVM_ARM_MAX_VCPUS'
    arm64: KVM: Remove all traces of the ThumbEE registers
    arm: KVM: Disable virtual timer even if the guest is not using it
    arm64: KVM: Disable virtual timer even if the guest is not using it
    arm/arm64: KVM: vgic: Check for !irqchip_in_kernel() when mapping resources
    KVM: s390: Replace incorrect atomic_or with atomic_andnot
    arm: KVM: Fix incorrect device to IPA mapping
    arm64: KVM: Fix user access for debug registers
    KVM: vmx: fix VPID is 0000H in non-root operation
    KVM: add halt_attempted_poll to VCPU stats
    kvm: fix zero length mmio searching
    kvm: fix double free for fast mmio eventfd
    kvm: factor out core eventfd assign/deassign logic
    kvm: don't try to register to KVM_FAST_MMIO_BUS for non mmio eventfd
    KVM: make the declaration of functions within 80 characters
    KVM: arm64: add workaround for Cortex-A57 erratum #852523
    KVM: fix polling for guest halt continued even if disable it
    arm/arm64: KVM: Fix PSCI affinity info return value for non valid cores
    arm64: KVM: set {v,}TCR_EL2 RES1 bits
    ...

    Linus Torvalds
     

18 Sep, 2015

9 commits

  • Pull irq updates from Thomas Gleixner:
    "This is a rather large update post rc1 due to the final steps of
    cleanups and API changes which had to wait for the preparatory patches
    to hit your tree.

    - Regression fixes for ARM GIC irqchips

    - Regression fixes and lockdep anotations for renesas irq chips

    - The leftovers of the cleanup and preparatory patches which have
    been ignored by maintainers

    - Final conversions of the newly merged users of obsolete APIs

    - Final removal of obsolete APIs

    - Final removal of ARM artifacts which had been introduced during the
    conversion of ARM to the generic interrupt code.

    - Final split of the irq_data into chip specific and common data to
    reflect the needs of hierarchical irq domains.

    - Treewide removal of the first argument of interrupt flow handlers,
    i.e. the irq number, which is not used by the majority of handlers
    and simple to retrieve from the other argument the irq descriptor.

    - A few comment updates and build warning fixes"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits)
    arm64: Remove ununsed set_irq_flags
    ARM: Remove ununsed set_irq_flags
    sh: Kill off set_irq_flags usage
    irqchip: Kill off set_irq_flags usage
    gpu/drm: Kill off set_irq_flags usage
    genirq: Remove irq argument from irq flow handlers
    genirq: Move field 'msi_desc' from irq_data into irq_common_data
    genirq: Move field 'affinity' from irq_data into irq_common_data
    genirq: Move field 'handler_data' from irq_data into irq_common_data
    genirq: Move field 'node' from irq_data into irq_common_data
    irqchip/gic-v3: Use IRQD_FORWARDED_TO_VCPU flag
    irqchip/gic: Use IRQD_FORWARDED_TO_VCPU flag
    genirq: Provide IRQD_FORWARDED_TO_VCPU status flag
    genirq: Simplify irq_data_to_desc()
    genirq: Remove __irq_set_handler_locked()
    pinctrl/pistachio: Use irq_set_handler_locked
    gpio: vf610: Use irq_set_handler_locked
    powerpc/mpc8xx: Use irq_set_handler_locked()
    powerpc/ipic: Use irq_set_handler_locked()
    powerpc/cpm2: Use irq_set_handler_locked()
    ...

    Linus Torvalds
     
  • Pull x86 fix from Thomas Gleixner:
    "A single regression fix for the x86 dma allocator which got wreckaged
    in the merge window"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/pci/dma: Fix gfp flags for coherent DMA memory allocation

    Linus Torvalds
     
  • Pull powerpc fixes from Michael Ellerman:

    - Fix 32-bit TCE table init in kdump kernel from Nish

    - Fix kdump with non-power-of-2 crashkernel= from Nish

    - Abort cxl_pci_enable_device_hook() if PCI channel is offline from
    Andrew

    - Fix to release DRC when configure_connector() fails from Bharata

    - Wire up sys_userfaultfd()

    - Fix race condition in tearing down MSI interrupts from Paul

    - Fix unbalanced pci_dev_get() in cxl_probe() from Daniel

    - Fix cxl build failure due to -Wunused-variable gcc behaviour change
    from Ian

    - Tell the toolchain to use ABI v2 when building an LE boot wrapper
    from Benh

    - Fix THP to recompute hash value after a failed update from Aneesh

    - 32-bit memcpy/memset: only use dcbz once cache is enabled from
    Christophe

    * tag 'powerpc-4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc32: memset: only use dcbz once cache is enabled
    powerpc32: memcpy: only use dcbz once cache is enabled
    powerpc/mm: Recompute hash value after a failed update
    powerpc/boot: Specify ABI v2 when building an LE boot wrapper
    cxl: Fix build failure due to -Wunused-variable behaviour change
    cxl: Fix unbalanced pci_dev_get in cxl_probe
    powerpc/MSI: Fix race condition in tearing down MSI interrupts
    powerpc: Wire up sys_userfaultfd()
    powerpc/pseries: Release DRC when configure_connector fails
    cxl: abort cxl_pci_enable_device_hook() if PCI channel is offline
    powerpc/powernv/pci-ioda: fix kdump with non-power-of-2 crashkernel=
    powerpc/powernv/pci-ioda: fix 32-bit TCE table init in kdump kernel

    Linus Torvalds
     
  • Merge misc fixes from ANdrew Morton:
    "8 fixes"

    * emailed patches from Andrew Morton :
    revert "mm: make sure all file VMAs have ->vm_ops set"
    MAINTAINERS: update LTP mailing list
    userfaultfd: add missing mmput() in error path
    lib/string_helpers.c: fix infinite loop in string_get_size()
    alpha: lib: export __delay
    alpha: io: define ioremap_uc
    kasan: fix last shadow judgement in memory_is_poisoned_16()
    zram: fix possible use after free in zcomp_create()

    Linus Torvalds
     
  • __delay was not exported as a result while building with allmodconfig we
    were getting build error of undefined symbol. __delay is being used by:
    drivers/net/phy/mdio-octeon.c

    Signed-off-by: Sudip Mukherjee
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sudip Mukherjee
     
  • ioremap_uc was not defined and as a result while building with
    allmodconfig were getting build error of: implicit declaration of
    function 'ioremap_uc'.

    Signed-off-by: Sudip Mukherjee
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sudip Mukherjee
     
  • Pull arm64 fixes from Will Deacon:
    "This addresses some problems with filesystem writeback due to the
    recently merged hardware DBM patches, which caused us to treat some
    read-only pages as dirty.

    There are also some other, less significant fixes that are described
    in the summary below:

    A mixture of fixes for regressions introduced during the merge window,
    some longer standing problems that we spotted and a couple of hardware
    errata. The main changes are:

    - Fix fallout from the h/w DBM patches, causing filesystem writeback
    issues on both v8 and v8.1 CPUs

    - Workaround for Cortex-A53 erratum #843419 in the module loader

    - Fix for long-standing issue with compat big-endian signal handlers
    using the saved floating point state"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: errata: add module build workaround for erratum #843419
    arm64: compat: fix vfp save/restore across signal handlers in big-endian
    arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers
    arm64: head.S: initialise mdcr_el2 in el2_setup
    arm64: enable generic idle loop
    arm64: pgtable: use a single bit for PTE_WRITE regardless of DBM
    arm64: Fix pte_modify() to preserve the hardware dirty information
    arm64: Fix the pte_hw_dirty() check when AF/DBM is enabled
    arm64: dma-mapping: check whether cma area is initialized or not

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar:
    - misc fixes all around the map
    - block non-root vm86(old) if mmap_min_addr != 0
    - two small debuggability improvements
    - removal of obsolete paravirt op

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/platform: Fix Geode LX timekeeping in the generic x86 build
    x86/apic: Serialize LVTT and TSC_DEADLINE writes
    x86/ioapic: Force affinity setting in setup_ioapic_dest()
    x86/paravirt: Remove the unused pv_time_ops::get_tsc_khz method
    x86/ldt: Fix small LDT allocation for Xen
    x86/vm86: Fix the misleading CONFIG_VM86 Kconfig help text
    x86/cpu: Print family/model/stepping in hex
    x86/vm86: Block non-root vm86(old) if mmap_min_addr != 0
    x86/alternatives: Make optimize_nops() interrupt safe and synced
    x86/mm/srat: Print non-volatile flag in SRAT
    x86/cpufeatures: Enable cpuid for Intel SHA extensions

    Linus Torvalds
     
  • Pull perf fixes from Ingo MOlnar:
    "Mostly tooling fixes, but also two x86 PMU driver fixes"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf tests: Fix software clock events test setting maps
    perf tests: Fix task exit test setting maps
    perf evlist: Fix create_syswide_maps() not propagating maps
    perf evlist: Fix add() not propagating maps
    perf evlist: Factor out a function to propagate maps for a single evsel
    perf evlist: Make create_maps() use set_maps()
    perf evlist: Make set_maps() more resilient
    perf evsel: Add own_cpus member
    perf evlist: Fix missing thread_map__put in propagate_maps()
    perf evlist: Fix splice_list_tail() not setting evlist
    perf evlist: Add has_user_cpus member
    perf evlist: Remove redundant validation from propagate_maps()
    perf evlist: Simplify set_maps() logic
    perf evlist: Simplify propagate_maps() logic
    perf top: Fix segfault pressing -> with no hist entries
    perf header: Fixup reading of HEADER_NRCPUS feature
    perf/x86/intel: Fix constraint access
    perf/x86/intel/bts: Set event->hw.itrace_started in pmu::start to match the new logic
    perf tools: Fix use of wrong event when processing exit events
    perf tools: Fix parse_events_add_pmu caller

    Linus Torvalds
     

17 Sep, 2015

16 commits

  • Pull locking fixes from Ingo Molnar:
    "Spinlock performance regression fix, plus documentation fixes"

    * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    locking/static_keys: Fix up the static keys documentation
    locking/qspinlock/x86: Only emit the test-and-set fallback when building guest support
    locking/qspinlock/x86: Fix performance regression under unaccelerated VMs
    locking/static_keys: Fix a silly typo

    Linus Torvalds
     
  • …it/kvmarm/kvmarm into kvm-master

    Second set of KVM/ARM changes for 4.3-rc2

    - Workaround for a Cortex-A57 erratum
    - Bug fix for the debugging infrastructure
    - Fix for 32bit guests with more than 4GB of address space
    on a 32bit host
    - A number of fixes for the (unusual) case when we don't use
    the in-kernel GIC emulation
    - Removal of ThumbEE handling on arm64, since these have been
    dropped from the architecture before anyone actually ever
    built a CPU
    - Remove the KVM_ARM_MAX_VCPUS limitation which has become
    fairly pointless

    Paolo Bonzini
     
  • Commit 6894258eda2f reversed the order of gfp_flags adjustment in
    dma_alloc_attrs() for x86 [arch/x86/kernel/pci-dma.c] As a result,
    relevant flags set by dma_alloc_coherent_gfp_flags() are just
    discarded and cause coherent DMA memory allocation failure on some
    devices.

    Fixes: 6894258eda2f ("dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent}")
    Signed-off-by: Jun'ichi Nomura
    Tested-by: Tony Luck
    Acked-by: Christoph Hellwig
    Link: http://lkml.kernel.org/r/20150914073834.GA13077@xzibit.linux.bs1.fc.nec.co.jp
    Signed-off-by: Thomas Gleixner

    Junichi Nomura
     
  • This patch removes config option of KVM_ARM_MAX_VCPUS,
    and like other ARCHs, just choose the maximum allowed
    value from hardware, and follows the reasons:

    1) from distribution view, the option has to be
    defined as the max allowed value because it need to
    meet all kinds of virtulization applications and
    need to support most of SoCs;

    2) using a bigger value doesn't introduce extra memory
    consumption, and the help text in Kconfig isn't accurate
    because kvm_vpu structure isn't allocated until request
    of creating VCPU is sent from QEMU;

    3) the main effect is that the field of vcpus[] in 'struct kvm'
    becomes a bit bigger(sizeof(void *) per vcpu) and need more cache
    lines to hold the structure, but 'struct kvm' is one generic struct,
    and it has worked well on other ARCHs already in this way. Also,
    the world switch frequecy is often low, for example, it is ~2000
    when running kernel building load in VM from APM xgene KVM host,
    so the effect is very small, and the difference can't be observed
    in my test at all.

    Cc: Dann Frazier
    Signed-off-by: Ming Lei
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier

    Ming Lei
     
  • Although the ThumbEE registers and traps were present in earlier
    versions of the v8 architecture, it was retrospectively removed and so
    we can do the same.

    Whilst this breaks migrating a guest started on a previous version of
    the kernel, it is much better to kill these (non existent) registers
    as soon as possible.

    Reviewed-by: Marc Zyngier
    Signed-off-by: Will Deacon
    [maz: added commend about migration]
    Signed-off-by: Marc Zyngier

    Will Deacon
     
  • When running a guest with the architected timer disabled (with QEMU and
    the kernel_irqchip=off option, for example), it is important to make
    sure the timer gets turned off. Otherwise, the guest may try to
    enable it anyway, leading to a screaming HW interrupt.

    The fix is to unconditionally turn off the virtual timer on guest
    exit.

    Cc: stable@vger.kernel.org
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • When running a guest with the architected timer disabled (with QEMU and
    the kernel_irqchip=off option, for example), it is important to make
    sure the timer gets turned off. Otherwise, the guest may try to
    enable it anyway, leading to a screaming HW interrupt.

    The fix is to unconditionally turn off the virtual timer on guest
    exit.

    Cc: stable@vger.kernel.org
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • Cortex-A53 processors
    Acked-by: Catalin Marinas
    Signed-off-by: Will Deacon

    Will Deacon
     
  • When saving/restoring the VFP registers from a compat (AArch32)
    signal frame, we rely on the compat registers forming a prefix of the
    native register file and therefore make use of copy_{to,from}_user to
    transfer between the native fpsimd_state and the compat_vfp_sigframe.

    Unfortunately, this doesn't work so well in a big-endian environment.
    Our fpsimd save/restore code operates directly on 128-bit quantities
    (Q registers) whereas the compat_vfp_sigframe represents the registers
    as an array of 64-bit (D) registers. The architecture packs the compat D
    registers into the Q registers, with the least significant bytes holding
    the lower register. Consequently, we need to swap the 64-bit halves when
    converting between these two representations on a big-endian machine.

    This patch replaces the __copy_{to,from}_user invocations in our
    compat VFP signal handling code with explicit __put_user loops that
    operate on 64-bit values and swap them accordingly.

    Cc:
    Reviewed-by: Catalin Marinas
    Signed-off-by: Will Deacon

    Will Deacon
     
  • We have a couple of CPU hotplug notifiers for resetting the CPU debug
    state to a sane value when a CPU comes online.

    This patch ensures that we mask out CPU_TASKS_FROZEN so that we don't
    miss any online events occuring due to suspend/resume.

    Acked-by: Lorenzo Pieralisi
    Signed-off-by: Will Deacon

    Will Deacon
     
  • memset() uses instruction dcbz to speed up clearing by not wasting time
    loading cache line with data that will be overwritten.
    Some platform like mpc52xx do no have cache active at startup and
    can therefore not use memset(). Allthough no part of the code
    explicitly uses memset(), GCC may make calls to it.

    This patch modifies memset() such that at startup, memset()
    unconditionally skip the optimised bloc that uses dcbz instruction.

    Once the initial MMU is set up, in machine_init() we patch memset()
    by replacing this inconditional jump by a NOP

    Tested-by: Thomas Gleixner
    Signed-off-by: Christophe Leroy
    Signed-off-by: Michael Ellerman

    LEROY Christophe
     
  • memcpy() uses instruction dcbz to speed up copy by not wasting time
    loading cache line with data that will be overwritten.
    Some platform like mpc52xx do no have cache active at startup and
    can therefore not use memcpy(). Allthough no part of the code
    explicitly uses memcpy(), GCC makes calls to it.

    This patch modifies memcpy() such that at startup, memcpy()
    unconditionally jumps to generic_memcpy() which doesn't use
    the dcbz instruction.

    Once the initial MMU is set up, in machine_init() we patch memcpy()
    by replacing this inconditional jump by a NOP

    Reported-by: Michal Sojka
    Tested-by: Thomas Gleixner
    Signed-off-by: Christophe Leroy
    Signed-off-by: Michael Ellerman

    LEROY Christophe
     
  • In (23a4e40 arm: kgdb: Handle read-only text / modules) we moved to
    using patch_text() to set breakpoints so that we could handle the case
    when we had CONFIG_DEBUG_RODATA. That patch used patch_text().
    Unfortunately, patch_text() assumes that we're not in atomic context
    when it runs since it needs to grab a mutex and also wait for other
    CPUs to stop (which it does with a completion).

    This would result in a stack crawl if you had
    CONFIG_DEBUG_ATOMIC_SLEEP and tried to set a breakpoint in kgdb. The
    crawl looked something like:

    BUG: scheduling while atomic: swapper/0/0/0x00010007
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc7-00133-geb63b34 #1073
    Hardware name: Rockchip (Device Tree)
    (unwind_backtrace) from [] (show_stack+0x20/0x24)
    (show_stack) from [] (dump_stack+0x84/0xb8)
    (dump_stack) from [] (__schedule_bug+0x54/0x6c)
    (__schedule_bug) from [] (__schedule+0x80/0x668)
    (__schedule) from [] (schedule+0xb8/0xd4)
    (schedule) from [] (schedule_timeout+0x2c/0x234)
    (schedule_timeout) from [] (wait_for_common+0xf4/0x188)
    (wait_for_common) from [] (wait_for_completion+0x20/0x24)
    (wait_for_completion) from [] (__stop_cpus+0x58/0x70)
    (__stop_cpus) from [] (stop_cpus+0x3c/0x54)
    (stop_cpus) from [] (__stop_machine+0xcc/0xe8)
    (__stop_machine) from [] (stop_machine+0x34/0x44)
    (stop_machine) from [] (patch_text+0x28/0x34)
    (patch_text) from [] (kgdb_arch_set_breakpoint+0x40/0x4c)
    (kgdb_arch_set_breakpoint) from [] (kgdb_validate_break_address+0x2c/0x60)
    (kgdb_validate_break_address) from [] (dbg_set_sw_break+0x1c/0xdc)
    (dbg_set_sw_break) from [] (gdb_serial_stub+0x9c4/0xba4)
    (gdb_serial_stub) from [] (kgdb_cpu_enter+0x1f8/0x60c)
    (kgdb_cpu_enter) from [] (kgdb_handle_exception+0x19c/0x1d0)
    (kgdb_handle_exception) from [] (kgdb_compiled_brk_fn+0x30/0x3c)
    (kgdb_compiled_brk_fn) from [] (do_undefinstr+0x1a4/0x20c)
    (do_undefinstr) from [] (__und_svc_finish+0x0/0x34)

    It turns out that when we're in kgdb all the CPUs are stopped anyway
    so there's no reason we should be calling patch_text(). We can
    instead directly call __patch_text() which assumes that CPUs have
    already been stopped.

    Fixes: 23a4e4050ba9 ("arm: kgdb: Handle read-only text / modules")
    Reported-by: Aapo Vienamo
    Signed-off-by: Douglas Anderson
    Reviewed-by: Stephen Boyd
    Acked-by: Kees Cook
    Signed-off-by: Russell King

    Doug Anderson
     
  • Commit 96231b2686b5: ("ARM: 8419/1: dma-mapping: harmonize definition
    of DMA_ERROR_CODE") changed the definition of DMA_ERROR_CODE to use
    dma_addr_t, which makes the compiler barf on assigning this to an
    "int" variable on ARM with LPAE enabled:
    *************
    In file included from /src/linux/include/linux/dma-mapping.h:86:0,
    from /src/linux/arch/arm/mm/dma-mapping.c:21:
    /src/linux/arch/arm/mm/dma-mapping.c: In function '__iommu_create_mapping':
    /src/linux/arch/arm/include/asm/dma-mapping.h:16:24: warning:
    overflow in implicit constant conversion [-Woverflow]
    #define DMA_ERROR_CODE (~(dma_addr_t)0x0)
    ^
    /src/linux/arch/arm/mm/dma-mapping.c:1252:15: note: in expansion of
    macro DMA_ERROR_CODE'
    int i, ret = DMA_ERROR_CODE;
    ^
    *************

    Remove the actually unneeded initialization of "ret" in
    __iommu_create_mapping() and move the variable declaration inside the
    for-loop to make the scope of this variable more clear.

    Signed-off-by: Andre Przywara
    Signed-off-by: Russell King

    Andre Przywara
     
  • Remove the #if statement which caused trouble for kernels that support
    both ARMv6 and ARMv7. Older architectures do not implement these bits,
    so it should be safe to always clear them.

    Signed-off-by: Russell King

    Russell King
     
  • Until b26e5fdac43c ("arm/arm64: KVM: introduce per-VM ops"),
    kvm_vgic_map_resources() used to include a check on irqchip_in_kernel(),
    and vgic_v2_map_resources() still has it.

    But now vm_ops are not initialized until we call kvm_vgic_create().
    Therefore kvm_vgic_map_resources() can being called without a VGIC,
    and we die because vm_ops.map_resources is NULL.

    Fixing this restores QEMU's kernel-irqchip=off option to a working state,
    allowing to use GIC emulation in userspace.

    Fixes: b26e5fdac43c ("arm/arm64: KVM: introduce per-VM ops")
    Cc: stable@vger.kernel.org
    Signed-off-by: Pavel Fedin
    [maz: reworked commit message]
    Signed-off-by: Marc Zyngier

    Pavel Fedin
     

16 Sep, 2015

13 commits

  • The offending commit accidentally replaces an atomic_clear with an
    atomic_or instead of an atomic_andnot in kvm_s390_vcpu_request_handled.
    The symptom is that kvm guests on s390 hang on startup.
    This patch simply replaces the incorrect atomic_or with atomic_andnot

    Fixes: 805de8f43c20 (atomic: Replace atomic_{set,clear}_mask() usage)
    Signed-off-by: Jason J. Herne
    Acked-by: Christian Borntraeger
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Cornelia Huck
    Signed-off-by: Paolo Bonzini

    Jason J. Herne
     
  • Now that all users of set_irq_flags and custom flags are converted to
    genirq functions, the ARM specific set_irq_flags can be removed.

    Signed-off-by: Rob Herring
    Acked-by: Catalin Marinas
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Russell King
    Cc: Will Deacon
    Signed-off-by: Thomas Gleixner

    Rob Herring
     
  • Now that all users of set_irq_flags and custom flags are converted to
    genirq functions, the ARM specific set_irq_flags can be removed.

    Signed-off-by: Rob Herring
    Tested-by: Kevin Hilman
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Russell King
    Signed-off-by: Thomas Gleixner

    Rob Herring
     
  • In 2007, commit 07190a08eef36 ("Mark TSC on GeodeLX reliable")
    bypassed verification of the TSC on Geode LX. However, this code
    (now in the check_system_tsc_reliable() function in
    arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was
    set.

    OpenWRT has recently started building its generic Geode target
    for Geode GX, not LX, to include support for additional
    platforms. This broke the timekeeping on LX-based devices,
    because the TSC wasn't marked as reliable:
    https://dev.openwrt.org/ticket/20531

    By adding a runtime check on is_geode_lx(), we can also include
    the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus
    fixing the problem.

    Signed-off-by: David Woodhouse
    Cc: Andres Salomon
    Cc: Linus Torvalds
    Cc: Marcelo Tosatti
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/1442409003.131189.87.camel@infradead.org
    Signed-off-by: Ingo Molnar

    David Woodhouse
     
  • A critical bug has been found in device memory stage1 translation for
    VMs with more then 4GB of address space. Once vm_pgoff size is smaller
    then pa (which is true for LPAE case, u32 and u64 respectively) some
    more significant bits of pa may be lost as a shift operation is performed
    on u32 and later cast onto u64.

    Example: vm_pgoff(u32)=0x00210030, PAGE_SHIFT=12
    expected pa(u64): 0x0000002010030000
    produced pa(u64): 0x0000000010030000

    The fix is to change the order of operations (casting first onto phys_addr_t
    and then shifting).

    Reviewed-by: Marc Zyngier
    [maz: fixed changelog and patch formatting]
    Cc: stable@vger.kernel.org
    Signed-off-by: Marek Majtyka
    Signed-off-by: Marc Zyngier

    Marek Majtyka
     
  • When setting the debug register from userspace, make sure that
    copy_from_user() is called with its parameters in the expected
    order. It otherwise doesn't do what you think.

    Fixes: 84e690bfbed1 ("KVM: arm64: introduce vcpu->arch.debug_ptr")
    Reported-by: Peter Maydell
    Cc: Alex Bennée
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • Most interrupt flow handlers do not use the irq argument. Those few
    which use it can retrieve the irq number from the irq descriptor.

    Remove the argument.

    Search and replace was done with coccinelle and some extra helper
    scripts around it. Thanks to Julia for her help!

    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Jiang Liu

    Thomas Gleixner
     
  • Irq affinity mask is per-irq instead of per irqchip, so move it into
    struct irq_common_data.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Bjorn Helgaas
    Cc: Benjamin Herrenschmidt
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Jason Cooper
    Cc: Kevin Cernekee
    Cc: Arnd Bergmann
    Link: http://lkml.kernel.org/r/1433303281-27688-1-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Use irq_set_handler_locked() as it avoids a redundant lookup of the
    irq descriptor.

    Search and replacement was done with coccinelle:

    @@
    struct irq_data *d;
    expression E1;
    @@

    -__irq_set_handler_locked(d->irq, E1);
    +irq_set_handler_locked(d, E1);

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Julia Lawall
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: linuxppc-dev@lists.ozlabs.org

    Thomas Gleixner
     
  • Use irq_set_handler_locked() as it avoids a redundant lookup of the
    irq descriptor.

    Search and replacement was done with coccinelle:

    @@
    struct irq_data *d;
    expression E1;
    @@

    -__irq_set_handler_locked(d->irq, E1);
    +irq_set_handler_locked(d, E1);

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Julia Lawall
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Anton Blanchard
    Cc: linuxppc-dev@lists.ozlabs.org

    Thomas Gleixner
     
  • Use irq_set_handler_locked() as it avoids a redundant lookup of the
    irq descriptor.

    Search and replacement was done with coccinelle:

    @@
    struct irq_data *d;
    expression E1;
    @@

    -__irq_set_handler_locked(d->irq, E1);
    +irq_set_handler_locked(d, E1);

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Julia Lawall
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: linuxppc-dev@lists.ozlabs.org

    Thomas Gleixner
     
  • Use irq_set_handler_locked() as it avoids a redundant lookup of the
    irq descriptor.

    Search and replacement was done with coccinelle:

    @@
    struct irq_data *d;
    expression E1;
    @@

    -__irq_set_handler_locked(d->irq, E1);
    +irq_set_handler_locked(d, E1);

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Julia Lawall
    Cc: Anatolij Gustschin
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: linuxppc-dev@lists.ozlabs.org

    Thomas Gleixner
     
  • Reference SDM 28.1:

    The current VPID is 0000H in the following situations:
    - Outside VMX operation. (This includes operation in system-management
    mode under the default treatment of SMIs and SMM with VMX operation;
    see Section 34.14.)
    - In VMX root operation.
    - In VMX non-root operation when the “enable VPID” VM-execution control
    is 0.

    The VPID should never be 0000H in non-root operation when "enable VPID"
    VM-execution control is 1. However, commit 34a1cd60 ("kvm: x86: vmx:
    move some vmx setting from vmx_init() to hardware_setup()") remove the
    codes which reserve 0000H for VMX root operation.

    This patch fix it by again reserving 0000H for VMX root operation.

    Cc: stable@vger.kernel.org # 3.19+
    Fixes: 34a1cd60d17f62c1f077c1478a6c2ca8c3d17af4
    Reported-by: Wincy Van
    Signed-off-by: Wanpeng Li
    Signed-off-by: Paolo Bonzini

    Wanpeng Li