<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in mte.c</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>25c17c4b - hugetlb: arm64: add mte support</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#25c17c4b</link>
        <description>hugetlb: arm64: add mte supportEnable MTE support for hugetlb.The MTE page flags will be set on the folio only.  When copyinghugetlb folio (for example, CoW), the tags for all subpages will be copiedwhen copying the first subpage.When freeing hugetlb folio, the MTE flags will be cleared.Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;Signed-off-by: Yang Shi &lt;yang@os.amperecomputing.com&gt;Link: https://lore.kernel.org/r/20241001225220.271178-1-yang@os.amperecomputing.comSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Tue, 01 Oct 2024 22:52:19 +0000</pubDate>
        <dc:creator>Yang Shi &lt;yang@os.amperecomputing.com&gt;</dc:creator>
    </item>
<item>
        <title>86a6a68f - arm64: start using &apos;asm goto&apos; for get_user() when available</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#86a6a68f</link>
        <description>arm64: start using &apos;asm goto&apos; for get_user() when availableThis generates noticeably better code with compilers that support it,since we don&apos;t need to test the error register etc, the exception justjumps to the error handling directly.Note that this also marks SW_TTBR0_PAN incompatible with KCSAN support,since KCSAN wants to save and restore the user access state.KCSAN and SW_TTBR0_PAN were probably always incompatible, but it becameobvious only when implementing the unsafe user access functions.  Atthat point the default empty user_access_save/restore() functionsweren&apos;t provided by the default fallback functions.Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Sun, 09 Jun 2024 17:11:04 +0000</pubDate>
        <dc:creator>Linus Torvalds &lt;torvalds@linux-foundation.org&gt;</dc:creator>
    </item>
