30 Aug, 2016

3 commits

  • All three conflicts were cases of simple overlapping
    changes.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull networking fixes from David Miller:

    1) Segregate namespaces properly in conntrack dumps, from Liping Zhang.

    2) tcp listener refcount fix in netfilter tproxy, from Eric Dumazet.

    3) Fix timeouts in qed driver due to xmit_more, from Yuval Mintz.

    4) Fix use-after-free in tcp_xmit_retransmit_queue().

    5) Userspace header fixups (use of __u32, missing includes, etc.) from
    Mikko Rapeli.

    6) Further refinements to fragmentation wrt gso and tunnels, from
    Shmulik Ladkani.

    7) Trigger poll correctly for zero length UDP packets, from Eric
    Dumazet.

    8) TCP window scaling fix, also from Eric Dumazet.

    9) SLAB_DESTROY_BY_RCU is not relevant any more for UDP sockets.

    10) Module refcount leak in qdisc_create_dflt(), from Eric Dumazet.

    11) Fix deadlock in cp_rx_poll() of 8139cp driver, from Gao Feng.

    12) Memory leak in rhashtable's alloc_bucket_locks(), from Eric Dumazet.

    13) Add new device ID to alx driver, from Owen Lin.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (83 commits)
    Add Killer E2500 device ID in alx driver.
    net: smc91x: fix SMC accesses
    Documentation: networking: dsa: Remove platform device TODO
    net/mlx5: Increase number of ethtool steering priorities
    net/mlx5: Add error prints when validate ETS failed
    net/mlx5e: Fix memory leak if refreshing TIRs fails
    net/mlx5e: Add ethtool counter for TX xmit_more
    net/mlx5e: Fix ethtool -g/G rx ring parameter report with striding RQ
    net/mlx5e: Don't wait for SQ completions on close
    net/mlx5e: Don't post fragmented MPWQE when RQ is disabled
    net/mlx5e: Don't wait for RQ completions on close
    net/mlx5e: Limit UMR length to the device's limitation
    rhashtable: fix a memory leak in alloc_bucket_locks()
    sfc: fix potential stack corruption from running past stat bitmask
    team: loadbalance: push lacpdus to exact delivery
    net: hns: dereference ppe_cb->ppe_common_cb if it is non-null
    8139cp: Fix one possible deadloop in cp_rx_poll
    i40e: Change some init flow for the client
    Revert "phy: IRQ cannot be shared"
    net: dsa: bcm_sf2: Fix race condition while unmasking interrupts
    ...

    Linus Torvalds
     
  • Pull powerpc fixes from Ben Herrenschmidt:
    "This was meant to be sent early last week, but I has a change pending
    on one of the fixes and other things made me forget all about. Ugh.

    We have some misc fixes for powerpc 4.8. Some trivial bits and some
    regressions, and a trivial cleanup or two that I saw no point in
    letting rot in patchwork"

    * tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc: signals: Discard transaction state from signal frames
    powerpc/powernv : Drop reference added by kset_find_obj()
    powerpc/tm: do not use r13 for tabort_syscall
    powerpc: move hmi.c to arch/powerpc/kvm/
    powerpc: sysdev: cpm: fix gpio save_regs functions
    powerpc/pseries: PACA save area fix for MCE vs MCE
    powerpc/pseries: PACA save area fix for general exception vs MCE
    powerpc/prom: Fix sub-processor option passed to ibm, client-architecture-support
    powerpc, hotplug: Avoid to touch non-existent cpumasks.
    powerpc: migrate exception table users off module.h and onto extable.h
    powerpc/powernv/pci: fix iterator signedness
    powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb)
    cxl: use pcibios_free_controller_deferred() when removing vPHBs
    powerpc: mpc8349emitx: Delete unnecessary assignment for the field "owner"
    powerpc/512x: Delete unnecessary assignment for the field "owner"
    drivers/macintosh: Delete owner assignment
    powerpc: cputhreads: Add missing include file

    Linus Torvalds
     

29 Aug, 2016

