linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 13/14] powerpc/rtas: enture rtas_call is called with MMU enabled
Date: Tue, 15 Mar 2022 18:18:50 +0100	[thread overview]
Message-ID: <012cf7e7-4f92-3ffa-3859-7e4941476e9c@linux.ibm.com> (raw)
In-Reply-To: <20220308135047.478297-14-npiggin@gmail.com>

On 08/03/2022, 14:50:46, Nicholas Piggin wrote:
> rtas_call must not be called with the MMU disabled because in case
> of rtas error, log_error is called which requires MMU enabled. Add
> a test and warning for this.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

> ---
>  arch/powerpc/kernel/rtas.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 1fc22138e3ab..adf4892aeecd 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -479,6 +479,11 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
>  	if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE)
>  		return -1;
>  
> +	if ((mfmsr() & (MSR_IR|MSR_DR)) != (MSR_IR|MSR_DR)) {
> +		WARN_ON_ONCE(1);
> +		return -1;
> +	}
> +
>  	s = lock_rtas();
>  
>  	/* We use the global rtas args buffer */


  reply	other threads:[~2022-03-15 17:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 13:50 [PATCH 00/14] powerpc/rtas: various cleanups and improvements Nicholas Piggin
2022-03-08 13:50 ` [PATCH 01/14] powerpc/rtas: Move rtas entry assembly into its own file Nicholas Piggin
2022-03-08 13:50 ` [PATCH 02/14] powerpc/rtas: Make enter_rtas a nokprobe symbol on 64-bit Nicholas Piggin
2022-03-08 13:50 ` [PATCH 03/14] powerpc/rtas: Fix whitespace in rtas_entry.S Nicholas Piggin
2022-03-08 13:50 ` [PATCH 04/14] powerpc/rtas: Call enter_rtas with MSR[EE] disabled Nicholas Piggin
2022-03-14 15:12   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 05/14] powerpc/rtas: Modernise RI clearing on 64-bit Nicholas Piggin
2022-03-14 15:15   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 06/14] powerpc/rtas: Load rtas entry MSR explicitly Nicholas Piggin
2022-03-14 15:17   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 07/14] powerpc/rtas: PACA can be restored directly from SPRG Nicholas Piggin
2022-03-14 15:32   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 08/14] powerpc/rtas: call enter_rtas in real-mode on 64-bit Nicholas Piggin
2022-03-14 17:09   ` Laurent Dufour
2022-03-17  9:36   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 09/14] powerpc/rtas: Leave MSR[RI] enabled over RTAS call Nicholas Piggin
2022-03-14 17:17   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 10/14] powerpc/rtas: replace rtas_call_unlocked with raw_rtas_call Nicholas Piggin
2022-03-14 17:30   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 11/14] powerpc/rtas: tidy __fetch_rtas_last_error Nicholas Piggin
2022-03-08 13:50 ` [PATCH 12/14] powerpc/rtas: Close theoretical memory leak Nicholas Piggin
2022-03-15 17:17   ` Laurent Dufour
2022-03-08 13:50 ` [PATCH 13/14] powerpc/rtas: enture rtas_call is called with MMU enabled Nicholas Piggin
2022-03-15 17:18   ` Laurent Dufour [this message]
2022-03-08 13:50 ` [PATCH 14/14] powerpc/rtas: Consolidate and improve checking for rtas callers Nicholas Piggin
2022-03-15 17:26   ` Laurent Dufour
2022-03-08 14:51 ` [PATCH 00/14] powerpc/rtas: various cleanups and improvements Christophe Leroy
2022-03-17 11:15 ` Laurent Dufour
2022-05-24 11:08 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=012cf7e7-4f92-3ffa-3859-7e4941476e9c@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).