1. 19 5月, 2020 1 次提交
    • D
      kgdb: Delay "kgdbwait" to dbg_late_init() by default · b1a57bbf
      Douglas Anderson 提交于
      Using kgdb requires at least some level of architecture-level
      initialization.  If nothing else, it relies on the architecture to
      pass breakpoints / crashes onto kgdb.
      
      On some architectures this all works super early, specifically it
      starts working at some point in time before Linux parses
      early_params's.  On other architectures it doesn't.  A survey of a few
      platforms:
      
      a) x86: Presumably it all works early since "ekgdboc" is documented to
         work here.
      b) arm64: Catching crashes works; with a simple patch breakpoints can
         also be made to work.
      c) arm: Nothing in kgdb works until
         paging_init() -> devicemaps_init() -> early_trap_init()
      
      Let's be conservative and, by default, process "kgdbwait" (which tells
      the kernel to drop into the debugger ASAP at boot) a bit later at
      dbg_late_init() time.  If an architecture has tested it and wants to
      re-enable super early debugging, they can select the
      ARCH_HAS_EARLY_DEBUG KConfig option.  We'll do this for x86 to start.
      It should be noted that dbg_late_init() is still called quite early in
      the system.
      
      Note that this patch doesn't affect when kgdb runs its init.  If kgdb
      is set to initialize early it will still initialize when parsing
      early_param's.  This patch _only_ inhibits the initial breakpoint from
      "kgdbwait".  This means:
      
      * Without any extra patches arm64 platforms will at least catch
        crashes after kgdb inits.
      * arm platforms will catch crashes (and could handle a hardcoded
        kgdb_breakpoint()) any time after early_trap_init() runs, even
        before dbg_late_init().
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Link: https://lore.kernel.org/r/20200507130644.v4.4.I3113aea1b08d8ce36dc3720209392ae8b815201b@changeidSigned-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      b1a57bbf
  2. 22 4月, 2020 1 次提交
  3. 08 4月, 2020 2 次提交
  4. 21 3月, 2020 1 次提交
  5. 12 3月, 2020 2 次提交
    • N
      ima: add a new CONFIG for loading arch-specific policies · 9e2b4be3
      Nayna Jain 提交于
      Every time a new architecture defines the IMA architecture specific
      functions - arch_ima_get_secureboot() and arch_ima_get_policy(), the IMA
      include file needs to be updated. To avoid this "noise", this patch
      defines a new IMA Kconfig IMA_SECURE_AND_OR_TRUSTED_BOOT option, allowing
      the different architectures to select it.
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Acked-by: NArd Biesheuvel <ardb@kernel.org>
      Acked-by: Philipp Rudo <prudo@linux.ibm.com> (s390)
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      9e2b4be3
    • H
      x86: Select HARDIRQS_SW_RESEND on x86 · 17e5888e
      Hans de Goede 提交于
      Modern x86 laptops are starting to use GPIO pins as interrupts more
      and more, e.g. touchpads and touchscreens have almost all moved away
      from PS/2 and USB to using I2C with a GPIO pin as interrupt.
      Modern x86 laptops also have almost all moved to using s2idle instead
      of using the system S3 ACPI power state to suspend.
      
      The Intel and AMD pinctrl drivers do not define irq_retrigger handlers
      for the irqchips they register, this is causing edge triggered interrupts
      which happen while suspended using s2idle to get lost.
      
      One specific example of this is the lid switch on some devices, lid
      switches used to be handled by the embedded-controller, but now the
      lid open/closed sensor is sometimes directly connected to a GPIO pin.
      On most devices the ACPI code for this looks like this:
      
      Method (_E00, ...) {
      	Notify (LID0, 0x80) // Status Change
      }
      
      Where _E00 is an ACPI event handler for changes on both edges of the GPIO
      connected to the lid sensor, this event handler is then combined with an
      _LID method which directly reads the pin. When the device is resumed by
      opening the lid, the GPIO interrupt will wake the system, but because the
      pinctrl irqchip doesn't have an irq_retrigger handler, the Notify will not
      happen. This is not a problem in the case the _LID method directly reads
      the GPIO, because the drivers/acpi/button.c code will call _LID on resume
      anyways.
      
      But some devices have an event handler for the GPIO connected to the
      lid sensor which looks like this:
      
      Method (_E00, ...) {
      	if (LID_GPIO == One)
      		LIDS = One
      	else
      		LIDS = Zero
      	Notify (LID0, 0x80) // Status Change
      }
      
      And the _LID method returns the cached LIDS value, since on open we
      do not re-run the edge-interrupt handler when we re-enable IRQS on resume
      (because of the missing irq_retrigger handler), _LID now will keep
      reporting closed, as LIDS was never changed to reflect the open status,
      this causes userspace to re-resume the laptop again shortly after opening
      the lid.
      
      The Intel GPIO controllers do not allow implementing irq_retrigger without
      emulating it in software, at which point we are better of just using the
      generic HARDIRQS_SW_RESEND mechanism rather then re-implementing software
      emulation for this separately in aprox. 14 different pinctrl drivers.
      
      Select HARDIRQS_SW_RESEND to solve the problem of edge-triggered GPIO
      interrupts not being re-triggered on resume when they were triggered during
      suspend (s2idle) and/or when they were the cause of the wakeup.
      
      This requires
      
       008f1d60 ("x86/apic/vector: Force interupt handler invocation to irq context")
       c16816ac ("genirq: Add protection against unsafe usage of generic_handle_irq()")
      
      to protect the APIC based interrupts from being wreckaged by a software
      resend.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20200123210242.53367-1-hdegoede@redhat.com
      17e5888e
  6. 10 3月, 2020 1 次提交
  7. 03 3月, 2020 1 次提交
    • M
      kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST · 2a86f661
      Masahiro Yamada 提交于
      Most of the Kconfig commands (except defconfig and all*config) read
      the .config file as a base set of CONFIG options.
      
      When it does not exist, the files in DEFCONFIG_LIST are searched in
      this order and loaded if found.
      
      I do not see much sense in the last two lines in DEFCONFIG_LIST.
      
      [1] ARCH_DEFCONFIG
      
      The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
      ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
      
      arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
      64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
      should be a fixed string because the base config file is loaded before
      the symbol evaluation stage.
      
      Using KBUILD_DEFCONFIG makes more sense because it is fixed before
      Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
      in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
      with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
      
      [2] arch/$(ARCH)/defconfig
      
      This file path is no longer valid. The defconfig files are always located
      in the arch configs/ directories.
      
        $ find arch -name defconfig | sort
        arch/alpha/configs/defconfig
        arch/arm64/configs/defconfig
        arch/csky/configs/defconfig
        arch/nds32/configs/defconfig
        arch/riscv/configs/defconfig
        arch/s390/configs/defconfig
        arch/unicore32/configs/defconfig
      
      The path arch/*/configs/defconfig is already covered by
      "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
      not necessary.
      
      I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
      the 7 architectures listed above would end up with endless loop of
      syncconfig.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      2a86f661
  8. 26 2月, 2020 1 次提交
  9. 19 2月, 2020 1 次提交
    • D
      libnvdimm/e820: Retrieve and populate correct 'target_node' info · 7b27a862
      Dan Williams 提交于
      Use the new phys_to_target_node() and numa_map_to_online_node() helpers
      to retrieve the correct id for the 'numa_node' ("local" / online
      initiator node) and 'target_node' (offline target memory node) sysfs
      attributes.
      
      Below is an example from a 4 NUMA node system where all the memory on
      node2 is pmem / reserved. It should be noted that with the arrival of
      the ACPI HMAT table and EFI Specific Purpose Memory the kernel will
      start to see more platforms with reserved / performance differentiated
      memory in its own NUMA node. Hence all the stakeholders on the Cc for
      what is ostensibly a libnvdimm local patch.
      
      === Before ===
      
      /* Notice no online memory on node2 at start */
      
      # numactl --hardware
      available: 3 nodes (0-1,3)
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
      node 0 size: 3958 MB
      node 0 free: 3708 MB
      node 1 cpus: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
      node 1 size: 4027 MB
      node 1 free: 3871 MB
      node 3 cpus:
      node 3 size: 3994 MB
      node 3 free: 3971 MB
      node distances:
      node   0   1   3
        0:  10  21  21
        1:  21  10  21
        3:  21  21  10
      
      /*
       * Put the pmem namespace into devdax mode so it can be assigned to the
       * kmem driver
       */
      
      # ndctl create-namespace -e namespace0.0 -m devdax -f
      {
        "dev":"namespace0.0",
        "mode":"devdax",
        "map":"dev",
        "size":"3.94 GiB (4.23 GB)",
        "uuid":"1650af9b-9ba3-4704-acd6-10178399d9a3",
        [..]
      }
      
      /* Online Persistent Memory as System RAM */
      
      # daxctl reconfigure-device --mode=system-ram dax0.0
      libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
      libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
      libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
      libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
      [
        {
          "chardev":"dax0.0",
          "size":4225761280,
          "target_node":0,
          "mode":"system-ram"
        }
      ]
      reconfigured 1 device
      
      /* Note that the memory is onlined by default to the wrong node, node0 */
      
      # numactl --hardware
      available: 3 nodes (0-1,3)
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
      node 0 size: 7926 MB
      node 0 free: 7655 MB
      node 1 cpus: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
      node 1 size: 4027 MB
      node 1 free: 3871 MB
      node 3 cpus:
      node 3 size: 3994 MB
      node 3 free: 3971 MB
      node distances:
      node   0   1   3
        0:  10  21  21
        1:  21  10  21
        3:  21  21  10
      
      === After ===
      
      /* Notice that the "phys_index" error messages are gone */
      
      # daxctl reconfigure-device --mode=system-ram dax0.0
      [
        {
          "chardev":"dax0.0",
          "size":4225761280,
          "target_node":2,
          "mode":"system-ram"
        }
      ]
      reconfigured 1 device
      
      /* Notice that node2 is now correctly populated */
      
      # numactl --hardware
      available: 4 nodes (0-3)
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
      node 0 size: 3958 MB
      node 0 free: 3793 MB
      node 1 cpus: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
      node 1 size: 4027 MB
      node 1 free: 3851 MB
      node 2 cpus:
      node 2 size: 3968 MB
      node 2 free: 3968 MB
      node 3 cpus:
      node 3 size: 3994 MB
      node 3 free: 3908 MB
      node distances:
      node   0   1   2   3
        0:  10  21  21  21
        1:  21  10  21  21
        2:  21  21  10  21
        3:  21  21  21  10
      
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Ira Weiny <ira.weiny@intel.com>
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Link: https://lore.kernel.org/r/158188327614.894464.13122730362187722603.stgit@dwillia2-desk3.amr.corp.intel.com
      7b27a862
  10. 18 2月, 2020 1 次提交
  11. 17 2月, 2020 1 次提交
  12. 14 2月, 2020 2 次提交
    • F
      x86: Remove TIF_NOHZ · 68d87513
      Frederic Weisbecker 提交于
      Static keys have replaced TIF_NOHZ to optimize the calls to context
      tracking. We can now safely remove that thread flag.
      Signed-off-by: NFrederic Weisbecker <frederic@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      68d87513
    • F
      context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ · 490f561b
      Frederic Weisbecker 提交于
      A few archs (x86, arm, arm64) don't rely anymore on TIF_NOHZ to call
      into context tracking on user entry/exit but instead use static keys
      (or not) to optimize those calls. Ideally every arch should migrate to
      that behaviour in the long run.
      
      Settle a config option to let those archs remove their TIF_NOHZ
      definitions.
      Signed-off-by: NFrederic Weisbecker <frederic@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: David S. Miller <davem@davemloft.net>
      490f561b
  13. 04 2月, 2020 2 次提交
  14. 25 1月, 2020 1 次提交
  15. 24 1月, 2020 1 次提交
    • D
      x86/mpx: remove build infrastructure · 4ba68d00
      Dave Hansen 提交于
      From: Dave Hansen <dave.hansen@linux.intel.com>
      
      MPX is being removed from the kernel due to a lack of support
      in the toolchain going forward (gcc).
      
      Remove the Kconfig option and the Makefile line.  This makes
      arch/x86/mm/mpx.c and anything under an #ifdef for
      X86_INTEL_MPX dead code.
      
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: x86@kernel.org
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Hansen <dave.hansen@linux.intel.com>
      4ba68d00
  16. 20 1月, 2020 1 次提交
  17. 14 1月, 2020 1 次提交
    • D
      x86/vdso: Add time napespace page · 550a77a7
      Dmitry Safonov 提交于
      To support time namespaces in the VDSO with a minimal impact on regular non
      time namespace affected tasks, the namespace handling needs to be hidden in
      a slow path.
      
      The most obvious place is vdso_seq_begin(). If a task belongs to a time
      namespace then the VVAR page which contains the system wide VDSO data is
      replaced with a namespace specific page which has the same layout as the
      VVAR page. That page has vdso_data->seq set to 1 to enforce the slow path
      and vdso_data->clock_mode set to VCLOCK_TIMENS to enforce the time
      namespace handling path.
      
      The extra check in the case that vdso_data->seq is odd, e.g. a concurrent
      update of the VDSO data is in progress, is not really affecting regular
      tasks which are not part of a time namespace as the task is spin waiting
      for the update to finish and vdso_data->seq to become even again.
      
      If a time namespace task hits that code path, it invokes the corresponding
      time getter function which retrieves the real VVAR page, reads host time
      and then adds the offset for the requested clock which is stored in the
      special VVAR page.
      
      Allocate the time namespace page among VVAR pages and place vdso_data on
      it.  Provide __arch_get_timens_vdso_data() helper for VDSO code to get the
      code-relative position of VVARs on that special page.
      Co-developed-by: NAndrei Vagin <avagin@openvz.org>
      Signed-off-by: NAndrei Vagin <avagin@openvz.org>
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Link: https://lore.kernel.org/r/20191112012724.250792-23-dima@arista.com
      
      550a77a7
  18. 25 12月, 2019 1 次提交
  19. 18 12月, 2019 1 次提交
  20. 13 12月, 2019 1 次提交
  21. 12 12月, 2019 1 次提交
  22. 11 12月, 2019 1 次提交
  23. 10 12月, 2019 1 次提交
  24. 02 12月, 2019 1 次提交
  25. 25 11月, 2019 1 次提交
  26. 17 11月, 2019 1 次提交
    • A
      int128: move __uint128_t compiler test to Kconfig · c12d3362
      Ard Biesheuvel 提交于
      In order to use 128-bit integer arithmetic in C code, the architecture
      needs to have declared support for it by setting ARCH_SUPPORTS_INT128,
      and it requires a version of the toolchain that supports this at build
      time. This is why all existing tests for ARCH_SUPPORTS_INT128 also test
      whether __SIZEOF_INT128__ is defined, since this is only the case for
      compilers that can support 128-bit integers.
      
      Let's fold this additional test into the Kconfig declaration of
      ARCH_SUPPORTS_INT128 so that we can also use the symbol in Makefiles,
      e.g., to decide whether a certain object needs to be included in the
      first place.
      
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      c12d3362
  27. 16 11月, 2019 3 次提交
  28. 15 11月, 2019 1 次提交
  29. 13 11月, 2019 1 次提交
  30. 11 11月, 2019 1 次提交
    • N
      x86/PCI: sta2x11: use default DMA address translation · e380a039
      Nicolas Saenz Julienne 提交于
      The devices found behind this PCIe chip have unusual DMA mapping
      constraints as there is an AMBA interconnect placed in between them and
      the different PCI endpoints. The offset between physical memory
      addresses and AMBA's view is provided by reading a PCI config register,
      which is saved and used whenever DMA mapping is needed.
      
      It turns out that this DMA setup can be represented by properly setting
      'dma_pfn_offset', 'dma_bus_mask' and 'dma_mask' during the PCI device
      enable fixup. And ultimately allows us to get rid of this device's
      custom DMA functions.
      
      Aside from the code deletion and DMA setup, sta2x11_pdev_to_mapping() is
      moved to avoid warnings whenever CONFIG_PM is not enabled.
      Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      e380a039
  31. 07 11月, 2019 1 次提交
  32. 28 10月, 2019 1 次提交
  33. 18 10月, 2019 1 次提交
  34. 03 10月, 2019 1 次提交