18 Aug, 2016

1 commit


17 Aug, 2016

1 commit

  • Pull s390 fixes from Martin Schwidefsky:
    "A couple of bug fixes, minor cleanup and a change to the default
    config"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/dasd: fix failing CUIR assignment under LPAR
    s390/pageattr: handle numpages parameter correctly
    s390/dasd: fix hanging device after clear subchannel
    s390/qdio: avoid reschedule of outbound tasklet once killed
    s390/qdio: remove checks for ccw device internal state
    s390/qdio: fix double return code evaluation
    s390/qdio: get rid of spin_lock_irqsave usage
    s390/cio: remove subchannel_id from ccw_device_private
    s390/qdio: obtain subchannel_id via ccw_device_get_schid()
    s390/cio: stop using subchannel_id from ccw_device_private
    s390/config: make the vector optimized crc function builtin
    s390/lib: fix memcmp and strstr
    s390/crc32-vx: Fix checksum calculation for small sizes
    s390: clarify compressed image code path

    Linus Torvalds
     

15 Aug, 2016

1 commit


14 Aug, 2016

5 commits

  • …/groeck/linux-staging

    Pull h8300 and unicore32 architecture fixes from Guenter Roeck:
    "Two patches to fix h8300 and unicore32 builds.

    unicore32 builds have been broken since v4.6. The fix has been
    available in -next since March of this year.

    h8300 builds have been broken since the last commit window. The fix
    has been available in -next since June of this year"

    * tag 'fixes-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
    h8300: Add missing include file to asm/io.h
    unicore32: mm: Add missing parameter to arch_vma_access_permitted

    Linus Torvalds
     
  • Pull arm64 fixes from Catalin Marinas:

    - support for nr_cpus= command line argument (maxcpus was previously
    changed to allow secondary CPUs to be hot-plugged)

    - ARM PMU interrupt handling fix

    - fix potential TLB conflict in the hibernate code

    - improved handling of EL1 instruction aborts (better error reporting)

    - removal of useless jprobes code for stack saving/restoring

    - defconfig updates

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: defconfig: enable CONFIG_LOCALVERSION_AUTO
    arm64: defconfig: add options for virtualization and containers
    arm64: hibernate: handle allocation failures
    arm64: hibernate: avoid potential TLB conflict
    arm64: Handle el1 synchronous instruction aborts cleanly
    arm64: Remove stack duplicating code from jprobes
    drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property
    drivers/perf: arm-pmu: convert arm_pmu_mutex to spinlock
    arm64: Support hard limit of cpu count by nr_cpus

    Linus Torvalds
     
  • This patch fixes the backward compatibility when used with older kernel.

    Signed-off-by: Iyappan Subramanian
    Signed-off-by: David S. Miller

    Iyappan Subramanian
     
  • Added rxlos GPIO mapping by adding rxlos-gpios property.

    Signed-off-by: Quan Nguyen
    Signed-off-by: Iyappan Subramanian
    Tested-by: Fushen Chen
    Signed-off-by: David S. Miller

    Iyappan Subramanian
     
  • Pull KVM fixes from Radim Krčmář:
    "KVM:
    - lock kvm_device list to prevent corruption on device creation.

    PPC:
    - split debugfs initialization from creation of the xics device to
    unlock the newly taken kvm lock earlier.

    s390:
    - prevent userspace from triggering two WARN_ON_ONCE.

    MIPS:
    - fix several issues in the management of TLB faults (Cc: stable)"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    MIPS: KVM: Propagate kseg0/mapped tlb fault errors
    MIPS: KVM: Fix gfn range check in kseg0 tlb faults
    MIPS: KVM: Add missing gfn range check
    MIPS: KVM: Fix mapped fault broken commpage handling
    KVM: Protect device ops->create and list_add with kvm->lock
    KVM: PPC: Move xics_debugfs_init out of create
    KVM: s390: reset KVM_REQ_MMU_RELOAD if mapping the prefix failed
    KVM: s390: set the prefix initially properly

    Linus Torvalds
     

13 Aug, 2016

