Linux-EFI Archive mirror
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: alexghiti@rivosinc.com
Cc: ryan.roberts@arm.com, glider@google.com, elver@google.com,
	dvyukov@google.com, Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, anup@brainfault.org,
	atishp@atishpatra.org, Ard Biesheuvel <ardb@kernel.org>,
	ryabinin.a.a@gmail.com, andreyknvl@gmail.com,
	vincenzo.frascino@arm.com, kasan-dev@googlegroups.com,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
	linux-efi@vger.kernel.org, linux-mm@kvack.org,
	alexghiti@rivosinc.com
Subject: Re: [PATCH 0/5] riscv: Use READ_ONCE()/WRITE_ONCE() for pte accesses
Date: Thu, 07 Dec 2023 07:34:55 -0800 (PST)	[thread overview]
Message-ID: <mhng-079ed07b-4a53-4d32-9821-768bbb34fe58@palmer-ri-x1c9a> (raw)
In-Reply-To: <20231002151031.110551-1-alexghiti@rivosinc.com>

On Mon, 02 Oct 2023 08:10:26 PDT (-0700), alexghiti@rivosinc.com wrote:
> This series is a follow-up for riscv of a recent series from Ryan [1] which
> converts all direct dereferences of pte_t into a ptet_get() access.
>
> The goal here for riscv is to use READ_ONCE()/WRITE_ONCE() for all page
> table entries accesses to avoid any compiler transformation when the
> hardware can concurrently modify the page tables entries (A/D bits for
> example).
>
> I went a bit further and added pud/p4d/pgd_get() helpers as such concurrent
> modifications can happen too at those levels.
>
> [1] https://lore.kernel.org/all/20230612151545.3317766-1-ryan.roberts@arm.com/
>
> Alexandre Ghiti (5):
>   riscv: Use WRITE_ONCE() when setting page table entries
>   mm: Introduce pudp/p4dp/pgdp_get() functions
>   riscv: mm: Only compile pgtable.c if MMU
>   riscv: Suffix all page table entry pointers with 'p'
>   riscv: Use accessors to page table entries instead of direct
>     dereference
>
>  arch/riscv/include/asm/kfence.h     |   6 +-
>  arch/riscv/include/asm/kvm_host.h   |   2 +-
>  arch/riscv/include/asm/pgalloc.h    |  86 ++++++++++----------
>  arch/riscv/include/asm/pgtable-64.h |  26 +++---
>  arch/riscv/include/asm/pgtable.h    |  33 ++------
>  arch/riscv/kernel/efi.c             |   2 +-
>  arch/riscv/kvm/mmu.c                |  44 +++++-----
>  arch/riscv/mm/Makefile              |   3 +-
>  arch/riscv/mm/fault.c               |  38 ++++-----
>  arch/riscv/mm/hugetlbpage.c         |  80 +++++++++----------
>  arch/riscv/mm/init.c                |  30 +++----
>  arch/riscv/mm/kasan_init.c          | 119 ++++++++++++++--------------
>  arch/riscv/mm/pageattr.c            |  74 +++++++++--------
>  arch/riscv/mm/pgtable.c             |  71 +++++++++++------
>  include/linux/pgtable.h             |  21 +++++
>  15 files changed, 334 insertions(+), 301 deletions(-)

This has some build failures, I was just talking to Alex and he's going 
to fix them.

      parent reply	other threads:[~2023-12-07 15:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-02 15:10 [PATCH 0/5] riscv: Use READ_ONCE()/WRITE_ONCE() for pte accesses Alexandre Ghiti
2023-10-02 15:10 ` [PATCH 1/5] riscv: Use WRITE_ONCE() when setting page table entries Alexandre Ghiti
2023-10-02 15:10 ` [PATCH 2/5] mm: Introduce pudp/p4dp/pgdp_get() functions Alexandre Ghiti
2023-10-03  6:25   ` kernel test robot
2023-10-03  7:52   ` kernel test robot
2023-10-02 15:10 ` [PATCH 3/5] riscv: mm: Only compile pgtable.c if MMU Alexandre Ghiti
2023-10-02 15:10 ` [PATCH 4/5] riscv: Suffix all page table entry pointers with 'p' Alexandre Ghiti
2023-10-12 11:33   ` Conor Dooley
2023-10-12 11:35     ` Conor Dooley
2023-10-13  9:58       ` Andrew Jones
2023-10-19  9:06         ` Alexandre Ghiti
2023-10-12 12:13   ` Marco Elver
2023-10-02 15:10 ` [PATCH 5/5] riscv: Use accessors to page table entries instead of direct dereference Alexandre Ghiti
2023-12-07 15:34 ` Palmer Dabbelt [this message]

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=mhng-079ed07b-4a53-4d32-9821-768bbb34fe58@palmer-ri-x1c9a \
    --to=palmer@dabbelt.com \
    --cc=alexghiti@rivosinc.com \
    --cc=andreyknvl@gmail.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=atishp@atishpatra.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=paul.walmsley@sifive.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=ryan.roberts@arm.com \
    --cc=vincenzo.frascino@arm.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).