<item>
        <title>5a00bfd6 - arm64/mm: new ptep layer to manage contig bit</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#5a00bfd6</link>
        <description>arm64/mm: new ptep layer to manage contig bitCreate a new layer for the in-table PTE manipulation APIs.  For now, Theexisting API is prefixed with double underscore to become the arch-privateAPI and the public API is just a simple wrapper that calls the privateAPI.The public API implementation will subsequently be used to transparentlymanipulate the contiguous bit where appropriate.  But since there arealready some contig-aware users (e.g.  hugetlb, kernel mapper), we mustfirst ensure those users use the private API directly so that the futurecontig-bit manipulations in the public API do not interfere with thoseexisting uses.The following APIs are treated this way: - ptep_get - set_pte - set_ptes - pte_clear - ptep_get_and_clear - ptep_test_and_clear_young - ptep_clear_flush_young - ptep_set_wrprotect - ptep_set_access_flagsLink: https://lkml.kernel.org/r/20240215103205.2607016-11-ryan.roberts@arm.comSigned-off-by: Ryan Roberts &lt;ryan.roberts@arm.com&gt;Tested-by: John Hubbard &lt;jhubbard@nvidia.com&gt;Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Cc: Alistair Popple &lt;apopple@nvidia.com&gt;Cc: Andrey Ryabinin &lt;ryabinin.a.a@gmail.com&gt;Cc: Ard Biesheuvel &lt;ardb@kernel.org&gt;Cc: Barry Song &lt;21cnbao@gmail.com&gt;Cc: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Cc: David Hildenbrand &lt;david@redhat.com&gt;Cc: &quot;H. Peter Anvin&quot; &lt;hpa@zytor.com&gt;Cc: Ingo Molnar &lt;mingo@redhat.com&gt;Cc: James Morse &lt;james.morse@arm.com&gt;Cc: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;Cc: Marc Zyngier &lt;maz@kernel.org&gt;Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Cc: Yang Shi &lt;shy828301@gmail.com&gt;Cc: Zi Yan &lt;ziy@nvidia.com&gt;Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Thu, 15 Feb 2024 10:31:57 +0000</pubDate>
        <dc:creator>Ryan Roberts &lt;ryan.roberts@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>659e1930 - arm64/mm: convert set_pte_at() to set_ptes(..., 1)</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#659e1930</link>
        <description>arm64/mm: convert set_pte_at() to set_ptes(..., 1)Since set_ptes() was introduced, set_pte_at() has been implemented as ageneric macro around set_ptes(..., 1).  So this change should continue togenerate the same code.  However, making this change prepares us for thetransparent contpte support.  It means we can reroute set_ptes() to__set_ptes().  Since set_pte_at() is a generic macro, there will be noequivalent __set_pte_at() to reroute to.Note that a couple of calls to set_pte_at() remain in the arch code.  Thisis intentional, since those call sites are acting on behalf of core-mm andshould continue to call into the public set_ptes() rather than thearch-private __set_ptes().Link: https://lkml.kernel.org/r/20240215103205.2607016-9-ryan.roberts@arm.comSigned-off-by: Ryan Roberts &lt;ryan.roberts@arm.com&gt;Tested-by: John Hubbard &lt;jhubbard@nvidia.com&gt;Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Cc: Alistair Popple &lt;apopple@nvidia.com&gt;Cc: Andrey Ryabinin &lt;ryabinin.a.a@gmail.com&gt;Cc: Ard Biesheuvel &lt;ardb@kernel.org&gt;Cc: Barry Song &lt;21cnbao@gmail.com&gt;Cc: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Cc: David Hildenbrand &lt;david@redhat.com&gt;Cc: &quot;H. Peter Anvin&quot; &lt;hpa@zytor.com&gt;Cc: Ingo Molnar &lt;mingo@redhat.com&gt;Cc: James Morse &lt;james.morse@arm.com&gt;Cc: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;Cc: Marc Zyngier &lt;maz@kernel.org&gt;Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Cc: Yang Shi &lt;shy828301@gmail.com&gt;Cc: Zi Yan &lt;ziy@nvidia.com&gt;Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Thu, 15 Feb 2024 10:31:55 +0000</pubDate>
        <dc:creator>Ryan Roberts &lt;ryan.roberts@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>6a1960b8 - mm/gup: adapt get_user_page_vma_remote() to never return NULL</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#6a1960b8</link>
        <description>mm/gup: adapt get_user_page_vma_remote() to never return NULLget_user_pages_remote() will never return 0 except in the case ofFOLL_NOWAIT being specified, which we explicitly disallow.This simplifies error handling for the caller and avoids the awkwardnessof dealing with both errors and failing to pin.  Failing to pin here is anerror.Link: https://lkml.kernel.org/r/00319ce292d27b3aae76a0eb220ce3f528187508.1696288092.git.lstoakes@gmail.comSigned-off-by: Lorenzo Stoakes &lt;lstoakes@gmail.com&gt;Suggested-by: Arnd Bergmann &lt;arnd@arndb.de&gt;Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;Cc: Ian Rogers &lt;irogers@google.com&gt;Cc: Ingo Molnar &lt;mingo@redhat.com&gt;Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;Cc: John Hubbard &lt;jhubbard@nvidia.com&gt;Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Mon, 02 Oct 2023 23:14:54 +0000</pubDate>
        <dc:creator>Lorenzo Stoakes &lt;lstoakes@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>3425cec4 - arm64/mm: Hoist synchronization out of set_ptes() loop</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#3425cec4</link>
        <description>arm64/mm: Hoist synchronization out of set_ptes() loopset_ptes() sets a physically contiguous block of memory (which allbelongs to the same folio) to a contiguous block of ptes. The arm64implementation of this previously just looped, operating on eachindividual pte. But the __sync_icache_dcache() and mte_sync_tags()operations can both be hoisted out of the loop so that they areperformed once for the contiguous set of pages (which may be less thanthe whole folio). This should result in minor performance gains.__sync_icache_dcache() already acts on the whole folio, and sets a flagin the folio so that it skips duplicate calls. But by hoisting the call,all the pte testing is done only once.mte_sync_tags() operates on each individual page with its own loop. Butby passing the number of pages explicitly, we can rely solely on itsloop and do the checks only once. This approach also makes it robust forthe future, rather than assuming if a head page of a compound page isbeing mapped, then the whole compound page is being mapped, instead weexplicitly know how many pages are being mapped. The old assumption maynot continue to hold once the &quot;anonymous large folios&quot; feature ismerged.Signed-off-by: Ryan Roberts &lt;ryan.roberts@arm.com&gt;Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;Link: https://lore.kernel.org/r/20231005140730.2191134-1-ryan.roberts@arm.comSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Thu, 05 Oct 2023 14:07:30 +0000</pubDate>
        <dc:creator>Ryan Roberts &lt;ryan.roberts@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>332c151c - arm64: mte: simplify swap tag restoration logic</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#332c151c</link>
        <description>arm64: mte: simplify swap tag restoration logicAs a result of the patches &quot;mm: Call arch_swap_restore() fromdo_swap_page()&quot; and &quot;mm: Call arch_swap_restore() from unuse_pte()&quot;, thereare no circumstances in which a swapped-in page is installed in a pagetable without first having arch_swap_restore() called on it.  Therefore,we no longer need the logic in set_pte_at() that restores the tags, soremove it.Link: https://lkml.kernel.org/r/20230523004312.1807357-4-pcc@google.comLink: https://linux-review.googlesource.com/id/I8ad54476f3b2d0144ccd8ce0c1d7a2963e5ff6f3Signed-off-by: Peter Collingbourne &lt;pcc@google.com&gt;Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Cc: Alexandru Elisei &lt;alexandru.elisei@arm.com&gt;Cc: Chinwen Chang &lt;chinwen.chang@mediatek.com&gt;Cc: David Hildenbrand &lt;david@redhat.com&gt;Cc: Evgenii Stepanov &lt;eugenis@google.com&gt;Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;Cc: kasan-dev@googlegroups.comCc: kasan-dev &lt;kasan-dev@googlegroups.com&gt;Cc: &quot;Kuan-Ying Lee (&#26446;&#20896;&#31310;)&quot; &lt;Kuan-Ying.Lee@mediatek.com&gt;Cc: Qun-Wei Lin &lt;qun-wei.lin@mediatek.com&gt;Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;Cc: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Cc: &quot;Huang, Ying&quot; &lt;ying.huang@intel.com&gt;Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Tue, 23 May 2023 00:43:10 +0000</pubDate>
        <dc:creator>Peter Collingbourne &lt;pcc@google.com&gt;</dc:creator>
    </item>
