linux/drivers/tty/hvc
Michael Ellerman 9227f04314 powerpc/udbg: Reduce the footgun potential of EARLY_DEBUG_LPAR(_HVSI)
For debugging very early boot problems we have CONFIG_PPC_EARLY_DEBUG,
which allows configuring the kernel such that it unconditionally writes
to a particular type of console, regardless of whether that console
exists or not. This is useful sometimes when the kernel crashes before
it can even determine what platform it's on, and therefore what consoles
exist.

However if you boot a kernel built this way on a different platform, it
will generally crash because it writes to a console that doesn't exist.

A particularly nasty instance of this is if you enable the hypervisor
console early debug, and then boot that kernel on bare metal. The result
is that the kernel calls "the hypervisor" very early in boot, but the
kernel *is* the hypervisor, so we jump to the system call handler and
start executing all sorts of code that isn't ready to be run. This may
lead to a machine check or check stop depending on how lucky you are.

Luckily there is an easy way to avoid this particular case. We simply
read the MSR before installing the hooks, and if we see MSR_HV is set
then we are the hypervisor and we definitely should not use the
hypervisor console.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-07-31 16:56:45 +10:00
..
hvc_bfin_jtag.c hvc: add Blackfin JTAG console support 2011-02-17 11:12:40 -08:00
hvc_console.c tty/hvc_console: fix console lock ordering with spinlock 2017-03-31 11:37:13 +02:00
hvc_console.h tty/hvc: Use IRQF_SHARED for OPAL hvc consoles 2016-07-27 12:38:18 +10:00
hvc_dcc.c hvc_dcc: don't ignore errors during initialization 2015-10-04 17:49:27 +01:00
hvc_irq.c tty/hvc: Use IRQF_SHARED for OPAL hvc consoles 2016-07-27 12:38:18 +10:00
hvc_iucv.c s390/iucv: do not use arrays as argument 2015-09-21 16:03:04 -07:00
hvc_opal.c tty/hvc: Use opal irqchip interface if available 2016-07-27 12:38:20 +10:00
hvc_rtas.c drivers/tty/hvc: don't use module_init in non-modular hyp. console code 2014-02-07 08:40:54 -08:00
hvc_tile.c drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN 2015-05-11 11:22:20 -04:00
hvc_udbg.c drivers/tty/hvc: don't use module_init in non-modular hyp. console code 2014-02-07 08:40:54 -08:00
hvc_vio.c powerpc/udbg: Reduce the footgun potential of EARLY_DEBUG_LPAR(_HVSI) 2017-07-31 16:56:45 +10:00
hvc_xen.c xen: features and fixes for 4.6-rc0 2016-03-22 12:55:17 -07:00
hvcs.c driver core patches for 4.13-rc1 2017-07-03 20:27:48 -07:00
hvsi_lib.c tty-hvsi_lib: Deletion of an unnecessary check before the function call "tty_kref_put" 2014-11-26 19:35:49 -08:00
hvsi.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
Kconfig s390/hvc_iucv: fix broken Kconfig select statement 2017-06-12 16:25:58 +02:00
Makefile tty/hvc: remove celleb-only beat driver 2015-05-10 19:19:06 +02:00