All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Erhard F." <erhard_f@mailbox.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Benjamin Gray <bgray@linux.ibm.com>
Subject: Re: Bug: Write fault blocked by KUAP! (kernel 6.2-rc6, Talos II)
Date: Thu, 16 Feb 2023 16:20:20 +0100	[thread overview]
Message-ID: <20230216162020.0b90ed66@yea> (raw)
In-Reply-To: <65f1c4b4-a1f0-9eac-0ce3-70196a331052@csgroup.eu>

On Thu, 9 Feb 2023 07:21:55 +0000
Christophe Leroy <christophe.leroy@csgroup.eu> wrote:

> An easy fix would probably be to also check the suffix as a prefixed 
> instruction with 0 as suffix is not valid :
> 
> diff --git a/arch/powerpc/include/asm/inst.h 
> b/arch/powerpc/include/asm/inst.h
> index 684d3f453282..87084a52598b 100644
> --- a/arch/powerpc/include/asm/inst.h
> +++ b/arch/powerpc/include/asm/inst.h
> @@ -86,7 +86,7 @@ static inline ppc_inst_t ppc_inst_read(const u32 *ptr)
> 
>   static inline bool ppc_inst_prefixed(ppc_inst_t x)
>   {
> -	return IS_ENABLED(CONFIG_PPC64) && ppc_inst_primary_opcode(x) == 
> OP_PREFIX;
> +	return IS_ENABLED(CONFIG_PPC64) && ppc_inst_primary_opcode(x) == 
> OP_PREFIX && ppc_inst_suffix(x);
>   }
> 
>   static inline ppc_inst_t ppc_inst_swab(ppc_inst_t x)

Your patch works fine for me! Applied on top of v6.2-rc7 and in the resulting kernel the Write fault is gone. Thanks!

Regards,
Erhard

  reply	other threads:[~2023-02-16 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 23:46 Bug: Write fault blocked by KUAP! (kernel 6.2-rc6, Talos II) Erhard F.
2023-02-03  2:02 ` Benjamin Gray
2023-02-03  2:45   ` Nicholas Piggin
2023-02-09  7:21     ` Christophe Leroy
2023-02-16 15:20       ` Erhard F. [this message]
2023-02-03 10:46   ` Erhard F.

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=20230216162020.0b90ed66@yea \
    --to=erhard_f@mailbox.org \
    --cc=bgray@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.