LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Huacai Chen <chenhuacai@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Huacai Chen <chenhuacai@loongson.cn>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Darren Hart <dvhart@infradead.org>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
"open list:MIPS" <linux-mips@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Xuefeng Li <lixuefeng@loongson.cn>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
Hongchen Zhang <zhanghongchen@loongson.cn>
Subject: Re: [PATCH] futex: Fix fault_in_user_writeable()
Date: Tue, 17 Aug 2021 09:07:32 +0200 [thread overview]
Message-ID: <871r6spn0r.ffs@tglx> (raw)
In-Reply-To: <CAAhV-H5TKLMi0GSQmh9RFK_k5eNRwx8AE8MjMKjJfbnyVYP-+w@mail.gmail.com>
On Tue, Aug 17 2021 at 09:53, Huacai Chen wrote:
> On Tue, Aug 17, 2021 at 3:03 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>> That's surely one way to fix that. If that does not work for whatever
>> reason, then we really don't want this find_vma() hack there, but rather
>> something like:
> I don't know why find_vma() is unacceptable here, there is also
> find_vma() in fixup_user_fault().
Wrong. find_extend_vma() != find_vma(). Aside of that fixup_user_fault()
does way more than that.
>> if (IS_ENABLED(CONFIG_ARCH_USER_FAULT_VOODOO) && get_user(&tmp, uaddr))
>> return -EFAULT;
>
> get_user() may be better than find_vma(), but can we drop
> CONFIG_ARCH_USER_FAULT_VOODOO here? On those "W implies R" archs,
> get_user() always success, this can simplify the logic.
For architectures which imply R fixup_user_fault() is way more
effinicient than taking the fault on get_user() and then invoking
fixup_user_fault() to ensure that the mapping is writeable.
No, we are not making stuff less efficient just because of MIPS.
Thanks,
tglx
next prev parent reply other threads:[~2021-08-17 7:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 6:54 Huacai Chen
2021-08-16 18:27 ` Davidlohr Bueso
2021-08-16 19:03 ` Thomas Gleixner
2021-08-17 1:53 ` Huacai Chen
2021-08-17 7:07 ` Thomas Gleixner [this message]
2021-08-17 7:38 ` Huacai Chen
2021-08-17 9:05 ` Thomas Gleixner
2021-08-17 9:45 ` Peter Zijlstra
2021-08-17 12:27 ` Huacai Chen
2021-08-17 9:22 ` Peter Zijlstra
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=871r6spn0r.ffs@tglx \
--to=tglx@linutronix.de \
--cc=chenhuacai@gmail.com \
--cc=chenhuacai@loongson.cn \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tsbogend@alpha.franken.de \
--cc=zhanghongchen@loongson.cn \
--subject='Re: [PATCH] futex: Fix fault_in_user_writeable()' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).