[PATCH] powerpc/prom_init: Include the termination message in ibm, os-term RTAS call

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2331d

5 messages, 4 authors, 2020-03-25 · open the first message on its own page

[PATCH] powerpc/prom_init: Include the termination message in ibm, os-term RTAS call

From: Fabiano Rosas <hidden>
Date: 2020-03-24 20:14:33

QEMU can now print the ibm,os-term message[1], so let's include it in
the RTAS call. E.g.:

  qemu-system-ppc64: OS terminated: Switch to secure mode failed.

1- https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4c3791ae0

Signed-off-by: Fabiano Rosas <redacted>
---
 arch/powerpc/kernel/prom_init.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 577345382b23..d543fb6d29c5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1773,6 +1773,9 @@ static void __init prom_rtas_os_term(char *str)
 	if (token == 0)
 		prom_panic("Could not get token for ibm,os-term\n");
 	os_term_args.token = cpu_to_be32(token);
+	os_term_args.nargs = cpu_to_be32(1);
+	os_term_args.args[0] = cpu_to_be32(__pa(str));
+
 	prom_rtas_hcall((uint64_t)&os_term_args);
 }
 #endif /* CONFIG_PPC_SVM */
-- 
2.23.0

Re: [PATCH] powerpc/prom_init: Include the termination message in ibm, os-term RTAS call

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2020-03-25 10:08:20

Fabiano Rosas [off-list ref] writes:
QEMU can now print the ibm,os-term message[1], so let's include it in
the RTAS call. E.g.:

  qemu-system-ppc64: OS terminated: Switch to secure mode failed.

1- https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4c3791ae0

Signed-off-by: Fabiano Rosas <redacted>
---
 arch/powerpc/kernel/prom_init.c | 3 +++
 1 file changed, 3 insertions(+)
I have this queued:
  https://patchwork.ozlabs.org/patch/1253390/

Which I think does the same thing?

cheers
quoted hunk
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 577345382b23..d543fb6d29c5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1773,6 +1773,9 @@ static void __init prom_rtas_os_term(char *str)
 	if (token == 0)
 		prom_panic("Could not get token for ibm,os-term\n");
 	os_term_args.token = cpu_to_be32(token);
+	os_term_args.nargs = cpu_to_be32(1);
+	os_term_args.args[0] = cpu_to_be32(__pa(str));
+
 	prom_rtas_hcall((uint64_t)&os_term_args);
 }
 #endif /* CONFIG_PPC_SVM */
-- 
2.23.0

Re: [PATCH] powerpc/prom_init: Include the termination message in ibm,os-term RTAS call

From: Greg Kurz <hidden>
Date: 2020-03-25 11:17:47

On Wed, 25 Mar 2020 21:06:22 +1100
Michael Ellerman [off-list ref] wrote:
Fabiano Rosas [off-list ref] writes:
quoted
QEMU can now print the ibm,os-term message[1], so let's include it in
the RTAS call. E.g.:

  qemu-system-ppc64: OS terminated: Switch to secure mode failed.

1- https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4c3791ae0

Signed-off-by: Fabiano Rosas <redacted>
---
 arch/powerpc/kernel/prom_init.c | 3 +++
 1 file changed, 3 insertions(+)
I have this queued:
  https://patchwork.ozlabs.org/patch/1253390/

Which I think does the same thing?
Alexey's patch also sets os_term_args.nret as indicated in PAPR.
Even if QEMU's handler for "ibm,os-term" doesn't seem to have
a use for nret, I think it's better to stick to the spec.

Cheers,

--
Greg
cheers
quoted
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 577345382b23..d543fb6d29c5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1773,6 +1773,9 @@ static void __init prom_rtas_os_term(char *str)
 	if (token == 0)
 		prom_panic("Could not get token for ibm,os-term\n");
 	os_term_args.token = cpu_to_be32(token);
+	os_term_args.nargs = cpu_to_be32(1);
+	os_term_args.args[0] = cpu_to_be32(__pa(str));
+
 	prom_rtas_hcall((uint64_t)&os_term_args);
 }
 #endif /* CONFIG_PPC_SVM */
-- 
2.23.0

Re: [PATCH] powerpc/prom_init: Include the termination message in ibm,os-term RTAS call

From: Ram Pai <hidden>
Date: 2020-03-25 13:29:08

On Tue, Mar 24, 2020 at 05:12:11PM -0300, Fabiano Rosas wrote:
quoted hunk
QEMU can now print the ibm,os-term message[1], so let's include it in
the RTAS call. E.g.:

  qemu-system-ppc64: OS terminated: Switch to secure mode failed.

1- https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4c3791ae0

Signed-off-by: Fabiano Rosas <redacted>
---
 arch/powerpc/kernel/prom_init.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 577345382b23..d543fb6d29c5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1773,6 +1773,9 @@ static void __init prom_rtas_os_term(char *str)
 	if (token == 0)
 		prom_panic("Could not get token for ibm,os-term\n");
 	os_term_args.token = cpu_to_be32(token);
+	os_term_args.nargs = cpu_to_be32(1);
+	os_term_args.args[0] = cpu_to_be32(__pa(str));
+
Reviewed-by: Ram Pai <redacted>

RP

Re: [PATCH] powerpc/prom_init: Include the termination message in ibm, os-term RTAS call

From: Fabiano Rosas <hidden>
Date: 2020-03-25 13:32:37

Michael Ellerman [off-list ref] writes:
Fabiano Rosas [off-list ref] writes:
quoted
QEMU can now print the ibm,os-term message[1], so let's include it in
the RTAS call. E.g.:

  qemu-system-ppc64: OS terminated: Switch to secure mode failed.

1- https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4c3791ae0

Signed-off-by: Fabiano Rosas <redacted>
---
 arch/powerpc/kernel/prom_init.c | 3 +++
 1 file changed, 3 insertions(+)
I have this queued:
  https://patchwork.ozlabs.org/patch/1253390/

Which I think does the same thing?
Ah, all good then. Nothing to see here... =)
cheers
quoted
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 577345382b23..d543fb6d29c5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1773,6 +1773,9 @@ static void __init prom_rtas_os_term(char *str)
 	if (token == 0)
 		prom_panic("Could not get token for ibm,os-term\n");
 	os_term_args.token = cpu_to_be32(token);
+	os_term_args.nargs = cpu_to_be32(1);
+	os_term_args.args[0] = cpu_to_be32(__pa(str));
+
 	prom_rtas_hcall((uint64_t)&os_term_args);
 }
 #endif /* CONFIG_PPC_SVM */
-- 
2.23.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help