<item>
        <title>ca5e8632 - mm/gup: remove vmas parameter from get_user_pages_remote()</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#ca5e8632</link>
        <description>mm/gup: remove vmas parameter from get_user_pages_remote()The only instances of get_user_pages_remote() invocations which used thevmas parameter were for a single page which can instead simply look up theVMA directly. In particular:-- __update_ref_ctr() looked up the VMA but did nothing with it so we simply  remove it.- __access_remote_vm() was already using vma_lookup() when the original  lookup failed so by doing the lookup directly this also de-duplicates the  code.We are able to perform these VMA operations as we already hold themmap_lock in order to be able to call get_user_pages_remote().As part of this work we add get_user_page_vma_remote() which abstracts theVMA lookup, error handling and decrementing the page reference count shouldthe VMA lookup fail.This forms part of a broader set of patches intended to eliminate the vmasparameter altogether.[akpm@linux-foundation.org: avoid passing NULL to PTR_ERR]Link: https://lkml.kernel.org/r/d20128c849ecdbf4dd01cc828fcec32127ed939a.1684350871.git.lstoakes@gmail.comSigned-off-by: Lorenzo Stoakes &lt;lstoakes@gmail.com&gt;Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt; (for arm64)Acked-by: David Hildenbrand &lt;david@redhat.com&gt;Reviewed-by: Janosch Frank &lt;frankja@linux.ibm.com&gt; (for s390)Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;Cc: Christian K&#246;nig &lt;christian.koenig@amd.com&gt;Cc: Dennis Dalessandro &lt;dennis.dalessandro@cornelisnetworks.com&gt;Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;Cc: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Cc: Jason Gunthorpe &lt;jgg@nvidia.com&gt;Cc: Jens Axboe &lt;axboe@kernel.dk&gt;Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;Cc: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;Cc: Sean Christopherson &lt;seanjc@google.com&gt;Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Wed, 17 May 2023 19:25:39 +0000</pubDate>
        <dc:creator>Lorenzo Stoakes &lt;lstoakes@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>c4c597f1 - arm64: mte: Do not set PG_mte_tagged if tags were not initialized</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#c4c597f1</link>
        <description>arm64: mte: Do not set PG_mte_tagged if tags were not initializedThe mte_sync_page_tags() function sets PG_mte_tagged if it initializespage tags. Then we return to mte_sync_tags(), which sets PG_mte_taggedagain. At best, this is redundant. However, it is possible formte_sync_page_tags() to return without having initialized tags for thepage, i.e. in the case where check_swap is true (non-compound page),is_swap_pte(old_pte) is false and pte_is_tagged is false. So at worst,we set PG_mte_tagged on a page with uninitialized tags. This can happenif, for example, page migration causes a PTE for an untagged page tobe replaced. If the userspace program subsequently uses mprotect() toenable PROT_MTE for that page, the uninitialized tags will be exposedto userspace.Fix it by removing the redundant call to set_page_mte_tagged().Fixes: e059853d14ca (&quot;arm64: mte: Fix/clarify the PG_mte_tagged semantics&quot;)Signed-off-by: Peter Collingbourne &lt;pcc@google.com&gt;Cc: &lt;stable@vger.kernel.org&gt; # 6.1Link: https://linux-review.googlesource.com/id/Ib02d004d435b2ed87603b858ef7480f7b1463052Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reviewed-by: Alexandru Elisei &lt;alexandru.elisei@arm.com&gt;Link: https://lore.kernel.org/r/20230420214327.2357985-1-pcc@google.comSigned-off-by: Will Deacon &lt;will@kernel.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Thu, 20 Apr 2023 21:43:27 +0000</pubDate>
        <dc:creator>Peter Collingbourne &lt;pcc@google.com&gt;</dc:creator>
    </item>
