]> Git Repo - J-linux.git/commitdiff
Merge tag 'timers-core-2024-05-12' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Tue, 14 May 2024 16:27:40 +0000 (09:27 -0700)
committerLinus Torvalds <[email protected]>
Tue, 14 May 2024 16:27:40 +0000 (09:27 -0700)
Pull timers and timekeeping updates from Thomas Gleixner:
 "Core code:

   - Make timekeeping and VDSO time readouts resilent against math
     overflow:

     In guest context the kernel is prone to math overflow when the host
     defers the timer interrupt due to overload, malfunction or malice.

     This can be mitigated by checking the clocksource delta for the
     maximum deferrement which is readily available. If that value is
     exceeded then the code uses a slowpath function which can handle
     the multiplication overflow.

     This functionality is enabled unconditionally in the kernel, but
     made conditional in the VDSO code. The latter is conditional
     because it allows architectures to optimize the check so it is not
     causing performance regressions.

     On X86 this is achieved by reworking the existing check for
     negative TSC deltas as a negative delta obviously exceeds the
     maximum deferrement when it is evaluated as an unsigned value. That
     avoids two conditionals in the hotpath and allows to hide both the
     negative delta and the large delta handling in the same slow path.

   - Add an initial minimal ktime_t abstraction for Rust

   - The usual boring cleanups and enhancements

  Drivers:

   - Boring updates to device trees and trivial enhancements in various
     drivers"

* tag 'timers-core-2024-05-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (33 commits)
  clocksource/drivers/arm_arch_timer: Mark hisi_161010101_oem_info const
  clocksource/drivers/timer-ti-dm: Remove an unused field in struct dmtimer
  clocksource/drivers/renesas-ostm: Avoid reprobe after successful early probe
  clocksource/drivers/renesas-ostm: Allow OSTM driver to reprobe for RZ/V2H(P) SoC
  dt-bindings: timer: renesas: ostm: Document Renesas RZ/V2H(P) SoC
  rust: time: doc: Add missing C header links
  clocksource: Make the int help prompt unit readable in ncurses
  hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active()
  timerqueue: Remove never used function timerqueue_node_expires()
  rust: time: Add Ktime
  vdso: Fix powerpc build U64_MAX undeclared error
  clockevents: Convert s[n]printf() to sysfs_emit()
  clocksource: Convert s[n]printf() to sysfs_emit()
  clocksource: Make watchdog and suspend-timing multiplication overflow safe
  timekeeping: Let timekeeping_cycles_to_ns() handle both under and overflow
  timekeeping: Make delta calculation overflow safe
  timekeeping: Prepare timekeeping_cycles_to_ns() for overflow safety
  timekeeping: Fold in timekeeping_delta_to_ns()
  timekeeping: Consolidate timekeeping helpers
  timekeeping: Refactor timekeeping helpers
  ...

1  2 
arch/x86/Kconfig

diff --combined arch/x86/Kconfig
index fe196f49d27828a314b4438a3ef99c4c4d480991,4e251ba3bad261a27367e980095e2fd814ff3931..07e8817278a4c6b3415c93f8554cfb5b22b451c5
@@@ -62,7 -62,6 +62,7 @@@ config X8
        select ACPI_HOTPLUG_CPU                 if ACPI_PROCESSOR && HOTPLUG_CPU
        select ARCH_32BIT_OFF_T                 if X86_32
        select ARCH_CLOCKSOURCE_INIT
 +      select ARCH_CONFIGURES_CPU_MITIGATIONS
        select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
        select ARCH_ENABLE_HUGEPAGE_MIGRATION if X86_64 && HUGETLB_PAGE && MIGRATION
        select ARCH_ENABLE_MEMORY_HOTPLUG if X86_64
        select GENERIC_TIME_VSYSCALL
        select GENERIC_GETTIMEOFDAY
        select GENERIC_VDSO_TIME_NS
+       select GENERIC_VDSO_OVERFLOW_PROTECT
        select GUP_GET_PXX_LOW_HIGH             if X86_PAE
        select HARDIRQS_SW_RESEND
        select HARDLOCKUP_CHECK_TIMESTAMP       if X86_64
@@@ -501,11 -501,12 +502,11 @@@ config X86_FRE
          When enabled, try to use Flexible Return and Event Delivery
          instead of the legacy SYSCALL/SYSENTER/IDT architecture for
          ring transitions and exception/interrupt handling if the
 -        system supports.
 +        system supports it.
  
 -if X86_32
  config X86_BIGSMP
        bool "Support for big SMP systems with more than 8 CPUs"
 -      depends on SMP
 +      depends on SMP && X86_32
        help
          This option is needed for the systems that have more than 8 CPUs.
  
