[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <qsprh2qiisldfsielpx6inuiw3rrh5owr3urin7maxvwtlhipz@zbioc6hgqe3r>
Date: Mon, 11 Aug 2025 07:46:13 +0100
From: Kiryl Shutsemau <kas@...nel.org>
To: Harry Yoo <harry.yoo@...cle.com>
Cc: Dennis Zhou <dennis@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrey Ryabinin <ryabinin.a.a@...il.com>, x86@...nel.org,
Borislav Petkov <bp@...en8.de>, Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Tejun Heo <tj@...nel.org>,
Uladzislau Rezki <urezki@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Christoph Lameter <cl@...two.org>, David Hildenbrand <david@...hat.com>,
Andrey Konovalov <andreyknvl@...il.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
"H. Peter Anvin" <hpa@...or.com>, kasan-dev@...glegroups.com,
Mike Rapoport <rppt@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
linux-kernel@...r.kernel.org, Dmitry Vyukov <dvyukov@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Suren Baghdasaryan <surenb@...gle.com>, Thomas Huth <thuth@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Michal Hocko <mhocko@...e.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, linux-mm@...ck.org,
Oscar Salvador <osalvador@...e.de>, Jane Chu <jane.chu@...cle.com>,
Gwan-gyeong Mun <gwan-gyeong.mun@...el.com>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.ibm.com>,
Joerg Roedel <joro@...tes.org>, Alistair Popple <apopple@...dia.com>,
Joao Martins <joao.m.martins@...cle.com>, linux-arch@...r.kernel.org
Subject: Re: [PATCH V4 mm-hotfixes 0/3] mm, x86: fix crash due to missing
page table sync and make it harder to miss
On Mon, Aug 11, 2025 at 02:34:17PM +0900, Harry Yoo wrote:
> # The solution: Make page table sync more code robust and harder to miss
>
> To address this, Dave Hansen suggested [3] [4] introducing
> {pgd,p4d}_populate_kernel() for updating kernel portion
> of the page tables and allow each architecture to explicitly perform
> synchronization when installing top-level entries. With this approach,
> we no longer need to worry about missing the sync step, reducing the risk
> of future regressions.
Looks sane:
Acked-by: Kiryl Shutsemau <kas@...nel.org>
> The new interface reuses existing ARCH_PAGE_TABLE_SYNC_MASK,
> PGTBL_P*D_MODIFIED and arch_sync_kernel_mappings() facility used by
> vmalloc and ioremap to synchronize page tables.
>
> pgd_populate_kernel() looks like this:
> static inline void pgd_populate_kernel(unsigned long addr, pgd_t *pgd,
> p4d_t *p4d)
> {
> pgd_populate(&init_mm, pgd, p4d);
> if (ARCH_PAGE_TABLE_SYNC_MASK & PGTBL_PGD_MODIFIED)
> arch_sync_kernel_mappings(addr, addr);
> }
>
> It is worth noting that vmalloc() and apply_to_range() carefully
> synchronizes page tables by calling p*d_alloc_track() and
> arch_sync_kernel_mappings(), and thus they are not affected by
> this patch series.
Well, except ARCH_PAGE_TABLE_SYNC_MASK is not defined on x86-64 until
now. So I think it is affected.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists