All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@imgtec.com>
To: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Cc: <linux-mips@linux-mips.org>, <linux-kernel@vger.kernel.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	John Stultz <john.stultz@linaro.org>, <mguzik@redhat.com>,
	<athorlton@sgi.com>, <mhocko@suse.com>, <ebiederm@xmission.com>,
	<gorcunov@openvz.org>, <luto@kernel.org>, <cl@linux.com>,
	<serge.hallyn@ubuntu.com>, Kees Cook <keescook@chromium.org>,
	<jslaby@suse.cz>, Andrew Morton <akpm@linux-foundation.org>,
	Florian Fainelli <f.fainelli@gmail.com>, <mingo@kernel.org>,
	<alex.smith@imgtec.com>, <markos.chandras@imgtec.com>,
	Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	<david.daney@cavium.com>, <zhaoxiu.zeng@gmail.com>,
	<chenhc@lemote.com>, <Zubair.Kakakhel@imgtec.com>,
	James Hogan <james.hogan@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [RFC] mips: Add MXU context switching support
Date: Tue, 5 Jul 2016 11:53:17 +0100	[thread overview]
Message-ID: <alpine.DEB.2.00.1607051144190.4076@tp.orcam.me.uk> (raw)
In-Reply-To: <CANc+2y7meDYJyrHbbKWGsTNwangKCLB+kWLC6bys89PSXj-TdQ@mail.gmail.com>

On Tue, 5 Jul 2016, PrasannaKumar Muralidharan wrote:

> >> +     asm volatile(".word     0x700803ee\n\t");
> >> +     tsk->thread.mxu.xr[15] = reg_val;
> >> +}
> >
> >  Not using an output operand with asms here?
> 
> I think the instruction saves the xr* register value to reg_val
> without need for output operand.

 It does, a classic `asm' is supposed to act as an optimisation barrier.  

 However since you've used an operand `asm' in `__restore_mxu' I think 
it would be good for consistency to use one here as well; it would make 
this piece of code a little bit more readable too, as you wouldn't have 
to guess that the `asm' writes to `reg_val' then.

 So I suggest that you convert `__save_mxu' to use an operand `asm' as 
well.

  Maciej

WARNING: multiple messages have this Message-ID (diff)
From: "Maciej W. Rozycki" <macro@imgtec.com>
To: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Alexey Dobriyan <adobriyan@gmail.com>,
	John Stultz <john.stultz@linaro.org>,
	mguzik@redhat.com, athorlton@sgi.com, mhocko@suse.com,
	ebiederm@xmission.com, gorcunov@openvz.org, luto@kernel.org,
	cl@linux.com, serge.hallyn@ubuntu.com,
	Kees Cook <keescook@chromium.org>,
	jslaby@suse.cz, Andrew Morton <akpm@linux-foundation.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	mingo@kernel.org, alex.smith@imgtec.com,
	markos.chandras@imgtec.com,
	Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	david.daney@cavium.com, zhaoxiu.zeng@gmail.com,
	chenhc@lemote.com, Zubair.Kakakhel@imgtec.com,
	James Hogan <james.hogan@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [RFC] mips: Add MXU context switching support
Date: Tue, 5 Jul 2016 11:53:17 +0100	[thread overview]
Message-ID: <alpine.DEB.2.00.1607051144190.4076@tp.orcam.me.uk> (raw)
Message-ID: <20160705105317.ckUFgGKsV7mLev45D5c2jasxUeQN09oE_hOemBl_QoA@z> (raw)
In-Reply-To: <CANc+2y7meDYJyrHbbKWGsTNwangKCLB+kWLC6bys89PSXj-TdQ@mail.gmail.com>

On Tue, 5 Jul 2016, PrasannaKumar Muralidharan wrote:

> >> +     asm volatile(".word     0x700803ee\n\t");
> >> +     tsk->thread.mxu.xr[15] = reg_val;
> >> +}
> >
> >  Not using an output operand with asms here?
> 
> I think the instruction saves the xr* register value to reg_val
> without need for output operand.

 It does, a classic `asm' is supposed to act as an optimisation barrier.  

 However since you've used an operand `asm' in `__restore_mxu' I think 
it would be good for consistency to use one here as well; it would make 
this piece of code a little bit more readable too, as you wouldn't have 
to guess that the `asm' writes to `reg_val' then.

 So I suggest that you convert `__save_mxu' to use an operand `asm' as 
well.

  Maciej

  reply	other threads:[~2016-07-05 10:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-25 12:14 [RFC] mips: Add MXU context switching support PrasannaKumar Muralidharan
2016-07-03 13:17 ` PrasannaKumar Muralidharan
2016-07-04 21:45 ` Florian Fainelli
2016-07-05  9:47   ` PrasannaKumar Muralidharan
2016-07-04 22:30 ` Maciej W. Rozycki
2016-07-04 22:30   ` Maciej W. Rozycki
2016-07-05 10:07   ` PrasannaKumar Muralidharan
2016-07-05 10:53     ` Maciej W. Rozycki [this message]
2016-07-05 10:53       ` Maciej W. Rozycki
2016-07-05  9:34 ` Paul Burton
2016-07-05  9:34   ` Paul Burton
2016-07-05 15:21   ` PrasannaKumar Muralidharan
2016-07-05 16:17   ` Andy Lutomirski

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=alpine.DEB.2.00.1607051144190.4076@tp.orcam.me.uk \
    --to=macro@imgtec.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=Zubair.Kakakhel@imgtec.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.smith@imgtec.com \
    --cc=athorlton@sgi.com \
    --cc=chenhc@lemote.com \
    --cc=cl@linux.com \
    --cc=david.daney@cavium.com \
    --cc=ebiederm@xmission.com \
    --cc=f.fainelli@gmail.com \
    --cc=gorcunov@openvz.org \
    --cc=james.hogan@imgtec.com \
    --cc=john.stultz@linaro.org \
    --cc=jslaby@suse.cz \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=luto@kernel.org \
    --cc=markos.chandras@imgtec.com \
    --cc=mguzik@redhat.com \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=paul.burton@imgtec.com \
    --cc=prasannatsmkumar@gmail.com \
    --cc=ralf@linux-mips.org \
    --cc=serge.hallyn@ubuntu.com \
    --cc=zhaoxiu.zeng@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.