]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Jun 2018 02:19:16 +0000 (19:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Jun 2018 02:19:16 +0000 (19:19 -0700)
Pull x86 debug updates from Ingo Molnar:
 "This contains the x86 oops code printing reorganization and cleanups
  from Borislav Betkov, with a particular focus in enhancing opcode
  dumping all around"

* 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/dumpstack: Explain the reasoning for the prologue and buffer size
  x86/dumpstack: Save first regs set for the executive summary
  x86/dumpstack: Add a show_ip() function
  x86/fault: Dump user opcode bytes on fatal faults
  x86/dumpstack: Add loglevel argument to show_opcodes()
  x86/dumpstack: Improve opcodes dumping in the code section
  x86/dumpstack: Carve out code-dumping into a function
  x86/dumpstack: Unexport oops_begin()
  x86/dumpstack: Remove code_bytes

1  2 
Documentation/admin-guide/kernel-parameters.txt
arch/x86/mm/fault.c

index 746b799e9ed82e71dfd863fbd6eb6963d78d1220,47aa554e41b73224ade02964f8c3a9f5b3745491..9d699c85d8fe85654a48be0f9dc27ae9e4f871c1
                        use by PCI
                        Format: <irq>,<irq>...
  
 -      acpi_mask_gpe=  [HW,ACPI]
 +      acpi_mask_gpe=  [HW,ACPI]
                        Due to the existence of _Lxx/_Exx, some GPEs triggered
                        by unsupported hardware/firmware features can result in
 -                        GPE floodings that cannot be automatically disabled by
 -                        the GPE dispatcher.
 +                      GPE floodings that cannot be automatically disabled by
 +                      the GPE dispatcher.
                        This facility can be used to prevent such uncontrolled
                        GPE floodings.
                        Format: <int>
                        for platform specific values (SB1, Loongson3 and
                        others).
  
 -      ccw_timeout_log [S390]
 +      ccw_timeout_log [S390]
                        See Documentation/s390/CommonIO for details.
  
 -      cgroup_disable= [KNL] Disable a particular controller
 +      cgroup_disable= [KNL] Disable a particular controller
                        Format: {name of the controller(s) to disable}
                        The effects of cgroup_disable=foo are:
                        - foo isn't auto-mounted if you mount all cgroups in
                        those clocks in any way. This parameter is useful for
                        debug and development, but should not be needed on a
                        platform with proper driver support.  For more
 -                      information, see Documentation/clk.txt.
 +                      information, see Documentation/driver-api/clk.rst.
  
        clock=          [BUGS=X86-32, HW] gettimeofday clocksource override.
                        [Deprecated]
                        Sets the size of memory pool for coherent, atomic dma
                        allocations, by default set to 256K.
  
-       code_bytes      [X86] How many bytes of object code to print
-                       in an oops report.
-                       Range: 0 - 8192
-                       Default: 64
        com20020=       [HW,NET] ARCnet - COM20020 chipset
                        Format:
                        <io>[,<irq>[,<nodeID>[,<backplane>[,<ckp>[,<timeout>]]]]]
                hvc<n>  Use the hypervisor console device <n>. This is for
                        both Xen and PowerPC hypervisors.
  
 -                If the device connected to the port is not a TTY but a braille
 -                device, prepend "brl," before the device type, for instance
 +              If the device connected to the port is not a TTY but a braille
 +              device, prepend "brl," before the device type, for instance
                        console=brl,ttyS0
                For now, only VisioBraille is supported.
  
  
        consoleblank=   [KNL] The console blank (screen saver) timeout in
                        seconds. A value of 0 disables the blank timer.
 -                       Defaults to 0.
 +                      Defaults to 0.
  
        coredump_filter=
                        [KNL] Change the default value for
                        or memory reserved is below 4G.
  
        cryptomgr.notests
 -                        [KNL] Disable crypto self-tests
 +                      [KNL] Disable crypto self-tests
  
        cs89x0_dma=     [HW,NET]
                        Format: <dma>
                        Format: <port#>,<type>
                        See also Documentation/input/devices/joystick-parport.rst
  
 -      ddebug_query=   [KNL,DYNAMIC_DEBUG] Enable debug messages at early boot
 +      ddebug_query=   [KNL,DYNAMIC_DEBUG] Enable debug messages at early boot
                        time. See
                        Documentation/admin-guide/dynamic-debug-howto.rst for
                        details.  Deprecated, see dyndbg.
                        causing system reset or hang due to sending
                        INIT from AP to BSP.
  
 -      disable_ddw     [PPC/PSERIES]
 +      disable_ddw     [PPC/PSERIES]
                        Disable Dynamic DMA Window support. Use this if
                        to workaround buggy firmware.
  
                        parameter will force ia64_sal_cache_flush to call
                        ia64_pal_cache_flush instead of SAL_CACHE_FLUSH.
  
 -      forcepae [X86-32]
 +      forcepae        [X86-32]
                        Forcefully enable Physical Address Extension (PAE).
                        Many Pentium M systems disable PAE but may have a
                        functionally usable PAE implementation.
  
        gamma=          [HW,DRM]
  
 -      gart_fix_e820=  [X86_64] disable the fix e820 for K8 GART
 +      gart_fix_e820=  [X86_64] disable the fix e820 for K8 GART
                        Format: off | on
                        default: on
  
                        x86-64 are 2M (when the CPU supports "pse") and 1G
                        (when the CPU supports the "pdpe1gb" cpuinfo flag).
  
 -      hvc_iucv=       [S390] Number of z/VM IUCV hypervisor console (HVC)
 -                             terminal devices. Valid values: 0..8
 -      hvc_iucv_allow= [S390] Comma-separated list of z/VM user IDs.
 -                             If specified, z/VM IUCV HVC accepts connections
 -                             from listed z/VM user IDs only.
 +      hung_task_panic=
 +                      [KNL] Should the hung task detector generate panics.
 +                      Format: <integer>
  
 +                      A nonzero value instructs the kernel to panic when a
 +                      hung task is detected. The default value is controlled
 +                      by the CONFIG_BOOTPARAM_HUNG_TASK_PANIC build-time
 +                      option. The value selected by this boot parameter can
 +                      be changed later by the kernel.hung_task_panic sysctl.
 +
 +      hvc_iucv=       [S390]  Number of z/VM IUCV hypervisor console (HVC)
 +                              terminal devices. Valid values: 0..8
 +      hvc_iucv_allow= [S390]  Comma-separated list of z/VM user IDs.
 +                              If specified, z/VM IUCV HVC accepts connections
 +                              from listed z/VM user IDs only.
        keep_bootcon    [KNL]
                        Do not unregister boot console at start. This is only
                        useful for debugging when something happens in the window
                        between unregistering the boot console and initializing
                        the real console.
  
 -      i2c_bus=        [HW] Override the default board specific I2C bus speed
 -                           or register an additional I2C bus that is not
 -                           registered from board initialization code.
 -                           Format:
 -                           <bus_id>,<clkrate>
 +      i2c_bus=        [HW]    Override the default board specific I2C bus speed
 +                              or register an additional I2C bus that is not
 +                              registered from board initialization code.
 +                              Format:
 +                              <bus_id>,<clkrate>
  
        i8042.debug     [HW] Toggle i8042 debug mode
        i8042.unmask_kbd_data
                        Default: only on s2r transitions on x86; most other
                        architectures force reset to be always executed
        i8042.unlock    [HW] Unlock (ignore) the keylock
 -      i8042.kbdreset  [HW] Reset device connected to KBD port
 +      i8042.kbdreset  [HW] Reset device connected to KBD port
  
        i810=           [HW,DRM]
  
                        programs exec'd, files mmap'd for exec, and all files
                        opened for read by uid=0.
  
 -      ima_template=   [IMA]
 +      ima_template=   [IMA]
                        Select one of defined IMA measurements template formats.
                        Formats: { "ima" | "ima-ng" | "ima-sig" }
                        Default: "ima-ng"
  
        ima_template_fmt=
 -                      [IMA] Define a custom template format.
 +                      [IMA] Define a custom template format.
                        Format: { "field1|...|fieldN" }
  
        ima.ahash_minsize= [IMA] Minimum file size for asynchronous hash usage
        inport.irq=     [HW] Inport (ATI XL and Microsoft) busmouse driver
                        Format: <irq>
  
 -      int_pln_enable  [x86] Enable power limit notification interrupt
 +      int_pln_enable  [x86] Enable power limit notification interrupt
  
        integrity_audit=[IMA]
                        Format: { "0" | "1" }
                        0       disables intel_idle and fall back on acpi_idle.
                        1 to 9  specify maximum depth of C-state.
  
 -      intel_pstate=  [X86]
 -                     disable
 -                       Do not enable intel_pstate as the default
 -                       scaling driver for the supported processors
 -                     passive
 -                       Use intel_pstate as a scaling driver, but configure it
 -                       to work with generic cpufreq governors (instead of
 -                       enabling its internal governor).  This mode cannot be
 -                       used along with the hardware-managed P-states (HWP)
 -                       feature.
 -                     force
 -                       Enable intel_pstate on systems that prohibit it by default
 -                       in favor of acpi-cpufreq. Forcing the intel_pstate driver
 -                       instead of acpi-cpufreq may disable platform features, such
 -                       as thermal controls and power capping, that rely on ACPI
 -                       P-States information being indicated to OSPM and therefore
 -                       should be used with caution. This option does not work with
 -                       processors that aren't supported by the intel_pstate driver
 -                       or on platforms that use pcc-cpufreq instead of acpi-cpufreq.
 -                     no_hwp
 -                       Do not enable hardware P state control (HWP)
 -                       if available.
 -              hwp_only
 -                      Only load intel_pstate on systems which support
 -                      hardware P state control (HWP) if available.
 -              support_acpi_ppc
 -                      Enforce ACPI _PPC performance limits. If the Fixed ACPI
 -                      Description Table, specifies preferred power management
 -                      profile as "Enterprise Server" or "Performance Server",
 -                      then this feature is turned on by default.
 -              per_cpu_perf_limits
 -                      Allow per-logical-CPU P-State performance control limits using
 -                      cpufreq sysfs interface
 +      intel_pstate=   [X86]
 +                      disable
 +                        Do not enable intel_pstate as the default
 +                        scaling driver for the supported processors
 +                      passive
 +                        Use intel_pstate as a scaling driver, but configure it
 +                        to work with generic cpufreq governors (instead of
 +                        enabling its internal governor).  This mode cannot be
 +                        used along with the hardware-managed P-states (HWP)
 +                        feature.
 +                      force
 +                        Enable intel_pstate on systems that prohibit it by default
 +                        in favor of acpi-cpufreq. Forcing the intel_pstate driver
 +                        instead of acpi-cpufreq may disable platform features, such
 +                        as thermal controls and power capping, that rely on ACPI
 +                        P-States information being indicated to OSPM and therefore
 +                        should be used with caution. This option does not work with
 +                        processors that aren't supported by the intel_pstate driver
 +                        or on platforms that use pcc-cpufreq instead of acpi-cpufreq.
 +                      no_hwp
 +                        Do not enable hardware P state control (HWP)
 +                        if available.
 +                      hwp_only
 +                        Only load intel_pstate on systems which support
 +                        hardware P state control (HWP) if available.
 +                      support_acpi_ppc
 +                        Enforce ACPI _PPC performance limits. If the Fixed ACPI
 +                        Description Table, specifies preferred power management
 +                        profile as "Enterprise Server" or "Performance Server",
 +                        then this feature is turned on by default.
 +                      per_cpu_perf_limits
 +                        Allow per-logical-CPU P-State performance control limits using
 +                        cpufreq sysfs interface
  
        intremap=       [X86-64, Intel-IOMMU]
                        on      enable Interrupt Remapping (default)
                nopanic
                merge
                nomerge
 -              forcesac
                soft
                pt              [x86, IA-64]
                nobypass        [PPC/POWERNV]
                        * [no]ncqtrim: Turn off queued DSM TRIM.
  
                        * nohrst, nosrst, norst: suppress hard, soft
 -                          and both resets.
 +                        and both resets.
  
                        * rstonce: only attempt one reset during
                          hot-unplug link recovery
                        [KNL,SH] Allow user to override the default size for
                        per-device physically contiguous DMA buffers.
  
 -        memhp_default_state=online/offline
 +      memhp_default_state=online/offline
                        [KNL] Set the initial state for the memory hotplug
                        onlining policy. If not specified, the default value is
                        set according to the
                        emulation library even if a 387 maths coprocessor
                        is present.
  
 +      no5lvl          [X86-64] Disable 5-level paging mode. Forces
 +                      kernel to use 4-level paging instead.
 +
        no_console_suspend
                        [HW] Never suspend the console
                        Disable suspending of consoles during suspend and
                        allow data leaks with this option, which is equivalent
                        to spectre_v2=off.
  
 +      nospec_store_bypass_disable
 +                      [HW] Disable all mitigations for the Speculative Store Bypass vulnerability
 +
        noxsave         [BUGS=X86] Disables x86 extended register state save
                        and restore using xsave. The kernel will fallback to
                        enabling legacy floating-point and sse state.
                        [X86,PV_OPS] Disable paravirtualized VMware scheduler
                        clock and use the default one.
  
 -      no-steal-acc    [X86,KVM] Disable paravirtualized steal time accounting.
 +      no-steal-acc    [X86,KVM] Disable paravirtualized steal time accounting.
                        steal time is computed, but won't influence scheduler
                        behaviour
  
        notsc           [BUGS=X86-32] Disable Time Stamp Counter
  
        nowatchdog      [KNL] Disable both lockup detectors, i.e.
 -                        soft-lockup and NMI watchdog (hard-lockup).
 +                      soft-lockup and NMI watchdog (hard-lockup).
  
        nowb            [ARM]
  
                        If the dependencies are under your control, you can
                        turn on cpu0_hotplug.
  
 -      nps_mtm_hs_ctr= [KNL,ARC]
 +      nps_mtm_hs_ctr= [KNL,ARC]
                        This parameter sets the maximum duration, in
                        cycles, each HW thread of the CTOP can run
                        without interruptions, before HW switches it.
  
        pci=option[,option...]  [PCI] various PCI subsystem options:
                earlydump       [X86] dump PCI config space before the kernel
 -                              changes anything
 +                              changes anything
                off             [X86] don't probe for the PCI bus
                bios            [X86-32] force use of PCI BIOS, don't access
                                the hardware directly. Use this if your machine
                                is enabled by default.  If you need to use this,
                                please report a bug.
                nocrs           [X86] Ignore PCI host bridge windows from ACPI.
 -                              If you need to use this, please report a bug.
 +                              If you need to use this, please report a bug.
                routeirq        Do IRQ routing for all PCI devices.
                                This is normally done in pci_enable_device(),
                                so this option is a temporary workaround
                        cache (risks via metadata attacks are mostly
                        unchanged). Debug options disable merging on their
                        own.
 -                      For more information see Documentation/vm/slub.txt.
 +                      For more information see Documentation/vm/slub.rst.
  
        slab_max_order= [MM, SLAB]
                        Determines the maximum allowed order for slabs.
                        slub_debug can create guard zones around objects and
                        may poison objects when not in use. Also tracks the
                        last alloc / free. For more information see
 -                      Documentation/vm/slub.txt.
 +                      Documentation/vm/slub.rst.
  
        slub_memcg_sysfs=       [MM, SLUB]
                        Determines whether to enable sysfs directories for
                        Determines the maximum allowed order for slabs.
                        A high setting may cause OOMs due to memory
                        fragmentation. For more information see
 -                      Documentation/vm/slub.txt.
 +                      Documentation/vm/slub.rst.
  
        slub_min_objects=       [MM, SLUB]
                        The minimum number of objects per slab. SLUB will
                        the number of objects indicated. The higher the number
                        of objects the smaller the overhead of tracking slabs
                        and the less frequently locks need to be acquired.
 -                      For more information see Documentation/vm/slub.txt.
 +                      For more information see Documentation/vm/slub.rst.
  
        slub_min_order= [MM, SLUB]
                        Determines the minimum page order for slabs. Must be
                        lower than slub_max_order.
 -                      For more information see Documentation/vm/slub.txt.
 +                      For more information see Documentation/vm/slub.rst.
  
        slub_nomerge    [MM, SLUB]
                        Same with slab_nomerge. This is supported for legacy.
                        Not specifying this option is equivalent to
                        spectre_v2=auto.
  
 +      spec_store_bypass_disable=
 +                      [HW] Control Speculative Store Bypass (SSB) Disable mitigation
 +                      (Speculative Store Bypass vulnerability)
 +
 +                      Certain CPUs are vulnerable to an exploit against a
 +                      a common industry wide performance optimization known
 +                      as "Speculative Store Bypass" in which recent stores
 +                      to the same memory location may not be observed by
 +                      later loads during speculative execution. The idea
 +                      is that such stores are unlikely and that they can
 +                      be detected prior to instruction retirement at the
 +                      end of a particular speculation execution window.
 +
 +                      In vulnerable processors, the speculatively forwarded
 +                      store can be used in a cache side channel attack, for
 +                      example to read memory to which the attacker does not
 +                      directly have access (e.g. inside sandboxed code).
 +
 +                      This parameter controls whether the Speculative Store
 +                      Bypass optimization is used.
 +
 +                      on      - Unconditionally disable Speculative Store Bypass
 +                      off     - Unconditionally enable Speculative Store Bypass
 +                      auto    - Kernel detects whether the CPU model contains an
 +                                implementation of Speculative Store Bypass and
 +                                picks the most appropriate mitigation. If the
 +                                CPU is not vulnerable, "off" is selected. If the
 +                                CPU is vulnerable the default mitigation is
 +                                architecture and Kconfig dependent. See below.
 +                      prctl   - Control Speculative Store Bypass per thread
 +                                via prctl. Speculative Store Bypass is enabled
 +                                for a process by default. The state of the control
 +                                is inherited on fork.
 +                      seccomp - Same as "prctl" above, but all seccomp threads
 +                                will disable SSB unless they explicitly opt out.
 +
 +                      Not specifying this option is equivalent to
 +                      spec_store_bypass_disable=auto.
 +
 +                      Default mitigations:
 +                      X86:    If CONFIG_SECCOMP=y "seccomp", otherwise "prctl"
 +
        spia_io_base=   [HW,MTD]
        spia_fio_base=
        spia_pedr=
                        Format: [always|madvise|never]
                        Can be used to control the default behavior of the system
                        with respect to transparent hugepages.
 -                      See Documentation/vm/transhuge.txt for more details.
 +                      See Documentation/admin-guide/mm/transhuge.rst
 +                      for more details.
  
        tsc=            Disable clocksource stability checks for TSC.
                        Format: <string>
  
        usbcore.initial_descriptor_timeout=
                        [USB] Specifies timeout for the initial 64-byte
 -                        USB_REQ_GET_DESCRIPTOR request in milliseconds
 +                      USB_REQ_GET_DESCRIPTOR request in milliseconds
                        (default 5000 = 5.0 seconds).
  
        usbcore.nousb   [USB] Disable the USB subsystem
diff --combined arch/x86/mm/fault.c
index 0e634956efdf99ee0ee78d7f35bf146214281c16,a3fd94eff04d68eaf1a5aa525c515588b2f2aff7..9a84a0d08727b7452ebea1e2e35b5ad3eb0b6e79
@@@ -209,7 -209,6 +209,7 @@@ force_sig_info_fault(int si_signo, int 
        unsigned lsb = 0;
        siginfo_t info;
  
 +      clear_siginfo(&info);
        info.si_signo   = si_signo;
        info.si_errno   = 0;
        info.si_code    = si_code;
@@@ -440,7 -439,7 +440,7 @@@ static noinline int vmalloc_fault(unsig
        if (pgd_none(*pgd_k))
                return -1;
  
 -      if (pgtable_l5_enabled) {
 +      if (pgtable_l5_enabled()) {
                if (pgd_none(*pgd)) {
                        set_pgd(pgd, *pgd_k);
                        arch_flush_lazy_mmu_mode();
        if (p4d_none(*p4d_k))
                return -1;
  
 -      if (p4d_none(*p4d) && !pgtable_l5_enabled) {
 +      if (p4d_none(*p4d) && !pgtable_l5_enabled()) {
                set_p4d(p4d, *p4d_k);
                arch_flush_lazy_mmu_mode();
        } else {
@@@ -829,6 -828,8 +829,8 @@@ static inline voi
  show_signal_msg(struct pt_regs *regs, unsigned long error_code,
                unsigned long address, struct task_struct *tsk)
  {
+       const char *loglvl = task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG;
        if (!unhandled_signal(tsk, SIGSEGV))
                return;
  
                return;
  
        printk("%s%s[%d]: segfault at %lx ip %px sp %px error %lx",
-               task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
-               tsk->comm, task_pid_nr(tsk), address,
+               loglvl, tsk->comm, task_pid_nr(tsk), address,
                (void *)regs->ip, (void *)regs->sp, error_code);
  
        print_vma_addr(KERN_CONT " in ", regs->ip);
  
        printk(KERN_CONT "\n");
+       show_opcodes((u8 *)regs->ip, loglvl);
  }
  
  static void