<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/hvc, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-07-17T09:57:51Z</updated>
<entry>
<title>docs: powerpc: convert docs to ReST and rename to *.rst</title>
<updated>2019-07-17T09:57:51Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-04-10T11:32:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d2e26a38fbcde2ba14882cbdb845caa1c17e19b'/>
<id>urn:sha1:4d2e26a38fbcde2ba14882cbdb845caa1c17e19b</id>
<content type='text'>
Convert docs to ReST and add them to the arch-specific
book.

The conversion here was trivial, as almost every file there
was already using an elegant format close to ReST standard.

The changes were mostly to mark literal blocks and add a few
missing section title identifiers.

One note with regards to "--": on Sphinx, this can't be used
to identify a list, as it will format it badly. This can be
used, however, to identify a long hyphen - and "---" is an
even longer one.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Acked-by: Andrew Donnellan &lt;andrew.donnellan@au1.ibm.com&gt; # cxl
</content>
</entry>
<entry>
<title>powerpc/pseries/hvconsole: Fix stack overread via udbg</title>
<updated>2019-06-14T05:35:53Z</updated>
<author>
<name>Daniel Axtens</name>
<email>dja@axtens.net</email>
</author>
<published>2019-06-03T06:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=934bda59f286d0221f1a3ebab7f5156a996cc37d'/>
<id>urn:sha1:934bda59f286d0221f1a3ebab7f5156a996cc37d</id>
<content type='text'>
While developing KASAN for 64-bit book3s, I hit the following stack
over-read.

It occurs because the hypercall to put characters onto the terminal
takes 2 longs (128 bits/16 bytes) of characters at a time, and so
hvc_put_chars() would unconditionally copy 16 bytes from the argument
buffer, regardless of supplied length. However, udbg_hvc_putc() can
call hvc_put_chars() with a single-byte buffer, leading to the error.

  ==================================================================
  BUG: KASAN: stack-out-of-bounds in hvc_put_chars+0xdc/0x110
  Read of size 8 at addr c0000000023e7a90 by task swapper/0

  CPU: 0 PID: 0 Comm: swapper Not tainted 5.2.0-rc2-next-20190528-02824-g048a6ab4835b #113
  Call Trace:
    dump_stack+0x104/0x154 (unreliable)
    print_address_description+0xa0/0x30c
    __kasan_report+0x20c/0x224
    kasan_report+0x18/0x30
    __asan_report_load8_noabort+0x24/0x40
    hvc_put_chars+0xdc/0x110
    hvterm_raw_put_chars+0x9c/0x110
    udbg_hvc_putc+0x154/0x200
    udbg_write+0xf0/0x240
    console_unlock+0x868/0xd30
    register_console+0x970/0xe90
    register_early_udbg_console+0xf8/0x114
    setup_arch+0x108/0x790
    start_kernel+0x104/0x784
    start_here_common+0x1c/0x534

  Memory state around the buggy address:
   c0000000023e7980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   c0000000023e7a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
  &gt;c0000000023e7a80: f1 f1 01 f2 f2 f2 00 00 00 00 00 00 00 00 00 00
                           ^
   c0000000023e7b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   c0000000023e7b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  ==================================================================

Document that a 16-byte buffer is requred, and provide it in udbg.

Signed-off-by: Daniel Axtens &lt;dja@axtens.net&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>Merge tag 'riscv-for-linus-5.2-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux</title>
<updated>2019-05-19T16:56:36Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-05-19T16:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0bb1269b9788a35af68587505d8df90498df75f'/>
<id>urn:sha1:b0bb1269b9788a35af68587505d8df90498df75f</id>
<content type='text'>
Pull RISC-V updates from Palmer Dabbelt:
 "This contains an assortment of RISC-V related patches that I'd like to
  target for the 5.2 merge window. Most of the patches are cleanups, but
  there are a handful of user-visible changes:

   - The nosmp and nr_cpus command-line arguments are now supported,
     which work like normal.

   - The SBI console no longer installs itself as a preferred console,
     we rely on standard mechanisms (/chosen, command-line, hueristics)
     instead.

   - sfence_remove_sfence_vma{,_asid} now pass their arguments along to
     the SBI call.

   - Modules now support BUG().

   - A missing sfence.vma during boot has been added. This bug only
     manifests during boot.

   - The arch/riscv support for SiFive's L2 cache controller has been
     merged, which should un-block the EDAC framework work.

  I've only tested this on QEMU again, as I didn't have time to get
  things running on the Unleashed. The latest master from this morning
  merges in cleanly and passes the tests as well"

