Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: John David Anglin <dave.anglin@bell.net>,
	linux-parisc@vger.kernel.org,
	James Bottomley <James.Bottomley@hansenpartnership.com>
Subject: Re: [PATCH][RFC] parisc: Use local tlb purges only on PA2.0 machines
Date: Tue, 27 Sep 2022 22:06:37 +0200	[thread overview]
Message-ID: <efb7b1fa-f593-3c52-c8b2-cd42c2594848@gmx.de> (raw)
In-Reply-To: <5f476a72-d2c0-8b0e-2446-13456a92e0bf@bell.net>

On 9/25/22 22:28, John David Anglin wrote:
> On 2022-09-25 4:11 p.m., Helge Deller wrote:
>> n 9/25/22 22:02, John David Anglin wrote:
>>> On 2022-09-25 2:57 p.m., Helge Deller wrote:
>>>> +#ifdef CONFIG_PA20
>>>> +#define ALT_COND_PACACHE    ALT_COND_ALWAYS
>>>> +#else
>>>> +#define ALT_COND_PACACHE    ALT_COND_NO_SMP
>>>> +#endif
>>>> +
>>>>   ENTRY_CFI(flush_tlb_all_local)
>>>>       /*
>>>>        * The pitlbe and pdtlbe instructions should only be used to
>>>> @@ -539,15 +545,10 @@ ENTRY_CFI(copy_user_page_asm)
>>>>
>>>>       /* Purge any old translations */
>>>>
>>>> -#ifdef CONFIG_PA20
>>>> -    pdtlb,l        %r0(%r28)
>>>> -    pdtlb,l        %r0(%r29)
>>>> -#else
>>>>   0:    pdtlb        %r0(%r28)
>>>>   1:    pdtlb        %r0(%r29)
>>>> -    ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
>>>> -    ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SMP, INSN_PxTLB)
>>>> -#endif
>>>> +    ALTERNATIVE(0b, 0b+4, ALT_COND_PACACHE, INSN_PxTLB)
>>>> +    ALTERNATIVE(1b, 1b+4, ALT_COND_PACACHE, INSN_PxTLB)
>>> This doesn't look correct.  If ALT_COND_PACACHE is defined as ALT_COND_NO_SMP, the pdtlb
>>> instructions will be converted to pdtlb,l instructions when running UP.  These are not supported
>>> on PA 1.1.
>>
>> Your concern is correct, but there is an additonal check in the alternative-coding,
>> which prevents enabling the local flag if we're not running on a PA2.0 CPU.
>> So, those ALTERNATIVE() macros will only apply on PA2.0 machines.
> You are correct.  Missed that.
>
> That only leaves the bus serialization issue when pdtlb is used on an SMP machine.

I think we are Ok with what's in the kernel already.

According to arch/parisc/include/asm/pgtable.h:

* This is for the serialization of PxTLB broadcasts. At least on the N class
  * systems, only one PxTLB inter processor broadcast can be active at any one
  * time on the Merced bus. */
extern spinlock_t pa_tlb_flush_lock;
#if defined(CONFIG_64BIT) && defined(CONFIG_SMP)
extern int pa_serialize_tlb_flushes;
#else
#define pa_serialize_tlb_flushes        (0)
#endif

we currently do TLB serialization on 64-bit machines with a 64-bit kernel only.
N-class machines are 64-bit-only machines which can't run a 32-bit kernel.
So, 32-bit SMP kernels (which don't have serialization for PxTLB flushes)
don't seem to be affected.

Helge

  reply	other threads:[~2022-09-27 20:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 18:57 [PATCH][RFC] parisc: Use local tlb purges only on PA2.0 machines Helge Deller
2022-09-25 20:02 ` John David Anglin
2022-09-25 20:11   ` Helge Deller
2022-09-25 20:28     ` John David Anglin
2022-09-27 20:06       ` Helge Deller [this message]
2022-09-27 22:06         ` John David Anglin
2022-09-28  9:25           ` Helge Deller

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=efb7b1fa-f593-3c52-c8b2-cd42c2594848@gmx.de \
    --to=deller@gmx.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=dave.anglin@bell.net \
    --cc=linux-parisc@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