linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gustavo Romero <gromero@linux.vnet.ibm.com>,
	Jan Stancek <jstancek@redhat.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: Laurent Vivier <lvivier@redhat.com>,
	David Gibson <dgibson@redhat.com>,
	thuth@redhat.com, Steve Best <sbest@redhat.com>,
	Paul Mackerras <pmac@au1.ibm.com>
Subject: Re: [bug] KVM: Unrecoverable TM Unavailable Exception f60
Date: Fri, 14 Jul 2017 06:59:36 +1000	[thread overview]
Message-ID: <1499979576.2865.64.camel@kernel.crashing.org> (raw)
In-Reply-To: <596787D5.7000704@linux.vnet.ibm.com>

On Thu, 2017-07-13 at 11:46 -0300, Gustavo Romero wrote:
> Hi Jan
> Looks like that TM unavailable exception will only able to recover
> properly if it comes from problem state and since the trigger comes
> from kernel space (kvm module) it does not match
> "if (user_mode(regs))" in tm_unavailable().
> 
> I'm able to avoid this problem using the following patch:

I think the KVM exit path should be enabling TM if necessary rather
than taking the fault.

> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index d4e545d27ef9..1091dc4f4274 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -1433,13 +1433,11 @@ void vsx_unavailable_exception(struct pt_regs *regs)
>  static void tm_unavailable(struct pt_regs *regs)
>  {
>  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> -       if (user_mode(regs)) {
> -               current->thread.load_tm++;
> -               regs->msr |= MSR_TM;
> -               tm_enable();
> -               tm_restore_sprs(&current->thread);
> -               return;
> -       }
> +       current->thread.load_tm++;
> +       regs->msr |= MSR_TM;
> +       tm_enable();
> +       tm_restore_sprs(&current->thread);
> +       return;
>  #endif
>         pr_emerg("Unrecoverable TM Unavailable Exception "
>                         "%lx at %lx\n", regs->trap, regs->nip);
> 
> Regards,
> Gustavo

  reply	other threads:[~2017-07-13 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <830588289.51042658.1499942166009.JavaMail.zimbra@redhat.com>
2017-07-13 10:52 ` [bug] KVM: Unrecoverable TM Unavailable Exception f60 Jan Stancek
2017-07-13 12:07   ` Jan Stancek
2017-07-13 14:46     ` Gustavo Romero
2017-07-13 20:59       ` Benjamin Herrenschmidt [this message]
2017-07-13 20:58     ` Benjamin Herrenschmidt
2017-07-14  6:28       ` Jan Stancek

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=1499979576.2865.64.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=dgibson@redhat.com \
    --cc=gromero@linux.vnet.ibm.com \
    --cc=jstancek@redhat.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lvivier@redhat.com \
    --cc=pmac@au1.ibm.com \
    --cc=sbest@redhat.com \
    --cc=thuth@redhat.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).