linux-stable/arch/x86
Suren Baghdasaryan 68f48381d7 mm: introduce __vm_flags_mod and use it in untrack_pfn
There are scenarios when vm_flags can be modified without exclusive
mmap_lock, such as:
- after VMA was isolated and mmap_lock was downgraded or dropped
- in exit_mmap when there are no other mm users and locking is unnecessary
Introduce __vm_flags_mod to avoid assertions when the caller takes
responsibility for the required locking.
Pass a hint to untrack_pfn to conditionally use __vm_flags_mod for
flags modification to avoid assertion.

Link: https://lkml.kernel.org/r/20230126193752.297968-7-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjun Roy <arjunroy@google.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Minchan Kim <minchan@google.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Oskolkov <posk@google.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-02-09 16:51:40 -08:00
..
boot x86/boot: Avoid using Intel mnemonics in AT&T syntax asm 2023-01-10 13:03:23 +01:00
coco x86/insn: Avoid namespace clash by separating instruction decoder MMIO type from MMIO trace type 2023-01-03 18:46:06 +01:00
configs
crypto - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
entry mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
events perf/x86/intel/uncore: Add Emerald Rapids 2023-01-09 12:00:58 +01:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2022-11-29 17:55:29 +00:00
ia32 x86/signal/32: Merge native and compat 32-bit signal code 2022-10-19 09:58:49 +02:00
include mm: add vma_alloc_zeroed_movable_folio() 2023-02-02 22:33:18 -08:00
kernel mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
kvm KVM: x86/xen: Avoid deadlock by adding kvm->arch.xen.xen_lock leaf node lock 2023-01-11 17:45:58 -05:00
lib x86/insn: Avoid namespace clash by separating instruction decoder MMIO type from MMIO trace type 2023-01-03 18:46:06 +01:00
math-emu
mm mm: introduce __vm_flags_mod and use it in untrack_pfn 2023-02-09 16:51:40 -08:00
net - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
pci x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space 2023-01-13 11:53:54 -06:00
platform pci-v6.2-changes 2022-12-14 09:54:10 -08:00
power - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
purgatory x86/purgatory: disable KMSAN instrumentation 2022-10-28 13:37:23 -07:00
ras
realmode x86/boot: Skip realmode init code when running as Xen PV guest 2022-11-25 12:05:22 +01:00
tools
um mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
video
virt/vmx/tdx
xen xen: branch for v6.2-rc4 2023-01-12 17:02:20 -06:00
.gitignore
Kbuild
Kconfig powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile Kbuild updates for v6.2 2022-12-19 12:33:32 -06:00
Makefile.um
Makefile_32.cpu