<item>
        <title>d77e59a8 - arm64: mte: Lock a page for MTE tag initialisation</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#d77e59a8</link>
        <description>arm64: mte: Lock a page for MTE tag initialisationInitialising the tags and setting PG_mte_tagged flag for a page can racebetween multiple set_pte_at() on shared pages or setting the stage 2 ptevia user_mem_abort(). Introduce a new PG_mte_lock flag as PG_arch_3 andset it before attempting page initialisation. Given that PG_mte_taggedis never cleared for a page, consider setting this flag to mean pageunlocked and wait on this bit with acquire semantics if the page islocked:- try_page_mte_tagging() - lock the page for tagging, return true if it  can be tagged, false if already tagged. No acquire semantics if it  returns true (PG_mte_tagged not set) as there is no serialisation with  a previous set_page_mte_tagged().- set_page_mte_tagged() - set PG_mte_tagged with release semantics.The two-bit locking is based on Peter Collingbourne&apos;s idea.Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Signed-off-by: Peter Collingbourne &lt;pcc@google.com&gt;Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Cc: Marc Zyngier &lt;maz@kernel.org&gt;Cc: Peter Collingbourne &lt;pcc@google.com&gt;Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;Link: https://lore.kernel.org/r/20221104011041.290951-6-pcc@google.com

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Fri, 04 Nov 2022 01:10:38 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>e059853d - arm64: mte: Fix/clarify the PG_mte_tagged semantics</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#e059853d</link>
        <description>arm64: mte: Fix/clarify the PG_mte_tagged semanticsCurrently the PG_mte_tagged page flag mostly means the page containsvalid tags and it should be set after the tags have been cleared orrestored. However, in mte_sync_tags() it is set before setting the tagsto avoid, in theory, a race with concurrent mprotect(PROT_MTE) forshared pages. However, a concurrent mprotect(PROT_MTE) with a copy onwrite in another thread can cause the new page to have stale tags.Similarly, tag reading via ptrace() can read stale tags if thePG_mte_tagged flag is set before actually clearing/restoring the tags.Fix the PG_mte_tagged semantics so that it is only set after the tagshave been cleared or restored. This is safe for swap restoring into aMAP_SHARED or CoW page since the core code takes the page lock. Add twofunctions to test and set the PG_mte_tagged flag with acquire andrelease semantics. The downside is that concurrent mprotect(PROT_MTE) ona MAP_SHARED page may cause tag loss. This is already the case for KVMguests if a VMM changes the page protection while the guest triggers auser_mem_abort().Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;[pcc@google.com: fix build with CONFIG_ARM64_MTE disabled]Signed-off-by: Peter Collingbourne &lt;pcc@google.com&gt;Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Cc: Marc Zyngier &lt;maz@kernel.org&gt;Cc: Peter Collingbourne &lt;pcc@google.com&gt;Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;Link: https://lore.kernel.org/r/20221104011041.290951-3-pcc@google.com

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Fri, 04 Nov 2022 01:10:35 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>a8e5e514 - arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#a8e5e514</link>
        <description>arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restoredPrior to commit 69e3b846d8a7 (&quot;arm64: mte: Sync tags for pages where PTEis untagged&quot;), mte_sync_tags() was only called for pte_tagged() entries(those mapped with PROT_MTE). Therefore mte_sync_tags() could safely usetest_and_set_bit(PG_mte_tagged, &amp;page-&gt;flags) without inadvertentlysetting PG_mte_tagged on an untagged page.The above commit was required as guests may enable MTE without anycontrol at the stage 2 mapping, nor a PROT_MTE mapping in the VMM.However, the side-effect was that any page with a PTE that looked likeswap (or migration) was getting PG_mte_tagged set automatically. Asubsequent page copy (e.g. migration) copied the tags to the destinationpage even if the tags were owned by KASAN.This issue was masked by the page_kasan_tag_reset() call introduced incommit e5b8d9218951 (&quot;arm64: mte: reset the page tag in page-&gt;flags&quot;).When this commit was reverted (20794545c146), KASAN started reportingaccess faults because the overriding tags in a page did not match theoriginal page-&gt;flags (with CONFIG_KASAN_HW_TAGS=y):  BUG: KASAN: invalid-access in copy_page+0x10/0xd0 arch/arm64/lib/copy_page.S:26  Read at addr f5ff000017f2e000 by task syz-executor.1/2218  Pointer tag: [f5], memory tag: [f2]Move the PG_mte_tagged bit setting from mte_sync_tags() to the actualplace where tags are cleared (mte_sync_page_tags()) or restored(mte_restore_tags()).Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reported-by: syzbot+c2c79c6d6eddc5262b77@syzkaller.appspotmail.comFixes: 69e3b846d8a7 (&quot;arm64: mte: Sync tags for pages where PTE is untagged&quot;)Cc: &lt;stable@vger.kernel.org&gt; # 5.14.xCc: Steven Price &lt;steven.price@arm.com&gt;Cc: Andrey Konovalov &lt;andreyknvl@gmail.com&gt;Cc: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Link: https://lore.kernel.org/r/0000000000004387dc05e5888ae5@google.com/Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;Link: https://lore.kernel.org/r/20221006163354.3194102-1-catalin.marinas@arm.comSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Thu, 06 Oct 2022 16:33:54 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>973b9e37 - arm64: mte: move register initialization to C</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#973b9e37</link>
        <description>arm64: mte: move register initialization to CIf FEAT_MTE2 is disabled via the arm64.nomte command line argument on aCPU that claims to support FEAT_MTE2, the kernel will use Tagged Normalin the MAIR. If we interpret arm64.nomte to mean that the CPU does notin fact implement FEAT_MTE2, setting the system register like this maylead to UNSPECIFIED behavior. Fix it by arranging for MAIR to be setin the C function cpu_enable_mte which is called based on the sanitizedversion of the system register.There is no need for the rest of the MTE-related system registerinitialization to happen from assembly, with the exception of TCR_EL1,which must be set to include at least TBI1 because the secondary CPUsaccess KASan-allocated data structures early. Therefore, make the TCR_EL1initialization unconditional and move the rest of the initialization tocpu_enable_mte so that we no longer have a dependency on the unsanitizedID register value.Co-developed-by: Evgenii Stepanov &lt;eugenis@google.com&gt;Signed-off-by: Peter Collingbourne &lt;pcc@google.com&gt;Signed-off-by: Evgenii Stepanov &lt;eugenis@google.com&gt;Suggested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reported-by: kernel test robot &lt;lkp@intel.com&gt;Fixes: 3b714d24ef17 (&quot;arm64: mte: CPU feature detection and initial sysreg configuration&quot;)Cc: &lt;stable@vger.kernel.org&gt; # 5.10.xLink: https://lore.kernel.org/r/20220915222053.3484231-1-eugenis@google.comSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Thu, 15 Sep 2022 22:20:53 +0000</pubDate>
        <dc:creator>Peter Collingbourne &lt;pcc@google.com&gt;</dc:creator>
    </item>
