All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@ozlabs.org
Cc: matt@ozlabs.org
Subject: Re: [PATCH] powerpc/tm: Don't check for WARN in TM Bad Thing handling
Date: Thu, 12 Oct 2017 21:47:21 +1100	[thread overview]
Message-ID: <1507805241.16703.53.camel@neuling.org> (raw)
In-Reply-To: <1507783525-28940-1-git-send-email-mpe@ellerman.id.au>

On Thu, 2017-10-12 at 15:45 +1100, Michael Ellerman wrote:
> Currently when we take a TM Bad Thing program check exception, we
> search the bug table to see if the program check was generated by a
> WARN/WARN_ON etc.
>=20
> That makes no sense, the WARN macros use trap instructions, which
> should never generate a TM Bad Thing exception. If they ever did that
> would be a bug and we should oops.
>=20
> We do have some hand-coded bugs in tm.S, using EMIT_BUG_ENTRY, but
> those are all BUGs not WARNs, and they all use trap instructions
> anyway. Almost certainly this check was incorrectly copied from the
> REASON_TRAP handling in the same function.
>=20
> Remove it.
>=20
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

LGTM

Acked-By: Michael Neuling <mikey@neuling.org>

> ---
> =C2=A0arch/powerpc/kernel/traps.c | 9 ++-------
> =C2=A01 file changed, 2 insertions(+), 7 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 9ae1924c7d1a..0e4099fef198 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -1337,13 +1337,8 @@ void program_check_exception(struct pt_regs *regs)
> =C2=A0		=C2=A0* -=C2=A0=C2=A0A treclaim is attempted when non transaction=
al.
> =C2=A0		=C2=A0* -=C2=A0=C2=A0A tend is illegally attempted.
> =C2=A0		=C2=A0* -=C2=A0=C2=A0writing a TM SPR when transactional.
> -		=C2=A0*/
> -		if (!user_mode(regs) &&
> -		=C2=A0=C2=A0=C2=A0=C2=A0report_bug(regs->nip, regs) =3D=3D BUG_TRAP_TY=
PE_WARN) {
> -			regs->nip +=3D 4;
> -			goto bail;
> -		}
> -		/* If usermode caused this, it's done something illegal and
> +		=C2=A0*
> +		=C2=A0* If usermode caused this, it's done something illegal and
> =C2=A0		=C2=A0* gets a SIGILL slap on the wrist.=C2=A0=C2=A0We call it an=
 illegal
> =C2=A0		=C2=A0* operand to distinguish from the instruction just being ba=
d
> =C2=A0		=C2=A0* (e.g. executing a 'tend' on a CPU without TM!); it's an

  reply	other threads:[~2017-10-12 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  4:45 [PATCH] powerpc/tm: Don't check for WARN in TM Bad Thing handling Michael Ellerman
2017-10-12 10:47 ` Michael Neuling [this message]
2017-11-07 23:30 ` 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=1507805241.16703.53.camel@neuling.org \
    --to=mikey@neuling.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=matt@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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.