From: Michael Neuling <mikey@neuling.org>
To: Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Cc: imunsie@au1.ibm.com, mpe@ellerman.id.au, stable@vger.kernel.org
Subject: Re: [PATCH] cxl: Set endianess of kernel contexts
Date: Tue, 08 Dec 2015 14:11:41 +1100 [thread overview]
Message-ID: <1449544301.3197.21.camel@neuling.org> (raw)
In-Reply-To: <1449495280-18819-1-git-send-email-fbarrat@linux.vnet.ibm.com>
On Mon, 2015-12-07 at 14:34 +0100, Frederic Barrat wrote:
> A process element (defined in CAIA) keeps track of the endianess of
> contexts through the Little Endian (LE) bit of the State Register. It
> is currently set for user contexts, but was somehow forgotten for
> kernel contexts, so this patch fixes it.
> It could lead to erratic behavior from an AFU when the context is
> attached through the kernel API.
>=20
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Suggested-by: Michael Neuling <mikey@neuling.org>
> Cc: <stable@vger.kernel.org> # 4.3+
> ---
> cxl kernel API is supported starting with 4.3 (for cxlflash)
The cxlflash's AFU doesn't use this bit, so the stable@ marker here is
probably not strictly needed.
Mikey
> drivers/misc/cxl/native.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
> index d2e75c8..f409097 100644
> --- a/drivers/misc/cxl/native.c
> +++ b/drivers/misc/cxl/native.c
> @@ -497,6 +497,7 @@ static u64 calculate_sr(struct cxl_context *ctx)
> {
> u64 sr =3D 0;
> =20
> + set_endian(sr);
> if (ctx->master)
> sr |=3D CXL_PSL_SR_An_MP;
> if (mfspr(SPRN_LPCR) & LPCR_TC)
> @@ -506,7 +507,6 @@ static u64 calculate_sr(struct cxl_context *ctx)
> sr |=3D CXL_PSL_SR_An_HV;
> } else {
> sr |=3D CXL_PSL_SR_An_PR | CXL_PSL_SR_An_R;
> - set_endian(sr);
> sr &=3D ~(CXL_PSL_SR_An_HV);
> if (!test_tsk_thread_flag(current, TIF_32BIT))
> sr |=3D CXL_PSL_SR_An_SF;
next prev parent reply other threads:[~2015-12-08 3:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 13:34 [PATCH] cxl: Set endianess of kernel contexts Frederic Barrat
2015-12-08 3:11 ` Michael Neuling [this message]
2015-12-14 6:45 ` Ian Munsie
2015-12-14 9:46 ` 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=1449544301.3197.21.camel@neuling.org \
--to=mikey@neuling.org \
--cc=fbarrat@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=stable@vger.kernel.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 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).