* tag 'riscv-for-linus-5.2-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: (31 commits)
  riscv: fix locking violation in page fault handler
  RISC-V: sifive_l2_cache: Add L2 cache controller driver for SiFive SoCs
  RISC-V: Add DT documentation for SiFive L2 Cache Controller
  RISC-V: Avoid using invalid intermediate translations
  riscv: Support BUG() in kernel module
  riscv: Add the support for c.ebreak check in is_valid_bugaddr()
  riscv: support trap-based WARN()
  riscv: fix sbi_remote_sfence_vma{,_asid}.
  riscv: move switch_mm to its own file
  riscv: move flush_icache_{all,mm} to cacheflush.c
  tty: Don't force RISCV SBI console as preferred console
  RISC-V: Access CSRs using CSR numbers
  RISC-V: Add interrupt related SCAUSE defines in asm/csr.h
  RISC-V: Use tabs to align macro values in asm/csr.h
  RISC-V: Fix minor checkpatch issues.
  RISC-V: Support nr_cpus command line option.
  RISC-V: Implement nosmp commandline option.
  RISC-V: Add RISC-V specific arch_match_cpu_phys_id
  riscv: vdso: drop unnecessary cc-ldoption
  riscv: call pm_power_off from machine_halt / machine_power_off
  ...
</content>
</entry>
<entry>
<title>tty: Don't force RISCV SBI console as preferred console</title>
<updated>2019-05-17T03:42:11Z</updated>
<author>
<name>Anup Patel</name>
<email>Anup.Patel@wdc.com</email>
</author>
<published>2019-04-25T13:35:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f91253a3d005796404ae0e578b3394459b5f9b71'/>
<id>urn:sha1:f91253a3d005796404ae0e578b3394459b5f9b71</id>
<content type='text'>
The Linux kernel will auto-disables all boot consoles whenever it
gets a preferred real console.

Currently on RISC-V systems, if we have a real console which is not
RISCV SBI console then boot consoles (such as earlycon=sbi) are not
auto-disabled when a real console (ttyS0 or ttySIF0) is available.
This results in duplicate prints at boot-time after kernel starts
using real console (i.e. ttyS0 or ttySIF0) if "earlycon=" kernel
parameter was passed by bootloader.

The reason for above issue is that RISCV SBI console always adds
itself as preferred console which is causing other real consoles
to be not used as preferred console.

Ideally "console=" kernel parameter passed by bootloaders should
be the one selecting a preferred real console.

This patch fixes above issue by not forcing RISCV SBI console as
preferred console.

Fixes: afa6b1ccfad5 ("tty: New RISC-V SBI console driver")
Cc: stable@vger.kernel.org
Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>tty: remove redundant 'default n' from Kconfig-s</title>
<updated>2019-04-16T13:21:33Z</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>b.zolnierkie@samsung.com</email>
</author>
<published>2019-04-12T10:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f692f7766f335ca38f0d6d1cb4c32dfad81820d4'/>
<id>urn:sha1:f692f7766f335ca38f0d6d1cb4c32dfad81820d4</id>
<content type='text'>
'default n' is the default value for any bool or tristate Kconfig
setting so there is no need to write it explicitly.

Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO
is not set' for visible symbols") the Kconfig behavior is the same
regardless of 'default n' being present or not:

    ...
    One side effect of (and the main motivation for) this change is making
    the following two definitions behave exactly the same:

        config FOO
                bool

        config FOO
                bool
                default n

    With this change, neither of these will generate a
    '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
    That might make it clearer to people that a bare 'default n' is
    redundant.
    ...

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: add SPDX identifiers to Kconfig and Makefiles</title>
<updated>2019-04-04T16:48:43Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-04-02T14:07:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38c91d1d55fe842bf7edde4469e812b34a711cd8'/>
<id>urn:sha1:38c91d1d55fe842bf7edde4469e812b34a711cd8</id>
<content type='text'>
There were a few Kconfig and Makefiles under drivers/tty/ that were
missing a SPDX identifier.  Fix that up so that automated tools can
properly classify all kernel source files.

Cc: Jiri Slaby &lt;jslaby@suse.com&gt;
Cc: Jiri Kosina &lt;jikos@kernel.org&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Acked-by: David Sterba &lt;dsterba@suse.com&gt;
Reviewed-by: Mukesh Ojha &lt;mojha@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: hvc_xen: Mark expected switch fall-through</title>
<updated>2019-02-26T11:30:44Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-02-25T17:34:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d56f00fd5380a77c2cd56231bb02fe54b96a7766'/>
<id>urn:sha1:d56f00fd5380a77c2cd56231bb02fe54b96a7766</id>
<content type='text'>
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warning:

