* [PATCH] openrisc: define nop command for simulator reboot @ 2022-04-28 11:11 Jason A. Donenfeld 2022-04-28 11:55 ` Stafford Horne 0 siblings, 1 reply; 4+ messages in thread From: Jason A. Donenfeld @ 2022-04-28 11:11 UTC (permalink / raw) To: shorne, openrisc, linux-kernel; +Cc: Jason A. Donenfeld, Peter Maydell The simulator defines `l.nop 1` for shutdown, but doesn't have anything for reboot. Use 13 for this, which is currently unused, dubbed `NOP_REBOOT`. Cc: Stafford Horne <shorne@gmail.com> Cc: Peter Maydell <peter.maydell@linaro.org> Link: https://lore.kernel.org/all/YmnaDUpVI5ihgvg6@zx2c4.com/ Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> --- arch/openrisc/kernel/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index 3c0c91bcdcba..4cce95fa6eb5 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c @@ -52,6 +52,8 @@ void machine_restart(char *cmd) { do_kernel_restart(cmd); + __asm__("l.nop 13"); + /* Give a grace period for failure to restart of 1s */ mdelay(1000); -- 2.35.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] openrisc: define nop command for simulator reboot 2022-04-28 11:11 [PATCH] openrisc: define nop command for simulator reboot Jason A. Donenfeld @ 2022-04-28 11:55 ` Stafford Horne 2022-04-28 12:42 ` Jason A. Donenfeld 0 siblings, 1 reply; 4+ messages in thread From: Stafford Horne @ 2022-04-28 11:55 UTC (permalink / raw) To: Jason A. Donenfeld; +Cc: openrisc, linux-kernel, Peter Maydell On Thu, Apr 28, 2022 at 01:11:39PM +0200, Jason A. Donenfeld wrote: > The simulator defines `l.nop 1` for shutdown, but doesn't have anything > for reboot. Use 13 for this, which is currently unused, dubbed > `NOP_REBOOT`. > > Cc: Stafford Horne <shorne@gmail.com> > Cc: Peter Maydell <peter.maydell@linaro.org> > Link: https://lore.kernel.org/all/YmnaDUpVI5ihgvg6@zx2c4.com/ > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > --- > arch/openrisc/kernel/process.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c > index 3c0c91bcdcba..4cce95fa6eb5 100644 > --- a/arch/openrisc/kernel/process.c > +++ b/arch/openrisc/kernel/process.c > @@ -52,6 +52,8 @@ void machine_restart(char *cmd) > { > do_kernel_restart(cmd); > > + __asm__("l.nop 13"); > + > /* Give a grace period for failure to restart of 1s */ > mdelay(1000); > > -- > 2.35.1 This seems fair, probably it would be good to have a comment mentioninmg what the nop is for, fyi for context these are the nop numbers used to control simulations. #define NOP_NOP 0x0000 /* Normal nop instruction */ #define NOP_EXIT 0x0001 /* End of simulation */ #define NOP_REPORT 0x0002 /* Simple report */ /*#define NOP_PRINTF 0x0003 Simprintf instruction (obsolete)*/ #define NOP_PUTC 0x0004 /* JPB: Simputc instruction */ #define NOP_CNT_RESET 0x0005 /* Reset statistics counters */ #define NOP_GET_TICKS 0x0006 /* JPB: Get # ticks running */ #define NOP_GET_PS 0x0007 /* JPB: Get picosecs/cycle */ #define NOP_TRACE_ON 0x0008 /* Turn on tracing */ #define NOP_TRACE_OFF 0x0009 /* Turn off tracing */ #define NOP_RANDOM 0x000a /* Return 4 random bytes */ #define NOP_OR1KSIM 0x000b /* Return non-zero if this is Or1ksim */ #define NOP_EXIT_SILENT 0x000c /* End of simulation, quiet version */ /* New! */ #define NOP_RESET 0x000d /* Reset the cpu */ I will queue this once we update the spec to define some of these, I am thinking if qemu should allow for the shutdown to work in user mode. BTW, are you working specifically on openrisc? Or just setting up test environments for all architectures? Acked-by: Stafford Horne <shorne@gmail.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] openrisc: define nop command for simulator reboot 2022-04-28 11:55 ` Stafford Horne @ 2022-04-28 12:42 ` Jason A. Donenfeld 2022-04-30 22:45 ` Stafford Horne 0 siblings, 1 reply; 4+ messages in thread From: Jason A. Donenfeld @ 2022-04-28 12:42 UTC (permalink / raw) To: Stafford Horne; +Cc: openrisc, linux-kernel, Peter Maydell On Thu, Apr 28, 2022 at 08:55:51PM +0900, Stafford Horne wrote: > On Thu, Apr 28, 2022 at 01:11:39PM +0200, Jason A. Donenfeld wrote: > > The simulator defines `l.nop 1` for shutdown, but doesn't have anything > > for reboot. Use 13 for this, which is currently unused, dubbed > > `NOP_REBOOT`. > > > > Cc: Stafford Horne <shorne@gmail.com> > > Cc: Peter Maydell <peter.maydell@linaro.org> > > Link: https://lore.kernel.org/all/YmnaDUpVI5ihgvg6@zx2c4.com/ > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > > --- > > arch/openrisc/kernel/process.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c > > index 3c0c91bcdcba..4cce95fa6eb5 100644 > > --- a/arch/openrisc/kernel/process.c > > +++ b/arch/openrisc/kernel/process.c > > @@ -52,6 +52,8 @@ void machine_restart(char *cmd) > > { > > do_kernel_restart(cmd); > > > > + __asm__("l.nop 13"); > > + > > /* Give a grace period for failure to restart of 1s */ > > mdelay(1000); > > > > -- > > 2.35.1 > > This seems fair, probably it would be good to have a comment mentioninmg what > the nop is for, fyi for context these are the nop numbers used to control > simulations. > > #define NOP_NOP 0x0000 /* Normal nop instruction */ > #define NOP_EXIT 0x0001 /* End of simulation */ > #define NOP_REPORT 0x0002 /* Simple report */ > /*#define NOP_PRINTF 0x0003 Simprintf instruction (obsolete)*/ > #define NOP_PUTC 0x0004 /* JPB: Simputc instruction */ > #define NOP_CNT_RESET 0x0005 /* Reset statistics counters */ > #define NOP_GET_TICKS 0x0006 /* JPB: Get # ticks running */ > #define NOP_GET_PS 0x0007 /* JPB: Get picosecs/cycle */ > #define NOP_TRACE_ON 0x0008 /* Turn on tracing */ > #define NOP_TRACE_OFF 0x0009 /* Turn off tracing */ > #define NOP_RANDOM 0x000a /* Return 4 random bytes */ > #define NOP_OR1KSIM 0x000b /* Return non-zero if this is Or1ksim */ > #define NOP_EXIT_SILENT 0x000c /* End of simulation, quiet version */ > /* New! */ > #define NOP_RESET 0x000d /* Reset the cpu */ Right, that's where I got 13 from. By the way, the .tex file only mentions ones up to 11, so at first I chose 12, and then saw this file. > > I will queue this once we update the spec to define some of these, I am thinking > if qemu should allow for the shutdown to work in user mode. > > BTW, are you working specifically on openrisc? Or just setting up test > environments for all architectures? Trying to get OpenRISC up on https://build.wireguard.com/ . The other architectures were simple, but OpenRISC is requiring some work... Jason ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] openrisc: define nop command for simulator reboot 2022-04-28 12:42 ` Jason A. Donenfeld @ 2022-04-30 22:45 ` Stafford Horne 0 siblings, 0 replies; 4+ messages in thread From: Stafford Horne @ 2022-04-30 22:45 UTC (permalink / raw) To: Jason A. Donenfeld; +Cc: openrisc, linux-kernel, Peter Maydell On Thu, Apr 28, 2022 at 02:42:20PM +0200, Jason A. Donenfeld wrote: > On Thu, Apr 28, 2022 at 08:55:51PM +0900, Stafford Horne wrote: > > On Thu, Apr 28, 2022 at 01:11:39PM +0200, Jason A. Donenfeld wrote: > > > The simulator defines `l.nop 1` for shutdown, but doesn't have anything > > > for reboot. Use 13 for this, which is currently unused, dubbed > > > `NOP_REBOOT`. > > > > > > Cc: Stafford Horne <shorne@gmail.com> > > > Cc: Peter Maydell <peter.maydell@linaro.org> > > > Link: https://lore.kernel.org/all/YmnaDUpVI5ihgvg6@zx2c4.com/ > > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > > > --- > > > arch/openrisc/kernel/process.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c > > > index 3c0c91bcdcba..4cce95fa6eb5 100644 > > > --- a/arch/openrisc/kernel/process.c > > > +++ b/arch/openrisc/kernel/process.c > > > @@ -52,6 +52,8 @@ void machine_restart(char *cmd) > > > { > > > do_kernel_restart(cmd); > > > > > > + __asm__("l.nop 13"); > > > + > > > /* Give a grace period for failure to restart of 1s */ > > > mdelay(1000); > > > > > > -- > > > 2.35.1 > > > > This seems fair, probably it would be good to have a comment mentioninmg what > > the nop is for, fyi for context these are the nop numbers used to control > > simulations. > > > > #define NOP_NOP 0x0000 /* Normal nop instruction */ > > #define NOP_EXIT 0x0001 /* End of simulation */ > > #define NOP_REPORT 0x0002 /* Simple report */ > > /*#define NOP_PRINTF 0x0003 Simprintf instruction (obsolete)*/ > > #define NOP_PUTC 0x0004 /* JPB: Simputc instruction */ > > #define NOP_CNT_RESET 0x0005 /* Reset statistics counters */ > > #define NOP_GET_TICKS 0x0006 /* JPB: Get # ticks running */ > > #define NOP_GET_PS 0x0007 /* JPB: Get picosecs/cycle */ > > #define NOP_TRACE_ON 0x0008 /* Turn on tracing */ > > #define NOP_TRACE_OFF 0x0009 /* Turn off tracing */ > > #define NOP_RANDOM 0x000a /* Return 4 random bytes */ > > #define NOP_OR1KSIM 0x000b /* Return non-zero if this is Or1ksim */ > > #define NOP_EXIT_SILENT 0x000c /* End of simulation, quiet version */ > > /* New! */ > > #define NOP_RESET 0x000d /* Reset the cpu */ > > Right, that's where I got 13 from. By the way, the .tex file only > mentions ones up to 11, so at first I chose 12, and then saw this file. BTW, I have queued this for 5.19. > > > > I will queue this once we update the spec to define some of these, I am thinking > > if qemu should allow for the shutdown to work in user mode. > > > > BTW, are you working specifically on openrisc? Or just setting up test > > environments for all architectures? > > Trying to get OpenRISC up on https://build.wireguard.com/ . The other > architectures were simple, but OpenRISC is requiring some work... Thanks, any work is appreciated. Now, I am going to go and replace my openVPN setup with wireguard. -Stafford ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-30 22:46 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-04-28 11:11 [PATCH] openrisc: define nop command for simulator reboot Jason A. Donenfeld 2022-04-28 11:55 ` Stafford Horne 2022-04-28 12:42 ` Jason A. Donenfeld 2022-04-30 22:45 ` Stafford Horne
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox