Merge tag 'printk-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/printk...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Apr 2021 01:09:44 +0000 (18:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Apr 2021 01:09:44 +0000 (18:09 -0700)
Pull printk updates from Petr Mladek:

 - Stop synchronizing kernel log buffer readers by logbuf_lock. As a
   result, the access to the buffer is fully lockless now.

   Note that printk() itself still uses locks because it tries to flush
   the messages to the console immediately. Also the per-CPU temporary
   buffers are still there because they prevent infinite recursion and
   serialize backtraces from NMI. All this is going to change in the
   future.

 - kmsg_dump API rework and cleanup as a side effect of the logbuf_lock
   removal.

 - Make bstr_printf() aware that %pf and %pF formats could deference the
   given pointer.

 - Show also page flags by %pGp format.

 - Clarify the documentation for plain pointer printing.

 - Do not show no_hash_pointers warning multiple times.

 - Update Senozhatsky email address.

 - Some clean up.

* tag 'printk-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: (24 commits)
  lib/vsprintf.c: remove leftover 'f' and 'F' cases from bstr_printf()
  printk: clarify the documentation for plain pointer printing
  kernel/printk.c: Fixed mundane typos
  printk: rename vprintk_func to vprintk
  vsprintf: dump full information of page flags in pGp
  mm, slub: don't combine pr_err with INFO
  mm, slub: use pGp to print page flags
  MAINTAINERS: update Senozhatsky email address
  lib/vsprintf: do not show no_hash_pointers message multiple times
  printk: console: remove unnecessary safe buffer usage
  printk: kmsg_dump: remove _nolock() variants
  printk: remove logbuf_lock
  printk: introduce a kmsg_dump iterator
  printk: kmsg_dumper: remove @active field
  printk: add syslog_lock
  printk: use atomic64_t for devkmsg_user.seq
  printk: use seqcount_latch for clear_seq
  printk: introduce CONSOLE_LOG_MAX
  printk: consolidate kmsg_dump_get_buffer/syslog_print_all code
  printk: refactor kmsg_dump_get_buffer()
  ...

1  2 
MAINTAINERS
arch/powerpc/xmon/xmon.c
drivers/hv/vmbus_drv.c
kernel/debug/kdb/kdb_main.c
mm/slub.c

diff --cc MAINTAINERS
Simple merge
Simple merge
@@@ -1399,7 -1391,9 +1399,8 @@@ static irqreturn_t vmbus_percpu_isr(in
  static void hv_kmsg_dump(struct kmsg_dumper *dumper,
                         enum kmsg_dump_reason reason)
  {
+       struct kmsg_dump_iter iter;
        size_t bytes_written;
 -      phys_addr_t panic_pa;
  
        /* We are only interested in panics. */
        if ((reason != KMSG_DUMP_PANIC) || (!sysctl_record_panic_msg))
         * Write dump contents to the page. No need to synchronize; panic should
         * be single-threaded.
         */
-       kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE,
+       kmsg_dump_rewind(&iter);
+       kmsg_dump_get_buffer(&iter, false, hv_panic_page, HV_HYP_PAGE_SIZE,
                             &bytes_written);
 -      if (bytes_written)
 -              hyperv_report_panic_msg(panic_pa, bytes_written);
 +      if (!bytes_written)
 +              return;
 +      /*
 +       * P3 to contain the physical address of the panic page & P4 to
 +       * contain the size of the panic data in that page. Rest of the
 +       * registers are no-op when the NOTIFY_MSG flag is set.
 +       */
 +      hv_set_register(HV_REGISTER_CRASH_P0, 0);
 +      hv_set_register(HV_REGISTER_CRASH_P1, 0);
 +      hv_set_register(HV_REGISTER_CRASH_P2, 0);
 +      hv_set_register(HV_REGISTER_CRASH_P3, virt_to_phys(hv_panic_page));
 +      hv_set_register(HV_REGISTER_CRASH_P4, bytes_written);
 +
 +      /*
 +       * Let Hyper-V know there is crash data available along with
 +       * the panic message.
 +       */
 +      hv_set_register(HV_REGISTER_CRASH_CTL,
 +             (HV_CRASH_CTL_CRASH_NOTIFY | HV_CRASH_CTL_CRASH_NOTIFY_MSG));
  }
  
  static struct kmsg_dumper hv_kmsg_dumper = {
Simple merge
diff --cc mm/slub.c
Simple merge