1. 08 3月, 2022 1 次提交
  2. 20 1月, 2022 1 次提交
  3. 14 12月, 2021 1 次提交
    • E
      exit: Rename complete_and_exit to kthread_complete_and_exit · cead1855
      Eric W. Biederman 提交于
      Update complete_and_exit to call kthread_exit instead of do_exit.
      
      Change the name to reflect this change in functionality.  All of the
      users of complete_and_exit are causing the current kthread to exit so
      this change makes it clear what is happening.
      
      Move the implementation of kthread_complete_and_exit from
      kernel/exit.c to to kernel/kthread.c.  As this function is kthread
      specific it makes most sense to live with the kthread functions.
      
      There are no functional change.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      cead1855
  4. 11 11月, 2021 1 次提交
    • V
      preempt: Restore preemption model selection configs · a8b76910
      Valentin Schneider 提交于
      Commit c597bfdd ("sched: Provide Kconfig support for default dynamic
      preempt mode") changed the selectable config names for the preemption
      model. This means a config file must now select
      
        CONFIG_PREEMPT_BEHAVIOUR=y
      
      rather than
      
        CONFIG_PREEMPT=y
      
      to get a preemptible kernel. This means all arch config files would need to
      be updated - right now they'll all end up with the default
      CONFIG_PREEMPT_NONE_BEHAVIOUR.
      
      Rather than touch a good hundred of config files, restore usage of
      CONFIG_PREEMPT{_NONE, _VOLUNTARY}. Make them configure:
      o The build-time preemption model when !PREEMPT_DYNAMIC
      o The default boot-time preemption model when PREEMPT_DYNAMIC
      
      Add siblings of those configs with the _BUILD suffix to unconditionally
      designate the build-time preemption model (PREEMPT_DYNAMIC is built with
      the "highest" preemption model it supports, aka PREEMPT). Downstream
      configs should by now all be depending / selected by CONFIG_PREEMPTION
      rather than CONFIG_PREEMPT, so only a few sites need patching up.
      Signed-off-by: NValentin Schneider <valentin.schneider@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NMarco Elver <elver@google.com>
      Link: https://lore.kernel.org/r/20211110202448.4054153-2-valentin.schneider@arm.com
      a8b76910
  5. 10 11月, 2021 4 次提交
  6. 07 11月, 2021 1 次提交
  7. 01 10月, 2021 3 次提交
  8. 19 8月, 2021 1 次提交
  9. 02 7月, 2021 2 次提交
  10. 30 6月, 2021 1 次提交
    • S
      slub: force on no_hash_pointers when slub_debug is enabled · 79270291
      Stephen Boyd 提交于
      Obscuring the pointers that slub shows when debugging makes for some
      confusing slub debug messages:
      
       Padding overwritten. 0x0000000079f0674a-0x000000000d4dce17
      
      Those addresses are hashed for kernel security reasons.  If we're trying
      to be secure with slub_debug on the commandline we have some big problems
      given that we dump whole chunks of kernel memory to the kernel logs.
      Let's force on the no_hash_pointers commandline flag when slub_debug is on
      the commandline.  This makes slub debug messages more meaningful and if by
      chance a kernel address is in some slub debug object dump we will have a
      better chance of figuring out what went wrong.
      
      Note that we don't use %px in the slub code because we want to reduce the
      number of places that %px is used in the kernel.  This also nicely prints
      a big fat warning at kernel boot if slub_debug is on the commandline so
      that we know that this kernel shouldn't be used on production systems.
      
      [akpm@linux-foundation.org: fix build with CONFIG_SLUB_DEBUG=n]
      
      Link: https://lkml.kernel.org/r/20210601182202.3011020-5-swboyd@chromium.orgSigned-off-by: NStephen Boyd <swboyd@chromium.org>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NPetr Mladek <pmladek@suse.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Muchun Song <songmuchun@bytedance.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      79270291
  11. 11 6月, 2021 1 次提交
    • J
      ice: add low level PTP clock access functions · 03cb4473
      Jacob Keller 提交于
      Add the ice_ptp_hw.c file and some associated definitions to the ice
      driver folder. This file contains basic low level definitions for
      functions that interact with the device hardware.
      
      For now, only E810-based devices are supported. The ice hardware
      supports 2 major variants which have different PHYs with different
      procedures necessary for interacting with the device clock.
      
      Because the device captures timestamps in the PHY, each PHY has its own
      internal timer. The timers are synchronized in hardware by first
      preparing the source timer and the PHY timer shadow registers, and then
      issuing a synchronization command. This ensures that both the source
      timer and PHY timers are programmed simultaneously. The timers
      themselves are all driven from the same oscillator source.
      
      The functions in ice_ptp_hw.c abstract over the differences between how
      the PHYs in E810 are programmed vs how the PHYs in E822 devices are
      programmed. This series only implements E810 support, but E822 support
      will be added in a future change.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      03cb4473
  12. 08 5月, 2021 1 次提交
    • M
      linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h> · 0ab1438b
      Masahiro Yamada 提交于
      <linux/kconfig.h> is included from all the kernel-space source files,
      including C, assembly, linker scripts. It is intended to contain a
      minimal set of macros to evaluate CONFIG options.
      
      IF_ENABLED() is an intruder here because (x ? y : z) is C code, which
      should not be included from assembly files or linker scripts.
      
      Also, <linux/kconfig.h> is no longer self-contained because NULL is
      defined in <linux/stddef.h>.
      
      Move IF_ENABLED() out to <linux/kernel.h> as PTR_IF(). PTF_IF()
      takes the general boolean expression instead of a CONFIG option
      so that it fits better in <linux/kernel.h>.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      0ab1438b
  13. 07 5月, 2021 1 次提交
  14. 17 2月, 2021 2 次提交
  15. 16 12月, 2020 1 次提交
  16. 24 11月, 2020 1 次提交
  17. 20 11月, 2020 1 次提交
  18. 26 10月, 2020 1 次提交
  19. 17 10月, 2020 1 次提交
  20. 15 9月, 2020 1 次提交
  21. 29 8月, 2020 1 次提交
  22. 13 8月, 2020 5 次提交
  23. 27 7月, 2020 1 次提交
  24. 09 6月, 2020 2 次提交
    • G
      panic: add sysctl to dump all CPUs backtraces on oops event · 60c958d8
      Guilherme G. Piccoli 提交于
      Usually when the kernel reaches an oops condition, it's a point of no
      return; in case not enough debug information is available in the kernel
      splat, one of the last resorts would be to collect a kernel crash dump
      and analyze it.  The problem with this approach is that in order to
      collect the dump, a panic is required (to kexec-load the crash kernel).
      When in an environment of multiple virtual machines, users may prefer to
      try living with the oops, at least until being able to properly shutdown
      their VMs / finish their important tasks.
      
      This patch implements a way to collect a bit more debug details when an
      oops event is reached, by printing all the CPUs backtraces through the
      usage of NMIs (on architectures that support that).  The sysctl added
      (and documented) here was called "oops_all_cpu_backtrace", and when set
      will (as the name suggests) dump all CPUs backtraces.
      
      Far from ideal, this may be the last option though for users that for
      some reason cannot panic on oops.  Most of times oopses are clear enough
      to indicate the kernel portion that must be investigated, but in virtual
      environments it's possible to observe hypervisor/KVM issues that could
      lead to oopses shown in other guests CPUs (like virtual APIC crashes).
      This patch hence aims to help debug such complex issues without
      resorting to kdump.
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Matthew Wilcox <willy@infradead.org>
      Link: http://lkml.kernel.org/r/20200327224116.21030-1-gpiccoli@canonical.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      60c958d8
    • R
      kernel: add panic_on_taint · db38d5c1
      Rafael Aquini 提交于
      Analogously to the introduction of panic_on_warn, this patch introduces
      a kernel option named panic_on_taint in order to provide a simple and
      generic way to stop execution and catch a coredump when the kernel gets
      tainted by any given flag.
      
      This is useful for debugging sessions as it avoids having to rebuild the
      kernel to explicitly add calls to panic() into the code sites that
      introduce the taint flags of interest.
      
      For instance, if one is interested in proceeding with a post-mortem
      analysis at the point a given code path is hitting a bad page (i.e.
      unaccount_page_cache_page(), or slab_bug()), a coredump can be collected
      by rebooting the kernel with 'panic_on_taint=0x20' amended to the
      command line.
      
      Another, perhaps less frequent, use for this option would be as a means
      for assuring a security policy case where only a subset of taints, or no
      single taint (in paranoid mode), is allowed for the running system.  The
      optional switch 'nousertaint' is handy in this particular scenario, as
      it will avoid userspace induced crashes by writes to sysctl interface
      /proc/sys/kernel/tainted causing false positive hits for such policies.
      
      [akpm@linux-foundation.org: tweak kernel-parameters.txt wording]
      Suggested-by: NQian Cai <cai@lca.pw>
      Signed-off-by: NRafael Aquini <aquini@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NLuis Chamberlain <mcgrof@kernel.org>
      Cc: Dave Young <dyoung@redhat.com>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Bunk <bunk@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Jeff Mahoney <jeffm@suse.com>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Takashi Iwai <tiwai@suse.de>
      Link: http://lkml.kernel.org/r/20200515175502.146720-1-aquini@redhat.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      db38d5c1
  25. 21 2月, 2020 1 次提交
    • T
      sched: Provide cant_migrate() · 4e139c77
      Thomas Gleixner 提交于
      Some code pathes rely on preempt_disable() to prevent migration on a non RT
      enabled kernel. These preempt_disable/enable() pairs are substituted by
      migrate_disable/enable() pairs or other forms of RT specific protection. On
      RT these protections prevent migration but not preemption. Obviously a
      cant_sleep() check in such a section will trigger on RT because preemption
      is not disabled.
      
      Provide a cant_migrate() macro which maps to cant_sleep() on a non RT
      kernel and an empty placeholder for RT for now. The placeholder will be
      changed to a proper debug check along with the RT specific migration
      protection mechanism.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20200214161503.070487511@linutronix.de
      4e139c77
  26. 31 12月, 2019 1 次提交
  27. 05 12月, 2019 1 次提交
  28. 25 11月, 2019 1 次提交