1. 17 Feb, 2018 3 commits
    • Dan Williams's avatar
      nospec: Include <asm/barrier.h> dependency · eb6174f6
      Dan Williams authored
      The nospec.h header expects the per-architecture header file
      <asm/barrier.h> to optionally define array_index_mask_nospec(). Include
      that dependency to prevent inadvertent fallback to the default
      array_index_mask_nospec() implementation.
      
      The default implementation may not provide a full mitigation
      on architectures that perform data value speculation.
      Reported-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arch@vger.kernel.org
      Link: http://lkml.kernel.org/r/151881605404.17395.1341935530792574707.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      eb6174f6
    • Rasmus Villemoes's avatar
      nospec: Allow index argument to have const-qualified type · b98c6a16
      Rasmus Villemoes authored
      The last expression in a statement expression need not be a bare
      variable, quoting gcc docs
      
        The last thing in the compound statement should be an expression
        followed by a semicolon; the value of this subexpression serves as the
        value of the entire construct.
      
      and we already use that in e.g. the min/max macros which end with a
      ternary expression.
      
      This way, we can allow index to have const-qualified type, which will in
      some cases avoid the need for introducing a local copy of index of
      non-const qualified type. That, in turn, can prevent readers not
      familiar with the internals of array_index_nospec from wondering about
      the seemingly redundant extra variable, and I think that's worthwhile
      considering how confusing the whole _nospec business is.
      
      The expression _i&_mask has type unsigned long (since that is the type
      of _mask, and the BUILD_BUG_ONs guarantee that _i will get promoted to
      that), so in order not to change the type of the whole expression, add
      a cast back to typeof(_i).
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/151881604837.17395.10812767547837568328.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b98c6a16
    • Dan Williams's avatar
      nospec: Kill array_index_nospec_mask_check() · 1d91c1d2
      Dan Williams authored
      There are multiple problems with the dynamic sanity checking in
      array_index_nospec_mask_check():
      
      * It causes unnecessary overhead in the 32-bit case since integer sized
        @index values will no longer cause the check to be compiled away like
        in the 64-bit case.
      
      * In the 32-bit case it may trigger with user controllable input when
        the expectation is that should only trigger during development of new
        kernel enabling.
      
      * The macro reuses the input parameter in multiple locations which is
        broken if someone passes an expression like 'index++' to
        array_index_nospec().
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arch@vger.kernel.org
      Link: http://lkml.kernel.org/r/151881604278.17395.6605847763178076520.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1d91c1d2
  2. 15 Feb, 2018 15 commits
  3. 14 Feb, 2018 2 commits
    • Linus Torvalds's avatar
      Merge tag 'gfs2-4.16.rc1.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 6556677a
      Linus Torvalds authored
      Pull gfs2 fix from Bob Peterson:
       "Fix regressions in the gfs2 iomap for block_map implementation we
        recently discovered in commit 3974320c"
      
      * tag 'gfs2-4.16.rc1.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Fixes to "Implement iomap for block_map"
      6556677a
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 694a20da
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A larger batch of fixes than we'd like. Roughly 1/3 fixes for new
        code, 1/3 fixes for stable and 1/3 minor things.
      
        There's four commits fixing bugs when using 16GB huge pages on hash,
        caused by some of the preparatory changes for pkeys.
      
        Two fixes for bugs in the enhanced IRQ soft masking for local_t, one
        of which broke KVM in some circumstances.
      
        Four fixes for Power9. The most bizarre being a bug where futexes
        stopped working because a NULL pointer dereference didn't trap during
        early boot (it aliased the kernel mapping). A fix for memory hotplug
        when using the Radix MMU, and a fix for live migration of guests using
        the Radix MMU.
      
        Two fixes for hotplug on pseries machines. One where we weren't
        correctly updating NUMA info when CPUs are added and removed. And the
        other fixes crashes/hangs seen when doing memory hot remove during
        boot, which is apparently a thing people do.
      
        Finally a handful of build fixes for obscure configs and other minor
        fixes.
      
        Thanks to: Alexey Kardashevskiy, Aneesh Kumar K.V, Balbir Singh, Colin
        Ian King, Daniel Henrique Barboza, Florian Weimer, Guenter Roeck,
        Harish, Laurent Vivier, Madhavan Srinivasan, Mauricio Faria de
        Oliveira, Nathan Fontenot, Nicholas Piggin, Sam Bobroff"
      
      * tag 'powerpc-4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        selftests/powerpc: Fix to use ucontext_t instead of struct ucontext
        powerpc/kdump: Fix powernv build break when KEXEC_CORE=n
        powerpc/pseries: Fix build break for SPLPAR=n and CPU hotplug
        powerpc/mm/hash64: Zero PGD pages on allocation
        powerpc/mm/hash64: Store the slot information at the right offset for hugetlb
        powerpc/mm/hash64: Allocate larger PMD table if hugetlb config is enabled
        powerpc/mm: Fix crashes with 16G huge pages
        powerpc/mm: Flush radix process translations when setting MMU type
        powerpc/vas: Don't set uses_vas for kernel windows
        powerpc/pseries: Enable RAS hotplug events later
        powerpc/mm/radix: Split linear mapping on hot-unplug
        powerpc/64s/radix: Boot-time NULL pointer protection using a guard-PID
        ocxl: fix signed comparison with less than zero
        powerpc/64s: Fix may_hard_irq_enable() for PMI soft masking
        powerpc/64s: Fix MASKABLE_RELON_EXCEPTION_HV_OOL macro
        powerpc/numa: Invalidate numa_cpu_lookup_table on cpu remove
      694a20da
  4. 13 Feb, 2018 20 commits