Linux PARISC architecture development
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Helge Deller <deller@gmx.de>
Cc: linux-parisc <linux-parisc@vger.kernel.org>,
	James Bottomley <James.Bottomley@hansenpartnership.com>
Subject: Re: [PATCH] parisc: Fix extraction of hash lock bits in syscall.S
Date: Fri, 19 Nov 2021 15:27:46 -0500	[thread overview]
Message-ID: <8125f9ae-e0ff-e3d7-f9d0-7315131fbda8@bell.net> (raw)
In-Reply-To: <YZfJLEmjAUdY+4OO@ls3530>

On 2021-11-19 10:56 a.m., Helge Deller wrote:
> * John David Anglin<dave.anglin@bell.net>:
>> The extru instruction leaves the most significant 32 bits of the target register in an undefined
>> state on PA 2.0 systems.  If any of these bits are nonzero, this will break the calculation of the
>> lock pointer.
>>
>> Fix by using extrd,u instruction on 64-bit kernels.
> I wonder if we shouldn't introduce an extru_safe() macro.
> The name doesn't matter, but that way we can get rid of the ifdefs and
> use it in other places as well, e.g. as seen below.
> Thoughs?
Seems like a good idea.

Only question is this hunk

@@ -366,17 +366,9 @@
       */
      .macro        L2_ptep    pmd,pte,index,va,fault
  #if CONFIG_PGTABLE_LEVELS == 3
-    extru        \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
+    extru_safe    \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
  #else
-# if defined(CONFIG_64BIT)
-    extrd,u        \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
-  #else
-  # if PAGE_SIZE > 4096
-    extru        \va,31-ASM_PGDIR_SHIFT,32-ASM_PGDIR_SHIFT,\index
-  # else
-    extru        \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
-  # endif
-# endif
+    extru_safe    \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
  #endif
      dep             %r0,31,PAGE_SHIFT,\pmd  /* clear offset */
  #if CONFIG_PGTABLE_LEVELS < 3

where we lose the PAGE_SIZE > 4096 shift.

Dave

-- 
John David Anglin  dave.anglin@bell.net


  reply	other threads:[~2021-11-19 20:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 17:03 [PATCH] parisc: Fix extraction of hash lock bits in syscall.S John David Anglin
2021-11-18 19:24 ` Helge Deller
2021-11-18 19:47   ` John David Anglin
2021-11-18 19:55     ` John David Anglin
2021-11-19 15:56 ` Helge Deller
2021-11-19 20:27   ` John David Anglin [this message]
2021-11-19 20:41     ` 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=8125f9ae-e0ff-e3d7-f9d0-7315131fbda8@bell.net \
    --to=dave.anglin@bell.net \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=deller@gmx.de \
    --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