1. 22 Nov, 2019 1 commit
    • Mike Rapoport's avatar
      mips: fix build when "48 bits virtual memory" is enabled · 3ed6751b
      Mike Rapoport authored
      With CONFIG_MIPS_VA_BITS_48=y the build fails miserably:
      
        CC      arch/mips/kernel/asm-offsets.s
      In file included from arch/mips/include/asm/pgtable.h:644,
                       from include/linux/mm.h:99,
                       from arch/mips/kernel/asm-offsets.c:15:
      include/asm-generic/pgtable.h:16:2: error: #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED
       #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED
        ^~~~~
      include/asm-generic/pgtable.h:390:28: error: unknown type name 'p4d_t'; did you mean 'pmd_t'?
       static inline int p4d_same(p4d_t p4d_a, p4d_t p4d_b)
                                  ^~~~~
                                  pmd_t
      
      [ ... more such errors ... ]
      
      scripts/Makefile.build:99: recipe for target 'arch/mips/kernel/asm-offsets.s' failed
      make[2]: *** [arch/mips/kernel/asm-offsets.s] Error 1
      
      This happens because when CONFIG_MIPS_VA_BITS_48 enables 4th level of the
      page tables, but neither pgtable-nop4d.h nor 5level-fixup.h are included to
      cope with the 5th level.
      
      Replace #ifdef conditions around includes of the pgtable-nop{m,u}d.h with
      explicit CONFIG_PGTABLE_LEVELS and add include of 5level-fixup.h for the
      case when CONFIG_PGTABLE_LEVELS==4
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mm@kvack.org
      Cc: Mike Rapoport <rppt@kernel.org>
      3ed6751b
  2. 11 Nov, 2019 9 commits
  3. 04 Nov, 2019 1 commit
  4. 01 Nov, 2019 10 commits
  5. 31 Oct, 2019 1 commit
  6. 24 Oct, 2019 9 commits
    • Thomas Bogendoerfer's avatar
      MIPS: include: remove unsued header file asm/sgi/sgi.h · 2409839a
      Thomas Bogendoerfer authored
      asm/sgi/sgi.h is unused, time to remove it.
      Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      2409839a
    • Paul Burton's avatar
      MIPS: tlbex: Fix build_restore_pagemask KScratch restore · b42aa3fd
      Paul Burton authored
      build_restore_pagemask() will restore the value of register $1/$at when
      its restore_scratch argument is non-zero, and aims to do so by filling a
      branch delay slot. Commit 0b24cae4 ("MIPS: Add missing EHB in mtc0
      -> mfc0 sequence.") added an EHB instruction (Execution Hazard Barrier)
      prior to restoring $1 from a KScratch register, in order to resolve a
      hazard that can result in stale values of the KScratch register being
      observed. In particular, P-class CPUs from MIPS with out of order
      execution pipelines such as the P5600 & P6600 are affected.
      
      Unfortunately this EHB instruction was inserted in the branch delay slot
      causing the MFC0 instruction which performs the restoration to no longer
      execute along with the branch. The result is that the $1 register isn't
      actually restored, ie. the TLB refill exception handler clobbers it -
      which is exactly the problem the EHB is meant to avoid for the P-class
      CPUs.
      
      Similarly build_get_pgd_vmalloc() will restore the value of $1/$at when
      its mode argument equals refill_scratch, and suffers from the same
      problem.
      
      Fix this by in both cases moving the EHB earlier in the emitted code.
      There's no reason it needs to immediately precede the MFC0 - it simply
      needs to be between the MTC0 & MFC0.
      
      This bug only affects Cavium Octeon systems which use
      build_fast_tlb_refill_handler().
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Fixes: 0b24cae4 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.")
      Cc: Dmitry Korotin <dkorotin@wavecomp.com>
      Cc: stable@vger.kernel.org # v3.15+
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      b42aa3fd
    • Thomas Bogendoerfer's avatar
      MIPS: SGI-IP27: reduce ARC usage to a minimum · e9422427
      Thomas Bogendoerfer authored
      IP27 uses ARC prom only for parsing prom arguments and has a hack
      for IP27 to make the ARC code behave. By introducing config symbol
      ARC_CMDLINE_ONLY IP27 only drags in ARC cmdline parsing and does
      everything else in IP27 specific code.
      Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      e9422427
    • Thomas Bogendoerfer's avatar
      MIPS: arc: use function argument for passing argc/argv to prom_init_cmdline · 7b16831d
      Thomas Bogendoerfer authored
      prom_argc and prom_argv are only used by prom_init_cmdline(), so
      we could pass them directly as function argument.
      Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      7b16831d
    • Thomas Bogendoerfer's avatar
      MIPS: arc: remove unused stuff · cbd09241
      Thomas Bogendoerfer authored
      remove unused _prom_envp and prom_argc macro.
      Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      cbd09241
    • Thomas Bogendoerfer's avatar
      MIPS: SGI-IP27: move registering of smp ops into IP27 specific code · c823f416
      Thomas Bogendoerfer authored
      Calling register_smp_ops() in plat_mem_setup() is still early enough.
      So by doing this we could remove the ugly #ifdef CONFIG_SGI_IP27 in
      fw/arc/init.c.
      Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      c823f416
    • Thomas Bogendoerfer's avatar
      MIPS: SGI-IP27: collect externs in new header file · 249be563
      Thomas Bogendoerfer authored
      IP27 code has a few externs distributed over .c files. Collect them
      together into one commcon header file.
      Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      249be563
    • Jonas Gorski's avatar
      MIPS: bmips: mark exception vectors as char arrays · e4f5cb1a
      Jonas Gorski authored
      The vectors span more than one byte, so mark them as arrays.
      
      Fixes the following build error when building when using GCC 8.3:
      
      In file included from ./include/linux/string.h:19,
                       from ./include/linux/bitmap.h:9,
                       from ./include/linux/cpumask.h:12,
                       from ./arch/mips/include/asm/processor.h:15,
                       from ./arch/mips/include/asm/thread_info.h:16,
                       from ./include/linux/thread_info.h:38,
                       from ./include/asm-generic/preempt.h:5,
                       from ./arch/mips/include/generated/asm/preempt.h:1,
                       from ./include/linux/preempt.h:81,
                       from ./include/linux/spinlock.h:51,
                       from ./include/linux/mmzone.h:8,
                       from ./include/linux/bootmem.h:8,
                       from arch/mips/bcm63xx/prom.c:10:
      arch/mips/bcm63xx/prom.c: In function 'prom_init':
      ./arch/mips/include/asm/string.h:162:11: error: '__builtin_memcpy' forming offset [2, 32] is out of the bounds [0, 1] of object 'bmips_smp_movevec' with type 'char' [-Werror=array-bounds]
         __ret = __builtin_memcpy((dst), (src), __len); \
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      arch/mips/bcm63xx/prom.c:97:3: note: in expansion of macro 'memcpy'
         memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
         ^~~~~~
      In file included from arch/mips/bcm63xx/prom.c:14:
      ./arch/mips/include/asm/bmips.h:80:13: note: 'bmips_smp_movevec' declared here
       extern char bmips_smp_movevec;
      
      Fixes: 18a1eef9 ("MIPS: BMIPS: Introduce bmips.h")
      Signed-off-by: default avatarJonas Gorski <jonas.gorski@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      e4f5cb1a
    • Rikard Falkeborn's avatar
      MIPS: Loongson: Fix GENMASK misuse · e02d026f
      Rikard Falkeborn authored
      Arguments are supposed to be ordered high then low.
      
      Fixes: 6a6f9b7d ("MIPS: Loongson: Add CFUCFG&CSR support")
      Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
      Reviewed-by: default avatarHuacai Chen <chenhc@lemote.com>
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Cc: chenhuacai@gmail.com
      Cc: jhogan@kernel.org
      Cc: jiaxun.yang@flygoat.com
      Cc: linux-mips@linux-mips.org
      Cc: linux-mips@vger.kernel.org
      Cc: paul.burton@mips.com
      Cc: ralf@linux-mips.org
      Cc: wuzhangjin@gmail.com
      Cc: zhangfx@lemote.com
      e02d026f
  7. 18 Oct, 2019 2 commits
  8. 13 Oct, 2019 7 commits
    • Linus Torvalds's avatar
      Linux 5.4-rc3 · 4f5cafb5
      Linus Torvalds authored
      4f5cafb5
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · d4615e5a
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "A few tracing fixes:
      
         - Remove lockdown from tracefs itself and moved it to the trace
           directory. Have the open functions there do the lockdown checks.
      
         - Fix a few races with opening an instance file and the instance
           being deleted (Discovered during the lockdown updates). Kept
           separate from the clean up code such that they can be backported to
           stable easier.
      
         - Clean up and consolidated the checks done when opening a trace
           file, as there were multiple checks that need to be done, and it
           did not make sense having them done in each open instance.
      
         - Fix a regression in the record mcount code.
      
         - Small hw_lat detector tracer fixes.
      
         - A trace_pipe read fix due to not initializing trace_seq"
      
      * tag 'trace-v5.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Initialize iter->seq after zeroing in tracing_read_pipe()
        tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency
        tracing/hwlat: Report total time spent in all NMIs during the sample
        recordmcount: Fix nop_mcount() function
        tracing: Do not create tracefs files if tracefs lockdown is in effect
        tracing: Add locked_down checks to the open calls of files created for tracefs
        tracing: Add tracing_check_open_get_tr()
        tracing: Have trace events system open call tracing_open_generic_tr()
        tracing: Get trace_array reference for available_tracers files
        ftrace: Get a reference counter for the trace_array on filter files
        tracefs: Revert ccbd54ff ("tracefs: Restrict tracefs when the kernel is locked down")
      d4615e5a
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.4-rc3' of... · 2581efa9
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Update/fix inspur-ipsps1 and k10temp Documentation
      
       - Fix nct7904 driver
      
       - Fix HWMON_P_MIN_ALARM mask in hwmon core
      
      * tag 'hwmon-for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: docs: Extend inspur-ipsps1 title underline
        hwmon: (nct7904) Add array fan_alarm and vsen_alarm to store the alarms in nct7904_data struct.
        docs: hwmon: Include 'inspur-ipsps1.rst' into docs
        hwmon: Fix HWMON_P_MIN_ALARM mask
        hwmon: (k10temp) Update documentation and add temp2_input info
        hwmon: (nct7904) Fix the incorrect value of vsen_mask in nct7904_data struct
      2581efa9
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 71b1b553
      Linus Torvalds authored
      Pull MTD fixes from Richard Weinberger:
       "Two fixes for MTD:
      
         - spi-nor: Fix for a regression in write_sr()
      
         - rawnand: Regression fix for the au1550nd driver"
      
      * tag 'fixes-for-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: au1550nd: Fix au_read_buf16() prototype
        mtd: spi-nor: Fix direction of the write_sr() transfer
      71b1b553
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20191012' of git://git.kernel.dk/linux-block · b27528b0
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "Single small fix for a regression in the sequence logic for linked
        commands"
      
      * tag 'for-linus-20191012' of git://git.kernel.dk/linux-block:
        io_uring: fix sequence logic for timeout requests
      b27528b0
    • Petr Mladek's avatar
      tracing: Initialize iter->seq after zeroing in tracing_read_pipe() · d303de1f
      Petr Mladek authored
      A customer reported the following softlockup:
      
      [899688.160002] NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [test.sh:16464]
      [899688.160002] CPU: 0 PID: 16464 Comm: test.sh Not tainted 4.12.14-6.23-azure #1 SLE12-SP4
      [899688.160002] RIP: 0010:up_write+0x1a/0x30
      [899688.160002] Kernel panic - not syncing: softlockup: hung tasks
      [899688.160002] RIP: 0010:up_write+0x1a/0x30
      [899688.160002] RSP: 0018:ffffa86784d4fde8 EFLAGS: 00000257 ORIG_RAX: ffffffffffffff12
      [899688.160002] RAX: ffffffff970fea00 RBX: 0000000000000001 RCX: 0000000000000000
      [899688.160002] RDX: ffffffff00000001 RSI: 0000000000000080 RDI: ffffffff970fea00
      [899688.160002] RBP: ffffffffffffffff R08: ffffffffffffffff R09: 0000000000000000
      [899688.160002] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8b59014720d8
      [899688.160002] R13: ffff8b59014720c0 R14: ffff8b5901471090 R15: ffff8b5901470000
      [899688.160002]  tracing_read_pipe+0x336/0x3c0
      [899688.160002]  __vfs_read+0x26/0x140
      [899688.160002]  vfs_read+0x87/0x130
      [899688.160002]  SyS_read+0x42/0x90
      [899688.160002]  do_syscall_64+0x74/0x160
      
      It caught the process in the middle of trace_access_unlock(). There is
      no loop. So, it must be looping in the caller tracing_read_pipe()
      via the "waitagain" label.
      
      Crashdump analyze uncovered that iter->seq was completely zeroed
      at this point, including iter->seq.seq.size. It means that
      print_trace_line() was never able to print anything and
      there was no forward progress.
      
      The culprit seems to be in the code:
      
      	/* reset all but tr, trace, and overruns */
      	memset(&iter->seq, 0,
      	       sizeof(struct trace_iterator) -
      	       offsetof(struct trace_iterator, seq));
      
      It was added by the commit 53d0aa77 ("ftrace:
      add logic to record overruns"). It was v2.6.27-rc1.
      It was the time when iter->seq looked like:
      
           struct trace_seq {
      	unsigned char		buffer[PAGE_SIZE];
      	unsigned int		len;
           };
      
      There was no "size" variable and zeroing was perfectly fine.
      
      The solution is to reinitialize the structure after or without
      zeroing.
      
      Link: http://lkml.kernel.org/r/20191011142134.11997-1-pmladek@suse.comSigned-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      d303de1f
    • Srivatsa S. Bhat (VMware)'s avatar
      tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency · fc64e4ad
      Srivatsa S. Bhat (VMware) authored
      max_latency is intended to record the maximum ever observed hardware
      latency, which may occur in either part of the loop (inner/outer). So
      we need to also consider the outer-loop sample when updating
      max_latency.
      
      Link: http://lkml.kernel.org/r/157073345463.17189.18124025522664682811.stgit@srivatsa-ubuntu
      
      Fixes: e7c15cd8 ("tracing: Added hardware latency tracer")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSrivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      fc64e4ad