All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Breno Leitao <leitao@debian.org>
Cc: linuxppc-dev@lists.ozlabs.org, Gustavo Romero <gusbromero@gmail.com>
Subject: Re: [PATCH] powerpc/kernel: improve FP and vector registers restoration
Date: Sun, 4 Jun 2017 11:38:14 +1000	[thread overview]
Message-ID: <20170604113814.6c04fae8@kryten> (raw)
In-Reply-To: <20170603224213.7pf3vdltypx3uwom@gmail.com>

On Sat, 3 Jun 2017 19:42:14 -0300
Breno Leitao <leitao@debian.org> wrote:

> Hi Anton,
> 
> On Sat, Jun 03, 2017 at 08:04:11AM +1000, Anton Blanchard wrote:
> > Hi Breno,
> >   
> > > Currently tsk->thread->load_vec and load_fp are not initialized
> > > during a task creation, which set garbage to these variables
> > > (non-zero value).  
> > 
> > Nice catch! It seems like we should zero load_tm too though?  
> 
> Yes, it seems we need to zero load_tm also, since it does not seem to
> be zeroed anywhere else.
> 
> But I did some tests, and load_tm is always zero after start_thread()
> is being called.
> 
> In fact, start_thread() is being called and pt_regs->load_tm is
> already zero since the function start.
> 
> I also wrote a SystemTap script[1] to investigate it better, and I've
> never seen a single load_tm != 0 in a my machine. I tested on both
> POWER8 bare metal and KVM guests. (load_vec and load_fp happened to
> have garbage all the time)
> 
> Any idea if this is just occasional event, or, if there is someone
> zeroing it in an obscure code?

Quite likely no one uses TM :) Try:

#include <unistd.h>

int main(void)
{
        __builtin_tbegin(0);
        execlp("/bin/true", "/bin/true", NULL);
}

Anton

  reply	other threads:[~2017-06-04  1:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 21:43 [PATCH] powerpc/kernel: improve FP and vector registers restoration Breno Leitao
2017-06-02 22:04 ` Anton Blanchard
2017-06-03 22:42   ` Breno Leitao
2017-06-04  1:38     ` Anton Blanchard [this message]
2017-06-04 14:34       ` Breno Leitao
2017-06-05  5:59 ` Michael Ellerman
2017-06-08  4:05 ` Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2017-06-02 20:56 [PATCH] " Breno Leitao

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=20170604113814.6c04fae8@kryten \
    --to=anton@samba.org \
    --cc=gusbromero@gmail.com \
    --cc=leitao@debian.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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.