From: Joerg Roedel <jroedel@suse.de>
To: Pekka Enberg <penberg@kernel.org>
Cc: linux-riscv <linux-riscv@lists.infradead.org>,
Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: vmalloc faulting on RISC-V
Date: Wed, 9 Sep 2020 20:28:34 +0200 [thread overview]
Message-ID: <20200909182834.GF23826@suse.de> (raw)
In-Reply-To: <CAOJsxLFWbV6FoEgHPHVN3PksrP5mXWbbFUuzH8YEDd1VdvEp7g@mail.gmail.com>
On Wed, Sep 09, 2020 at 09:29:10AM +0300, Pekka Enberg wrote:
> Why does RISC-V need vmalloc faulting in do_page_fault()? If I
> understand correctly, some architectures implement it because process
> page tables can get out of sync with "init_mm.pgd". How does that
> happen on RISC-V?
>
> I am asking because Joerg Roedel recently switched the x86
> architecture to a different approach because apparently vmalloc
> faulting is error-prone:
>
> commit 7f0a002b5a21302d9f4b29ba83c96cd433ff3769
> Author: Joerg Roedel <jroedel@suse.de>
> Date: Mon Jun 1 21:52:40 2020 -0700
>
> x86/mm: remove vmalloc faulting
>
> Remove fault handling on vmalloc areas, as the vmalloc code now takes
> care of synchronizing changes to all page-tables in the system.
It is actually not vmalloc-faulting alone that was error-prone, it was
its combination with the (now removed) vmalloc_sync_* interfaces which
had to be called at random places in the kernel. This interface was
removed and replaced by arch_sync_kernel_mappings(), which makes sure
that mappings are synchronized to all page-tables before the vmalloc'ed
pointer is returned.
Above commit to remove vmalloc-faulting on x86 had to be (partially)
reverted, because relying on arch_sync_kernel_mappings() alone turned
out to have a race condition.
Please see commit
4819e15f740e x86/mm/32: Bring back vmalloc faulting on x86_32
for details on that.
Regards,
Joerg
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2020-09-09 18:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 6:29 vmalloc faulting on RISC-V Pekka Enberg
2020-09-09 18:28 ` Joerg Roedel [this message]
2020-09-09 20:35 ` Palmer Dabbelt
2020-09-18 12:08 ` Joerg Roedel
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=20200909182834.GF23826@suse.de \
--to=jroedel@suse.de \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=penberg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.