1. 26 Jun, 2019 5 commits
    • Thomas Gleixner's avatar
      lib/vdso: Make delta calculation work correctly · 9d90b93b
      Thomas Gleixner authored
      The x86 vdso implementation on which the generic vdso library is based on
      has subtle (unfortunately undocumented) twists:
      
       1) The code assumes that the clocksource mask is U64_MAX which means that
          no bits are masked. Which is true for any valid x86 VDSO clocksource.
          Stupidly it still did the mask operation for no reason and at the wrong
          place right after reading the clocksource.
      
       2) It contains a sanity check to catch the case where slightly
          unsynchronized TSC values can be observed which would cause the delta
          calculation to make a huge jump. It therefore checks whether the
          current TSC value is larger than the value on which the current
          conversion is based on. If it's not larger the base value is used to
          prevent time jumps.
      
      #1 Is not only stupid for the X86 case because it does the masking for no
      reason it is also completely wrong for clocksources with a smaller mask
      which can legitimately wrap around during a conversion period. The core
      timekeeping code does it correct by applying the mask after the delta
      calculation:
      
      	(now - base) & mask
      
      #2 is equally broken for clocksources which have smaller masks and can wrap
      around during a conversion period because there the now > base check is
      just wrong and causes stale time stamps and time going backwards issues.
      
      Unbreak it by:
      
        1) Removing the mask operation from the clocksource read which makes the
           fallback detection work for all clocksources
      
        2) Replacing the conditional delta calculation with a overrideable inline
           function.
      
      #2 could reuse clocksource_delta() from the timekeeping code but that
      results in a significant performance hit for the x86 VSDO. The timekeeping
      core code must have the non optimized version as it has to operate
      correctly with clocksources which have smaller masks as well to handle the
      case where TSC is discarded as timekeeper clocksource and replaced by HPET
      or pmtimer. For the VDSO there is no replacement clocksource. If TSC is
      unusable the syscall is enforced which does the right thing.
      
      To accommodate to the needs of various architectures provide an
      override-able inline function which defaults to the regular delta
      calculation with masking:
      
      	(now - base) & mask
      
      Override it for x86 with the non-masking and checking version.
      
      This unbreaks the ARM64 syscall fallback operation, allows to use
      clocksources with arbitrary width and preserves the performance
      optimization for x86.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: LAK <linux-arm-kernel@lists.infradead.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: catalin.marinas@arm.com
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: linux@armlinux.org.uk
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: paul.burton@mips.com
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: salyzyn@android.com
      Cc: pcc@google.com
      Cc: shuah@kernel.org
      Cc: 0x7f454c46@gmail.com
      Cc: linux@rasmusvillemoes.dk
      Cc: huw@codeweavers.com
      Cc: sthotton@marvell.com
      Cc: andre.przywara@arm.com
      Cc: Andy Lutomirski <luto@kernel.org>
      Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1906261159230.32342@nanos.tec.linutronix.de
      9d90b93b
    • Thomas Gleixner's avatar
      MAINTAINERS: Add entry for the generic VDSO library · e7098031
      Thomas Gleixner authored
      
      Assign the following folks in alphabetic order:
      
       - Andy for being the VDSO wizard of x86 and in general. He's also the
         performance monitor of choice and the code in the generic library is
         heavily influenced by his previous x86 VDSO work.
      
       - Thomas for being the dude who has to deal with any form of time(r)
         nonsense anyway
      
       - Vincenzo for being the poor sod who went through all the different
         architecture implementations in order to unify them. A lot of knowledge
         gained from VDSO implementation details to the intricacies of taming the
         build system.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: LAK <linux-arm-kernel@lists.infradead.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Cc: Dmitry Safonov <dima@arista.com>
      Cc: Andrei Vagin <avagin@openvz.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Sasha Levin <sashal@kernel.org>
      Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1906240142000.32342@nanos.tec.linutronix.de
      e7098031
    • Catalin Marinas's avatar
      arm64: compat: No need for pre-ARMv7 barriers on an ARMv8 system · 6a5b78b3
      Catalin Marinas authored
      Remove the deprecated (pre-ARMv7) compat barriers as they would not be used
      on an ARMv8 system.
      
      Fixes: a7f71a2c ("arm64: compat: Add vDSO")
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Link: https://lkml.kernel.org/r/20190624140018.GD29120@arrakis.emea.arm.com
      6a5b78b3
    • Catalin Marinas's avatar
      arm64: vdso: Remove unnecessary asm-offsets.c definitions · 94fee4d4
      Catalin Marinas authored
      Since the VDSO code has moved to C from assembly, there is no need to
      define and maintain the corresponding asm offsets.
      
      Fixes: 28b1a824 ("arm64: vdso: Substitute gettimeofday() with C implementation")
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Link: https://lkml.kernel.org/r/20190624135812.GC29120@arrakis.emea.arm.com
      94fee4d4
    • Catalin Marinas's avatar
      vdso: Remove superfluous #ifdef __KERNEL__ in vdso/datapage.h · ed75e8f6
      Catalin Marinas authored
      With the move to UAPI headers, such #ifdefs are no longer necessary.
      
      Fixes: 361f8aee ("vdso: Define standardized vdso_datapage")
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Link: https://lkml.kernel.org/r/20190624135624.GB29120@arrakis.emea.arm.com
      ed75e8f6
  2. 23 Jun, 2019 1 commit
  3. 22 Jun, 2019 25 commits
    • Vincenzo Frascino's avatar
      x86/vdso: Add clock_gettime64() entry point · 22ca9622
      Vincenzo Frascino authored
      Linux 5.1 gained the new clock_gettime64() syscall to address the Y2038
      problem on 32bit systems. The x86 VDSO is missing support for this variant
      of clock_gettime().
      
      Update the x86 specific vDSO library accordingly so it exposes the new time
      getter.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-25-vincenzo.frascino@arm.com
      22ca9622
    • Vincenzo Frascino's avatar
      x86/vdso: Add clock_getres() entry point · f66501dc
      Vincenzo Frascino authored
      The generic vDSO library provides an implementation of clock_getres()
      that can be leveraged by each architecture.
      
      Add the clock_getres() VDSO entry point on x86.
      
      [ tglx: Massaged changelog and cleaned up the function signature formatting ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-24-vincenzo.frascino@arm.com
      f66501dc
    • Vincenzo Frascino's avatar
      x86/vdso: Switch to generic vDSO implementation · 7ac87074
      Vincenzo Frascino authored
      The x86 vDSO library requires some adaptations to take advantage of the
      newly introduced generic vDSO library.
      
      Introduce the following changes:
       - Modification of vdso.c to be compliant with the common vdso datapage
       - Use of lib/vdso for gettimeofday
      
      [ tglx: Massaged changelog and cleaned up the function signature formatting ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Shijith Thotton <sthotton@marvell.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-23-vincenzo.frascino@arm.com
      7ac87074
    • Vincenzo Frascino's avatar
      arm64: vdso: Enable vDSO compat support · bfe801eb
      Vincenzo Frascino authored
      Add vDSO compat support to the arm64 build system.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-16-vincenzo.frascino@arm.com
      bfe801eb
    • Vincenzo Frascino's avatar
      arm64: compat: Get sigreturn trampolines from vDSO · f01703b3
      Vincenzo Frascino authored
      When the compat vDSO is enabled, the sigreturn trampolines are not
      anymore available through [sigpage] but through [vdso].
      
      Add the relevant code the enable the feature.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-15-vincenzo.frascino@arm.com
      f01703b3
    • Vincenzo Frascino's avatar
      arm64: elf: VDSO code page discovery · 1e3f17f5
      Vincenzo Frascino authored
      Like in normal vDSOs, when compat vDSOs are enabled the auxiliary
      vector symbol AT_SYSINFO_EHDR needs to point to the address of the
      vDSO code, to allow the dynamic linker to find it.
      
      Add the necessary code to the elf arm64 module to make this possible.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-14-vincenzo.frascino@arm.com
      1e3f17f5
    • Vincenzo Frascino's avatar
      arm64: compat: VDSO setup for compat layer · 7c1deeeb
      Vincenzo Frascino authored
      If CONFIG_GENERIC_COMPAT_VDSO is enabled, compat vDSO is installed in a
      compat (32 bit) process instead of sigpage.
      
      Add the necessary code to setup the vDSO required pages.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-13-vincenzo.frascino@arm.com
      7c1deeeb
    • Vincenzo Frascino's avatar
      arm64: vdso: Refactor vDSO code · c7aa2d71
      Vincenzo Frascino authored
      Most of the code for initializing the vDSOs in arm64 and compat will be
      shared, hence refactoring of the current code is required to avoid
      duplication and to simplify maintainability.
      
      No functional change.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-12-vincenzo.frascino@arm.com
      c7aa2d71
    • Vincenzo Frascino's avatar
      arm64: compat: Add vDSO · a7f71a2c
      Vincenzo Frascino authored
      Provide the arm64 compat (AArch32) vDSO in kernel/vdso32 in a similar
      way to what happens in kernel/vdso.
      
      The compat vDSO leverages on an adaptation of the arm architecture code
      with few changes:
      
       - Use of lib/vdso for gettimeofday
       - Implement a syscall based fallback
       - Introduce clock_getres() for the compat library
       - Implement trampolines
       - Implement elf note
      
      To build the compat vDSO a 32 bit compiler is required and needs to be
      specified via CONFIG_CROSS_COMPILE_COMPAT_VDSO.
      
      The code is not yet enabled as other prerequisites are missing.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-11-vincenzo.frascino@arm.com
      a7f71a2c
    • Vincenzo Frascino's avatar
      arm64: compat: Generate asm offsets for signals · f14d8025
      Vincenzo Frascino authored
      Update asm-offsets for arm64 to generate the correct offsets for
      compat signals.
      
      They will be useful for the implementation of the compat sigreturn
      trampolines in vDSO context.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-9-vincenzo.frascino@arm.com
      f14d8025
    • Vincenzo Frascino's avatar
      arm64: compat: Expose signal related structures · 206c0dfa
      Vincenzo Frascino authored
      The compat signal data structures are required as part of the compat
      vDSO implementation in order to provide the unwinding information for
      the sigreturn trampolines.
      
      Expose these data structures as part of signal32.h.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-8-vincenzo.frascino@arm.com
      206c0dfa
    • Vincenzo Frascino's avatar
      arm64: compat: Add missing syscall numbers · 53c489e1
      Vincenzo Frascino authored
      vDSO requires gettimeofday() and clock_gettime() syscalls to implement the
      fallback mechanism.
      
      Add the missing syscall numbers to unistd.h for arm64.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-7-vincenzo.frascino@arm.com
      53c489e1
    • Peter Collingbourne's avatar
      arm64: vdso: Build vDSO with -ffixed-x18 · 98cd3c3f
      Peter Collingbourne authored
      The vDSO needs to be built with x18 reserved in order to accommodate
      userspace platform ABIs built on top of Linux that use the register
      to carry inter-procedural state, as provided for by the AAPCS.
      An example of such a platform ABI is the one that will be used by an
      upcoming version of Android.
      
      Although this change is currently a no-op due to the fact that the vDSO
      is currently implemented in pure assembly on arm64, it is necessary
      in order to prepare for using the generic C implementation of the vDSO.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: default avatarPeter Collingbourne <pcc@google.com>
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Cc: Mark Salyzyn <salyzyn@google.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-6-vincenzo.frascino@arm.com
      98cd3c3f
    • Vincenzo Frascino's avatar
      arm64: vdso: Substitute gettimeofday() with C implementation · 28b1a824
      Vincenzo Frascino authored
      To take advantage of the commonly defined vdso interface for gettimeofday()
      the architectural code requires an adaptation.
      
      Re-implement the gettimeofday VDSO in C in order to use lib/vdso.
      
      With the new implementation arm64 gains support for CLOCK_BOOTTIME
      and CLOCK_TAI.
      
      [ tglx: Reformatted the function line breaks ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-5-vincenzo.frascino@arm.com
      28b1a824
    • Vincenzo Frascino's avatar
      timekeeping: Provide a generic update_vsyscall() implementation · 44f57d78
      Vincenzo Frascino authored
      The new generic VDSO library allows to unify the update_vsyscall[_tz]()
      implementations.
      
      Provide a generic implementation based on the x86 code and the bindings
      which need to be implemented in architecture specific code.
      
      [ tglx: Moved it into kernel/time where it belongs. Removed the pointless
        	line breaks in the stub functions. Massaged changelog ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-4-vincenzo.frascino@arm.com
      44f57d78
    • Vincenzo Frascino's avatar
      lib/vdso: Add compat support · 629fdf77
      Vincenzo Frascino authored
      Some 64 bit architectures have support for 32 bit applications that
      require a separate version of the vDSOs.
      
      Add support to the generic code for compat fallback functions.
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-10-vincenzo.frascino@arm.com
      629fdf77
    • Vincenzo Frascino's avatar
      lib/vdso: Provide generic VDSO implementation · 00b26474
      Vincenzo Frascino authored
      In the last few years the kernel gained quite some architecture specific
      vdso implementations which contain very similar code.
      
      Introduce a generic VDSO implementation of gettimeofday() which will be
      shareable between architectures once they are converted over.
      
      The implementation is based on the current x86 VDSO code.
      
      [ tglx: Massaged changelog and made the kernel doc tabular ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-3-vincenzo.frascino@arm.com
      00b26474
    • Vincenzo Frascino's avatar
      vdso: Define standardized vdso_datapage · 361f8aee
      Vincenzo Frascino authored
      Define a common formet for the vdso datapage as a preparation for sharing
      the VDSO implementation as a generic library.
      
      The datastructures are based on the current x86 layout.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-2-vincenzo.frascino@arm.com
      361f8aee
    • Vincenzo Frascino's avatar
      hrtimer: Split out hrtimer defines into separate header · 32e29396
      Vincenzo Frascino authored
      To avoid include dependency hell split out the hrtimer defines which are
      required in the upcoming VDSO library into a separate header file.
      
      [ tglx: Split out from the VDSO library patch and included ktime.h as
              the new header depends on it. ]
      Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarShijith Thotton <sthotton@marvell.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Huw Davies <huw@codeweavers.com>
      Link: https://lkml.kernel.org/r/20190621095252.32307-3-vincenzo.frascino@arm.com
      32e29396
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.2-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · b253d5f3
      Linus Torvalds authored
      Pull PCI fix from Bjorn Helgaas:
       "If an IOMMU is present, ignore the P2PDMA whitelist we added for v5.2
        because we don't yet know how to support P2PDMA in that case (Logan
        Gunthorpe)"
      
      * tag 'pci-v5.2-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI/P2PDMA: Ignore root complex whitelist when an IOMMU is present
      b253d5f3
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · f4102766
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Three driver fixes (and one version number update): a suspend hang in
        ufs, a qla hard lock on module removal and a qedi panic during
        discovery"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix hardlockup in abort command during driver remove
        scsi: ufs: Avoid runtime suspend possibly being blocked forever
        scsi: qedi: update driver version to 8.37.0.20
        scsi: qedi: Check targetname while finding boot target information
      f4102766
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.2-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a8282bf0
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "This is a frustratingly large batch at rc5. Some of these were sent
        earlier but were missed by me due to being distracted by other things,
        and some took a while to track down due to needing manual bisection on
        old hardware. But still we clearly need to improve our testing of KVM,
        and of 32-bit, so that we catch these earlier.
      
        Summary: seven fixes, all for bugs introduced this cycle.
      
         - The commit to add KASAN support broke booting on 32-bit SMP
           machines, due to a refactoring that moved some setup out of the
           secondary CPU path.
      
         - A fix for another 32-bit SMP bug introduced by the fast syscall
           entry implementation for 32-bit BOOKE. And a build fix for the same
           commit.
      
         - Our change to allow the DAWR to be force enabled on Power9
           introduced a bug in KVM, where we clobber r3 leading to a host
           crash.
      
         - The same commit also exposed a previously unreachable bug in the
           nested KVM handling of DAWR, which could lead to an oops in a
           nested host.
      
         - One of the DMA reworks broke the b43legacy WiFi driver on some
           people's powermacs, fix it by enabling a 30-bit ZONE_DMA on 32-bit.
      
         - A fix for TLB flushing in KVM introduced a new bug, as it neglected
           to also flush the ERAT, this could lead to memory corruption in the
           guest.
      
        Thanks to: Aaro Koskinen, Christoph Hellwig, Christophe Leroy, Larry
        Finger, Michael Neuling, Suraj Jitindar Singh"
      
      * tag 'powerpc-5.2-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries
        powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac
        KVM: PPC: Book3S HV: Only write DAWR[X] when handling h_set_dawr in real mode
        KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()
        powerpc/32: fix build failure on book3e with KVM
        powerpc/booke: fix fast syscall entry on SMP
        powerpc/32s: fix initial setup of segment registers on secondary CPU
      a8282bf0
    • Marcel Holtmann's avatar
      Bluetooth: Fix regression with minimum encryption key size alignment · 693cd8ce
      Marcel Holtmann authored
      When trying to align the minimum encryption key size requirement for
      Bluetooth connections, it turns out doing this in a central location in
      the HCI connection handling code is not possible.
      
      Original Bluetooth version up to 2.0 used a security model where the
      L2CAP service would enforce authentication and encryption.  Starting
      with Bluetooth 2.1 and Secure Simple Pairing that model has changed into
      that the connection initiator is responsible for providing an encrypted
      ACL link before any L2CAP communication can happen.
      
      Now connecting Bluetooth 2.1 or later devices with Bluetooth 2.0 and
      before devices are causing a regression.  The encryption key size check
      needs to be moved out of the HCI connection handling into the L2CAP
      channel setup.
      
      To achieve this, the current check inside hci_conn_security() has been
      moved into l2cap_check_enc_key_size() helper function and then called
      from four decisions point inside L2CAP to cover all combinations of
      Secure Simple Pairing enabled devices and device using legacy pairing
      and legacy service security model.
      
      Fixes: d5bb334a ("Bluetooth: Align minimum encryption key size for LE and BR/EDR connections")
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203643Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      693cd8ce
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c356dc4b
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix leak of unqueued fragments in ipv6 nf_defrag, from Guillaume
          Nault.
      
       2) Don't access the DDM interface unless the transceiver implements it
          in bnx2x, from Mauro S. M. Rodrigues.
      
       3) Don't double fetch 'len' from userspace in sock_getsockopt(), from
          JingYi Hou.
      
       4) Sign extension overflow in lio_core, from Colin Ian King.
      
       5) Various netem bug fixes wrt. corrupted packets from Jakub Kicinski.
      
       6) Fix epollout hang in hvsock, from Sunil Muthuswamy.
      
       7) Fix regression in default fib6_type, from David Ahern.
      
       8) Handle memory limits in tcp_fragment more appropriately, from Eric
          Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (24 commits)
        tcp: refine memory limit test in tcp_fragment()
        inet: clear num_timeout reqsk_alloc()
        net: mvpp2: debugfs: Add pmap to fs dump
        ipv6: Default fib6_type to RTN_UNICAST when not set
        net: hns3: Fix inconsistent indenting
        net/af_iucv: always register net_device notifier
        net/af_iucv: build proper skbs for HiperTransport
        net/af_iucv: remove GFP_DMA restriction for HiperTransport
        net: dsa: mv88e6xxx: fix shift of FID bits in mv88e6185_g1_vtu_loadpurge()
        hvsock: fix epollout hang from race condition
        net/udp_gso: Allow TX timestamp with UDP GSO
        net: netem: fix use after free and double free with packet corruption
        net: netem: fix backlog accounting for corrupted GSO frames
        net: lio_core: fix potential sign-extension overflow on large shift
        tipc: pass tunnel dev as NULL to udp_tunnel(6)_xmit_skb
        ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL
        ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL
        tun: wake up waitqueues after IFF_UP is set
        net: remove duplicate fetch in sock_getsockopt
        tipc: fix issues with early FAILOVER_MSG from peer
        ...
      c356dc4b
    • Eric Dumazet's avatar
      tcp: refine memory limit test in tcp_fragment() · b6653b36
      Eric Dumazet authored
      tcp_fragment() might be called for skbs in the write queue.
      
      Memory limits might have been exceeded because tcp_sendmsg() only
      checks limits at full skb (64KB) boundaries.
      
      Therefore, we need to make sure tcp_fragment() wont punish applications
      that might have setup very low SO_SNDBUF values.
      
      Fixes: f070ef2a ("tcp: tcp_fragment() should apply sane memory limits")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Tested-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6653b36
  4. 21 Jun, 2019 9 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 121bddf3
      Linus Torvalds authored
      Pull rdma fixes from Doug Ledford:
       "This is probably our last -rc pull request. We don't have anything
        else outstanding at the moment anyway, and with the summer months on
        us and people taking trips, I expect the next weeks leading up to the
        merge window to be pretty calm and sedate.
      
        This has two simple, no brainer fixes for the EFA driver.
      
        Then it has ten not quite so simple fixes for the hfi1 driver. The
        problem with them is that they aren't simply one liner typo fixes.
        They're still fixes, but they're more complex issues like livelock
        under heavy load where the answer was to change work queue usage and
        spinlock usage to resolve the problem, or issues with orphaned
        requests during certain types of failures like link down which
        required some more complex work to fix too. They all look like
        legitimate fixes to me, they just aren't small like I wish they were.
      
        Summary:
      
         - 2 minor EFA fixes
      
         - 10 hfi1 fixes related to scaling issues"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/efa: Handle mmap insertions overflow
        RDMA/efa: Fix success return value in case of error
        IB/hfi1: Handle port down properly in pio
        IB/hfi1: Handle wakeup of orphaned QPs for pio
        IB/hfi1: Wakeup QPs orphaned on wait list after flush
        IB/hfi1: Use aborts to trigger RC throttling
        IB/hfi1: Create inline to get extended headers
        IB/hfi1: Silence txreq allocation warnings
        IB/hfi1: Avoid hardlockup with flushlist_lock
        IB/hfi1: Correct tid qp rcd to match verbs context
        IB/hfi1: Close PSM sdma_progress sleep window
        IB/hfi1: Validate fault injection opcode user input
      121bddf3
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.2-3' of git://git.linux-nfs.org/projects/anna/linux-nfs · c036f7da
      Linus Torvalds authored
      Pull more NFS client fixes from Anna Schumaker:
       "These are mostly refcounting issues that people have found recently.
        The revert fixes a suspend recovery performance issue.
      
         - SUNRPC: Fix a credential refcount leak
      
         - Revert "SUNRPC: Declare RPC timers as TIMER_DEFERRABLE"
      
         - SUNRPC: Fix xps refcount imbalance on the error path
      
         - NFS4: Only set creation opendata if O_CREAT"
      
      * tag 'nfs-for-5.2-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        SUNRPC: Fix a credential refcount leak
        Revert "SUNRPC: Declare RPC timers as TIMER_DEFERRABLE"
        net :sunrpc :clnt :Fix xps refcount imbalance on the error path
        NFS4: Only set creation opendata if O_CREAT
      c036f7da
    • Andy Lutomirski's avatar
      x86/vdso: Prevent segfaults due to hoisted vclock reads · ff17bbe0
      Andy Lutomirski authored
      GCC 5.5.0 sometimes cleverly hoists reads of the pvclock and/or hvclock
      pages before the vclock mode checks.  This creates a path through
      vclock_gettime() in which no vclock is enabled at all (due to disabled
      TSC on old CPUs, for example) but the pvclock or hvclock page
      nevertheless read.  This will segfault on bare metal.
      
      This fixes commit 459e3a21 ("gcc-9: properly declare the
      {pv,hv}clock_page storage") in the sense that, before that commit, GCC
      didn't seem to generate the offending code.  There was nothing wrong
      with that commit per se, and -stable maintainers should backport this to
      all supported kernels regardless of whether the offending commit was
      present, since the same crash could just as easily be triggered by the
      phase of the moon.
      
      On GCC 9.1.1, this doesn't seem to affect the generated code at all, so
      I'm not too concerned about performance regressions from this fix.
      
      Cc: stable@vger.kernel.org
      Cc: x86@kernel.org
      Cc: Borislav Petkov <bp@alien8.de>
      Reported-by: default avatarDuncan Roe <duncan_roe@optusnet.com.au>
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ff17bbe0
    • Trond Myklebust's avatar
      SUNRPC: Fix a credential refcount leak · 19d55046
      Trond Myklebust authored
      All callers of __rpc_clone_client() pass in a value for args->cred,
      meaning that the credential gets assigned and referenced in
      the call to rpc_new_client().
      Reported-by: default avatarIdo Schimmel <idosch@idosch.org>
      Fixes: 79caa5fa ("SUNRPC: Cache cred of process creating the rpc_client")
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      19d55046
    • Anna Schumaker's avatar
      Revert "SUNRPC: Declare RPC timers as TIMER_DEFERRABLE" · 502980e8
      Anna Schumaker authored
      Jon Hunter reports:
        "I have been noticing intermittent failures with a system suspend test on
         some of our machines that have a NFS mounted root file-system. Bisecting
         this issue points to your commit 43123581 ("SUNRPC: Declare RPC
         timers as TIMER_DEFERRABLE") and reverting this on top of v5.2-rc3 does
         appear to resolve the problem.
      
         The cause of the suspend failure appears to be a long delay observed
         sometimes when resuming from suspend, and this is causing our test to
         timeout."
      
      This reverts commit 43123581.
      Reported-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      502980e8
    • Lin Yi's avatar
      net :sunrpc :clnt :Fix xps refcount imbalance on the error path · b9622614
      Lin Yi authored
      rpc_clnt_add_xprt take a reference to struct rpc_xprt_switch, but forget
      to release it before return, may lead to a memory leak.
      Signed-off-by: default avatarLin Yi <teroincn@163.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      b9622614
    • Benjamin Coddington's avatar
      NFS4: Only set creation opendata if O_CREAT · 90910519
      Benjamin Coddington authored
      We can end up in nfs4_opendata_alloc during task exit, in which case
      current->fs has already been cleaned up.  This leads to a crash in
      current_umask().
      
      Fix this by only setting creation opendata if we are actually doing an open
      with O_CREAT.  We can drop the check for NULL nfs4_open_createattrs, since
      O_CREAT will never be set for the recovery path.
      Suggested-by: default avatarTrond Myklebust <trondmy@hammerspace.com>
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      90910519
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · a4c33bbb
      Linus Torvalds authored
      Pull ARM fix from Russell King:
       "Just one ARM fix this time around for Jason Donenfeld, fixing a
        problem with the VDSO generation on big endian"
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8867/1: vdso: pass --be8 to linker if necessary
      a4c33bbb
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-06-21' of git://anongit.freedesktop.org/drm/drm · 0728f6c3
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Just catching up on the week since back from holidays, everything
        seems quite sane.
      
        core:
         - copy_to_user fix for really legacy codepaths.
      
        vmwgfx:
         - two dma fixes
         - one virt hw interaction fix
      
        i915:
         - modesetting fix
         - gvt fix
      
        panfrost:
         - BO unmapping fix
      
        imx:
         - image converter fixes"
      
      * tag 'drm-fixes-2019-06-21' of git://anongit.freedesktop.org/drm/drm:
        drm/i915: Don't clobber M/N values during fastset check
        drm: return -EFAULT if copy_to_user() fails
        drm/panfrost: Make sure a BO is only unmapped when appropriate
        drm/i915/gvt: ignore unexpected pvinfo write
        gpu: ipu-v3: image-convert: Fix image downsize coefficients
        gpu: ipu-v3: image-convert: Fix input bytesperline for packed formats
        gpu: ipu-v3: image-convert: Fix input bytesperline width/height align
        drm/vmwgfx: fix a warning due to missing dma_parms
        drm/vmwgfx: Honor the sg list segment size limitation
        drm/vmwgfx: Use the backdoor port if the HB port is not available
      0728f6c3