From: Segher Boessenkool <segher@kernel.crashing.org>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: Eirik Fuller <efuller@redhat.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 1/2] powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state
Date: Thu, 2 Sep 2021 17:20:02 -0500 [thread overview]
Message-ID: <20210902222002.GN1583@gate.crashing.org> (raw)
In-Reply-To: <20210902215203.GM1583@gate.crashing.org>
On Thu, Sep 02, 2021 at 04:52:03PM -0500, Segher Boessenkool wrote:
> On Thu, Sep 02, 2021 at 01:33:10PM +1000, Nicholas Piggin wrote:
> > Excerpts from Christophe Leroy's message of September 2, 2021 3:21 am:
> > >> - /* Firstly we need to enable TM in the kernel */
> > >> + /* We need to enable TM in the kernel, and disable EE (for scv) */
> > >> mfmsr r10
> > >> li r9, 1
> > >> rldimi r10, r9, MSR_TM_LG, 63-MSR_TM_LG
> > >> + LOAD_REG_IMMEDIATE(r9, MSR_EE)
> > >> + andc r10, r10, r9
> > >
> > > Why not use 'rlwinm' to mask out MSR_EE ?
> > >
> > > Something like
> > >
> > > rlwinm r10, r10, 0, ~MSR_EE
> >
> > Mainly because I'm bad at powerpc assembly. Why do you think I'm trying
> > to change as much as possible to C?
>
> The actual bit (bit 31, i.e. with value 1UL << 32) cannot be cleared
> with rlwinm (only the low 32 bits can). There are many ways to do it
> using two insns of course.
Wow I misread that, you want to clear MSR[EE] really, not MSR[TM].
You cannot use rlwinm and keep the high 32 bits of the target register
intact. You either clear all to 0 or set them to a copy of the rotated
value in the low 32 bits.
Segher
next prev parent reply other threads:[~2021-09-02 22:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 16:54 [PATCH v2 1/2] powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state Nicholas Piggin
2021-09-01 16:54 ` [PATCH v2 2/2] selftests/powerpc: Add scv versions of the basic TM syscall tests Nicholas Piggin
2021-09-01 17:15 ` Christophe Leroy
2021-09-02 3:27 ` Nicholas Piggin
2021-09-02 3:44 ` Michael Ellerman
2021-09-02 5:36 ` Michael Ellerman
2021-09-01 17:21 ` [PATCH v2 1/2] powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state Christophe Leroy
2021-09-02 3:33 ` Nicholas Piggin
2021-09-02 21:52 ` Segher Boessenkool
2021-09-02 22:20 ` Segher Boessenkool [this message]
2021-09-03 5:04 ` Christophe Leroy
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=20210902222002.GN1583@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=efuller@redhat.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@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 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).