1. 22 Jan, 2018 4 commits
  2. 16 Jan, 2018 4 commits
    • Sergey Senozhatsky's avatar
      printk: Never set console_may_schedule in console_trylock() · fd5f7cde
      Sergey Senozhatsky authored
      This patch, basically, reverts commit 6b97a20d ("printk:
      set may_schedule for some of console_trylock() callers").
      That commit was a mistake, it introduced a big dependency
      on the scheduler, by enabling preemption under console_sem
      in printk()->console_unlock() path, which is rather too
      critical. The patch did not significantly reduce the
      possibilities of printk() lockups, but made it possible to
      stall printk(), as has been reported by Tetsuo Handa [1].
      
      Another issues is that preemption under console_sem also
      messes up with Steven Rostedt's hand off scheme, by making
      it possible to sleep with console_sem both in console_unlock()
      and in vprintk_emit(), after acquiring the console_sem
      ownership (anywhere between printk_safe_exit_irqrestore() in
      console_trylock_spinning() and printk_safe_enter_irqsave()
      in console_unlock()). This makes hand off less likely and,
      at the same time, may result in a significant amount of
      pending logbuf messages. Preempted console_sem owner makes
      it impossible for other CPUs to emit logbuf messages, but
      does not make it impossible for other CPUs to append new
      messages to the logbuf.
      
      Reinstate the old behavior and make printk() non-preemptible.
      Should any printk() lockup reports arrive they must be handled
      in a different way.
      
      [1] http://lkml.kernel.org/r/201603022101.CAH73907.OVOOMFHFFtQJSL%20()%20I-love%20!%20SAKURA%20!%20ne%20!%20jp
      Fixes: 6b97a20d ("printk: set may_schedule for some of console_trylock() callers")
      Link: http://lkml.kernel.org/r/20180116044716.GE6607@jagdpanzerIV
      To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: akpm@linux-foundation.org
      Cc: linux-mm@kvack.org
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Byungchul Park <byungchul.park@lge.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      fd5f7cde
    • Petr Mladek's avatar
      printk: Hide console waiter logic into helpers · c162d5b4
      Petr Mladek authored
      The commit ("printk: Add console owner and waiter logic to load balance
      console writes") made vprintk_emit() and console_unlock() even more
      complicated.
      
      This patch extracts the new code into 3 helper functions. They should
      help to keep it rather self-contained. It will be easier to use and
      maintain.
      
      This patch just shuffles the existing code. It does not change
      the functionality.
      
      Link: http://lkml.kernel.org/r/20180112160837.GD24497@linux.suse
      Cc: akpm@linux-foundation.org
      Cc: linux-mm@kvack.org
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: rostedt@home.goodmis.org
      Cc: Byungchul Park <byungchul.park@lge.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: linux-kernel@vger.kernel.org
      Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Acked-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      c162d5b4
    • Steven Rostedt (VMware)'s avatar
      printk: Add console owner and waiter logic to load balance console writes · dbdda842
      Steven Rostedt (VMware) authored
      This patch implements what I discussed in Kernel Summit. I added
      lockdep annotation (hopefully correctly), and it hasn't had any splats
      (since I fixed some bugs in the first iterations). It did catch
      problems when I had the owner covering too much. But now that the owner
      is only set when actively calling the consoles, lockdep has stayed
      quiet.
      
      Here's the design again:
      
      I added a "console_owner" which is set to a task that is actively
      writing to the consoles. It is *not* the same as the owner of the
      console_lock. It is only set when doing the calls to the console
      functions. It is protected by a console_owner_lock which is a raw spin
      lock.
      
      There is a console_waiter. This is set when there is an active console
      owner that is not current, and waiter is not set. This too is protected
      by console_owner_lock.
      
      In printk() when it tries to write to the consoles, we have:
      
      	if (console_trylock())
      		console_unlock();
      
      Now I added an else, which will check if there is an active owner, and
      no current waiter. If that is the case, then console_waiter is set, and
      the task goes into a spin until it is no longer set.
      
      When the active console owner finishes writing the current message to
      the consoles, it grabs the console_owner_lock and sees if there is a
      waiter, and clears console_owner.
      
      If there is a waiter, then it breaks out of the loop, clears the waiter
      flag (because that will release the waiter from its spin), and exits.
      Note, it does *not* release the console semaphore. Because it is a
      semaphore, there is no owner. Another task may release it. This means
      that the waiter is guaranteed to be the new console owner! Which it
      becomes.
      
      Then the waiter calls console_unlock() and continues to write to the
      consoles.
      
      If another task comes along and does a printk() it too can become the
      new waiter, and we wash rinse and repeat!
      
      By Petr Mladek about possible new deadlocks:
      
      The thing is that we move console_sem only to printk() call
      that normally calls console_unlock() as well. It means that
      the transferred owner should not bring new type of dependencies.
      As Steven said somewhere: "If there is a deadlock, it was
      there even before."
      
      We could look at it from this side. The possible deadlock would
      look like:
      
      CPU0                            CPU1
      
      console_unlock()
      
        console_owner = current;
      
      				spin_lockA()
      				  printk()
      				    spin = true;
      				    while (...)
      
          call_console_drivers()
            spin_lockA()
      
      This would be a deadlock. CPU0 would wait for the lock A.
      While CPU1 would own the lockA and would wait for CPU0
      to finish calling the console drivers and pass the console_sem
      owner.
      
      But if the above is true than the following scenario was
      already possible before:
      
      CPU0
      
      spin_lockA()
        printk()
          console_unlock()
            call_console_drivers()
      	spin_lockA()
      
      By other words, this deadlock was there even before. Such
      deadlocks are prevented by using printk_deferred() in
      the sections guarded by the lock A.
      
      By Steven Rostedt:
      
      To demonstrate the issue, this module has been shown to lock up a
      system with 4 CPUs and a slow console (like a serial console). It is
      also able to lock up a 8 CPU system with only a fast (VGA) console, by
      passing in "loops=100". The changes in this commit prevent this module
      from locking up the system.
      
       #include <linux/module.h>
       #include <linux/delay.h>
       #include <linux/sched.h>
       #include <linux/mutex.h>
       #include <linux/workqueue.h>
       #include <linux/hrtimer.h>
      
       static bool stop_testing;
       static unsigned int loops = 1;
      
       static void preempt_printk_workfn(struct work_struct *work)
       {
       	int i;
      
       	while (!READ_ONCE(stop_testing)) {
       		for (i = 0; i < loops && !READ_ONCE(stop_testing); i++) {
       			preempt_disable();
       			pr_emerg("%5d%-75s\n", smp_processor_id(),
       				 " XXX NOPREEMPT");
       			preempt_enable();
       		}
       		msleep(1);
       	}
       }
      
       static struct work_struct __percpu *works;
      
       static void finish(void)
       {
       	int cpu;
      
       	WRITE_ONCE(stop_testing, true);
       	for_each_online_cpu(cpu)
       		flush_work(per_cpu_ptr(works, cpu));
       	free_percpu(works);
       }
      
       static int __init test_init(void)
       {
       	int cpu;
      
       	works = alloc_percpu(struct work_struct);
       	if (!works)
       		return -ENOMEM;
      
       	/*
       	 * This is just a test module. This will break if you
       	 * do any CPU hot plugging between loading and
       	 * unloading the module.
       	 */
      
       	for_each_online_cpu(cpu) {
       		struct work_struct *work = per_cpu_ptr(works, cpu);
      
       		INIT_WORK(work, &preempt_printk_workfn);
       		schedule_work_on(cpu, work);
       	}
      
       	return 0;
       }
      
       static void __exit test_exit(void)
       {
       	finish();
       }
      
       module_param(loops, uint, 0);
       module_init(test_init);
       module_exit(test_exit);
       MODULE_LICENSE("GPL");
      
      Link: http://lkml.kernel.org/r/20180110132418.7080-2-pmladek@suse.com
      Cc: akpm@linux-foundation.org
      Cc: linux-mm@kvack.org
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Byungchul Park <byungchul.park@lge.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      [pmladek@suse.com: Commit message about possible deadlocks]
      Acked-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      dbdda842
    • Sergey Senozhatsky's avatar
      kallsyms: remove print_symbol() function · d2279c9d
      Sergey Senozhatsky authored
      No more print_symbol()/__print_symbol() users left, remove these
      symbols.
      
      It was a very old API that encouraged people use continuous lines.
      It had been obsoleted by %pS format specifier in a normal printk()
      call.
      
      Link: http://lkml.kernel.org/r/20180105102538.GC471@jagdpanzerIV
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Suggested-by: default avatarJoe Perches <joe@perches.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      d2279c9d
  3. 09 Jan, 2018 7 commits
    • Sergey Senozhatsky's avatar
      checkpatch: add pF/pf deprecation warning · 1df7338a
      Sergey Senozhatsky authored
      We deprecated '%pF/%pf' printk specifiers, since '%pS/%ps' is now smart
      enough to handle function pointer dereference on platforms where such
      dereference is required.
      
      Link: http://lkml.kernel.org/r/20171109234830.5067-7-sergey.senozhatsky@gmail.com
      To: Tony Luck <tony.luck@intel.com>
      To: Fenghua Yu <fenghua.yu@intel.com>
      To: Helge Deller <deller@gmx.de>
      To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      To: Paul Mackerras <paulus@samba.org>
      To: Michael Ellerman <mpe@ellerman.id.au>
      To: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Andy Whitcroft <apw@canonical.com>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      1df7338a
    • Sergey Senozhatsky's avatar
      symbol lookup: introduce dereference_symbol_descriptor() · 04b8eb7a
      Sergey Senozhatsky authored
      dereference_symbol_descriptor() invokes appropriate ARCH specific
      function descriptor dereference callbacks:
      - dereference_kernel_function_descriptor() if the pointer is a
        kernel symbol;
      
      - dereference_module_function_descriptor() if the pointer is a
        module symbol.
      
      This is the last step needed to make '%pS/%ps' smart enough to
      handle function descriptor dereference on affected ARCHs and
      to retire '%pF/%pf'.
      
      To refresh it:
        Some architectures (ia64, ppc64, parisc64) use an indirect pointer
        for C function pointers - the function pointer points to a function
        descriptor and we need to dereference it to get the actual function
        pointer.
      
        Function descriptors live in .opd elf section and all affected
        ARCHs (ia64, ppc64, parisc64) handle it properly for kernel and
        modules. So we, technically, can decide if the dereference is
        needed by simply looking at the pointer: if it belongs to .opd
        section then we need to dereference it.
      
        The kernel and modules have their own .opd sections, obviously,
        that's why we need to split dereference_function_descriptor()
        and use separate kernel and module dereference arch callbacks.
      
      Link: http://lkml.kernel.org/r/20171206043649.GB15885@jagdpanzerIV
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Tested-by: Tony Luck <tony.luck@intel.com> #ia64
      Tested-by: Santosh Sivaraj <santosh@fossix.org> #powerpc
      Tested-by: Helge Deller <deller@gmx.de> #parisc64
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      04b8eb7a
    • Sergey Senozhatsky's avatar
      parisc64: Add .opd based function descriptor dereference · 1705bd6a
      Sergey Senozhatsky authored
      We are moving towards separate kernel and module function descriptor
      dereference callbacks. This patch enables it for parisc64.
      
      For pointers that belong to the kernel
      -  Added __start_opd and __end_opd pointers, to track the kernel
         .opd section address range;
      
      -  Added dereference_kernel_function_descriptor(). Now we
         will dereference only function pointers that are within
         [__start_opd, __end_opd);
      
      For pointers that belong to a module
      -  Added dereference_module_function_descriptor() to handle module
         function descriptor dereference. Now we will dereference only
         pointers that are within [module->opd.start, module->opd.end).
      
      Link: http://lkml.kernel.org/r/20171109234830.5067-5-sergey.senozhatsky@gmail.com
      To: Tony Luck <tony.luck@intel.com>
      To: Fenghua Yu <fenghua.yu@intel.com>
      To: Helge Deller <deller@gmx.de>
      To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      To: Paul Mackerras <paulus@samba.org>
      To: Michael Ellerman <mpe@ellerman.id.au>
      To: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Tested-by: Helge Deller <deller@gmx.de> #parisc64
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      1705bd6a
    • Sergey Senozhatsky's avatar
      powerpc64: Add .opd based function descriptor dereference · 5633e85b
      Sergey Senozhatsky authored
      We are moving towards separate kernel and module function descriptor
      dereference callbacks. This patch enables it for powerpc64.
      
      For pointers that belong to the kernel
      -  Added __start_opd and __end_opd pointers, to track the kernel
         .opd section address range;
      
      -  Added dereference_kernel_function_descriptor(). Now we
         will dereference only function pointers that are within
         [__start_opd, __end_opd);
      
      For pointers that belong to a module
      -  Added dereference_module_function_descriptor() to handle module
         function descriptor dereference. Now we will dereference only
         pointers that are within [module->opd.start, module->opd.end).
      
      Link: http://lkml.kernel.org/r/20171109234830.5067-4-sergey.senozhatsky@gmail.com
      To: Tony Luck <tony.luck@intel.com>
      To: Fenghua Yu <fenghua.yu@intel.com>
      To: Helge Deller <deller@gmx.de>
      To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      To: Paul Mackerras <paulus@samba.org>
      To: Michael Ellerman <mpe@ellerman.id.au>
      To: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Tested-by: Santosh Sivaraj <santosh@fossix.org> #powerpc
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      5633e85b
    • Sergey Senozhatsky's avatar
      ia64: Add .opd based function descriptor dereference · 8e307888
      Sergey Senozhatsky authored
      We are moving towards separate kernel and module function descriptor
      dereference callbacks. This patch enables it for IA64.
      
      For pointers that belong to the kernel
      -  Added __start_opd and __end_opd pointers, to track the kernel
         .opd section address range;
      
      -  Added dereference_kernel_function_descriptor(). Now we
         will dereference only function pointers that are within
         [__start_opd, __end_opd);
      
      For pointers that belong to a module
      -  Added dereference_module_function_descriptor() to handle module
         function descriptor dereference. Now we will dereference only
         pointers that are within [module->opd.start, module->opd.end).
      
      Link: http://lkml.kernel.org/r/20171109234830.5067-3-sergey.senozhatsky@gmail.com
      To: Fenghua Yu <fenghua.yu@intel.com>
      To: Helge Deller <deller@gmx.de>
      To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      To: Paul Mackerras <paulus@samba.org>
      To: Michael Ellerman <mpe@ellerman.id.au>
      To: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Tested-by: Tony Luck <tony.luck@intel.com> #ia64
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      8e307888
    • Sergey Senozhatsky's avatar
      sections: split dereference_function_descriptor() · b865ea64
      Sergey Senozhatsky authored
      There are two format specifiers to print out a pointer in symbolic
      format: '%pS/%ps' and '%pF/%pf'. On most architectures, the two
      mean exactly the same thing, but some architectures (ia64, ppc64,
      parisc64) use an indirect pointer for C function pointers, where
      the function pointer points to a function descriptor (which in
      turn contains the actual pointer to the code). The '%pF/%pf, when
      used appropriately, automatically does the appropriate function
      descriptor dereference on such architectures.
      
      The "when used appropriately" part is tricky. Basically this is
      a subtle ABI detail, specific to some platforms, that made it to
      the API level and people can be unaware of it and miss the whole
      "we need to dereference the function" business out. [1] proves
      that point (note that it fixes only '%pF' and '%pS', there might
      be '%pf' and '%ps' cases as well).
      
      It appears that we can handle everything within the affected
      arches and make '%pS/%ps' smart enough to retire '%pF/%pf'.
      Function descriptors live in .opd elf section and all affected
      arches (ia64, ppc64, parisc64) handle it properly for kernel
      and modules. So we, technically, can decide if the dereference
      is needed by simply looking at the pointer: if it belongs to
      .opd section then we need to dereference it.
      
      The kernel and modules have their own .opd sections, obviously,
      that's why we need to split dereference_function_descriptor()
      and use separate kernel and module dereference arch callbacks.
      
      This patch does the first step, it
      a) adds dereference_kernel_function_descriptor() function.
      b) adds a weak alias to dereference_module_function_descriptor()
         function.
      
      So, for the time being, we will have:
      1) dereference_function_descriptor()
         A generic function, that simply dereferences the pointer. There is
         bunch of places that call it: kgdbts, init/main.c, extable, etc.
      
      2) dereference_kernel_function_descriptor()
         A function to call on kernel symbols that does kernel .opd section
         address range test.
      
      3) dereference_module_function_descriptor()
         A function to call on modules' symbols that does modules' .opd
         section address range test.
      
      [1] https://marc.info/?l=linux-kernel&m=150472969730573
      
      Link: http://lkml.kernel.org/r/20171109234830.5067-2-sergey.senozhatsky@gmail.com
      To: Fenghua Yu <fenghua.yu@intel.com>
      To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      To: Paul Mackerras <paulus@samba.org>
      To: Michael Ellerman <mpe@ellerman.id.au>
      To: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Tested-by: Tony Luck <tony.luck@intel.com> #ia64
      Tested-by: Santosh Sivaraj <santosh@fossix.org> #powerpc
      Tested-by: Helge Deller <deller@gmx.de> #parisc64
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      b865ea64
    • Joel Stanley's avatar
      openrisc: Fix conflicting types for _exext and _stext · ce666d91
      Joel Stanley authored
      The printk tree in linux-next has a patch "symbol lookup: introduce
      dereference_symbol_descriptor()" that includes sections.h in kallsyms.h,
      so arch/openrisc/kernel/traps.c gets a second extern definition for
      _etext and _stext.
      
      Remove the local definitions and include sections.h directly in
      preparation for the kallsyms.h change.
      
      This fixes the following (future) build error:
      
        CC      arch/openrisc/kernel/traps.o
      arch/openrisc/kernel/traps.c:43:13: error: conflicting types for ‘_etext’
       extern char _etext, _stext;
                   ^
      In file included from ./arch/openrisc/include/generated/asm/sections.h:1:0,
                       from ./include/linux/kallsyms.h:15,
                       from arch/openrisc/kernel/traps.c:35:
      ./include/asm-generic/sections.h:35:32: note: previous declaration of ‘_etext’ was here
       extern char _text[], _stext[], _etext[];
                                      ^
      Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
      Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarStafford Horne <shorne@gmail.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      ce666d91
  4. 05 Jan, 2018 12 commits
    • Sergey Senozhatsky's avatar
      lib: do not use print_symbol() · d202d47b
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-13-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      d202d47b
    • Sergey Senozhatsky's avatar
      irq debug: do not use print_symbol() · 3b14f08d
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call and avoid
      using continuous lines.
      
      Link: http://lkml.kernel.org/r/20171212073453.21455-1-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      To: David Laight <David.Laight@ACULAB.COM>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      3b14f08d
    • Sergey Senozhatsky's avatar
      sysfs: do not use print_symbol() · 9e6d35ff
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-11-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      9e6d35ff
    • Sergey Senozhatsky's avatar
      drivers: do not use print_symbol() · a52668c6
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-10-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      a52668c6
    • Sergey Senozhatsky's avatar
      x86: do not use print_symbol() · 7b606162
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call and correctly
      handle continuous lines.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-9-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Borislav Petkov <bp@suse.de> # mce.c part
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      7b606162
    • Sergey Senozhatsky's avatar
      unicore32: do not use print_symbol() · cb380025
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-8-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message, fixed complication warning]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      cb380025
    • Sergey Senozhatsky's avatar
      sh: do not use print_symbol() · 9e6a42f0
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-7-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Rich Felker <dalias@libc.org>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message, fixed complication warning]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      9e6a42f0
    • Sergey Senozhatsky's avatar
      mn10300: do not use print_symbol() · 67580c9f
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-6-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      67580c9f
    • Sergey Senozhatsky's avatar
      ia64: do not use print_symbol() · 253c9620
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call and avoid
      using continuous lines.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-5-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      253c9620
    • Sergey Senozhatsky's avatar
      c6x: do not use print_symbol() · 4717fc19
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call and avoid
      using continuous lines.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-4-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      4717fc19
    • Sergey Senozhatsky's avatar
      arm64: do not use print_symbol() · 4ef79638
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-3-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      4ef79638
    • Sergey Senozhatsky's avatar
      arm: do not use print_symbol() · 3ea70d7d
      Sergey Senozhatsky authored
      print_symbol() is a very old API that has been obsoleted by %pS format
      specifier in a normal printk() call.
      
      Replace print_symbol() with a direct printk("%pS") call.
      
      Link: http://lkml.kernel.org/r/20171211125025.2270-2-sergey.senozhatsky@gmail.com
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Russell King <linux@armlinux.org.uk>
      To: Catalin Marinas <catalin.marinas@arm.com>
      To: Mark Salter <msalter@redhat.com>
      To: Tony Luck <tony.luck@intel.com>
      To: David Howells <dhowells@redhat.com>
      To: Yoshinori Sato <ysato@users.sourceforge.jp>
      To: Guan Xuetao <gxt@mprc.pku.edu.cn>
      To: Borislav Petkov <bp@alien8.de>
      To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      To: Thomas Gleixner <tglx@linutronix.de>
      To: Peter Zijlstra <peterz@infradead.org>
      To: Vineet Gupta <vgupta@synopsys.com>
      To: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-am33-list@redhat.com
      Cc: linux-sh@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: x86@kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      [pmladek@suse.com: updated commit message, fixed complication warning]
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      3ea70d7d
  5. 04 Jan, 2018 1 commit
    • Sergey Senozhatsky's avatar
      printk: add console_msg_format command line option · cca10d58
      Sergey Senozhatsky authored
      0day and kernelCI automatically parse kernel log - basically some sort
      of grepping using the pre-defined text patterns - in order to detect
      and report regressions/errors. There are several sources they get the
      kernel logs from:
      
      a) dmesg or /proc/ksmg
      
         This is the preferred way. Because `dmesg --raw' (see later Note)
         and /proc/kmsg output contains facility and log level, which greatly
         simplifies grepping for EMERG/ALERT/CRIT/ERR messages.
      
      b) serial consoles
      
         This option is harder to maintain, because serial console messages
         don't contain facility and log level.
      
      This patch introduces a `console_msg_format=' command line option,
      to switch between different message formatting on serial consoles.
      For the time being we have just two options - default and syslog.
      The "default" option just keeps the existing format. While the
      "syslog" option makes serial console messages to appear in syslog
      format [syslog() syscall], matching the `dmesg -S --raw' and
      `cat /proc/kmsg' output formats:
      
      - facility and log level
      - time stamp (depends on printk_time/PRINTK_TIME)
      - message
      
      	<%u>[time stamp] text\n
      
      NOTE: while Kevin and Fengguang talk about "dmesg --raw", it's actually
      "dmesg -S --raw" that always prints messages in syslog format [per
      Petr Mladek]. Running "dmesg --raw" may produce output in non-syslog
      format sometimes. console_msg_format=syslog enables syslog format,
      thus in documentation we mention "dmesg -S --raw", not "dmesg --raw".
      
      Per Kevin Hilman:
      
      : Right now we can get this info from a "dmesg --raw" after bootup,
      : but it would be really nice in certain automation frameworks to
      : have a kernel command-line option to enable printing of loglevels
      : in default boot log.
      :
      : This is especially useful when ingesting kernel logs into advanced
      : search/analytics frameworks (I'm playing with and ELK stack: Elastic
      : Search, Logstash, Kibana).
      :
      : The other important reason for having this on the command line is that
      : for testing linux-next (and other bleeding edge developer branches),
      : it's common that we never make it to userspace, so can't even run
      : "dmesg --raw" (or equivalent.)  So we really want this on the primary
      : boot (serial) console.
      
      Per Fengguang Wu, 0day scripts should quickly benefit from that
      feature, because they will be able to switch to a more reliable
      parsing, based on messages' facility and log levels [1]:
      
      `#{grep} -a -E -e '^<[0123]>' -e '^kern  :(err   |crit  |alert |emerg )'
      
      instead of doing text pattern matching
      
      `#{grep} -a -F -f /lkp/printk-error-messages #{kmsg_file} |
            grep -a -v -E -f #{LKP_SRC}/etc/oops-pattern |
            grep -a -v -F -f #{LKP_SRC}/etc/kmsg-blacklist`
      
      [1] https://github.com/fengguang/lkp-tests/blob/master/lib/dmesg.rb
      
      Link: http://lkml.kernel.org/r/20171221054149.4398-1-sergey.senozhatsky@gmail.com
      To: Steven Rostedt <rostedt@goodmis.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reviewed-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
      Tested-by: default avatarKevin Hilman <khilman@baylibre.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      cca10d58
  6. 08 Dec, 2017 2 commits
  7. 21 Nov, 2017 4 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk · 11ca75d2
      Linus Torvalds authored
      Pull printk updates from Petr Mladek:
      
       - print the warning about dropped messages on consoles on a separate
         line.   It makes it more legible.
      
       - one typo fix and small code clean up.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
        added new line symbol after warning about dropped messages
        printk: fix typo in printk_safe.c
        printk: simplify no_printk()
      11ca75d2
    • Linus Torvalds's avatar
      Merge tag 'fbdev-v4.15' of git://github.com/bzolnier/linux · e1d1ea54
      Linus Torvalds authored
      Pull fbdev updates from Bartlomiej Zolnierkiewicz:
       "There is nothing really major here (though removal of the dead igafb
        driver stands out in diffstat).
      
        Summary:
      
         - convert timers to use timer_setup() (Kees Cook, Thierry Reding)
      
         - fix panels support on iMX boards in mxsfb driver (Stefan Agner)
      
         - fix timeout on EDID read in udlfb driver (Ladislav Michl)
      
         - add missing modes to fix out of bounds access in controlfb driver
           (Geert Uytterhoeven)
      
         - update initialisation paths in sa1100fb driver to be more robust
           (Russell King)
      
         - fix error handling path of ->probe method in au1200fb driver
           (Christophe JAILLET)
      
         - fix handling of cases when either panel or crt is defined in
           sm501fb driver (Sudip Mukherjee, Colin Ian King)
      
         - add ability to the Goldfish FB driver to be recognized by OS via DT
           (Aleksandar Markovic)
      
         - structures constifications (Bhumika Goyal)
      
         - misc fixes (Allen Pais, Gustavo A. R. Silva, Dan Carpenter)
      
         - misc cleanups (Colin Ian King, Himanshu Jha, Markus Elfring)
      
         - remove dead igafb driver"
      
      * tag 'fbdev-v4.15' of git://github.com/bzolnier/linux: (42 commits)
        OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()
        video: fbdev: sm501fb: fix potential null pointer dereference on fbi
        fbcon: Initialize ops->info early
        video: fbdev: Convert timers to use timer_setup()
        video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup()
        fbdev: controlfb: Add missing modes to fix out of bounds access
        video: fbdev: sis_main: mark expected switch fall-throughs
        video: fbdev: cirrusfb: mark expected switch fall-throughs
        video: fbdev: aty: radeon_pm: mark expected switch fall-throughs
        video: fbdev: sm501fb: mark expected switch fall-through in sm501fb_blank_crt
        video: fbdev: intelfb: remove redundant variables
        video/fbdev/dnfb: Use common error handling code in dnfb_probe()
        sm501fb: suspend and resume fb if it exists
        sm501fb: unregister framebuffer only if registered
        sm501fb: deallocate colormap only if allocated
        video: goldfishfb: Add support for device tree bindings
        Documentation: Add device tree binding for Goldfish FB driver
        video: udlfb: Fix read EDID timeout
        video: fbdev: remove dead igafb driver
        video: fbdev: mxsfb: fix pixelclock polarity
        ...
      e1d1ea54
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · c633e898
      Linus Torvalds authored
      Pull DeviceTree fixes from Rob Herring:
      
       - Remove mc13892 as a trivial device
      
       - Improve of_find_node_by_name() documentation
      
       - Fix unit test dtc warnings
      
       - Clean-ups of USB binding documentation
      
       - Fix potential NULL deref in of_pci_map_rid
      
      * tag 'devicetree-fixes-for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: trivial-devices: Remove fsl,mc13892
        of: Document exactly what of_find_node_by_name() puts
        of: unittest: disable interrupts_property warning
        of: unittest: let dtc generate __local_fixups__
        dt-bindings: usb: document hub and host-controller properties
        dt-bindings: usb: clean up compatible property
        dt-bindings: usb: fix reg-property port-number range
        dt-bindings: usb: fix example hub node name
        of/pci: Fix theoretical NULL dereference
      c633e898
    • Linus Torvalds's avatar
      Merge tag 'jfs-4.15-2' of git://github.com/kleikamp/linux-shaggy · bf8973fc
      Linus Torvalds authored
      Pull jfs fixlet from Dave Kleikamp:
       "Update jfs git tree in MAINTAINERS"
      
      * tag 'jfs-4.15-2' of git://github.com/kleikamp/linux-shaggy:
        MAINTAINERS: fix jfs tree location
      bf8973fc
  8. 20 Nov, 2017 4 commits
    • Jonathan Neuschäfer's avatar
      dt-bindings: trivial-devices: Remove fsl,mc13892 · def4db33
      Jonathan Neuschäfer authored
      This device's bindings are not trivial: Additional properties are
      documented in in Documentation/devicetree/bindings/mfd/mc13xxx.txt.
      Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
      Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      def4db33
    • Stephen Boyd's avatar
      of: Document exactly what of_find_node_by_name() puts · 02a876b5
      Stephen Boyd authored
      It isn't clear if this function of_node_put()s the 'from'
      argument, or the node it searches. Clearly indicate which
      variable is touched. Fold in some more fixes from Randy too
      because we're in the area.
      
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      02a876b5
    • Tom Saeger's avatar
      MAINTAINERS: fix jfs tree location · 86313903
      Tom Saeger authored
      JFS tree has been moved to github.
      Signed-off-by: default avatarTom Saeger <tom.saeger@oracle.com>
      Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      86313903
    • Linus Torvalds's avatar
      Merge tag 'ntb-4.15' of git://github.com/jonmason/ntb · c8a0739b
      Linus Torvalds authored
      Pull ntb updates from Jon Mason:
       "Support for the switchtec ntb and related changes. Also, a couple of
        bug fixes"
      
      [ The timing isn't great. I had asked people to send me pull requests
        before my family vacation, and this code has not even been in
        linux-next as far as I can tell. But Logan Gunthorpe pleaded for its
        inclusion because the Switchtec driver has apparently been around for
        a while, just never in linux-next - Linus ]
      
      * tag 'ntb-4.15' of git://github.com/jonmason/ntb:
        ntb: intel: remove b2b memory window workaround for Skylake NTB
        NTB: make idt_89hpes_cfg const
        NTB: switchtec_ntb: Update switchtec documentation with notes for NTB
        NTB: switchtec_ntb: Add memory window support
        NTB: switchtec_ntb: Implement scratchpad registers
        NTB: switchtec_ntb: Implement doorbell registers
        NTB: switchtec_ntb: Add link management
        NTB: switchtec_ntb: Add skeleton NTB driver
        NTB: switchtec_ntb: Initialize hardware for doorbells and messages
        NTB: switchtec_ntb: Initialize hardware for memory windows
        NTB: switchtec_ntb: Introduce initial NTB driver
        NTB: Add check and comment for link up to mw_count() and mw_get_align()
        NTB: Ensure ntb_mw_get_align() is only called when the link is up
        NTB: switchtec: Add link event notifier callback
        NTB: switchtec: Add NTB hardware register definitions
        NTB: switchtec: Export class symbol for use in upper layer driver
        NTB: switchtec: Move structure definitions into a common header
        ntb: update maintainer list for Intel NTB driver
      c8a0739b
  9. 19 Nov, 2017 2 commits