diff mbox series

[v2,1/4] powerpc/pseries: hvcall.h: add H_WATCHDOG opcode, H_NOOP return code

Message ID 20220602175353.68942-2-cheloha@linux.ibm.com
State Superseded
Headers show
Series pseries-wdt: initial support for H_WATCHDOG-based watchdog timers | expand

Commit Message

Scott Cheloha June 2, 2022, 5:53 p.m. UTC
PAPR v2.12 defines a new hypercall, H_WATCHDOG.  The hypercall permits
guest control of one or more virtual watchdog timers.

Add the opcode for the H_WATCHDOG hypercall to hvcall.h.  While here,
add a definition for H_NOOP, a possible return code for H_WATCHDOG.

Signed-off-by: Scott Cheloha <cheloha@linux.ibm.com>
---
 arch/powerpc/include/asm/hvcall.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Nathan Lynch June 21, 2022, 2:44 p.m. UTC | #1
Scott Cheloha <cheloha@linux.ibm.com> writes:
> PAPR v2.12 defines a new hypercall, H_WATCHDOG.  The hypercall permits
> guest control of one or more virtual watchdog timers.
>
> Add the opcode for the H_WATCHDOG hypercall to hvcall.h.  While here,
> add a definition for H_NOOP, a possible return code for H_WATCHDOG.
>
> Signed-off-by: Scott Cheloha <cheloha@linux.ibm.com>
> ---
>  arch/powerpc/include/asm/hvcall.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
> index d92a20a85395..4b4f69c35b4f 100644
> --- a/arch/powerpc/include/asm/hvcall.h
> +++ b/arch/powerpc/include/asm/hvcall.h
> @@ -87,6 +87,7 @@
>  #define H_P7		-60
>  #define H_P8		-61
>  #define H_P9		-62
> +#define H_NOOP		-63
>  #define H_TOO_BIG	-64
>  #define H_UNSUPPORTED	-67
>  #define H_OVERLAP	-68

Not a problem to fix in your series, but I guess these should be
parenthesized i.e.

#define H_P7		(-60)
#define H_P8		(-61)
#define H_P9		(-62)
#define H_NOOP		(-63)

> @@ -324,7 +325,8 @@
>  #define H_RPT_INVALIDATE	0x448
>  #define H_SCM_FLUSH		0x44C
>  #define H_GET_ENERGY_SCALE_INFO	0x450
> -#define MAX_HCALL_OPCODE	H_GET_ENERGY_SCALE_INFO
> +#define H_WATCHDOG		0x45C
> +#define MAX_HCALL_OPCODE	H_WATCHDOG
>

Looks fine.

Reviewed-by: Nathan Lynch <nathanl@linux.ibm.com>
Segher Boessenkool June 21, 2022, 5:31 p.m. UTC | #2
Hi!

On Tue, Jun 21, 2022 at 09:44:42AM -0500, Nathan Lynch wrote:
> Not a problem to fix in your series, but I guess these should be
> parenthesized i.e.
> 
> #define H_P7		(-60)
> #define H_P8		(-61)
> #define H_P9		(-62)
> #define H_NOOP		(-63)

Why?  It does not change the semantics of any correct code.  For what
incorrect code will it make the diagnostics clearer?


Segher
Nathan Lynch June 21, 2022, 10:22 p.m. UTC | #3
Segher Boessenkool <segher@kernel.crashing.org> writes:

> Hi!
>
> On Tue, Jun 21, 2022 at 09:44:42AM -0500, Nathan Lynch wrote:
>> Not a problem to fix in your series, but I guess these should be
>> parenthesized i.e.
>> 
>> #define H_P7		(-60)
>> #define H_P8		(-61)
>> #define H_P9		(-62)
>> #define H_NOOP		(-63)
>
> Why?  It does not change the semantics of any correct code.  For what
> incorrect code will it make the diagnostics clearer?

Yeah never mind, I was confused.
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index d92a20a85395..4b4f69c35b4f 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -87,6 +87,7 @@ 
 #define H_P7		-60
 #define H_P8		-61
 #define H_P9		-62
+#define H_NOOP		-63
 #define H_TOO_BIG	-64
 #define H_UNSUPPORTED	-67
 #define H_OVERLAP	-68
@@ -324,7 +325,8 @@ 
 #define H_RPT_INVALIDATE	0x448
 #define H_SCM_FLUSH		0x44C
 #define H_GET_ENERGY_SCALE_INFO	0x450
-#define MAX_HCALL_OPCODE	H_GET_ENERGY_SCALE_INFO
+#define H_WATCHDOG		0x45C
+#define MAX_HCALL_OPCODE	H_WATCHDOG
 
 /* Scope args for H_SCM_UNBIND_ALL */
 #define H_UNBIND_SCOPE_ALL (0x1)