virtio_console: Stop doing DMA on the stack
authorAndy Lutomirski <luto@kernel.org>
Tue, 30 Aug 2016 15:04:15 +0000 (08:04 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 8 Sep 2016 06:48:35 +0000 (08:48 +0200)
commit9472fe7040bba45c6200858cbe40d643cf02bccb
tree42fbdc86d2feb50ff5c288c4ef32dc9cfa977e94
parent6271cfdfc0e4731b76921ef02fdd87409d71dfdf
virtio_console: Stop doing DMA on the stack

virtio_console uses a small DMA buffer for control requests.  Move
that buffer into heap memory.

Doing virtio DMA on the stack is normally okay on non-DMA-API virtio
systems (which is currently most of them), but it breaks completely
if the stack is virtually mapped (CONFIG_VMAP_STACK=y).

Tested by typing both directions using picocom aimed at /dev/hvc0.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: virtualization@lists.linux-foundation.org
Link: http://lkml.kernel.org/r/0afe68f9b4be6c95af9e7672b07acd0274c26dfe.1472569320.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/char/virtio_console.c