On Thu, Oct 26, 2017 at 10:42:17AM +0200, Florian Riehm wrote:
> Hi,
>
> Sometimes I see systems hanging in ddb(4) after panic(9) and the "boot reboot"
> command doesn't work anymore, i.e. of filesystem or locking issues.
> Bluhm@ suggested to me to use "call cpu_reset" in such situations.
>
> I would like to introduce a command 'boot reset' to do this.
>
> ok?
No, cpu_reset() is MD this will break ddb on all non x86 archs besides
landisk.
>
> friehm
>
>
> Index: share/man/man4//ddb.4
> ===================================================================
> RCS file: /cvs/src/share/man/man4/ddb.4,v
> retrieving revision 1.91
> diff -u -p -r1.91 ddb.4
> --- share/man/man4//ddb.4 29 Sep 2017 09:36:04 -0000 1.91
> +++ share/man/man4//ddb.4 26 Oct 2017 08:18:44 -0000
> @@ -379,6 +379,10 @@ Just halt.
> Just reboot.
> .It Ic boot poweroff
> Power down the machine whenever possible; if it fails, just halt.
> +.It Ic boot reset
> +Restart the machine by resetting the CPU. Useful in situations were
> +.Ic boot reboot
> +does not work anymore.
> .El
> .\" --------------------
> .It Xo
> Index: sys/ddb/db_command.c
> ===================================================================
> RCS file: /cvs/src/sys/ddb/db_command.c,v
> retrieving revision 1.79
> diff -u -p -r1.79 db_command.c
> --- sys/ddb/db_command.c 19 Oct 2017 16:58:05 -0000 1.79
> +++ sys/ddb/db_command.c 26 Oct 2017 08:18:55 -0000
> @@ -105,6 +105,7 @@ void db_boot_dump_cmd(db_expr_t, int, db
> void db_boot_halt_cmd(db_expr_t, int, db_expr_t, char *);
> void db_boot_reboot_cmd(db_expr_t, int, db_expr_t, char *);
> void db_boot_poweroff_cmd(db_expr_t, int, db_expr_t, char *);
> +void db_boot_reset_cmd(db_expr_t, int, db_expr_t, char *);
> void db_stack_trace_cmd(db_expr_t, int, db_expr_t, char *);
> void db_dmesg_cmd(db_expr_t, int, db_expr_t, char *);
> void db_show_panic_cmd(db_expr_t, int, db_expr_t, char *);
> @@ -606,6 +607,7 @@ struct db_command db_boot_cmds[] = {
> { "halt", db_boot_halt_cmd, 0, 0 },
> { "reboot", db_boot_reboot_cmd, 0, 0 },
> { "poweroff", db_boot_poweroff_cmd, 0, 0 },
> + { "reset", db_boot_reset_cmd, 0, 0 },
> { NULL, }
> };
> @@ -812,6 +814,12 @@ void
> db_boot_poweroff_cmd(db_expr_t addr, int haddr, db_expr_t count, char *modif)
> {
> reboot(RB_NOSYNC | RB_HALT | RB_POWERDOWN | RB_TIMEBAD | RB_USERREQ);
> +}
> +
> +void
> +db_boot_reset_cmd(db_expr_t addr, int haddr, db_expr_t count, char *modif)
> +{
> + cpu_reset();
> }
> void
>