OSDN Git Service

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 May 2019 18:00:20 +0000 (11:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 May 2019 18:00:20 +0000 (11:00 -0700)
Pull time fixes from Ingo Molnar:
 "A TIA adjtimex interface extension, and a POSIX compliance ABI fix for
  timespec64 users"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  ntp: Allow TAI-UTC offset to be set to zero
  y2038: Make CONFIG_64BIT_TIME unconditional

1  2 
arch/Kconfig
kernel/time/ntp.c

diff --combined arch/Kconfig
@@@ -245,21 -245,10 +245,21 @@@ config ARCH_HAS_FORTIFY_SOURC
          An architecture should select this when it can successfully
          build and run with CONFIG_FORTIFY_SOURCE.
  
 +#
 +# Select if the arch provides a historic keepinit alias for the retain_initrd
 +# command line option
 +#
 +config ARCH_HAS_KEEPINITRD
 +      bool
 +
  # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
  config ARCH_HAS_SET_MEMORY
        bool
  
 +# Select if arch has all set_direct_map_invalid/default() functions
 +config ARCH_HAS_SET_DIRECT_MAP
 +      bool
 +
  # Select if arch init_task must go in the __init_task_data section
  config ARCH_TASK_STRUCT_ON_STACK
         bool
@@@ -394,13 -383,7 +394,13 @@@ config HAVE_ARCH_JUMP_LABEL_RELATIV
  config HAVE_RCU_TABLE_FREE
        bool
  
 -config HAVE_RCU_TABLE_INVALIDATE
 +config HAVE_RCU_TABLE_NO_INVALIDATE
 +      bool
 +
 +config HAVE_MMU_GATHER_PAGE_SIZE
 +      bool
 +
 +config HAVE_MMU_GATHER_NO_GATHER
        bool
  
  config ARCH_HAVE_NMI_SAFE_CMPXCHG
@@@ -781,7 -764,7 +781,7 @@@ config COMPAT_OLD_SIGACTIO
        bool
  
  config 64BIT_TIME
-       def_bool ARCH_HAS_64BIT_TIME
+       def_bool y
        help
          This should be selected by all architectures that need to support
          new system calls with a 64-bit time_t. This is relevant on all 32-bit
@@@ -918,15 -901,6 +918,15 @@@ config HAVE_ARCH_PREL32_RELOCATION
  config ARCH_USE_MEMREMAP_PROT
        bool
  
 +config LOCK_EVENT_COUNTS
 +      bool "Locking event counts collection"
 +      depends on DEBUG_FS
 +      ---help---
 +        Enable light-weight counting of various locking related events
 +        in the system with minimal performance impact. This reduces
 +        the chance of application behavior change because of timing
 +        differences. The counts are reported via debugfs.
 +
  source "kernel/gcov/Kconfig"
  
  source "scripts/gcc-plugins/Kconfig"
diff --combined kernel/time/ntp.c
@@@ -17,7 -17,6 +17,7 @@@
  #include <linux/mm.h>
  #include <linux/module.h>
  #include <linux/rtc.h>
 +#include <linux/audit.h>
  
  #include "ntp_internal.h"
  #include "timekeeping_internal.h"
@@@ -691,7 -690,7 +691,7 @@@ static inline void process_adjtimex_mod
                time_constant = max(time_constant, 0l);
        }
  
-       if (txc->modes & ADJ_TAI && txc->constant > 0)
+       if (txc->modes & ADJ_TAI && txc->constant >= 0)
                *time_tai = txc->constant;
  
        if (txc->modes & ADJ_OFFSET)
   * kernel time-keeping variables. used by xntpd.
   */
  int __do_adjtimex(struct __kernel_timex *txc, const struct timespec64 *ts,
 -                s32 *time_tai)
 +                s32 *time_tai, struct audit_ntp_data *ad)
  {
        int result;
  
                        /* adjtime() is independent from ntp_adjtime() */
                        time_adjust = txc->offset;
                        ntp_update_frequency();
 +
 +                      audit_ntp_set_old(ad, AUDIT_NTP_ADJUST, save_adjust);
 +                      audit_ntp_set_new(ad, AUDIT_NTP_ADJUST, time_adjust);
                }
                txc->offset = save_adjust;
        } else {
 -
                /* If there are input parameters, then process them: */
 -              if (txc->modes)
 +              if (txc->modes) {
 +                      audit_ntp_set_old(ad, AUDIT_NTP_OFFSET, time_offset);
 +                      audit_ntp_set_old(ad, AUDIT_NTP_FREQ,   time_freq);
 +                      audit_ntp_set_old(ad, AUDIT_NTP_STATUS, time_status);
 +                      audit_ntp_set_old(ad, AUDIT_NTP_TAI,    *time_tai);
 +                      audit_ntp_set_old(ad, AUDIT_NTP_TICK,   tick_usec);
 +
                        process_adjtimex_modes(txc, time_tai);
  
 +                      audit_ntp_set_new(ad, AUDIT_NTP_OFFSET, time_offset);
 +                      audit_ntp_set_new(ad, AUDIT_NTP_FREQ,   time_freq);
 +                      audit_ntp_set_new(ad, AUDIT_NTP_STATUS, time_status);
 +                      audit_ntp_set_new(ad, AUDIT_NTP_TAI,    *time_tai);
 +                      audit_ntp_set_new(ad, AUDIT_NTP_TICK,   tick_usec);
 +              }
 +
                txc->offset = shift_right(time_offset * NTP_INTERVAL_FREQ,
                                  NTP_SCALE_SHIFT);
                if (!(time_status & STA_NANO))