LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc/32: Fix unpaired stwcx. on interrupt exit
Date: Fri, 12 Sep 2025 15:34:50 +0200	[thread overview]
Message-ID: <73b75b17-adde-44f0-b252-5a7ea2f9d138@csgroup.eu> (raw)
In-Reply-To: <aMQfD5M5yNmYxLho@gate>

Hi Segher,

Le 12/09/2025 à 15:24, Segher Boessenkool a écrit :
> Hi!
> 
> On Fri, Sep 12, 2025 at 10:37:34AM +0200, Christophe Leroy wrote:
>>   BEGIN_FTR_SECTION
>> +	lwarx   r0,0,r1
>> +END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
>>   	stwcx.	r0,0,r1		/* to clear the reservation */
>> -FTR_SECTION_ELSE
>> -	lwarx	r0,0,r1
>> -ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
> 
> Hrm.  So this is for V'ger (mpc7450)?  What kind of issues does that
> old thing have with unpaired larx/stcx., some performance impact?

No idea, The original commit (from 2007) only says "some processors can 
have issues if this stwcx to address A occurs while the reservation is 
already held to a different address B".

> 
> The extra "dummy" larx has serious performance impact itself, on most
> implementations (also on all newer stuff).

To be honnest I don't know. I just discovered I made a mistake when I 
implemented C interrupt exit and this patch is aiming at restoring the 
previous behaviour.

If you think this is pointless then no problem, I can instead just 
remove the impossible case and that's it.

What is odd to begin with is that we have two features that seems to 
address the same problem but in a slightly different way
- CPU_FTR_NEED_PAIRED_STWCX for PPC32
- CPU_FTR_STCX_CHECKS_ADDRESS for PPC64

What do you recommend ?

Christophe


  reply	other threads:[~2025-09-12 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12  8:37 [PATCH v2] powerpc/32: Fix unpaired stwcx. on interrupt exit Christophe Leroy
2025-09-12 13:24 ` Segher Boessenkool
2025-09-12 13:34   ` Christophe Leroy [this message]
2025-11-21  2:53 ` Madhavan Srinivasan

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=73b75b17-adde-44f0-b252-5a7ea2f9d138@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=segher@kernel.crashing.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