<item>
        <title>20794545 - arm64: kasan: Revert &quot;arm64: mte: reset the page tag in page-&gt;flags&quot;</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#20794545</link>
        <description>arm64: kasan: Revert &quot;arm64: mte: reset the page tag in page-&gt;flags&quot;This reverts commit e5b8d9218951e59df986f627ec93569a0d22149b.Pages mapped in user-space with PROT_MTE have the allocation tags eitherzeroed or copied/restored to some user values. In order for the kernelto access such pages via page_address(), resetting the tag inpage-&gt;flags was necessary. This tag resetting was deferred toset_pte_at() -&gt; mte_sync_page_tags() but it can race with another CPUreading the flags (via page_to_virt()):P0 (mte_sync_page_tags):	P1 (memcpy from virt_to_page):				  Rflags!=0xff  Wflags=0xff  DMB (doesn&apos;t help)  Wtags=0				  Rtags=0   // faultSince now the post_alloc_hook() function resets the page-&gt;flags tag whenunpoisoning is skipped for user pages (including the __GFP_ZEROTAGScase), revert the arm64 commit calling page_kasan_tag_reset().Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Cc: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;Cc: Andrey Konovalov &lt;andreyknvl@gmail.com&gt;Cc: Peter Collingbourne &lt;pcc@google.com&gt;Reviewed-by: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;Acked-by: Andrey Konovalov &lt;andreyknvl@gmail.com&gt;Link: https://lore.kernel.org/r/20220610152141.2148929-5-catalin.marinas@arm.comSigned-off-by: Will Deacon &lt;will@kernel.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Fri, 10 Jun 2022 15:21:41 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>78cdaf3f - arm64: Add kasan_hw_tags_enable() prototype to silence sparse</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#78cdaf3f</link>
        <description>arm64: Add kasan_hw_tags_enable() prototype to silence sparseThis function is only called from assembly, no need for a prototypedeclaration in a header file. In addition, add #ifdef around thefunction since it is only used when CONFIG_KASAN_HW_TAGS.Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reported-by: kernel test robot &lt;lkp@intel.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Fri, 10 Jun 2022 17:01:31 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>1d0cb4c8 - arm64: mte: Ensure the cleared tags are visible before setting the PTE</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#1d0cb4c8</link>
        <description>arm64: mte: Ensure the cleared tags are visible before setting the PTEAs an optimisation, only pages mapped with PROT_MTE in user space havethe MTE tags zeroed. This is done lazily at the set_pte_at() time viamte_sync_tags(). However, this function is missing a barrier and anotherCPU may see the PTE updated before the zeroed tags are visible. Add ansmp_wmb() barrier if the mapping is Normal Tagged.Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Fixes: 34bfeea4a9e9 (&quot;arm64: mte: Clear the tags when a page is mapped in user-space with PROT_MTE&quot;)Cc: &lt;stable@vger.kernel.org&gt; # 5.10.xReported-by: Vladimir Murzin &lt;vladimir.murzin@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;Tested-by: Vladimir Murzin &lt;vladimir.murzin@arm.com&gt;Link: https://lore.kernel.org/r/20220517093532.127095-1-catalin.marinas@arm.comSigned-off-by: Will Deacon &lt;will@kernel.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Tue, 17 May 2022 09:35:32 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>bc249e37 - arm64/mte: Make TCF field values and naming more standard</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#bc249e37</link>
        <description>arm64/mte: Make TCF field values and naming more standardIn preparation for automatic generation of the defines for system registersmake the values used for the enumeration in SCTLR_ELx.TCF suitable for usewith the newly defined SYS_FIELD_PREP_ENUM helper, removing the shift fromthe define and using the helper to generate it on use instead. Since weonly ever interact with this field in EL1 and in preparation for generationof the defines also rename from SCTLR_ELx to SCTLR_EL1. SCTLR_EL2 is notquite the same as SCTLR_EL1 so the conversion does not share the fielddefinitions.There should be no functional change from this patch.Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;Link: https://lore.kernel.org/r/20220503170233.507788-4-broonie@kernel.orgSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Tue, 03 May 2022 17:02:24 +0000</pubDate>
        <dc:creator>Mark Brown &lt;broonie@kernel.org&gt;</dc:creator>
    </item>