drivers/tty/hvc/hvc_xen.c: In function ‘xencons_backend_changed’:
drivers/tty/hvc/hvc_xen.c:493:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (dev-&gt;state == XenbusStateClosed)
      ^
drivers/tty/hvc/hvc_xen.c:496:2: note: here
  case XenbusStateClosing:
  ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Use of_node_name_{eq,prefix} for node name comparisons</title>
<updated>2018-12-17T15:12:17Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2018-12-05T19:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=778ec49c14018730ec177bdd34b17e15e2e748b8'/>
<id>urn:sha1:778ec49c14018730ec177bdd34b17e15e2e748b8</id>
<content type='text'>
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For hvc, the code can also be simplified by using of_stdout pointer
instead of searching again for the stdout node.

Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.com&gt;
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-serial@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: hvc: hvc_write() fix break condition</title>
<updated>2018-09-10T16:04:31Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2018-09-09T05:39:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f2bf7840b74a160f908db83bc8829f8de10629b'/>
<id>urn:sha1:7f2bf7840b74a160f908db83bc8829f8de10629b</id>
<content type='text'>
Commit 550ddadcc758 ("tty: hvc: hvc_write() may sleep") broke the
termination condition in case the driver stops accepting characters.
This can result in unnecessary polling of the busy driver.

Restore it by testing the hvc_push return code.

Tested-by: Matteo Croce &lt;mcroce@redhat.com&gt;
Tested-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Tested-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: hvc: hvc_poll() fix read loop batching</title>
<updated>2018-09-10T16:04:31Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2018-09-09T05:39:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=68b2fc714fb1e08385f9c810d84f06affd007350'/>
<id>urn:sha1:68b2fc714fb1e08385f9c810d84f06affd007350</id>
<content type='text'>
Commit ec97eaad1383 ("tty: hvc: hvc_poll() break hv read loop")
removes get_chars batching entirely, which slows down large console
operations like paste -- virtio console "feels worse than a 9600 baud
serial line," reports Matteo.

This adds back batching in a more latency friendly way. If the caller
can sleep then we try to fill the entire flip buffer, releasing the
lock and scheduling between each iteration. If it can not sleep, then
batches are limited to 128 bytes. Matteo confirms this fixes the
performance problem.

Latency testing the powerpc OPAL console with OpenBMC UART with a
large paste shows about 0.25ms latency, which seems reasonable. 10ms
latencies were typical for this case before the latency breaking work,
so we still see most of the benefit.

  kopald-1204    0d.h.    5us : hvc_poll &lt;-hvc_handle_interrupt
  kopald-1204    0d.h.    5us : __hvc_poll &lt;-hvc_handle_interrupt
  kopald-1204    0d.h.    5us : _raw_spin_lock_irqsave &lt;-__hvc_poll
  kopald-1204    0d.h.    5us : tty_port_tty_get &lt;-__hvc_poll
  kopald-1204    0d.h.    6us : _raw_spin_lock_irqsave &lt;-tty_port_tty_get
  kopald-1204    0d.h.    6us : _raw_spin_unlock_irqrestore &lt;-tty_port_tty_get
  kopald-1204    0d.h.    6us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.    7us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.    7us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.   36us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.   36us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.   36us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.   65us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.   65us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.   66us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.   94us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.   95us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.   95us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.  124us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  124us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  125us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.  154us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  154us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  154us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.  183us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  184us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  184us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.  213us : tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  213us : __tty_buffer_request_room &lt;-__hvc_poll
  kopald-1204    0d.h.  213us+: opal_get_chars &lt;-__hvc_poll
  kopald-1204    0d.h.  242us : _raw_spin_unlock_irqrestore &lt;-__hvc_poll
  kopald-1204    0d.h.  242us : tty_flip_buffer_push &lt;-__hvc_poll
  kopald-1204    0d.h.  243us : queue_work_on &lt;-tty_flip_buffer_push
  kopald-1204    0d.h.  243us : tty_kref_put &lt;-__hvc_poll
  kopald-1204    0d.h.  243us : hvc_kick &lt;-hvc_handle_interrupt
  kopald-1204    0d.h.  243us : wake_up_process &lt;-hvc_kick
  kopald-1204    0d.h.  244us : try_to_wake_up &lt;-hvc_kick
  kopald-1204    0d.h.  244us : _raw_spin_lock_irqsave &lt;-try_to_wake_up
  kopald-1204    0d.h.  244us : _raw_spin_unlock_irqrestore &lt;-try_to_wake_up

Reported-by: Matteo Croce &lt;mcroce@redhat.com&gt;
Tested-by: Matteo Croce &lt;mcroce@redhat.com&gt;
Tested-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Tested-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