@@@ -518,10 -519,7 +519,10 @@@ config X86_EXTENDED_PLATFOR
          systems out there.)
  
          If you enable this option then you'll be able to select support
 -        for the following (non-PC) 32 bit x86 platforms:
 +        for the following non-PC x86 platforms, depending on the value of
 +        CONFIG_64BIT.
 +
 +        32-bit platforms (CONFIG_64BIT=n):
                Goldfish (Android emulator)
                AMD Elan
                RDC R-321x SoC
                STA2X11-based (e.g. Northville)
                Moorestown MID devices
  
 -        If you have one of these systems, or if you want to build a
 -        generic distribution kernel, say Y here - otherwise say N.
 -endif # X86_32
 -
 -if X86_64
 -config X86_EXTENDED_PLATFORM
 -      bool "Support for extended (non-PC) x86 platforms"
 -      default y
 -      help
 -        If you disable this option then the kernel will only support
 -        standard PC platforms. (which covers the vast majority of
 -        systems out there.)
 -
 -        If you enable this option then you'll be able to select support
 -        for the following (non-PC) 64 bit x86 platforms:
 +        64-bit platforms (CONFIG_64BIT=y):
                Numascale NumaChip
                ScaleMP vSMP
                SGI Ultraviolet
  
          If you have one of these systems, or if you want to build a
          generic distribution kernel, say Y here - otherwise say N.
 -endif # X86_64
 +
  # This is an alphabetically sorted list of 64 bit extended platforms
  # Please maintain the alphabetic order if and when there are additions
  config X86_NUMACHIP
@@@ -2418,20 -2430,18 +2419,20 @@@ source "kernel/livepatch/Kconfig
  endmenu
  
  config CC_HAS_NAMED_AS
 -      def_bool CC_IS_GCC && GCC_VERSION >= 120100
 +      def_bool CC_IS_GCC && GCC_VERSION >= 90100
 +
 +config CC_HAS_NAMED_AS_FIXED_SANITIZERS
 +      def_bool CC_IS_GCC && GCC_VERSION >= 130300
  
  config USE_X86_SEG_SUPPORT
        def_bool y
        depends on CC_HAS_NAMED_AS
        #
 -      # -fsanitize=kernel-address (KASAN) is at the moment incompatible
 -      # with named address spaces - see GCC PR sanitizer/111736.
 +      # -fsanitize=kernel-address (KASAN) and -fsanitize=thread
 +      # (KCSAN) are incompatible with named address spaces with
 +      # GCC < 13.3 - see GCC PR sanitizer/111736.
        #
 -      depends on !KASAN
 -      # -fsanitize=thread (KCSAN) is also incompatible.
 -      depends on !KCSAN
 +      depends on !(KASAN || KCSAN) || CC_HAS_NAMED_AS_FIXED_SANITIZERS
  
  config CC_HAS_SLS
        def_bool $(cc-option,-mharden-sls=all)
@@@ -2479,21 -2489,17 +2480,21 @@@ config PREFIX_SYMBOL
        def_bool y
        depends on CALL_PADDING && !CFI_CLANG
  
 -menuconfig SPECULATION_MITIGATIONS
 -      bool "Mitigations for speculative execution vulnerabilities"
 +menuconfig CPU_MITIGATIONS
 +      bool "Mitigations for CPU vulnerabilities"
        default y
        help
 -        Say Y here to enable options which enable mitigations for
 -        speculative execution hardware vulnerabilities.
 +        Say Y here to enable options which enable mitigations for hardware
 +        vulnerabilities (usually related to speculative execution).
 +        Mitigations can be disabled or restricted to SMT systems at runtime
 +        via the "mitigations" kernel parameter.
  
 -        If you say N, all mitigations will be disabled. You really
 -        should know what you are doing to say so.
 +        If you say N, all mitigations will be disabled.  This CANNOT be
 +        overridden at runtime.
  
 -if SPECULATION_MITIGATIONS
 +        Say 'Y', unless you really know what you are doing.
 +
 +if CPU_MITIGATIONS
  
  config MITIGATION_PAGE_TABLE_ISOLATION
        bool "Remove the kernel mapping in user mode"
@@@ -2628,16 -2634,6 +2629,16 @@@ config MITIGATION_RFD
          stored in floating point, vector and integer registers.
          See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
  
 +config MITIGATION_SPECTRE_BHI
 +      bool "Mitigate Spectre-BHB (Branch History Injection)"
 +      depends on CPU_SUP_INTEL
 +      default y
 +      help
 +        Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks
 +        where the branch history buffer is poisoned to speculatively steer
 +        indirect branches.
 +        See <file:Documentation/admin-guide/hw-vuln/spectre.rst>
 +
  endif
  
  config ARCH_HAS_ADD_PAGES
This page took 0.096492 seconds and 4 git commands to generate.