[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 4/9] mm: convert PTE table entries in ptep_get()
- To: Anshuman Khandual <anshuman.khandual@xxxxxxx>
- From: Muhammad Usama Anjum <usama.anjum@xxxxxxx>
- Date: Wed, 30 Sep 2026 18:46:04 +0100
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=suse.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9aEn4ubSlfZC8d5zvTQtfBiiaBLSDPSceR3sArTbNzQ=; b=rM59Fm/6rsdHArT+fhUJ7+NnqpucwwGgzqnA1iPF3eh5BdWnNRrAku02ia6uGb8R8yAO5r7R66NE9s7gU2p6TYZpjY6yW9M8VmRndz2HvxBscprInbUJMV0vn9L8W3hWF3qt7EilxHN9T7a3Lmn55vsrIHaw356FFf2/dKIwUChUlK+r9H26uaIGR4jngzVlSQNB7RpGmS8uM3kWEzB0FIY/Ih01xYHpNaWnZoK2fDNVeh8g2aKiYo+6wyWa55/jToVTioQxPQ5PJ9WVsDdPwM4Jo7Nbg9b/ThA68qjsxFxkSBeVDZXtbouQVVDjLPgvJ3WXo5CCY0b9BsWOq/pdjA==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9aEn4ubSlfZC8d5zvTQtfBiiaBLSDPSceR3sArTbNzQ=; b=ZsggRuyxLjcd8+2f4JXPpiWJb7z/RdwMlc/1OsaKp3QfGH+7efVgUS7TRQ08hawPnxT9HZf0Io06NQwMx7j+vsSWq5URWBJVw9sLsLR2GraphdNuJscW6zflIaCHH/VRlwWOAb1g57Q3XS51Vg4QO4Ae8jm2ddAN89NCXmxeHIIrXnrbqSmZpUAe8CqLiabrAa9ZMZduVNzTwW8sqCtOIDiRW3qj1eNCtci7hVWc9hoDkgcKRT8lpEKnTS4wtgDGyRHQpTnF3mH5aMVZT0kPlClhF0tYKmwGQyNzhYcm+Bgezg9a0RlXWmcc2WOVk9GbmrodsgUUfb4Bt15Ani7PBQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Pf3AkXcKel8p4LUJQC0e2vcSFRN3WKW1LGZMxUXwymGBT+G6MXv6B+dzPNgzDxHDKPmMrYPAeHTc00PMUchrKEETT772Mt9c3P+8cr62nW+3rgNgOdaQ3+bZnJCwtRxI7VN3q7uG9n08e7C5yJcxy1ZK5ZPk90hugE7QEo0XD0R+QQEotvR1e4erleadLJA3bmYybur2n2ZMab/PiA1LDWQUQ73cyAXF58ZqwBD+iAUqMT8YJ1vHlLFmLBf9braKahEoS84sboHqk1XVP/0QoLvv9log39zMenWh9STzWO4sk2M48sPm3LPJ0vq4pckbNVD3y7IlfgBy0aoUsrV7ZQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kfkl2k50yIYjdGeMbUiIF0rrLLmt5/RkXdUnQVABHxYJT7Eh5OTIl9ZObXkohhFG/096DXxPKea0hK+UdBVNlB+rbDP7uCbeg8t2jb/PojZQarJ1Pq7hFRj0NDZ/5dm1E/3ESQk9QjWSDqa9mIaODPbhxpXkrbMBZ0+WsboP9vwclEhC1h2qhT4yqozVlGZgxkbrd54IDCGcrwprbr42T7K9hqSI3+VoDRa6hY9eBZf2laSJhfFIzeUiEs48q9IcvMZL21RmgNbsMoEa3eXqYx0EqNIMxVO/US3fFjvorKO4EOKTZ1R3TnjECWby5jX2YlQw3vwCGKR0YzXImFfEBg==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results-original: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: usama.anjum@xxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Lorenzo Stoakes <ljs@xxxxxxxxxx>, "Liam R. Howlett" <liam@xxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, Suren Baghdasaryan <surenb@xxxxxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, Xu Xin <xu.xin16@xxxxxxxxxx>, Chengming Zhou <chengming.zhou@xxxxxxxxx>, Jann Horn <jannh@xxxxxxxxxx>, Muchun Song <muchun.song@xxxxxxxxx>, Oscar Salvador <osalvador@xxxxxxx>, Pedro Falcato <pfalcato@xxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxx>, Nick Piggin <npiggin@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>, Rik van Riel <riel@xxxxxxxxxxx>, Harry Yoo <harry@xxxxxxxxxx>, Lance Yang <lance.yang@xxxxxxxxx>, Chris Li <chrisl@xxxxxxxxxx>, Kairui Song <kasong@xxxxxxxxxxx>, Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>, Nhat Pham <nphamcs@xxxxxxxxx>, Baoquan He <baoquan.he@xxxxxxxxx>, Barry Song <baohua@xxxxxxxxxx>, Youngjun Park <youngjun.park@xxxxxxx>, Uladzislau Rezki <urezki@xxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Masami Hiramatsu <mhiramat@xxxxxxxxxx>, Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>, Alexei Starovoitov <ast@xxxxxxxxxx>, Daniel Borkmann <daniel@xxxxxxxxxxxxx>, Andrii Nakryiko <andrii@xxxxxxxxxx>, Eduard Zingerman <eddyz87@xxxxxxxxx>, Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>, Martin KaFai Lau <martin.lau@xxxxxxxxx>, Song Liu <song@xxxxxxxxxx>, Yonghong Song <yonghong.song@xxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>, Emil Tsalapatis <emil@xxxxxxxxxxxxxxx>, Ihor Solodrai <ihor.solodrai@xxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Namhyung Kim <namhyung@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Ian Rogers <irogers@xxxxxxxxxx>, Adrian Hunter <adrian.hunter@xxxxxxxxx>, James Clark <james.clark@xxxxxxxxxx>, SJ Park <sj@xxxxxxxxxx>, "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>, Jan Kara <jack@xxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, John Hubbard <jhubbard@xxxxxxxxxx>, Peter Xu <peterx@xxxxxxxxxx>, Leon Romanovsky <leon@xxxxxxxxxx>, Zi Yan <ziy@xxxxxxxxxx>, Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>, Nico Pache <nico.pache@xxxxxxxxx>, Ryan Roberts <ryan.roberts@xxxxxxx>, Dev Jain <dev.jain@xxxxxxx>, Usama Arif <usama.arif@xxxxxxxxx>, Kiryl Shutsemau <kas@xxxxxxxxxx>, Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx>, Alexander Potapenko <glider@xxxxxxxxxx>, Andrey Konovalov <andreyknvl@xxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, Vincenzo Frascino <vincenzo.frascino@xxxxxxx>, Miaohe Lin <linmiaohe@xxxxxxxxxx>, Naoya Horiguchi <nao.horiguchi@xxxxxxxxx>, Matthew Brost <matthew.brost@xxxxxxxxx>, Joshua Hahn <joshua.hahnjy@xxxxxxxxx>, Rakie Kim <rakie.kim@xxxxxx>, Byungchul Park <byungchul@xxxxxx>, Gregory Price <gourry@xxxxxxxxxx>, Ying Huang <ying.huang@xxxxxxxxxxxxxxxxx>, Alistair Popple <apopple@xxxxxxxxxx>, Dennis Zhou <dennis@xxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, Christoph Lameter <cl@xxxxxxxxxx>, Johannes Weiner <hannes@xxxxxxxxxxx>, Qi Zheng <qi.zheng@xxxxxxxxx>, Shakeel Butt <shakeel.butt@xxxxxxxxx>, Axel Rasmussen <axelrasmussen@xxxxxxxxxx>, Yuanchu Xie <yuanchu@xxxxxxxxxx>, Wei Xu <weixugc@xxxxxxxxxx>, Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>, Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>, Tvrtko Ursulin <tursulin@xxxxxxxxxxx>, David Airlie <airlied@xxxxxxxxx>, Simona Vetter <simona@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-trace-kernel@xxxxxxxxxxxxxxx, bpf@xxxxxxxxxxxxxxx, linux-perf-users@xxxxxxxxxxxxxxx, damon@xxxxxxxxxxxxxxx, kasan-dev@xxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 30 Sep 2026 18:41:07 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
On 30/09/2026 6:10 am, Anshuman Khandual wrote:
> On Tue, Sep 22, 2026 at 06:12:32PM +0100, Muhammad Usama Anjum wrote:
>> ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
>> return a software PTE value. Add __pte_from_hw for both generic hw_pte_t
>> definitions. Read the hw_pte_t table element atomically before converting
>> it to pte_t.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxx>
>> ---
>> Changes since v1:
>> - Use software PTE value terminology.
>>
>> Changes since RFC v1:
>> - Define __pte_from_hw for the opted-in generic wrapper.
>> - Apply READ_ONCE() to hw_pte_t before converting it to pte_t.
>> ---
>> include/linux/pgtable.h | 2 +-
>> include/linux/pgtable_types.h | 2 ++
>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
>> index 19098e302b75a..41337da0d65aa 100644
>> --- a/include/linux/pgtable.h
>> +++ b/include/linux/pgtable.h
>> @@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct
>> vm_area_struct *vma,
>> #ifndef ptep_get
>> static inline pte_t ptep_get(hw_pte_t *ptep)
>> {
>> - return READ_ONCE(*ptep);
>> + return __pte_from_hw(READ_ONCE(*ptep));
>> }
>
> Just curious - when would other pgtable levels (PMD, PUD, P4D and PGD) be
> converted
> in this format as well ?
I've patches for conversion of all levels offline. But it would have been
so much difficult and complex (to review and rebase) if I would have posted
all of them. That's why this split was done. I'll be sending other conversion
after acceptance of these current series. PMD conversions has some patches
which require discussion. Other remaining levels are going to be straight
forward. Maybe I'll send those together.
--
Thanks,
Usama
|