linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: John David Anglin <dave.anglin@bell.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	linux-kernel@vger.kernel.org, Linux-MM <linux-mm@kvack.org>,
	Helge Deller <deller@gmx.de>,
	linux-parisc@vger.kernel.org,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH 6.10 000/809] 6.10.3-rc3 review
Date: Thu, 8 Aug 2024 17:50:32 -0700	[thread overview]
Message-ID: <314821a5-43e1-4c96-ad8d-188bca8ae0a1@roeck-us.net> (raw)
In-Reply-To: <ac7284f9-ba29-4068-ab00-82ddc839afaf@bell.net>

On 8/8/24 14:50, John David Anglin wrote:
> On 2024-08-08 4:52 p.m., Guenter Roeck wrote:
>> On 8/8/24 11:19, Linus Torvalds wrote:
>>> On Thu, 8 Aug 2024 at 10:48, Thomas Gleixner <tglx@linutronix.de> wrote:
>>>>
>>>> Here is the disassembly from my latest crashing debug kernel which
>>>> shifts it up a couple of pages. Add 0x10 or sub 0x20 to make it work.
>>>
>>> Looks like I was off by an instruction, it's the 28th divide-step (not
>>> 29) that does the page crosser:
>>>
>>>>      4121dffc:   0b 21 04 41     ds r1,r25,r1
>>>>      4121e000:   0b bd 07 1d     add,c ret1,ret1,ret1
> I think this macro might clobber the C/B bits on a ITLB missing:
> 
>          /* This is for ILP32 PA2.0 only.  The TLB insertion needs
>           * to extend into I/O space if the address is 0xfXXXXXXX
>           * so we extend the f's into the top word of the pte in
>           * this case */
>          .macro          f_extend        pte,tmp
>          extrd,s         \pte,42,4,\tmp
>          addi,<>         1,\tmp,%r0
>          extrd,s         \pte,63,25,\pte
>          .endm
> 
> The addi instruction affects the C/B bits.  However, it is only used for 32-bit PA 2.0 kernels.
> A second tmp register would be needed to change the addi to an add logical.
> 
> The mode likely problem is the shladd instruction in the following macro in entry.S:
> 
>          .macro          L2_ptep pmd,pte,index,va,fault
> #if CONFIG_PGTABLE_LEVELS == 3
>          extru_safe      \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
> #else
>          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
>          copy            %r0,\pte
> #endif
>          ldw,s           \index(\pmd),\pmd
>          bb,>=,n         \pmd,_PxD_PRESENT_BIT,\fault
>          dep             %r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */
>          SHLREG          \pmd,PxD_VALUE_SHIFT,\pmd
>          extru_safe      \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
>          dep             %r0,31,PAGE_SHIFT,\pmd  /* clear offset */
>          shladd          \index,BITS_PER_PTE_ENTRY,\pmd,\pmd /* pmd is now pte */
>          .endm
> 
> I believe the shladd instruction should be changed to shladd,l (shift left and add logical).
> 

That doesn't help, at least not in qemu.

Guenter



  parent reply	other threads:[~2024-08-09  0:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240731095022.970699670@linuxfoundation.org>
     [not found] ` <718b8afe-222f-4b3a-96d3-93af0e4ceff1@roeck-us.net>
2024-08-06  2:40   ` Linus Torvalds
2024-08-06 11:02     ` Vlastimil Babka
2024-08-06 17:33       ` Thomas Gleixner
     [not found]         ` <90e02d99-37a2-437e-ad42-44b80c4e94f6@suse.cz>
     [not found]           ` <87frrh44mf.ffs@tglx>
     [not found]             ` <76c643ee-17d6-463b-8ee1-4e30b0133671@roeck-us.net>
     [not found]               ` <87plqjz6aa.ffs@tglx>
2024-08-08 15:53                 ` Linus Torvalds
2024-08-08 16:12                   ` Thomas Gleixner
2024-08-08 16:33                     ` Linus Torvalds
2024-08-08 17:48                       ` Thomas Gleixner
2024-08-08 18:19                         ` Linus Torvalds
2024-08-08 20:52                           ` Guenter Roeck
2024-08-08 21:50                             ` John David Anglin
2024-08-08 22:29                               ` John David Anglin
2024-08-08 23:33                                 ` Linus Torvalds
2024-08-09  0:33                                   ` John David Anglin
2024-08-09  0:56                                 ` Guenter Roeck
2024-08-09  0:50                               ` Guenter Roeck [this message]
2024-08-08 22:15                             ` Richard Henderson
2024-09-03  7:54                           ` Helge Deller
2024-09-03 14:13                             ` Guenter Roeck
2024-09-03 18:43                             ` Linus Torvalds
     [not found]                 ` <cffe30ed-43a3-46ac-ad03-afb7633f17e5@roeck-us.net>
2024-08-08 15:58                   ` John David Anglin
     [not found]       ` <f63c6789-b01a-4d76-b7c9-74c04867bc13@roeck-us.net>
     [not found]         ` <CAHk-=wjmumbT73xLkSAnnxDwaFE__Ny=QCp6B_LE2aG1SUqiTg@mail.gmail.com>
2024-08-06 17:49           ` Linus Torvalds

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=314821a5-43e1-4c96-ad8d-188bca8ae0a1@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=richard.henderson@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /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