Skip to contentSkip to conversation

powerpc/prom_init: Pass the "os-term" message to hypervisor

PATCH Applied Alexey Kardashevskiy 3 participants 3 messages Mar 12, 2020 – Mar 26, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/prom_init: Pass the "os-term" message to hypervisor

The "os-term" RTAS calls has one argument with a message address of OS termination cause. rtas_os_term() already passes it but the recently added prom_init's version of that missed it; it also does not fill args correctly.

This passes the message address and initializes the number of arguments.

---
 arch/powerpc/kernel/prom_init.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/kernel/prom_init.c +3 -0
index 577345382b23..673f13b87db1 100644
@@ -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.nret = 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 */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 8 lines · Alexey Kardashevskiy

The "os-term" RTAS calls has one argument with a message address of OS termination cause. rtas_os_term() already passes it but the recently added prom_init's version of that missed it; it also does not fill args correctly.

This passes the message address and initializes the number of arguments.

I added:

Fixes 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")

cheers

Quoted 16 lines
arch/powerpc/kernel/prom_init.c +3 -0
index 577345382b23..673f13b87db1 100644
@@ -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.nret = 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 */
Signature · 1 line
2.17.1
#2 lore raw
In reply to Alexey Kardashevskiy
Quoted 8 lines · Alexey Kardashevskiy

The "os-term" RTAS calls has one argument with a message address of OS termination cause. rtas_os_term() already passes it but the recently added prom_init's version of that missed it; it also does not fill args correctly.

This passes the message address and initializes the number of arguments.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/74bb84e5117146fa73eb9d01305975c53022b3c3

cheers