<item>
        <title>96f101a9 - arm64/mte: Make TCF0 naming and field values more standard</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#96f101a9</link>
        <description>arm64/mte: Make TCF0 naming and field values more standardIn preparation for automatic generation of SCTLR_EL1 register definitionsmake the macros used to define SCTLR_EL1.TCF0 and the enumeration values ithas more standard so they can be used with FIELD_PREP() via the newlydefined SYS_FIELD_PREP_ helpers.Since the field also exists in SCTLR_EL2 with the same values also renamethe macros to SCTLR_ELx rather than SCTLR_EL1.There should be no functional change as a result of this patch.Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;Acked-by: Mark Rutland &lt;mark.rutland@arm.comLink: https://lore.kernel.org/r/20220503170233.507788-3-broonie@kernel.orgSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Tue, 03 May 2022 17:02:23 +0000</pubDate>
        <dc:creator>Mark Brown &lt;broonie@kernel.org&gt;</dc:creator>
    </item>
<item>
        <title>f3ba50a7 - arm64: Add support for user sub-page fault probing</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#f3ba50a7</link>
        <description>arm64: Add support for user sub-page fault probingWith MTE, even if the pte allows an access, a mismatched tag somewherewithin a page can still cause a fault. Select ARCH_HAS_SUBPAGE_FAULTS ifMTE is enabled and implement the probe_subpage_writeable() function.Note that get_user() is sufficient for the writeable MTE check since thesame tag mismatch fault would be triggered by a read. The caller ofprobe_subpage_writeable() will need to check the pte permissions(put_user, GUP).Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Cc: Will Deacon &lt;will@kernel.org&gt;Link: https://lore.kernel.org/r/20220423100751.1870771-3-catalin.marinas@arm.comSigned-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Sat, 23 Apr 2022 10:07:50 +0000</pubDate>
        <dc:creator>Catalin Marinas &lt;catalin.marinas@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>cf220ad6 - arm64/mte: Remove asymmetric mode from the prctl() interface</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/arch/arm64/kernel/mte.c#cf220ad6</link>
        <description>arm64/mte: Remove asymmetric mode from the prctl() interfaceAs pointed out by Evgenii Stepanov one potential issue with the new ABI forenabling asymmetric is that if there are multiple places where MTE isconfigured in a process, some of which were compiled with the old prctl.hand some of which were compiled with the new prctl.h, there may be problemskeeping track of which MTE modes are requested. For example some code maydisable only sync and async modes leaving asymmetric mode enabled when itintended to fully disable MTE.In order to avoid such mishaps remove asymmetric mode from the prctl(),instead implicitly allowing it if both sync and async modes are requested.This should not disrupt userspace since a process requesting both mayalready see a mix of sync and async modes due to differing defaults betweenCPUs or changes in default while the process is running but it does meanthat userspace is unable to explicitly request asymmetric mode withoutchanging the system default for CPUs.Reported-by: Evgenii Stepanov &lt;eugenis@google.com&gt;Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;Reviewed-by: Evgenii Stepanov &lt;eugenis@google.com&gt;Cc: Peter Collingbourne &lt;pcc@google.com&gt;Cc: Joey Gouly &lt;joey.gouly@arm.com&gt;Cc: Branislav Rankov &lt;branislav.rankov@arm.com&gt;Link: https://lore.kernel.org/r/20220309131200.112637-1-broonie@kernel.orgSigned-off-by: Will Deacon &lt;will@kernel.org&gt;

            List of files:
            /linux-6.15/arch/arm64/kernel/mte.c</description>
        <pubDate>Wed, 09 Mar 2022 13:12:00 +0000</pubDate>
        <dc:creator>Mark Brown &lt;broonie@kernel.org&gt;</dc:creator>
    </item>
</channel>
</rss>
