linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ben Hutchings <ben@decadent.org.uk>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org, linux-mm@kvack.org,
	Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH v2 0/3] Handle delay slot for extable lookup
Date: Fri, 2 Feb 2024 21:31:22 +0000	[thread overview]
Message-ID: <21ed604c-8607-43b7-853a-9bd1623bd918@flygoat.com> (raw)
In-Reply-To: <CAHk-=wiaSjYApqmUYCdCyYfr_bRsfVKDkwU6r6FMmoZzrxHrKQ@mail.gmail.com>



在 2024/2/2 18:39, Linus Torvalds 写道:
> On Fri, 2 Feb 2024 at 04:30, Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>>        ptrace: Introduce exception_ip arch hook
>>        MIPS: Clear Cause.BD in instruction_pointer_set
>>        mm/memory: Use exception ip to search exception tables
> Just to clarify: does that second patch fix the problem that
> __isa_exception_epc() does a __get_user()?

No it only covers an obvious case when I was playing around exception_ip 
with kgdb.
There are still potential cases __isa_exception_epc may touch user space.

> Because that mm/memory.c use of "exception_ip()" most definitely
> cannot take a page fault.
>
> So if MIPS cannot do that whole exception IP thing without potentially
> touching user space, I do worry that we might just have to add a
>
>     #ifndef __MIPS__
>
> around this all.

It is possible to perform exception_ip() without touching user space by 
saving "BadInstr" in pt_regs
at exception entries. For newer hardware it's as simple as saving an 
extra CP0 register, on older hardware
we may have to read it from user space.

+ Thomas (MIPS maintainer), what's your opinion?

Thanks
>
> Possibly somehow limited to just the microMIPS/MIPS16e case in Kconfig instead?
>
>              Linus

-- 
---
Jiaxun Yang



  reply	other threads:[~2024-02-02 21:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 12:30 Jiaxun Yang
2024-02-02 12:30 ` [PATCH v2 1/3] ptrace: Introduce exception_ip arch hook Jiaxun Yang
2024-02-02 12:30 ` [PATCH v2 2/3] MIPS: Clear Cause.BD in instruction_pointer_set Jiaxun Yang
2024-02-02 12:30 ` [PATCH v2 3/3] mm/memory: Use exception ip to search exception tables Jiaxun Yang
2024-02-02 18:39 ` [PATCH v2 0/3] Handle delay slot for extable lookup Linus Torvalds
2024-02-02 21:31   ` Jiaxun Yang [this message]
2024-02-03 13:56   ` Jiaxun Yang
2024-02-04  7:41     ` Linus Torvalds
2024-02-04 11:03       ` Jiaxun Yang
2024-02-04 11:45         ` Linus Torvalds
2024-02-08  9:20 ` Jiaxun Yang
2024-02-08  9:23   ` Xi Ruoyao
2024-02-08  9:31     ` Jiaxun Yang
2024-02-12 22:10 ` Thomas Bogendoerfer

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=21ed604c-8607-43b7-853a-9bd1623bd918@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ben@decadent.org.uk \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=xry111@xry111.site \
    /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