Commit f6fbb8b2 authored by Alexander Potapenko's avatar Alexander Potapenko Committed by Andrew Morton

Revert "kmsan: unpoison @tlb in arch_tlb_gather_mmu()"

This reverts commit ac801e7e.

The patch in question was picked to -mm from the KMSAN v6 patch series
(https://lore.kernel.org/linux-mm/20220905122452.2258262-1-glider@google.com/)
and sneaked into mainline despite its removal from the v7 series
(https://lore.kernel.org/linux-mm/20220915150417.722975-1-glider@google.com/)

Currently KMSAN does not warn about origin chains hitting the maximum
depth, so keeping @tlb poisoned won't result in any inconveniences.

Link: https://lkml.kernel.org/r/20221110113541.1844156-1-glider@google.comSigned-off-by: default avatarAlexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 7438899b
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kmsan-checks.h>
#include <linux/mmdebug.h> #include <linux/mmdebug.h>
#include <linux/mm_types.h> #include <linux/mm_types.h>
#include <linux/mm_inline.h> #include <linux/mm_inline.h>
...@@ -299,15 +298,6 @@ void tlb_flush_mmu(struct mmu_gather *tlb) ...@@ -299,15 +298,6 @@ void tlb_flush_mmu(struct mmu_gather *tlb)
static void __tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, static void __tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
bool fullmm) bool fullmm)
{ {
/*
* struct mmu_gather contains 7 1-bit fields packed into a 32-bit
* unsigned int value. The remaining 25 bits remain uninitialized
* and are never used, but KMSAN updates the origin for them in
* zap_pXX_range() in mm/memory.c, thus creating very long origin
* chains. This is technically correct, but consumes too much memory.
* Unpoisoning the whole structure will prevent creating such chains.
*/
kmsan_unpoison_memory(tlb, sizeof(*tlb));
tlb->mm = mm; tlb->mm = mm;
tlb->fullmm = fullmm; tlb->fullmm = fullmm;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment