From 0acb5f64560a052fd66ab37b212a72964847160f Mon Sep 17 00:00:00 2001 From: "Christopher M. Riedl" Date: Mon, 15 Apr 2019 22:26:38 -0500 Subject: powerpc/xmon: add read-only mode Operations which write to memory and special purpose registers should be restricted on systems with integrity guarantees (such as Secure Boot) and, optionally, to avoid self-destructive behaviors. Add a config option, XMON_DEFAULT_RO_MODE, to set default xmon behavior. The kernel cmdline options xmon=ro and xmon=rw override this default. The following xmon operations are affected: memops: disable memmove disable memset disable memzcan memex: no-op'd mwrite super_regs: no-op'd write_spr bpt_cmds: disable proc_call: disable Signed-off-by: Christopher M. Riedl Reviewed-by: Oliver O'Halloran Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig.debug | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'arch/powerpc/Kconfig.debug') diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index e9ae650c8e93..c59920920ddc 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug @@ -117,6 +117,14 @@ config XMON_DISASSEMBLY to say Y here, unless you're building for a memory-constrained system. +config XMON_DEFAULT_RO_MODE + bool "Restrict xmon to read-only operations by default" + depends on XMON + default y + help + Operate xmon in read-only mode. The cmdline options 'xmon=rw' and + 'xmon=ro' override this default. + config DEBUGGER bool depends on KGDB || XMON -- cgit v1.2.3-59-g8ed1b