5 commits

  • Commit b70661c70830 ("net: smc91x: use run-time configuration on all ARM
    machines") broke some ARM platforms through several mistakes. Firstly,
    the access size must correspond to the following rule:

    (a) at least one of 16-bit or 8-bit access size must be supported
    (b) 32-bit accesses are optional, and may be enabled in addition to
    the above.

    Secondly, it provides no emulation of 16-bit accesses, instead blindly
    making 16-bit accesses even when the platform specifies that only 8-bit
    is supported.

    Reorganise smc91x.h so we can make use of the existing 16-bit access
    emulation already provided - if 16-bit accesses are supported, use
    16-bit accesses directly, otherwise if 8-bit accesses are supported,
    use the provided 16-bit access emulation. If neither, BUG(). This
    exactly reflects the driver behaviour prior to the commit being fixed.

    Since the conversion incorrectly cut down the available access sizes on
    several platforms, we also need to go through every platform and fix up
    the overly-restrictive access size: Arnd assumed that if a platform can
    perform 32-bit, 16-bit and 8-bit accesses, then only a 32-bit access
    size needed to be specified - not so, all available access sizes must
    be specified.

    This likely fixes some performance regressions in doing this: if a
    platform does not support 8-bit accesses, 8-bit accesses have been
    emulated by performing a 16-bit read-modify-write access.

    Tested on the Intel Assabet/Neponset platform, which supports only 8-bit
    accesses, which was broken by the original commit.

    Fixes: b70661c70830 ("net: smc91x: use run-time configuration on all ARM machines")
    Signed-off-by: Russell King
    Tested-by: Robert Jarzmik
    Signed-off-by: David S. Miller

    Russell King
     
  • Userspace can begin and suspend a transaction within the signal
    handler which means they might enter sys_rt_sigreturn() with the
    processor in suspended state.

    sys_rt_sigreturn() wants to restore process context (which may have
    been in a transaction before signal delivery). To do this it must
    restore TM SPRS. To achieve this, any transaction initiated within the
    signal frame must be discarded in order to be able to restore TM SPRs
    as TM SPRs can only be manipulated non-transactionally..
    >From the PowerPC ISA:
    TM Bad Thing Exception [Category: Transactional Memory]
    An attempt is made to execute a mtspr targeting a TM register in
    other than Non-transactional state.

    Not doing so results in a TM Bad Thing:
    [12045.221359] Kernel BUG at c000000000050a40 [verbose debug info unavailable]
    [12045.221470] Unexpected TM Bad Thing exception at c000000000050a40 (msr 0x201033)
    [12045.221540] Oops: Unrecoverable exception, sig: 6 [#1]
    [12045.221586] SMP NR_CPUS=2048 NUMA PowerNV
    [12045.221634] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE
    nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4
    xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter
    ebtables ip6table_filter ip6_tables iptable_filter ip_tables x_tables kvm_hv kvm
    uio_pdrv_genirq ipmi_powernv uio powernv_rng ipmi_msghandler autofs4 ses enclosure
    scsi_transport_sas bnx2x ipr mdio libcrc32c
    [12045.222167] CPU: 68 PID: 6178 Comm: sigreturnpanic Not tainted 4.7.0 #34
    [12045.222224] task: c0000000fce38600 ti: c0000000fceb4000 task.ti: c0000000fceb4000
    [12045.222293] NIP: c000000000050a40 LR: c0000000000163bc CTR: 0000000000000000
    [12045.222361] REGS: c0000000fceb7ac0 TRAP: 0700 Not tainted (4.7.0)
    [12045.222418] MSR: 9000000300201033 CR: 28444280 XER: 20000000
    [12045.222625] CFAR: c0000000000163b8 SOFTE: 0 PACATMSCRATCH: 900000014280f033
    GPR00: 01100000b8000001 c0000000fceb7d40 c00000000139c100 c0000000fce390d0
    GPR04: 900000034280f033 0000000000000000 0000000000000000 0000000000000000
    GPR08: 0000000000000000 b000000000001033 0000000000000001 0000000000000000
    GPR12: 0000000000000000 c000000002926400 0000000000000000 0000000000000000
    GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    GPR24: 0000000000000000 00003ffff98cadd0 00003ffff98cb470 0000000000000000
    GPR28: 900000034280f033 c0000000fceb7ea0 0000000000000001 c0000000fce390d0
    [12045.223535] NIP [c000000000050a40] tm_restore_sprs+0xc/0x1c
    [12045.223584] LR [c0000000000163bc] tm_recheckpoint+0x5c/0xa0
    [12045.223630] Call Trace:
    [12045.223655] [c0000000fceb7d80] [c000000000026e74] sys_rt_sigreturn+0x494/0x6c0
    [12045.223738] [c0000000fceb7e30] [c0000000000092e0] system_call+0x38/0x108
    [12045.223806] Instruction dump:
    [12045.223841] 7c800164 4e800020 7c0022a6 f80304a8 7c0222a6 f80304b0 7c0122a6 f80304b8
    [12045.223955] 4e800020 e80304a8 7c0023a6 e80304b0 e80304b8 7c0123a6 4e800020
    [12045.224074] ---[ end trace cb8002ee240bae76 ]---

    It isn't clear exactly if there is really a use case for userspace
    returning with a suspended transaction, however, doing so doesn't (on
    its own) constitute a bad frame. As such, this patch simply discards
    the transactional state of the context calling the sigreturn and
    continues.

    Reported-by: Laurent Dufour
    Signed-off-by: Cyril Bur
    Tested-by: Laurent Dufour
    Reviewed-by: Laurent Dufour
    Acked-by: Simon Guo
    Signed-off-by: Benjamin Herrenschmidt

    Cyril Bur
     
  • In a situation, where Linux kernel gets notified about duplicate error log
    from OPAL, it is been observed that kernel fails to remove sysfs entries
    (/sys/firmware/opal/elog/0xXXXXXXXX) of such error logs. This is because,
    we currently search the error log/dump kobject in the kset list via
    'kset_find_obj()' routine. Which eventually increment the reference count
    by one, once it founds the kobject.

    So, unless we decrement the reference count by one after it found the kobject,
    we would not be able to release the kobject properly later.

    This patch adds the 'kobject_put()' which was missing earlier.

    Signed-off-by: Mukesh Ojha
    Cc: stable@vger.kernel.org
    Reviewed-by: Vasant Hegde
    Signed-off-by: Benjamin Herrenschmidt

    Mukesh Ojha
     
  • tabort_syscall runs with RI=1, so a nested recoverable machine
    check will load the paca into r13 and overwrite what we loaded
    it with, because exceptions returning to privileged mode do not
    restore r13.

    Fixes: b4b56f9ecab4 (powerpc/tm: Abort syscalls in active transactions)
    Cc: stable@vger.kernel.org
    Signed-off-by: Nick Piggin
    Signed-off-by: Benjamin Herrenschmidt

    Nicholas Piggin
     
  • Pull x86 fix from Thomas Gleixner:
    "A single bugfix to prevent irq remapping when the ioapic is disabled"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/apic: Do not init irq remapping if ioapic is disabled

    Linus Torvalds
     

28 Aug, 2016

1 commit

  • Pull KVM fixes from Paolo Bonzini:
    "ARM:
    - fixes for ITS init issues, error handling, IRQ leakage, race
    conditions
    - an erratum workaround for timers
    - some removal of misleading use of errors and comments
    - a fix for GICv3 on 32-bit guests

    MIPS:
    - fix for where the guest could wrongly map the first page of
    physical memory

    x86:
    - nested virtualization fixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    MIPS: KVM: Check for pfn noslot case
    kvm: nVMX: fix nested tsc scaling
    KVM: nVMX: postpone VMCS changes on MSR_IA32_APICBASE write
    KVM: nVMX: fix msr bitmaps to prevent L2 from accessing L0 x2APIC
    arm64: KVM: report configured SRE value to 32-bit world
    arm64: KVM: remove misleading comment on pmu status
    KVM: arm/arm64: timer: Workaround misconfigured timer interrupt
    arm64: Document workaround for Cortex-A72 erratum #853709
    KVM: arm/arm64: Change misleading use of is_error_pfn
    KVM: arm64: ITS: avoid re-mapping LPIs
    KVM: arm64: check for ITS device on MSI injection
    KVM: arm64: ITS: move ITS registration into first VCPU run
    KVM: arm64: vgic-its: Make updates to propbaser/pendbaser atomic
    KVM: arm64: vgic-its: Plug race in vgic_put_irq
    KVM: arm64: vgic-its: Handle errors from vgic_add_lpi
    KVM: arm64: ITS: return 1 on successful MSI injection

    Linus Torvalds
     

27 Aug, 2016

4 commits

  • Merge fixes from Andrew Morton:
    "11 fixes"

    * emailed patches from Andrew Morton :
    mm: silently skip readahead for DAX inodes
    dax: fix device-dax region base
    fs/seq_file: fix out-of-bounds read
    mm: memcontrol: avoid unused function warning
    mm: clarify COMPACTION Kconfig text
    treewide: replace config_enabled() with IS_ENABLED() (2nd round)
    printk: fix parsing of "brl=" option
    soft_dirty: fix soft_dirty during THP split
    sysctl: handle error writing UINT_MAX to u32 fields
    get_maintainer: quiet noisy implicit -f vcs_file_exists checking
    byteswap: don't use __builtin_bswap*() with sparse

    Linus Torvalds
     
  • Pull ARM64 fix from Catalin Marinas:
    "ARM64 fix to avoid potential TLB conflict when CONFIG_RANDOMIZE_BASE
    is enabled"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE

    Linus Torvalds
     
  • Pull PCI fixes from Bjorn Helgaas:
    "Resource management:
    - Update "pci=resource_alignment" documentation (Mathias Koehrer)

    MSI:
    - Use positive flags in pci_alloc_irq_vectors() (Christoph Hellwig)
    - Call pci_intx() when using legacy interrupts in pci_alloc_irq_vectors() (Christoph Hellwig)

    Intel VMD host bridge driver:
    - Fix infinite loop executing irq's (Keith Busch)"

    * tag 'pci-v4.8-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    x86/PCI: VMD: Fix infinite loop executing irq's
    PCI: Call pci_intx() when using legacy interrupts in pci_alloc_irq_vectors()
    PCI: Use positive flags in pci_alloc_irq_vectors()
    PCI: Update "pci=resource_alignment" documentation

    Linus Torvalds
     
  • Commit 97f2645f358b ("tree-wide: replace config_enabled() with
    IS_ENABLED()") mostly killed config_enabled(), but some new users have
    appeared for v4.8-rc1. They are all used for a boolean option, so can
    be replaced with IS_ENABLED() safely.

    Link: http://lkml.kernel.org/r/1471970749-24867-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Acked-by: Kees Cook
    Acked-by: Peter Oberparleiter
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Ralf Baechle
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

25 Aug, 2016

4 commits

  • When CONFIG_RANDOMIZE_BASE is selected, we modify the page tables to remap the
    kernel at a newly-chosen VA range. We do this with the MMU disabled, but do not
    invalidate TLBs prior to re-enabling the MMU with the new tables. Thus the old
    mappings entries may still live in TLBs, and we risk violating
    Break-Before-Make requirements, leading to TLB conflicts and/or other issues.

    We invalidate TLBs when we uninsall the idmap in early setup code, but prior to
    this we are subject to issues relating to the Break-Before-Make violation.

    Avoid these issues by invalidating the TLBs before the new mappings can be
    used by the hardware.

    Fixes: f80fb3a3d508 ("arm64: add support for kernel ASLR")
    Cc: # 4.6+
    Acked-by: Ard Biesheuvel
    Acked-by: Will Deacon
    Signed-off-by: Mark Rutland
    Signed-off-by: Catalin Marinas

    Mark Rutland
     
  • Pull UML fix from Richard Weinberger:
    "This contains a fix for a build regression introduced during the merge
    window"

    * 'for-linus-4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
    um: Don't discard .text.exit section

    Linus Torvalds
     
  • Pull xen regression fix from David Vrabel:
    "Fix a regression in the xenbus device preventing userspace tools from
    working"

    * tag 'for-linus-4.8b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen: change the type of xen_vcpu_id to uint32_t
    xenbus: don't look up transaction IDs for ordinary writes

    Linus Torvalds
     
  • We pass xen_vcpu_id mapping information to hypercalls which require
    uint32_t type so it would be cleaner to have it as uint32_t. The
    initializer to -1 can be dropped as we always do the mapping before using
    it and we never check the 'not set' value anyway.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: David Vrabel

    Vitaly Kuznetsov
     

24 Aug, 2016

4 commits

  • native_smp_prepare_cpus
    -> default_setup_apic_routing
    -> enable_IR_x2apic
    -> irq_remapping_prepare
    -> intel_prepare_irq_remapping
    -> intel_setup_irq_remapping

    So IR table is setup even if "noapic" boot parameter is added. As a result we
    crash later when the interrupt affinity is set due to a half initialized
    remapping infrastructure.

    Prevent remap initialization when IOAPIC is disabled.

    Signed-off-by: Wanpeng Li
    Cc: Peter Zijlstra
    Cc: Joerg Roedel
    Link: http://lkml.kernel.org/r/1471954039-3942-1-git-send-email-wanpeng.li@hotmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Gleixner

    Wanpeng Li
     
  • We can't initialize the list head on deletion as this causes the node to
    point to itself, which causes an infinite loop if vmd_irq() happens to be
    servicing that node.

    The list initialization was trying to fix a bug from multiple calls to
    disable the same IRQ. Fix this instead by having the VMD driver track if
    the interrupt is enabled.

    [bhelgaas: changelog, add "Fixes"]
    Fixes: 97e923063575 ("x86/PCI: VMD: Initialize list item in IRQ disable")
    Reported-by: Grzegorz Koczot
    Tested-by: Miroslaw Drost
    Signed-off-by: Keith Busch
    Signed-off-by: Bjorn Helgaas
    Acked-by Jon Derrick:

    Keith Busch
     
  • Commit e41f501d3912 ("vmlinux.lds: account for destructor sections")
    added '.text.exit' to EXIT_TEXT which is discarded at link time by default.
    This breaks compilation of UML:
    `.text.exit' referenced in section `.fini_array' of
    /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o):
    defined in discarded section `.text.exit' of
    /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o)

    Apparently UML doesn't want to discard exit text, so let's place all EXIT_TEXT
    sections in .exit.text.

    Fixes: e41f501d3912 ("vmlinux.lds: account for destructor sections")
    Reported-by: Stefan Traby
    Signed-off-by: Andrey Ryabinin
    Cc:
    Acked-by: Dmitry Vyukov
    Signed-off-by: Richard Weinberger

    Andrey Ryabinin
     
  • Pull crypto fixes from Herbert Xu:
    "This fixes a number of memory corruption bugs in the newly added
    sha256-mb/sha256-mb code"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: sha512-mb - fix ctx pointer
    crypto: sha256-mb - fix ctx pointer and digest copy

    Linus Torvalds
     

23 Aug, 2016

1 commit

  • Pull ARC fixes from Vineet Gupta:

    - support for Syscall ABI v4 with upstream gcc 6.x

    - lockdep fix (Daniel Mentz)

    - gdb register clobber (Liav Rehana)

    - couple of missing exports for modules

    - other fixes here and there

    * tag 'arc-4.8-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
    ARC: export __udivdi3 for modules
    ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS
    ARC: export kmap
    ARC: Support syscall ABI v4
    ARC: use correct offset in pt_regs for saving/restoring user mode r25
    ARC: Elide redundant setup of DMA callbacks
    ARC: Call trace_hardirqs_on() before enabling irqs

    Linus Torvalds
     

22 Aug, 2016

12 commits

  • hmi.c functions are unused unless sibling_subcore_state is nonzero, and
    that in turn happens only if KVM is in use. So move the code to
    arch/powerpc/kvm/, putting it under CONFIG_KVM_BOOK3S_HV_POSSIBLE
    rather than CONFIG_PPC_BOOK3S_64. The sibling_subcore_state is also
    included in struct paca_struct only if KVM is supported by the kernel.

    Cc: Daniel Axtens
    Cc: Michael Ellerman
    Cc: Mahesh Salgaonkar
    Cc: Paul Mackerras
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: kvm-ppc@vger.kernel.org
    Cc: kvm@vger.kernel.org
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Benjamin Herrenschmidt

    Paolo Bonzini
     
  • of_mm_gpiochip_add_data() calls mm_gc->save_regs() before
    setting the data. Therefore ->save_regs() cannot use
    gpiochip_get_data()

    [ 0.275940] Unable to handle kernel paging request for data at address 0x00000130
    [ 0.283120] Faulting instruction address: 0xc01b44cc
    [ 0.288175] Oops: Kernel access of bad area, sig: 11 [#1]
    [ 0.293343] PREEMPT CMPC885
    [ 0.296141] CPU: 0 PID: 1 Comm: swapper Not tainted 4.7.0-g65124df-dirty #68
    [ 0.304131] task: c6074000 ti: c6080000 task.ti: c6080000
    [ 0.309459] NIP: c01b44cc LR: c0011720 CTR: c0011708
    [ 0.314372] REGS: c6081d90 TRAP: 0300 Not tainted (4.7.0-g65124df-dirty)
    [ 0.322267] MSR: 00009032 CR: 24000028 XER: 20000000
    [ 0.328813] DAR: 00000130 DSISR: c0000000
    GPR00: c01b6d0c c6081e40 c6074000 c6017000 c9028000 c601d028 c6081dd8 00000000
    GPR08: c601d028 00000000 ffffffff 00000001 24000044 00000000 c0002790 00000000
    GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c05643b0 00000083
    GPR24: c04a1a6c c0560000 c04a8308 c04c6480 c0012498 c6017000 c7ffcc78 c6017000
    [ 0.360806] NIP [c01b44cc] gpiochip_get_data+0x4/0xc
    [ 0.365684] LR [c0011720] cpm1_gpio16_save_regs+0x18/0x44
    [ 0.370972] Call Trace:
    [ 0.373451] [c6081e50] [c01b6d0c] of_mm_gpiochip_add_data+0x70/0xdc
    [ 0.379624] [c6081e70] [c00124c0] cpm_init_par_io+0x28/0x118
    [ 0.385238] [c6081e80] [c04a8ac0] do_one_initcall+0xb0/0x17c
    [ 0.390819] [c6081ef0] [c04a8cbc] kernel_init_freeable+0x130/0x1dc
    [ 0.396924] [c6081f30] [c00027a4] kernel_init+0x14/0x110
    [ 0.402177] [c6081f40] [c000b424] ret_from_kernel_thread+0x5c/0x64
    [ 0.408233] Instruction dump:
    [ 0.411168] 4182fafc 3f80c040 48234c6d 3bc0fff0 3b9c5ed0 4bfffaf4 81290020 712a0004
    [ 0.418825] 4182fb34 48234c51 4bfffb2c 81230004 4e800020 7c0802a6 9421ffe0
    [ 0.426763] ---[ end trace fe4113ee21d72ffa ]---

    fixes: e65078f1f3490 ("powerpc: sysdev: cpm1: use gpiochip data pointer")
    fixes: a14a2d484b386 ("powerpc: cpm_common: use gpiochip data pointer")
    Cc: stable@vger.kernel.org
    Signed-off-by: Christophe Leroy
    Reviewed-by: Linus Walleij
    Signed-off-by: Benjamin Herrenschmidt

    Christophe Leroy
     
  • MCE must not enable MSR_RI until PACA_EXMC is no longer being used.

    Signed-off-by: Benjamin Herrenschmidt

    Nicholas Piggin
     
  • MCE must not use PACA_EXGEN. When a general exception enables MSR_RI,
    that means SPRN_SRR[01] and SPRN_SPRG are no longer used. However the
    PACA save area is still in use.
    Acked-by: Mahesh Salgaonkar

    Signed-off-by: Benjamin Herrenschmidt

    Nicholas Piggin
     
  • When booting from an OpenFirmware which supports it, we use the
    "ibm,client-architecture-support" firmware call to communicate
    our capabilities to firmware.

    The format of the structure we pass to firmware is specified in
    PAPR (Power Architecture Platform Requirements), or the public version
    LoPAPR (Linux on Power Architecture Platform Reference).

    Referring to table 244 in LoPAPR v1.1, option vector 5 contains a 4 byte
    field at bytes 17-20 for the "Platform Facilities Enable". This is
    followed by a 1 byte field at byte 21 for "Sub-Processor Represenation
    Level".

    Comparing to the code, there we have the Platform Facilities
    options (OV5_PFO_*) at byte 17, but we fail to pad that field out to its
    full width of 4 bytes. This means the OV5_SUB_PROCESSORS option is
    incorrectly placed at byte 18.

    Fix it by adding zero bytes for bytes 18, 19, 20, and comment the bytes
    to hopefully make it clearer in future.

    As far as I'm aware nothing actually consumes this value at this time,
    so the effect of this bug is nil in practice.

    It does mean we've been incorrectly setting bit 15 of the "Platform
    Facilities Enable" option for the past ~3 1/2 years, so we should avoid
    allocating that bit to anything else in future.

    Fixes: df77c7992029 ("powerpc/pseries: Update ibm,architecture.vec for PAPR 2.7/POWER8")
    Signed-off-by: Michael Ellerman
    Signed-off-by: Benjamin Herrenschmidt

    Michael Ellerman
     
  • We observed a kernel oops when running a PPC guest with config NR_CPUS=4
    and qemu option "-smp cores=1,threads=8":

    [ 30.634781] Unable to handle kernel paging request for data at
    address 0xc00000014192eb17
    [ 30.636173] Faulting instruction address: 0xc00000000003e5cc
    [ 30.637069] Oops: Kernel access of bad area, sig: 11 [#1]
    [ 30.637877] SMP NR_CPUS=4 NUMA pSeries
    [ 30.638471] Modules linked in:
    [ 30.638949] CPU: 3 PID: 27 Comm: migration/3 Not tainted
    4.7.0-07963-g9714b26 #1
    [ 30.640059] task: c00000001e29c600 task.stack: c00000001e2a8000
    [ 30.640956] NIP: c00000000003e5cc LR: c00000000003e550 CTR:
    0000000000000000
    [ 30.642001] REGS: c00000001e2ab8e0 TRAP: 0300 Not tainted
    (4.7.0-07963-g9714b26)
    [ 30.643139] MSR: 8000000102803033 CR: 22004084 XER: 00000000
    [ 30.644583] CFAR: c000000000009e98 DAR: c00000014192eb17 DSISR: 40000000 SOFTE: 0
    GPR00: c00000000140a6b8 c00000001e2abb60 c0000000016dd300 0000000000000003
    GPR04: 0000000000000000 0000000000000004 c0000000016e5920 0000000000000008
    GPR08: 0000000000000004 c00000014192eb17 0000000000000000 0000000000000020
    GPR12: c00000000140a6c0 c00000000ffffc00 c0000000000d3ea8 c00000001e005680
    GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    GPR20: 0000000000000000 c00000001e6b3a00 0000000000000000 0000000000000001
    GPR24: c00000001ff85138 c00000001ff85130 000000001eb6f000 0000000000000001
    GPR28: 0000000000000000 c0000000017014e0 0000000000000000 0000000000000018
    [ 30.653882] NIP [c00000000003e5cc] __cpu_disable+0xcc/0x190
    [ 30.654713] LR [c00000000003e550] __cpu_disable+0x50/0x190
    [ 30.655528] Call Trace:
    [ 30.655893] [c00000001e2abb60] [c00000000003e550] __cpu_disable+0x50/0x190 (unreliable)
    [ 30.657280] [c00000001e2abbb0] [c0000000000aca0c] take_cpu_down+0x5c/0x100
    [ 30.658365] [c00000001e2abc10] [c000000000163918] multi_cpu_stop+0x1a8/0x1e0
    [ 30.659617] [c00000001e2abc60] [c000000000163cc0] cpu_stopper_thread+0xf0/0x1d0
    [ 30.660737] [c00000001e2abd20] [c0000000000d8d70] smpboot_thread_fn+0x290/0x2a0
    [ 30.661879] [c00000001e2abd80] [c0000000000d3fa8] kthread+0x108/0x130
    [ 30.662876] [c00000001e2abe30] [c000000000009968] ret_from_kernel_thread+0x5c/0x74
    [ 30.664017] Instruction dump:
    [ 30.664477] 7bde1f24 38a00000 787f1f24 3b600001 39890008 7d204b78 7d05e214 7d0b07b4
    [ 30.665642] 796b1f24 7d26582a 7d204a14 7d29f214 7d4a3878 7d4049ad 40c2fff4
    [ 30.666854] ---[ end trace 32643b7195717741 ]---

    The reason of this is that in __cpu_disable(), when we try to set the
    cpu_sibling_mask or cpu_core_mask of the sibling CPUs of the disabled
    one, we don't check whether the current configuration employs those
    sibling CPUs(hw threads). And if a CPU is not employed by a
    configuration, the percpu structures cpu_{sibling,core}_mask are not
    allocated, therefore accessing those cpumasks will result in problems as
    above.

    This patch fixes this problem by adding an addition check on whether the
    id is no less than nr_cpu_ids in the sibling CPU iteration code.

    Signed-off-by: Boqun Feng
    Signed-off-by: Benjamin Herrenschmidt

    Boqun Feng
     
  • These files were only including module.h for exception table
    related functions. We've now separated that content out into its
    own file "extable.h" so now move over to that and avoid all the
    extra header content in module.h that we don't really need to compile
    these files.

    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Benjamin Herrenschmidt

    Paul Gortmaker
     
  • Unsigned type is always non-negative, so the loop could not end in case
    condition is never true.

    The problem has been detected using semantic patch
    scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci

    Signed-off-by: Andrzej Hajda
    Signed-off-by: Benjamin Herrenschmidt

    Andrzej Hajda
     
  • This patch leverages 'struct pci_host_bridge' from the PCI subsystem
    in order to free the pci_controller only after the last reference to
    its devices is dropped (avoiding an oops in pcibios_release_device()
    if the last reference is dropped after pcibios_free_controller()).

    The patch relies on pci_host_bridge.release_fn() (and .release_data),
    which is called automatically by the PCI subsystem when the root bus
    is released (i.e., the last reference is dropped). Those fields are
    set via pci_set_host_bridge_release() (e.g. in the platform-specific
    implementation of pcibios_root_bridge_prepare()).

    It introduces the 'pcibios_free_controller_deferred()' .release_fn()
    and it expects .release_data to hold a pointer to the pci_controller.

    The function implictly calls 'pcibios_free_controller()', so an user
    must *NOT* explicitly call it if using the new _deferred() callback.

    The functionality is enabled for pseries (although it isn't platform
    specific, and may be used by cxl).

    Details on not-so-elegant design choices:

    - Use 'pci_host_bridge.release_data' field as pointer to associated
    'struct pci_controller' so *not* to 'pci_bus_to_host(bridge->bus)'
    in pcibios_free_controller_deferred().

    That's because pci_remove_root_bus() sets 'host_bridge->bus = NULL'
    (so, if the last reference is released after pci_remove_root_bus()
    runs, which eventually reaches pcibios_free_controller_deferred(),
    that would hit a null pointer dereference).

    The cxl/vphb.c code calls pci_remove_root_bus(), and the cxl folks
    are interested in this fix.

    Test-case #1 (hold references)

    # ls -ld /sys/block/sd* | grep -m1 0021:01:00.0
    /sys/block/sdaa -> ../devices/pci0021:01/0021:01:00.0/

    # ls -ld /sys/block/sd* | grep -m1 0021:01:00.1
    /sys/block/sdab -> ../devices/pci0021:01/0021:01:00.1/

    # cat >/dev/sdaa & pid1=$!
    # cat >/dev/sdab & pid2=$!

    # drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
    Validating PHB DLPAR capability...yes.
    [ 594.306719] pci_hp_remove_devices: PCI: Removing devices on bus 0021:01
    [ 594.306738] pci_hp_remove_devices: Removing 0021:01:00.0...
    ...
    [ 598.236381] pci_hp_remove_devices: Removing 0021:01:00.1...
    ...
    [ 611.972077] pci_bus 0021:01: busn_res: [bus 01-ff] is released
    [ 611.972140] rpadlpar_io: slot PHB 33 removed

    # kill -9 $pid1
    # kill -9 $pid2
    [ 632.918088] pcibios_free_controller_deferred: domain 33, dynamic 1

    Test-case #2 (don't hold references)

    # drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
    Validating PHB DLPAR capability...yes.
    [ 916.357363] pci_hp_remove_devices: PCI: Removing devices on bus 0021:01
    [ 916.357386] pci_hp_remove_devices: Removing 0021:01:00.0...
    ...
    [ 920.566527] pci_hp_remove_devices: Removing 0021:01:00.1...
    ...
    [ 933.955873] pci_bus 0021:01: busn_res: [bus 01-ff] is released
    [ 933.955977] pcibios_free_controller_deferred: domain 33, dynamic 1
    [ 933.955999] rpadlpar_io: slot PHB 33 removed

    Suggested-By: Gavin Shan
    Signed-off-by: Mauricio Faria de Oliveira
    Reviewed-by: Gavin Shan
    Reviewed-by: Andrew Donnellan
    Tested-by: Andrew Donnellan # cxl
    Signed-off-by: Benjamin Herrenschmidt

    Mauricio Faria de Oliveira
     
  • The field "owner" is set by the core.
    Thus delete an unneeded initialisation.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
    Signed-off-by: Markus Elfring
    Signed-off-by: Benjamin Herrenschmidt

    Markus Elfring
     
  • The field "owner" is set by the core.
    Thus delete an unneeded initialisation.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
    Signed-off-by: Markus Elfring
    Signed-off-by: Benjamin Herrenschmidt

    Markus Elfring
     
  • Powerpc builds may fail with the following build error.

    Error log:
    In file included from ./arch/powerpc/include/asm/mmu_context.h:11:0,
    from ./include/linux/mmu_context.h:4,
    from mm/mmu_context.c:8:
    ./arch/powerpc/include/asm/cputhreads.h: In function 'get_tensr':
    ./arch/powerpc/include/asm/cputhreads.h:101:2: error:
    implicit declaration of function 'cpu_has_feature'

    The problem can be triggered by configuring ppc64e_defconfig and selecting
    CONFIG_TICK_CPU_ACCOUNTING instead of CONFIG_VIRT_CPU_ACCOUNTING_NATIVE.

    Fixes: b92a226e5284 ("powerpc: Move cpu_has_feature() to a separate file")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Benjamin Herrenschmidt

    Guenter Roeck
     

20 Aug, 2016

6 commits

  • When building gccgo in userspace, errno.h gets parsed and the go include file
    sysinfo.go is generated.

    Since EREFUSED is defined to the same value as ECONNREFUSED, and ECONNREFUSED
    is defined later on in errno.h, this leads to go complaining that EREFUSED
    isn't defined yet.

    Fix this trivial problem by moving the define of EREFUSED down after
    ECONNREFUSED in errno.h (and clean up the indenting while touching this line).

    Signed-off-by: Helge Deller
    Cc: stable@vger.kernel.org

    Helge Deller
     
  • Commit 54b66800907 (parisc: Add native high-resolution sched_clock()
    implementation) added support to use the CPU-internal cr16 counters as reliable
    clocksource with the help of HAVE_UNSTABLE_SCHED_CLOCK.

    Sadly the commit missed to remove the hack which prevented cr16 to become the
    default clocksource even on SMP systems.

    Signed-off-by: Helge Deller
    Cc: stable@vger.kernel.org # 4.7+

    Helge Deller
     
  • Some module using div_u64() was failing to link because the libgcc 64-bit
    divide assist routine was not being exported for modules

    Reported-by: avinashp@quantenna.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Vineet Gupta

    Vineet Gupta
     
  • | CC mm/memory.o
    | In file included from ../mm/memory.c:53:0:
    | ../include/linux/pfn_t.h: In function ‘pfn_t_pte’:
    | ../include/linux/pfn_t.h:78:2: error: conversion to non-scalar type requested
    | return pfn_pte(pfn_t_to_pfn(pfn), pgprot);

    With STRICT_MM_TYPECHECKS pte_t is a struct and the offending code
    forces a cast which ends up shifting a struct and hence the gcc warning.

    Note that in recent past some of the arches (aarch64, s390) made
    STRICT_MM_TYPECHECKS default, but we don't for ARC as this leads to slightly
    worse generated code, given ARC ABI definition of returning structs
    (which pte_t would become)

    Quoting from ARC ABI...

    "Results of type struct are returned in a caller-supplied temporary
    variable whose address is passed in r0.
    For such functions, the arguments are shifted so that they are
    passed in r1 and up."

    So
    - struct to be returned would be allocated on stack requiring extra
    code at call sites
    - callee updates stack memory to facilitate the return (vs. simple
    MOV into return reg r0)

    Hence STRICT_MM_TYPECHECKS is not enabled by default for ARC

    Cc: #4.4+
    Signed-off-by: Vineet Gupta

    Vineet Gupta
     
  • | MODPOST 7 modules
    | ERROR: "kmap" [fs/ext2/ext2.ko] undefined!
    | ../scripts/Makefile.modpost:91: recipe for target '__modpost' failed

    Cc:
    Signed-off-by: Vineet Gupta

    Vineet Gupta
     
  • The syscall ABI includes the gcc functional calling ABI since a syscall
    implies userland caller and kernel callee.

    The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in
    even-odd register pairs, (potentially punching reg holes when passing such
    values as args). This was partly driven by the fact that the double-word
    LDD/STD instructions in ARCv2 expect the register alignment and thus gcc
    forcing this avoids extra MOV at the cost of a few unused register (which we
    have plenty anyways).

    This however was rejected as part of upstreaming gcc port to HS. So the new
    ABI v4 doesn't enforce the even-odd reg restriction.

    Do note that for ARCompact ISA builds v3 and v4 are practically the same in
    terms of gcc code generation.

    In terms of change management, we infer the new ABI if gcc 6.x onwards
    is used for building the kernel.

    This also needs a stable backport to enable older kernels to work with
    new tools/user-space

    Cc:
    Signed-off-by: Vineet Gupta

    Vineet Gupta