1. 28 Jul, 2017 4 commits
    • Michael Ellerman's avatar
      powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler · 65c5ec11
      Michael Ellerman authored
      Historically the boot wrapper was always built 32-bit big endian, even
      for 64-bit kernels. That was because old firmwares didn't necessarily
      support booting a 64-bit image. Because of that arch/powerpc/boot/Makefile
      uses CROSS32CC for compilation.
      
      However when we added 64-bit little endian support, we also added
      support for building the boot wrapper 64-bit. However we kept using
      CROSS32CC, because in most cases it is just CC and everything works.
      
      However if the user doesn't specify CROSS32_COMPILE (which no one ever
      does AFAIK), and CC is *not* biarch (32/64-bit capable), then CROSS32CC
      becomes just "gcc". On native systems that is probably OK, but if we're
      cross building it definitely isn't, leading to eg:
      
        gcc ... -m64 -mlittle-endian -mabi=elfv2 ... arch/powerpc/boot/cpm-serial.c
        gcc: error: unrecognized argument in option ‘-mabi=elfv2’
        gcc: error: unrecognized command line option ‘-mlittle-endian’
        make: *** [zImage] Error 2
      
      To fix it, stop using CROSS32CC, because we may or may not be building
      32-bit. Instead setup a BOOTCC, which defaults to CC, and only use
      CROSS32_COMPILE if it's set and we're building for 32-bit.
      
      Fixes: 147c0516 ("powerpc/boot: Add support for 64bit little endian wrapper")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: default avatarCyril Bur <cyrilbur@gmail.com>
      65c5ec11
    • Michael Ellerman's avatar
      powerpc/smp: Call smp_ops->setup_cpu() directly on the boot CPU · 7b7622bb
      Michael Ellerman authored
      In smp_cpus_done() we need to call smp_ops->setup_cpu() for the boot
      CPU, which means it has to run *on* the boot CPU.
      
      In the past we ensured it ran on the boot CPU by changing the CPU
      affinity mask of current directly. That was removed in commit
      6d11b87d ("powerpc/smp: Replace open coded task affinity logic"),
      and replaced with a work queue call.
      
      Unfortunately using a work queue leads to a lockdep warning, now that
      the CPU hotplug lock is a regular semaphore:
      
        ======================================================
        WARNING: possible circular locking dependency detected
        ...
        kworker/0:1/971 is trying to acquire lock:
         (cpu_hotplug_lock.rw_sem){++++++}, at: [<c000000000100974>] apply_workqueue_attrs+0x34/0xa0
      
        but task is already holding lock:
         ((&wfc.work)){+.+.+.}, at: [<c0000000000fdb2c>] process_one_work+0x25c/0x800
        ...
             CPU0                    CPU1
             ----                    ----
        lock((&wfc.work));
                                     lock(cpu_hotplug_lock.rw_sem);
                                     lock((&wfc.work));
        lock(cpu_hotplug_lock.rw_sem);
      
      Although the deadlock can't happen in practice, because
      smp_cpus_done() only runs in early boot before CPU hotplug is allowed,
      lockdep can't tell that.
      
      Luckily in commit 8fb12156 ("init: Pin init task to the boot CPU,
      initially") tglx changed the generic code to pin init to the boot CPU
      to begin with. The unpinning of init from the boot CPU happens in
      sched_init_smp(), which is called after smp_cpus_done().
      
      So smp_cpus_done() is always called on the boot CPU, which means we
      don't need the work queue call at all - and the lockdep warning goes
      away.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      7b7622bb
    • Gustavo Romero's avatar
      powerpc/tm: Fix saving of TM SPRs in core dump · cd63f3cf
      Gustavo Romero authored
      Currently flush_tmregs_to_thread() does not save the TM SPRs (TFHAR,
      TFIAR, TEXASR) to the thread struct, unless the process is currently
      inside a suspended transaction.
      
      If the process is core dumping, and the TM SPRs have changed since the
      last time the process was context switched, then we will save stale
      values of the TM SPRs to the core dump.
      
      Fix it by saving the live register state to the thread struct in that
      case.
      
      Fixes: 08e1c01d ("powerpc/ptrace: Enable support for TM SPR state")
      Cc: stable@vger.kernel.org # v4.8+
      Signed-off-by: default avatarGustavo Romero <gromero@linux.vnet.ibm.com>
      Reviewed-by: default avatarCyril Bur <cyrilbur@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      cd63f3cf
    • Oliver O'Halloran's avatar
      powerpc/mm: Fix pmd/pte_devmap() on non-leaf entries · c9c98bc5
      Oliver O'Halloran authored
      The Radix MMU translation tree as defined in ISA v3.0 contains two
      different types of entry, directories and leaves. Leaves are
      identified by _PAGE_PTE being set.
      
      The formats of the two entries are different, with the directory
      entries containing no spare bits for use by software. In particular
      the bit we use for _PAGE_DEVMAP is not reserved for software, and is
      part of the NLB (Next Level Base) field, essentially the address of
      the next level in the tree.
      
      Note that the Linux pte_t is not == _PAGE_PTE. A huge page pmd
      entry (or devmap!) is also a leaf and so has _PAGE_PTE set, even
      though we use a pmd_t for it in Linux.
      
      The fix is to ensure that the pmd/pte_devmap() confirm they are
      looking at a leaf entry (_PAGE_PTE) as well as checking _PAGE_DEVMAP.
      
      Fixes: ebd31197 ("powerpc/mm: Add devmap support for ppc64")
      Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
      Tested-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Tested-by: default avatarJose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
      Reviewed-by: default avatarSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      [mpe: Add a comment in the code and flesh out change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c9c98bc5
  2. 27 Jul, 2017 1 commit
  3. 26 Jul, 2017 3 commits
    • Michael Ellerman's avatar
      powerpc/Makefile: Fix ld version check with 64-bit LE-only toolchain · b40b2386
      Michael Ellerman authored
      In commit efe0160c ("powerpc/64: Linker on-demand sfpr functions
      for modules"), we added an ld version check early in the powerpc
      top-level Makefile.
      
      Because the Makefile runs before the kernel config is setup, the
      checks for CONFIG_CPU_LITTLE_ENDIAN etc. all take the default case. So
      we end up configuring ld for 32-bit big endian.
      
      That would be OK, except that for historical (or perhaps no) reason,
      we use 'override LD' to add the endian flags to the LD variable
      itself, rather than the normal approach of adding them to LDFLAGS.
      
      The end result is that when we check the ld version we run it as:
      
        $(CROSS_COMPILE)ld -EB -m elf32ppc --version
      
      This often works, unless you are using a 64-bit only and/or little
      endian only, toolchain. In which case you see something like:
      
        $ make defconfig
        powerpc64le-linux-ld: unrecognised emulation mode: elf32ppc
        Supported emulations: elf64lppc elf32lppc elf32lppclinux elf32lppcsim
        /bin/sh: 1: [: -ge: unexpected operator
      
      The proper fix is to stop using 'override LD', but that will require a
      fair bit of testing. Instead we can fix it for now just by reordering
      the Makefile to do the version check earlier.
      
      Fixes: efe0160c ("powerpc/64: Linker on-demand sfpr functions for modules")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      b40b2386
    • Laurent Vivier's avatar
      powerpc/pseries: Fix of_node_put() underflow during reconfig remove · 4fd1bd44
      Laurent Vivier authored
      As for commit 68baf692 ("powerpc/pseries: Fix of_node_put()
      underflow during DLPAR remove"), the call to of_node_put() must be
      removed from pSeries_reconfig_remove_node().
      
      dlpar_detach_node() and pSeries_reconfig_remove_node() both call
      of_detach_node(), and thus the node should not be released in both
      cases.
      
      Fixes: 0829f6d1 ("of: device_node kobject lifecycle fixes")
      Cc: stable@vger.kernel.org # v3.15+
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      4fd1bd44
    • Benjamin Herrenschmidt's avatar
      powerpc/mm/radix: Workaround prefetch issue with KVM · a25bd72b
      Benjamin Herrenschmidt authored
      There's a somewhat architectural issue with Radix MMU and KVM.
      
      When coming out of a guest with AIL (Alternate Interrupt Location, ie,
      MMU enabled), we start executing hypervisor code with the PID register
      still containing whatever the guest has been using.
      
      The problem is that the CPU can (and will) then start prefetching or
      speculatively load from whatever host context has that same PID (if
      any), thus bringing translations for that context into the TLB, which
      Linux doesn't know about.
      
      This can cause stale translations and subsequent crashes.
      
      Fixing this in a way that is neither racy nor a huge performance
      impact is difficult. We could just make the host invalidations always
      use broadcast forms but that would hurt single threaded programs for
      example.
      
      We chose to fix it instead by partitioning the PID space between guest
      and host. This is possible because today Linux only use 19 out of the
      20 bits of PID space, so existing guests will work if we make the host
      use the top half of the 20 bits space.
      
      We additionally add support for a property to indicate to Linux the
      size of the PID register which will be useful if we eventually have
      processors with a larger PID space available.
      
      There is still an issue with malicious guests purposefully setting the
      PID register to a value in the hosts PID range. Hopefully future HW
      can prevent that, but in the meantime, we handle it with a pair of
      kludges:
      
       - On the way out of a guest, before we clear the current VCPU in the
         PACA, we check the PID and if it's outside of the permitted range
         we flush the TLB for that PID.
      
       - When context switching, if the mm is "new" on that CPU (the
         corresponding bit was set for the first time in the mm cpumask), we
         check if any sibling thread is in KVM (has a non-NULL VCPU pointer
         in the PACA). If that is the case, we also flush the PID for that
         CPU (core).
      
      This second part is needed to handle the case where a process is
      migrated (or starts a new pthread) on a sibling thread of the CPU
      coming out of KVM, as there's a window where stale translations can
      exist before we detect it and flush them out.
      
      A future optimization could be added by keeping track of whether the
      PID has ever been used and avoid doing that for completely fresh PIDs.
      We could similarily mark PIDs that have been the subject of a global
      invalidation as "fresh". But for now this will do.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [mpe: Rework the asm to build with CONFIG_PPC_RADIX_MMU=n, drop
            unneeded include of kvm_book3s_asm.h]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      a25bd72b
  4. 18 Jul, 2017 5 commits
  5. 17 Jul, 2017 1 commit
    • Michael Ellerman's avatar
      powerpc/powernv: Fix boot on Power8 bare metal due to opal_configure_cores() · a70b487b
      Michael Ellerman authored
      In commit 1c0eaf0f ("powerpc/powernv: Tell OPAL about our MMU mode
      on POWER9"), we added additional flags to the OPAL call to configure
      CPUs at boot.
      
      These flags only work on Power9 firmwares, and worse can cause boot
      failures on Power8 machines, so we check for CPU_FTR_ARCH_300 (aka POWER9)
      before adding the extra flags.
      
      Unfortunately we forgot that opal_configure_cores() is called before
      the CPU feature checks are dynamically patched, meaning the check
      always returns true.
      
      We definitely need to do something to make the CPU feature checks less
      prone to bugs like this, but for now the minimal fix is to use
      early_cpu_has_feature().
      Reported-and-tested-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
      Fixes: 1c0eaf0f ("powerpc/powernv: Tell OPAL about our MMU mode on POWER9")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      a70b487b
  6. 12 Jul, 2017 4 commits
  7. 11 Jul, 2017 3 commits
    • Madhavan Srinivasan's avatar
      powerpc/perf: Fix SDAR_MODE value for continous sampling on Power9 · 20dd4c62
      Madhavan Srinivasan authored
      In case of continous sampling (non-marked), the code currently
      sets MMCRA[SDAR_MODE] to 0b01 (Update on TLB miss) for Power9 DD1.
      
      On DD2 and later it copies the sdar_mode value from the event code,
      which for most events is 0b00 (No updates).
      
      However we must set a non-zero value for SDAR_MODE when doing
      continuous sampling, so honor the event code, unless it's zero, in
      which case we use use 0b01 (Update on TLB miss).
      
      Fixes: 78b4416a ("powerpc/perf: Handle sdar_mode for marked event in power9")
      Cc: stable@vger.kernel.org # v4.11+
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      20dd4c62
    • Oliver O'Halloran's avatar
      powerpc/asm: Mark cr0 as clobbered in mftb() · 2400fd82
      Oliver O'Halloran authored
      The workaround for the CELL timebase bug does not correctly mark cr0 as
      being clobbered. This means GCC doesn't know that the asm block changes cr0 and
      might leave the result of an unrelated comparison in cr0 across the block, which
      we then trash, leading to basically random behaviour.
      
      Fixes: 859deea9 ("[POWERPC] Cell timebase bug workaround")
      Cc: stable@vger.kernel.org # v2.6.19+
      Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
      [mpe: Tweak change log and flag for stable]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      2400fd82
    • Nicholas Piggin's avatar
      powerpc/powernv: Fix local TLB flush for boot and MCE on POWER9 · 41d0c2ec
      Nicholas Piggin authored
      There are two cases outside the normal address space management
      where a CPU's local TLB is to be flushed:
      
        1. Host boot; in case something has left stale entries in the
           TLB (e.g., kexec).
      
        2. Machine check; to clean corrupted TLB entries.
      
      CPU state restore from deep idle states also flushes the TLB.
      However this seems to be a side effect of reusing the boot code to set
      CPU state, rather than a requirement itself.
      
      The current flushing has a number of problems with ISA v3.0B:
      
      - The current radix mode of the MMU is not taken into account. tlbiel
        is undefined if the R field does not match the current radix mode.
      
      - ISA v3.0B hash must flush the partition and process table caches.
      
      - ISA v3.0B radix must flush partition and process scoped translations,
        partition and process table caches, and also the page walk cache.
      
      Add POWER9 cases to handle these, with radix vs hash determined by the
      host MMU mode.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      41d0c2ec
  8. 10 Jul, 2017 5 commits
    • Benjamin Herrenschmidt's avatar
      powerpc/mm/radix: Synchronize updates to the process table · 3a6a0470
      Benjamin Herrenschmidt authored
      When writing to the process table, we need to ensure the store is
      visible to a subsequent access by the MMU. We assume we never have
      the PID active while doing the update, so a ptesync/isync pair
      should hopefully be a big enough hammer for our purpose.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      3a6a0470
    • Benjamin Herrenschmidt's avatar
      powerpc/mm/radix: Properly clear process table entry · c6bb0b8d
      Benjamin Herrenschmidt authored
      On radix, the process table entry we want to clear when destroying a
      context is entry 0, not entry 1. This has no *immediate* consequence
      on Power9, but it can cause other bugs to become worse.
      
      Fixes: 7e381c0f ("powerpc/mm/radix: Add mmu context handling callback for radix")
      Cc: stable@vger.kernel.org # v4.7+
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c6bb0b8d
    • Benjamin Herrenschmidt's avatar
      powerpc/powernv: Tell OPAL about our MMU mode on POWER9 · 1c0eaf0f
      Benjamin Herrenschmidt authored
      That will allow OPAL to configure the CPU in an optimal way.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      1c0eaf0f
    • Balbir Singh's avatar
      powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR · 1e2a516e
      Balbir Singh authored
      This patch fixes a crash seen while doing a kexec from radix mode to
      hash mode. Key 0 is special in hash and used in the RPN by default, we
      set the key values to 0 today. In radix mode key 0 is used to control
      supervisor<->user access. In hash key 0 is used by default, so the
      first instruction after the switch causes a crash on kexec.
      
      Commit 3b10d009 ("powerpc/mm/radix: Prevent kernel execution of
      user space") introduced the setting of IAMR and AMOR values to prevent
      execution of user mode instructions from supervisor mode. We need to
      clean up these SPR's on kexec.
      
      Fixes: 3b10d009 ("powerpc/mm/radix: Prevent kernel execution of user space")
      Cc: stable@vger.kernel.org # v4.10+
      Reported-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      1e2a516e
    • Linus Torvalds's avatar
      Merge tag 'drm-for-v4.13' of git://people.freedesktop.org/~airlied/linux · af3c8d98
      Linus Torvalds authored
      Pull drm updates from Dave Airlie:
       "This is the main pull request for the drm, I think I've got one later
        driver pull for mediatek SoC driver, I'm undecided on if it needs to
        go to you yet.
      
        Otherwise summary below:
      
        Core drm:
         - Atomic add driver private objects
         - Deprecate preclose hook in modern drivers
         - MST bandwidth tracking
         - Use kvmalloc in more places
         - Add mode_valid hook for crtc/encoder/bridge
         - Reduce sync_file construction time
         - Documentation updates
         - New DRM synchronisation object support
      
        New drivers:
         - pl111 - pl111 CLCD display controller
      
        Panel:
         - Innolux P079ZCA panel driver
         - Add NL12880B20-05, NL192108AC18-02D, P320HVN03 panels
         - panel-samsung-s6e3ha2: Add s6e3hf2 panel support
      
        i915:
         - SKL+ watermark fixes
         - G4x/G33 reset improvements
         - DP AUX backlight improvements
         - Buffer based GuC/host communication
         - New getparam for (sub)slice infomation
         - Cannonlake and Coffeelake initial patches
         - Execbuf optimisations
      
        radeon/amdgpu:
         - Lots of Vega10 bug fixes
         - Preliminary raven support
         - KIQ support for compute rings
         - MEC queue management rework
         - DCE6 Audio support
         - SR-IOV improvements
         - Better radeon/amdgpu selection support
      
        nouveau:
         - HDMI stereoscopic support
         - Display code rework for >= GM20x GPUs
      
        msm:
         - GEM rework for fine-grained locking
         - Per-process pagetable work
         - HDMI fixes for Snapdragon 820.
      
        vc4:
         - Remove 256MB CMA limit from vc4
         - Add out-fence support
         - Add support for cygnus
         - Get/set tiling ioctls support
         - Add T-format tiling support for scanout
      
        zte:
         - add VGA support.
      
        etnaviv:
         - Thermal throttle support for newer GPUs
         - Restore userspace buffer cache performance
         - dma-buf sync fix
      
        stm:
         - add stm32f429 display support
      
        exynos:
         - Rework vblank handling
         - Fixup sw-trigger code
      
        sun4i:
         - V3s display engine support
         - HDMI support for older SoCs
         - Preliminary work on dual-pipeline SoCs.
      
        rcar-du:
         - VSP work
      
        imx-drm:
         - Remove counter load enable from PRE
         - Double read/write reduction flag support
      
        tegra:
         - Documentation for the host1x and drm driver.
         - Lots of staging ioctl fixes due to grate project work.
      
        omapdrm:
         - dma-buf fence support
         - TILER rotation fixes"
      
      * tag 'drm-for-v4.13' of git://people.freedesktop.org/~airlied/linux: (1270 commits)
        drm: Remove unused drm_file parameter to drm_syncobj_replace_fence()
        drm/amd/powerplay: fix bug fail to remove sysfs when rmmod amdgpu.
        amdgpu: Set cik/si_support to 1 by default if radeon isn't built
        drm/amdgpu/gfx9: fix driver reload with KIQ
        drm/amdgpu/gfx8: fix driver reload with KIQ
        drm/amdgpu: Don't call amd_powerplay_destroy() if we don't have powerplay
        drm/ttm: Fix use-after-free in ttm_bo_clean_mm
        drm/amd/amdgpu: move get memory type function from early init to sw init
        drm/amdgpu/cgs: always set reference clock in mode_info
        drm/amdgpu: fix vblank_time when displays are off
        drm/amd/powerplay: power value format change for Vega10
        drm/amdgpu/gfx9: support the amdgpu.disable_cu option
        drm/amd/powerplay: change PPSMC_MSG_GetCurrPkgPwr for Vega10
        drm/amdgpu: Make amdgpu_cs_parser_init static (v2)
        drm/amdgpu/cs: fix a typo in a comment
        drm/amdgpu: Fix the exported always on CU bitmap
        drm/amdgpu/gfx9: gfx_v9_0_enable_gfx_static_mg_power_gating() can be static
        drm/amdgpu/psp: upper_32_bits/lower_32_bits for address setup
        drm/amd/powerplay/cz: print message if smc message fails
        drm/amdgpu: fix typo in amdgpu_debugfs_test_ib_init
        ...
      af3c8d98
  9. 09 Jul, 2017 14 commits
    • David Howells's avatar
      afs: Add metadata xattrs · d3e3b7ea
      David Howells authored
      Add xattrs to allow the user to get/set metadata in lieu of having pioctl()
      available.  The following xattrs are now available:
      
       - "afs.cell"
      
         The name of the cell in which the vnode's volume resides.
      
       - "afs.fid"
      
         The volume ID, vnode ID and vnode uniquifier of the file as three hex
         numbers separated by colons.
      
       - "afs.volume"
      
         The name of the volume in which the vnode resides.
      
      For example:
      
      	# getfattr -d -m ".*" /mnt/scratch
      	getfattr: Removing leading '/' from absolute path names
      	# file: mnt/scratch
      	afs.cell="mycell.myorg.org"
      	afs.fid="10000b:1:1"
      	afs.volume="scratch"
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d3e3b7ea
    • Marc Dionne's avatar
      afs: Ignore AFS_ACE_READ and AFS_ACE_WRITE for directories · fd249821
      Marc Dionne authored
      The AFS_ACE_READ and AFS_ACE_WRITE permission bits should not
      be used to make access decisions for the directory itself.  They
      are meant to control access for the objects contained in that
      directory.
      
      Reading a directory is allowed if the AFS_ACE_LOOKUP bit is set.
      This would cause an incorrect access denied error for a directory
      with AFS_ACE_LOOKUP but not AFS_ACE_READ.
      
      The AFS_ACE_WRITE bit does not allow operations that modify the
      directory.  For a directory with AFS_ACE_WRITE but neither
      AFS_ACE_INSERT nor AFS_ACE_DELETE, this would result in trying
      operations that would ultimately be denied by the server.
      Signed-off-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fd249821
    • Cong Wang's avatar
      mqueue: fix a use-after-free in sys_mq_notify() · f991af3d
      Cong Wang authored
      The retry logic for netlink_attachskb() inside sys_mq_notify()
      is nasty and vulnerable:
      
      1) The sock refcnt is already released when retry is needed
      2) The fd is controllable by user-space because we already
         release the file refcnt
      
      so we when retry but the fd has been just closed by user-space
      during this small window, we end up calling netlink_detachskb()
      on the error path which releases the sock again, later when
      the user-space closes this socket a use-after-free could be
      triggered.
      
      Setting 'sock' to NULL here should be sufficient to fix it.
      Reported-by: default avatarGeneBlue <geneblue.mail@gmail.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f991af3d
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2b976203
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "The x86 updates contain:
      
         - A fix for a longstanding PAT bug, where PAT was reported on CPUs
           that do not support it, which leads to wrong caching attributes and
           missing MTRR updates
      
         - Prevent overwriting of the e820 firmware table, which causes kexec
           kernels to lose the fake mptable which is stored there.
      
         - Cleanup of the UV/BAU code, removing unused code and making local
           functions static"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot/e820: Introduce the bootloader provided e820_table_firmware[] table
        x86/boot/e820: Rename the e820_table_firmware to e820_table_kexec
        x86/boot/e820: Avoid overwriting e820_table_firmware
        x86/mm/pat: Don't report PAT on CPUs that don't support it
        x86/platform/uv/BAU: Minor cleanup, make some local functions static
      2b976203
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8d97a6c3
      Linus Torvalds authored
      Pull timers fixlet from Thomas Gleixner:
       "Add Frederic Weisbecker as NOHZ/dyntick maintainer"
      
      [ And an unmentioned and unrelated typo fix in the same commit? Hmm.. ]
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        MAINTAINERS: Add Frederic Weisbecker as nohz/dyntics maintainer
      8d97a6c3
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4d3c4a42
      Linus Torvalds authored
      Pull smp/hotplug fix from Thomas Gleixner:
       "A single fix for a brown paperbag bug:
      
        The unparking of the initial percpu threads of an upcoming CPU happens
        right now on the idle task, but that's wrong as the unpark function
        might sleep. Move it to the control CPU."
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        smp/hotplug: Move unparking of percpu threads to the control CPU
      4d3c4a42
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4fde846a
      Linus Torvalds authored
      Pull scheduler fixes from Thomas Gleixner:
       "This scheduler update provides:
      
         - The (hopefully) final fix for the vtime accounting issues which
           were around for quite some time
      
         - Use types known to user space in UAPI headers to unbreak user space
           builds
      
         - Make load balancing respect the current scheduling domain again
           instead of evaluating unrelated CPUs"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/headers/uapi: Fix linux/sched/types.h userspace compilation errors
        sched/fair: Fix load_balance() affinity redo path
        sched/cputime: Accumulate vtime on top of nsec clocksource
        sched/cputime: Move the vtime task fields to their own struct
        sched/cputime: Rename vtime fields
        sched/cputime: Always set tsk->vtime_snap_whence after accounting vtime
        vtime, sched/cputime: Remove vtime_account_user()
        Revert "sched/cputime: Refactor the cputime_adjust() code"
      4fde846a
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c3931a87
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A couple of fixes for perf and kprobes:
      
         - Add he missing exclude_kernel attribute for the precise_ip level so
           !CAP_SYS_ADMIN users get the proper results.
      
         - Warn instead of failing completely when perf has no unwind support
           for a particular architectiure built in.
      
         - Ensure that jprobes are at function entry and not at some random
           place"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        kprobes: Ensure that jprobe probepoints are at function entry
        kprobes: Simplify register_jprobes()
        kprobes: Rename [arch_]function_offset_within_entry() to [arch_]kprobe_on_func_entry()
        perf unwind: Do not fail due to missing unwind support
        perf evsel: Set attr.exclude_kernel when probing max attr.precise_ip
      c3931a87
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c8b2ba83
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
      
       - Fix the EINTR logic in rwsem-spinlock to avoid double locking by a
         writer and a reader
      
       - Add a missing include to qspinlocks
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/qspinlock: Explicitly include asm/prefetch.h
        locking/rwsem-spinlock: Fix EINTR branch in __down_write_common()
      c8b2ba83
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7cb328c3
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
      
       - A few fixes mopping up the fallout of the big irq overhaul
      
       - Move the interrupt resource management logic out of the spin locked,
         irq disabled region to avoid unnecessary restrictions of the resource
         callbacks
      
       - Preparation for reworking the per cpu irq request function.
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqdomain: Allow ACPI device nodes to be used as irqdomain identifiers
        genirq/debugfs: Remove redundant NULL pointer check
        genirq: Allow to pass the IRQF_TIMER flag with percpu irq request
        genirq/timings: Move free timings out of spinlocked region
        genirq: Move irq resource handling out of spinlocked region
        genirq: Add mutex to irq desc to serialize request/free_irq()
        genirq: Move bus locking into __setup_irq()
        genirq: Force inlining of __irq_startup_managed to prevent build failure
        genirq/debugfs: Fix build for !CONFIG_IRQ_DOMAIN
      7cb328c3
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 19bf2e0e
      Linus Torvalds authored
      Pull objtool fix from Thomas Gleixner:
       "A fix to the objtool sibling call detection logic to distinguish
        normal jumps inside a function from a real sibling call"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Fix sibling call detection logic
      19bf2e0e
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · bc2c6421
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "The first major feature for ext4 this merge window is the largedir
        feature, which allows ext4 directories to support over 2 billion
        directory entries (assuming ~64 byte file names; in practice, users
        will run into practical performance limits first.) This feature was
        originally written by the Lustre team, and credit goes to Artem
        Blagodarenko from Seagate for getting this feature upstream.
      
        The second major major feature allows ext4 to support extended
        attribute values up to 64k. This feature was also originally from
        Lustre, and has been enhanced by Tahsin Erdogan from Google with a
        deduplication feature so that if multiple files have the same xattr
        value (for example, Windows ACL's stored by Samba), only one copy will
        be stored on disk for encoding and caching efficiency.
      
        We also have the usual set of bug fixes, cleanups, and optimizations"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (47 commits)
        ext4: fix spelling mistake: "prellocated" -> "preallocated"
        ext4: fix __ext4_new_inode() journal credits calculation
        ext4: skip ext4_init_security() and encryption on ea_inodes
        fs: generic_block_bmap(): initialize all of the fields in the temp bh
        ext4: change fast symlink test to not rely on i_blocks
        ext4: require key for truncate(2) of encrypted file
        ext4: don't bother checking for encryption key in ->mmap()
        ext4: check return value of kstrtoull correctly in reserved_clusters_store
        ext4: fix off-by-one fsmap error on 1k block filesystems
        ext4: return EFSBADCRC if a bad checksum error is found in ext4_find_entry()
        ext4: return EIO on read error in ext4_find_entry
        ext4: forbid encrypting root directory
        ext4: send parallel discards on commit completions
        ext4: avoid unnecessary stalls in ext4_evict_inode()
        ext4: add nombcache mount option
        ext4: strong binding of xattr inode references
        ext4: eliminate xattr entry e_hash recalculation for removes
        ext4: reserve space for xattr entries/names
        quota: add get_inode_usage callback to transfer multi-inode charges
        ext4: xattr inode deduplication
        ...
      bc2c6421
    • Linus Torvalds's avatar
      Merge tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt · 58f587cb
      Linus Torvalds authored
      Pull fscrypt updates from Ted Ts'o:
       "Add support for 128-bit AES and some cleanups to fscrypt"
      
      * tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt:
        fscrypt: make ->dummy_context() return bool
        fscrypt: add support for AES-128-CBC
        fscrypt: inline fscrypt_free_filename()
      58f587cb
    • Linus Torvalds's avatar
      Merge branch 'waitid-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · e28e9e3e
      Linus Torvalds authored
      Pull waitid fix from Al Viro.
      
      * 'waitid-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fix waitid(2) breakage
      e28e9e3e