14 commits

  • h8300 builds fail with

    arch/h8300/include/asm/io.h:9:15: error: unknown type name ‘u8’
    arch/h8300/include/asm/io.h:15:15: error: unknown type name ‘u16’
    arch/h8300/include/asm/io.h:21:15: error: unknown type name ‘u32’

    and many related errors.

    Fixes: 23c82d41bdf4 ("kexec-allow-architectures-to-override-boot-mapping-fix")
    Cc: Andrew Morton
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • unicore32 fails to compile with the following errors.

    mm/memory.c: In function ‘__handle_mm_fault’:
    mm/memory.c:3381: error:
    too many arguments to function ‘arch_vma_access_permitted’
    mm/gup.c: In function ‘check_vma_flags’:
    mm/gup.c:456: error:
    too many arguments to function ‘arch_vma_access_permitted’
    mm/gup.c: In function ‘vma_permits_fault’:
    mm/gup.c:640: error:
    too many arguments to function ‘arch_vma_access_permitted’

    Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate instruction fetches")
    Cc: Dave Hansen
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Guenter Roeck
    Acked-by: Guan Xuetao

    Guenter Roeck
     
  • Pull power management fixes from Rafael Wysocki:
    "Two hibernation fixes allowing it to work with the recently added
    randomization of the kernel identity mapping base on x86-64 and one
    cpufreq driver regression fix.

    Specifics:

    - Fix the x86 identity mapping creation helpers to avoid the
    assumption that the base address of the mapping will always be
    aligned at the PGD level, as it may be aligned at the PUD level if
    address space randomization is enabled (Rafael Wysocki).

    - Fix the hibernation core to avoid executing tracing functions
    before restoring the processor state completely during resume
    (Thomas Garnier).

    - Fix a recently introduced regression in the powernv cpufreq driver
    that causes it to crash due to an out-of-bounds array access
    (Akshay Adiga)"

    * tag 'pm-4.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / hibernate: Restore processor state before using per-CPU variables
    x86/power/64: Always create temporary identity mapping correctly
    cpufreq: powernv: Fix crash in gpstate_timer_handler()

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar:
    "This is bigger than usual - the reason is partly a pent-up stream of
    fixes after the merge window and partly accidental. The fixes are:

    - five patches to fix a boot failure on Andy Lutomirsky's laptop
    - four SGI UV platform fixes
    - KASAN fix
    - warning fix
    - documentation update
    - swap entry definition fix
    - pkeys fix
    - irq stats fix"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/apic/x2apic, smp/hotplug: Don't use before alloc in x2apic_cluster_probe()
    x86/efi: Allocate a trampoline if needed in efi_free_boot_services()
    x86/boot: Rework reserve_real_mode() to allow multiple tries
    x86/boot: Defer setup_real_mode() to early_initcall time
    x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features directly
    x86/boot: Run reserve_bios_regions() after we initialize the memory map
    x86/irq: Do not substract irq_tlb_count from irq_call_count
    x86/mm: Fix swap entry comment and macro
    x86/mm/kaslr: Fix -Wformat-security warning
    x86/mm/pkeys: Fix compact mode by removing protection keys' XSAVE buffer manipulation
    x86/build: Reduce the W=1 warnings noise when compiling x86 syscall tables
    x86/platform/UV: Fix kernel panic running RHEL kdump kernel on UV systems
    x86/platform/UV: Fix problem with UV4 BIOS providing incorrect PXM values
    x86/platform/UV: Fix bug with iounmap() of the UV4 EFI System Table causing a crash
    x86/platform/UV: Fix problem with UV4 Socket IDs not being contiguous
    x86/entry: Clarify the RF saving/restoring situation with SYSCALL/SYSRET
    x86/mm: Disable preemption during CR3 read+write
    x86/mm/KASLR: Increase BRK pages for KASLR memory randomization
    x86/mm/KASLR: Fix physical memory calculation on KASLR memory randomization
    x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text

    Linus Torvalds
     
  • Pull timer fixes from Ingo Molnar:
    "Misc fixes: a /dev/rtc regression fix, two APIC timer period
    calibration fixes, an ARM clocksource driver fix and a NOHZ
    power use regression fix"

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup
    x86/timers/apic: Inform TSC deadline clockevent device about recalibration
    x86/timers/apic: Fix imprecise timer interrupts by eliminating TSC clockevents frequency roundoff error
    timers: Fix get_next_timer_interrupt() computation
    clocksource/arm_arch_timer: Force per-CPU interrupt to be level-triggered

    Linus Torvalds
     
  • * pm-sleep:
    PM / hibernate: Restore processor state before using per-CPU variables
    x86/power/64: Always create temporary identity mapping correctly

    * pm-cpufreq:
    cpufreq: powernv: Fix crash in gpstate_timer_handler()

    Rafael J. Wysocki
     
  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, plus two uncore-PMU fixes, an uprobes fix, a
    perf-cgroups fix and an AUX events fix"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/intel/uncore: Add enable_box for client MSR uncore
    perf/x86/intel/uncore: Fix uncore num_counters
    uprobes/x86: Fix RIP-relative handling of EVEX-encoded instructions
    perf/core: Set cgroup in CPU contexts for new cgroup events
    perf/core: Fix sideband list-iteration vs. event ordering NULL pointer deference crash
    perf probe ppc64le: Fix probe location when using DWARF
    perf probe: Add function to post process kernel trace events
    tools: Sync cpufeatures headers with the kernel
    toops: Sync tools/include/uapi/linux/bpf.h with the kernel
    tools: Sync cpufeatures.h and vmx.h with the kernel
    perf probe: Support signedness casting
    perf stat: Avoid skew when reading events
    perf probe: Fix module name matching
    perf probe: Adjust map->reloc offset when finding kernel symbol from map
    perf hists: Trim libtraceevent trace_seq buffers
    perf script: Add 'bpf-output' field to usage message

    Linus Torvalds
     
  • Pull EFI fixes from Ingo Molnar:
    "A fix for EFI capsules and an SGI UV platform fix"

    * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    efi/capsule: Allocate whole capsule into virtual memory
    x86/platform/uv: Skip UV runtime services mapping in the efi_runtime_disabled case

    Linus Torvalds
     
  • Pull powerpc fixes from Michael Ellerman:
    "Some powerpc fixes for 4.8:

    Misc:
    - powerpc/vdso: Fix build rules to rebuild vdsos correctly from Nicholas Piggin
    - powerpc/ptrace: Fix coredump since ptrace TM changes from Cyril Bur
    - powerpc/32: Fix csum_partial_copy_generic() from Christophe Leroy
    - cxl: Set psl_fir_cntl to production environment value from Frederic Barrat
    - powerpc/eeh: Switch to conventional PCI address output in EEH log from Guilherme G. Piccoli
    - cxl: Use fixed width predefined types in data structure. from Philippe Bergheaud
    - powerpc/vdso: Add missing include file from Guenter Roeck
    - powerpc: Fix unused function warning 'lmb_to_memblock' from Alastair D'Silva
    - powerpc/powernv/ioda: Fix TCE invalidate to work in real mode again from Alexey Kardashevskiy
    - powerpc/cell: Add missing error code in spufs_mkgang() from Dan Carpenter
    - crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading from Anton Blanchard
    - powerpc/pasemi: Fix coherent_dma_mask for dma engine from Darren Stevens

    Benjamin Herrenschmidt:
    - powerpc/32: Fix crash during static key init
    - powerpc: Update obsolete comment in setup_32.c about early_init()
    - powerpc: Print the kernel load address at the end of prom_init()
    - powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs
    - powerpc/xics: Properly set Edge/Level type and enable resend

    Mahesh Salgaonkar:
    - powerpc/book3s: Fix MCE console messages for unrecoverable MCE.
    - powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers.
    - powerpc/powernv: Move IDLE_STATE_ENTER_SEQ macro to cpuidle.h
    - powerpc/powernv: Load correct TOC pointer while waking up from winkle.

    Andrew Donnellan:
    - cxl: Fix sparse warnings
    - cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests

    Michael Ellerman:
    - selftests/powerpc: Specify we expect to build with std=gnu99
    - powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
    - powerpc/pci: Fix endian bug in fixed PHB numbering"

    * tag 'powerpc-4.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (26 commits)
    selftests/powerpc: Specify we expect to build with std=gnu99
    powerpc/vdso: Fix build rules to rebuild vdsos correctly
    powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
    powerpc/32: Fix crash during static key init
    powerpc: Update obsolete comment in setup_32.c about early_init()
    powerpc: Print the kernel load address at the end of prom_init()
    powerpc/ptrace: Fix coredump since ptrace TM changes
    powerpc/32: Fix csum_partial_copy_generic()
    cxl: Set psl_fir_cntl to production environment value
    powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs
    powerpc/book3s: Fix MCE console messages for unrecoverable MCE.
    powerpc/pci: Fix endian bug in fixed PHB numbering
    powerpc/eeh: Switch to conventional PCI address output in EEH log
    cxl: Fix sparse warnings
    cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests
    cxl: Use fixed width predefined types in data structure.
    powerpc/vdso: Add missing include file
    powerpc: Fix unused function warning 'lmb_to_memblock'
    powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers.
    powerpc/powernv: Move IDLE_STATE_ENTER_SEQ macro to cpuidle.h
    ...

    Linus Torvalds
     
  • When CONFIG_LOCALVERSION_AUTO is disabled, the version string is
    just a tag name (or with a '+' appended if HEAD is not a tagged
    commit).

    During the development (and especially when git-bisecting), longer
    version string would be helpful to identify the commit we are running.

    This is a default y option, so drop the unset to enable it.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Catalin Marinas

    Masahiro Yamada
     
  • Enable options commonly needed by popular virtualization
    and container applications. Use modules when possible to
    avoid too much overhead for users not interested.

    - add namespace and cgroup options needed
    - add seccomp - optional, but enhances Qemu etc
    - bridge, nat, veth, macvtap and multicast for routing
    guests and containers
    - btfrs and overlayfs modules for container COW backends
    - while near it, make fuse a module instead of built-in.

    Generated with make saveconfig and dropping unrelated spurious
    change hunks while commiting. bloat-o-meter old-vmlinux vmlinux:

    add/remove: 905/390 grow/shrink: 767/229 up/down: 183513/-94861 (88652)
    ....
    Total: Before=10515408, After=10604060, chg +0.84%

    Signed-off-by: Riku Voipio
    Signed-off-by: Catalin Marinas

    Riku Voipio
     
  • In create_safe_exec_page(), we create a copy of the hibernate exit text,
    along with some page tables to map this via TTBR0. We then install the
    new tables in TTBR0.

    In swsusp_arch_resume() we call create_safe_exec_page() before trying a
    number of operations which may fail (e.g. copying the linear map page
    tables). If these fail, we bail out of swsusp_arch_resume() and return
    an error code, but leave TTBR0 as-is. Subsequently, the core hibernate
    code will call free_basic_memory_bitmaps(), which will free all of the
    memory allocations we made, including the page tables installed in
    TTBR0.

    Thus, we may have TTBR0 pointing at dangling freed memory for some
    period of time. If the hibernate attempt was triggered by a user
    requesting a hibernate test via the reboot syscall, we may return to
    userspace with the clobbered TTBR0 value.

    Avoid these issues by reorganising swsusp_arch_resume() such that we
    have no failure paths after create_safe_exec_page(). We also add a check
    that the zero page allocation succeeded, matching what we have for other
    allocations.

    Fixes: 82869ac57b5d ("arm64: kernel: Add support for hibernate/suspend-to-disk")
    Signed-off-by: Mark Rutland
    Acked-by: James Morse
    Cc: Lorenzo Pieralisi
    Cc: Will Deacon
    Cc: # 4.7+
    Signed-off-by: Catalin Marinas

    Mark Rutland
     
  • In create_safe_exec_page we install a set of global mappings in TTBR0,
    then subsequently invalidate TLBs. While TTBR0 points at the zero page,
    and the TLBs should be free of stale global entries, we may have stale
    ASID-tagged entries (e.g. from the EFI runtime services mappings) for
    the same VAs. Per the ARM ARM these ASID-tagged entries may conflict
    with newly-allocated global entries, and we must follow a
    Break-Before-Make approach to avoid issues resulting from this.

    This patch reworks create_safe_exec_page to invalidate TLBs while the
    zero page is still in place, ensuring that there are no potential
    conflicts when the new TTBR0 value is installed. As a single CPU is
    online while this code executes, we do not need to perform broadcast TLB
    maintenance, and can call local_flush_tlb_all(), which also subsumes
    some barriers. The remaining assembly is converted to use write_sysreg()
    and isb().

    Other than this, we safely manipulate TTBRs in the hibernate dance. The
    code we install as part of the new TTBR0 mapping (the hibernated
    kernel's swsusp_arch_suspend_exit) installs a zero page into TTBR1,
    invalidates TLBs, then installs its preferred value. Upon being restored
    to the middle of swsusp_arch_suspend, the new image will call
    __cpu_suspend_exit, which will call cpu_uninstall_idmap, installing the
    zero page in TTBR0 and invalidating all TLB entries.

    Fixes: 82869ac57b5d ("arm64: kernel: Add support for hibernate/suspend-to-disk")
    Signed-off-by: Mark Rutland
    Acked-by: James Morse
    Tested-by: James Morse
    Cc: Lorenzo Pieralisi
    Cc: Will Deacon
    Cc: # 4.7+
    Signed-off-by: Catalin Marinas

    Mark Rutland
     
  • Executing from a non-executable area gives an ugly message:

    lkdtm: Performing direct entry EXEC_RODATA
    lkdtm: attempting ok execution at ffff0000084c0e08
    lkdtm: attempting bad execution at ffff000008880700
    Bad mode in Synchronous Abort handler detected on CPU2, code 0x8400000e -- IABT (current EL)
    CPU: 2 PID: 998 Comm: sh Not tainted 4.7.0-rc2+ #13
    Hardware name: linux,dummy-virt (DT)
    task: ffff800077e35780 ti: ffff800077970000 task.ti: ffff800077970000
    PC is at lkdtm_rodata_do_nothing+0x0/0x8
    LR is at execute_location+0x74/0x88

    The 'IABT (current EL)' indicates the error but it's a bit cryptic
    without knowledge of the ARM ARM. There is also no indication of the
    specific address which triggered the fault. The increase in kernel
    page permissions makes hitting this case more likely as well.
    Handling the case in the vectors gives a much more familiar looking
    error message:

    lkdtm: Performing direct entry EXEC_RODATA
    lkdtm: attempting ok execution at ffff0000084c0840
    lkdtm: attempting bad execution at ffff000008880680
    Unable to handle kernel paging request at virtual address ffff000008880680
    pgd = ffff8000089b2000
    [ffff000008880680] *pgd=00000000489b4003, *pud=0000000048904003, *pmd=0000000000000000
    Internal error: Oops: 8400000e [#1] PREEMPT SMP
    Modules linked in:
    CPU: 1 PID: 997 Comm: sh Not tainted 4.7.0-rc1+ #24
    Hardware name: linux,dummy-virt (DT)
    task: ffff800077f9f080 ti: ffff800008a1c000 task.ti: ffff800008a1c000
    PC is at lkdtm_rodata_do_nothing+0x0/0x8
    LR is at execute_location+0x74/0x88

    Acked-by: Mark Rutland
    Signed-off-by: Laura Abbott
    Signed-off-by: Catalin Marinas

    Laura Abbott
     

12 Aug, 2016

15 commits

  • KVM: s390: Fixes for 4.8 (via kvm/master)

    Here are two fixes found by fuzzing of the ioctl interface.
    Both cases can trigger a WARN_ON_ONCE from user space.

    Radim Krčmář
     
  • Propagate errors from kvm_mips_handle_kseg0_tlb_fault() and
    kvm_mips_handle_mapped_seg_tlb_fault(), usually triggering an internal
    error since they normally indicate the guest accessed bad physical
    memory or the commpage in an unexpected way.

    Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
    Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: "Radim Krčmář"
    Cc: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Cc: # 3.10.x-
    Signed-off-by: Radim Krčmář

    James Hogan
     
  • Two consecutive gfns are loaded into host TLB, so ensure the range check
    isn't off by one if guest_pmap_npages is odd.

    Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: "Radim Krčmář"
    Cc: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Cc: # 3.10.x-
    Signed-off-by: Radim Krčmář

    James Hogan
     
  • kvm_mips_handle_mapped_seg_tlb_fault() calculates the guest frame number
    based on the guest TLB EntryLo values, however it is not range checked
    to ensure it lies within the guest_pmap. If the physical memory the
    guest refers to is out of range then dump the guest TLB and emit an
    internal error.

    Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: "Radim Krčmář"
    Cc: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Cc: # 3.10.x-
    Signed-off-by: Radim Krčmář

    James Hogan
     
  • kvm_mips_handle_mapped_seg_tlb_fault() appears to map the guest page at
    virtual address 0 to PFN 0 if the guest has created its own mapping
    there. The intention is unclear, but it may have been an attempt to
    protect the zero page from being mapped to anything but the comm page in
    code paths you wouldn't expect from genuine commpage accesses (guest
    kernel mode cache instructions on that address, hitting trapping
    instructions when executing from that address with a coincidental TLB
    eviction during the KVM handling, and guest user mode accesses to that
    address).

    Fix this to check for mappings exactly at KVM_GUEST_COMMPAGE_ADDR (it
    may not be at address 0 since commit 42aa12e74e91 ("MIPS: KVM: Move
    commpage so 0x0 is unmapped")), and set the corresponding EntryLo to be
    interpreted as 0 (invalid).

    Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: "Radim Krčmář"
    Cc: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Cc: # 3.10.x-
    Signed-off-by: Radim Krčmář

    James Hogan
     
  • KVM devices were manipulating list data structures without any form of
    synchronization, and some implementations of the create operations also
    suffered from a lack of synchronization.

    Now when we've split the xics create operation into create and init, we
    can hold the kvm->lock mutex while calling the create operation and when
    manipulating the devices list.

    The error path in the generic code gets slightly ugly because we have to
    take the mutex again and delete the device from the list, but holding
    the mutex during anon_inode_getfd or releasing/locking the mutex in the
    common non-error path seemed wrong.

    Signed-off-by: Christoffer Dall
    Reviewed-by: Paolo Bonzini
    Acked-by: Christian Borntraeger
    Signed-off-by: Radim Krčmář

    Christoffer Dall
     
  • As we are about to hold the kvm->lock during the create operation on KVM
    devices, we should move the call to xics_debugfs_init into its own
    function, since holding a mutex over extended amounts of time might not
    be a good idea.

    Introduce an init operation on the kvm_device_ops struct which cannot
    fail and call this, if configured, after the device has been created.

    Signed-off-by: Christoffer Dall
    Reviewed-by: Paolo Bonzini
    Signed-off-by: Radim Krčmář

    Christoffer Dall
     
  • When triggering KVM_RUN without a user memory region being mapped
    (KVM_SET_USER_MEMORY_REGION) a validity intercept occurs. This could
    happen, if the user memory region was not mapped initially or if it
    was unmapped after the vcpu is initialized. The function
    kvm_s390_handle_requests checks for the KVM_REQ_MMU_RELOAD bit. The
    check function always clears this bit. If gmap_mprotect_notify
    returns an error code, the mapping failed, but the KVM_REQ_MMU_RELOAD
    was not set anymore. So the next time kvm_s390_handle_requests is
    called, the execution would fall trough the check for
    KVM_REQ_MMU_RELOAD. The bit needs to be resetted, if
    gmap_mprotect_notify returns an error code. Resetting the bit with
    kvm_make_request(KVM_REQ_MMU_RELOAD, vcpu) fixes the bug.

    Reviewed-by: David Hildenbrand
    Signed-off-by: Julius Niedworok
    Signed-off-by: Christian Borntraeger

    Julius Niedworok
     
  • When KVM_RUN is triggered on a VCPU without an initial reset, a
    validity intercept occurs.
    Setting the prefix will set the KVM_REQ_MMU_RELOAD bit initially,
    thus preventing the bug.

    Reviewed-by: David Hildenbrand
    Acked-by: Cornelia Huck
    Signed-off-by: Julius Niedworok
    Signed-off-by: Christian Borntraeger

    Julius Niedworok
     
  • There are bug reports about miscounting uncore counters on some
    client machines like Sandybridge, Broadwell and Skylake. It is
    very likely to be observed on idle systems.

    This issue is caused by a hardware issue. PERF_GLOBAL_CTL could be
    cleared after Package C7, and nothing will be count.
    The related errata (HSD 158) could be found in:

    www.intel.com/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf

    This patch tries to work around this issue by re-enabling PERF_GLOBAL_CTL
    in ->enable_box(). The workaround does not cover all cases. It helps for new
    events after returning from C7. But it cannot prevent C7, it will still
    miscount if a counter is already active.

    There is no drawback in leaving it enabled, so it does not need
    disable_box() here.

    Signed-off-by: Kan Liang
    Cc:
    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: http://lkml.kernel.org/r/1470925874-59943-1-git-send-email-kan.liang@intel.com
    Signed-off-by: Ingo Molnar

    Kan Liang
     
  • Some uncore boxes' num_counters value for Haswell server and
    Broadwell server are not correct (too large, off by one).

    This issue was found by comparing the code with the document. Although
    there is no bug report from users yet, accessing non-existent counters
    is dangerous and the behavior is undefined: it may cause miscounting or
    even crashes.

    This patch makes them consistent with the uncore document.

    Reported-by: Lukasz Odzioba
    Signed-off-by: Kan Liang
    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
    Cc:
    Link: http://lkml.kernel.org/r/1470925820-59847-1-git-send-email-kan.liang@intel.com
    Signed-off-by: Ingo Molnar

    Kan Liang
     
  • Since instruction decoder now supports EVEX-encoded instructions, two fixes
    are needed to correctly handle them in uprobes.

    Extended bits for MODRM.rm field need to be sanitized just like we do it
    for VEX3, to avoid encoding wrong register for register-relative access.

    EVEX has _two_ extended bits: b and x. Theoretically, EVEX.x should be
    ignored by the CPU (since GPRs go only up to 15, not 31), but let's be
    paranoid here: proper encoding for register-relative access
    should have EVEX.x = 1.

    Secondly, we should fetch vex.vvvv for EVEX too.
    This is now super easy because instruction decoder populates
    vex_prefix.bytes[2] for all flavors of (e)vex encodings, even for VEX2.

    Signed-off-by: Denys Vlasenko
    Acked-by: Masami Hiramatsu
    Acked-by: Srikar Dronamraju
    Cc: Alexander Shishkin
    Cc: Andy Lutomirski
    Cc: Arnaldo Carvalho de Melo
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: H. Peter Anvin
    Cc: Jim Keniston
    Cc: Jiri Olsa
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Masami Hiramatsu
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: linux-kernel@vger.kernel.org
    Cc: # v4.1+
    Fixes: 8a764a875fe3 ("x86/asm/decoder: Create artificial 3rd byte for 2-byte VEX")
    Link: http://lkml.kernel.org/r/20160811154521.20469-1-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     
  • Pull ARM SoC fixes from Arnd Bergmann:
    "A couple of bug fixes have come in for v4.8 so far. Since the first
    few were originally meant to go into -rc1 (but didn't get sent in time
    for travel reasons), the branch is unfortunately based on top of a
    commit in the middle of the merge window rather than -rc1.

    Content-wise we have:

    - a fix for the last remaining broken build in kernelci, getting
    mach-shmobile to build again with SMP disabled

    - a fix for a realview regression that broke real hardware but not
    the qemu model that everyone uses in practice (needed for v4.7 as
    well)

    - a merge conflict fix for Tegra that also broke v4.7

    - two Kconfig fixes for arm64 build regressions

    - a couple of arm32 build warning fixes (all harmless)

    - fix the RTC on Exynos7 Espresso (which apparently never worked
    right)"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    Merge tag 'pxa-fixes-v4.8' of https://github.com/rjarzmik/linux into randconfig-4.8
    arm64: Kconfig: select HISILICON_IRQ_MBIGEN only if PCI is selected
    arm64: Kconfig: select ALPINE_MSI only if PCI is selected
    ARM: dts: realview: Fix PBX-A9 cache description
    ARM: tegra: fix erroneous address in dts
    ARM: dts: add syscon compatible string for AP syscon
    ARM: dts: add syscon compatible string for CP syscon
    ARM: oxnas: select reset controller framework
    ARM: hide mach-*/ include for ARM_SINGLE_ARMV7M
    ARM: don't include removed directories
    Revert "ARM: aspeed: adapt defconfigs for new CONFIG_PRINTK_TIME"
    ARM: shmobile: don't call platform_can_secondary_boot on UP
    MAINTAINER: alpine: add a mailing list
    ARM: do away with final ARCH_REQUIRE_GPIOLIB
    arm64: dts: Fix RTC by providing rtc_src clock

    Linus Torvalds
     
  • Pull virtio/vhost fixes and cleanups from Michael Tsirkin:
    "Misc fixes and cleanups all over the place"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    virtio/s390: deprecate old transport
    virtio/s390: keep early_put_chars
    virtio_blk: Fix a slient kernel panic
    virtio-vsock: fix include guard typo
    vhost/vsock: fix vhost virtio_vsock_pkt use-after-free
    9p/trans_virtio: use kvfree() for iov_iter_get_pages_alloc()
    virtio: fix error handling for debug builds
    virtio: fix memory leak in virtqueue_add()

    Linus Torvalds
     
  • Because the arm64 calling standard allows stacked function arguments to be
    anywhere in the stack frame, do not attempt to duplicate the stack frame for
    jprobes handler functions.

    Documentation changes to describe this issue have been broken out into a
    separate patch in order to simultaneously address them in other
    architecture(s).

    Signed-off-by: David A. Long
    Acked-by: Masami Hiramatsu
    Acked-by: Marc Zyngier
    Signed-off-by: Catalin Marinas

    David A. Long
     

11 Aug, 2016

3 commits

  • I made a mistake while converting the driver to the hotplug state
    machine and as a result x2apic_cluster_probe() was accessing
    cpus_in_cluster before allocating it.

    This patch fixes it by setting the cpumask after the allocation the
    memory succeeded.

    While at it, I marked two functions static which are only used within
    this file.

    Reported-by: Laura Abbott
    Signed-off-by: Sebastian Andrzej Siewior
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Fixes: 6b2c28471de5 ("x86/x2apic: Convert to CPU hotplug state machine")
    Link: http://lkml.kernel.org/r/1470924515-9444-1-git-send-email-bigeasy@linutronix.de
    Signed-off-by: Ingo Molnar

    Sebastian Andrzej Siewior
     
  • This problem has actually been in the UV code for a while, but we didn't
    catch it until recently, because we had been relying on EFI_OLD_MEMMAP
    to allow our systems to boot for a period of time. We noticed the issue
    when trying to kexec a recent community kernel, where we hit this NULL
    pointer dereference in efi_sync_low_kernel_mappings():

    [ 0.337515] BUG: unable to handle kernel NULL pointer dereference at 0000000000000880
    [ 0.346276] IP: [] efi_sync_low_kernel_mappings+0x5d/0x1b0

    The problem doesn't show up with EFI_OLD_MEMMAP because we skip the
    chunk of setup_efi_state() that sets the efi_loader_signature for the
    kexec'd kernel. When the kexec'd kernel boots, it won't set EFI_BOOT in
    setup_arch, so we completely avoid the bug.

    We always kexec with noefi on the command line, so this shouldn't be an
    issue, but since we're not actually checking for efi_runtime_disabled in
    uv_bios_init(), we end up trying to do EFI runtime callbacks when we
    shouldn't be. This patch just adds a check for efi_runtime_disabled in
    uv_bios_init() so that we don't map in uv_systab when runtime_disabled ==
    true.

    Signed-off-by: Alex Thorlton
    Signed-off-by: Matt Fleming
    Cc: # v4.7
    Cc: Andy Lutomirski
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Mike Travis
    Cc: Peter Zijlstra
    Cc: Russ Anderson
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1470912120-22831-2-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Alex Thorlton
     
  • On my Dell XPS 13 9350 with firmware 1.4.4 and SGX on, if I boot
    Fedora 24's grub2-efi off a hard disk, my first 1MB of RAM looks
    like:

    efi: mem00: [Runtime Data |RUN| | | | | | | |WB|WT|WC|UC] range=[0x0000000000000000-0x0000000000000fff] (0MB)
    efi: mem01: [Boot Data | | | | | | | | |WB|WT|WC|UC] range=[0x0000000000001000-0x0000000000027fff] (0MB)
    efi: mem02: [Loader Data | | | | | | | | |WB|WT|WC|UC] range=[0x0000000000028000-0x0000000000029fff] (0MB)
    efi: mem03: [Reserved | | | | | | | | |WB|WT|WC|UC] range=[0x000000000002a000-0x000000000002bfff] (0MB)
    efi: mem04: [Runtime Data |RUN| | | | | | | |WB|WT|WC|UC] range=[0x000000000002c000-0x000000000002cfff] (0MB)
    efi: mem05: [Loader Data | | | | | | | | |WB|WT|WC|UC] range=[0x000000000002d000-0x000000000002dfff] (0MB)
    efi: mem06: [Conventional Memory| | | | | | | | |WB|WT|WC|UC] range=[0x000000000002e000-0x0000000000057fff] (0MB)
    efi: mem07: [Reserved | | | | | | | | |WB|WT|WC|UC] range=[0x0000000000058000-0x0000000000058fff] (0MB)
    efi: mem08: [Conventional Memory| | | | | | | | |WB|WT|WC|UC] range=[0x0000000000059000-0x000000000009ffff] (0MB)

    My EBDA is at 0x2c000, which blocks off everything from 0x2c000 and
    up, and my trampoline is 0x6000 bytes (6 pages), so it doesn't fit
    in the loader data range at 0x28000.

    Without this patch, it panics due to a failure to allocate the
    trampoline. With this patch, it works:

    [ +0.001744] Base memory trampoline at [ffff880000001000] 1000 size 24576

    Signed-off-by: Andy Lutomirski
    Reviewed-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Mario Limonciello
    Cc: Matt Fleming
    Cc: Matthew Garrett
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/998c77b3bf709f3dfed85cb30701ed1a5d8a438b.1470821230.git.luto@kernel.org
    Signed-off-by: Ingo Molnar

    Andy Lutomirski