Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: convert prctl to mm_flags_*() accessors

As part of the effort to move to mm->flags becoming a bitmap field,
convert existing users to making use of the mm_flags_*() accessors which
will, when the conversion is complete, be the only means of accessing
mm_struct flags.

No functional change intended.

Link: https://lkml.kernel.org/r/b64f07b94822d02beb88d0d21a6a85f9ee45fc69.1755012943.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Marc Rutland <mark.rutland@arm.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mel Gorman <mgorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Namhyung kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: xu xin <xu.xin16@zte.com.cn>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lorenzo Stoakes and committed by
Andrew Morton
879d0d99 12e423ba

+8 -8
+8 -8
kernel/sys.c
··· 2392 2392 { 2393 2393 unsigned long ret = 0; 2394 2394 2395 - if (test_bit(MMF_HAS_MDWE, &current->mm->flags)) 2395 + if (mm_flags_test(MMF_HAS_MDWE, current->mm)) 2396 2396 ret |= PR_MDWE_REFUSE_EXEC_GAIN; 2397 - if (test_bit(MMF_HAS_MDWE_NO_INHERIT, &current->mm->flags)) 2397 + if (mm_flags_test(MMF_HAS_MDWE_NO_INHERIT, current->mm)) 2398 2398 ret |= PR_MDWE_NO_INHERIT; 2399 2399 2400 2400 return ret; ··· 2427 2427 return -EPERM; /* Cannot unset the flags */ 2428 2428 2429 2429 if (bits & PR_MDWE_NO_INHERIT) 2430 - set_bit(MMF_HAS_MDWE_NO_INHERIT, &current->mm->flags); 2430 + mm_flags_set(MMF_HAS_MDWE_NO_INHERIT, current->mm); 2431 2431 if (bits & PR_MDWE_REFUSE_EXEC_GAIN) 2432 - set_bit(MMF_HAS_MDWE, &current->mm->flags); 2432 + mm_flags_set(MMF_HAS_MDWE, current->mm); 2433 2433 2434 2434 return 0; 2435 2435 } ··· 2627 2627 case PR_GET_THP_DISABLE: 2628 2628 if (arg2 || arg3 || arg4 || arg5) 2629 2629 return -EINVAL; 2630 - error = !!test_bit(MMF_DISABLE_THP, &me->mm->flags); 2630 + error = !!mm_flags_test(MMF_DISABLE_THP, me->mm); 2631 2631 break; 2632 2632 case PR_SET_THP_DISABLE: 2633 2633 if (arg3 || arg4 || arg5) ··· 2635 2635 if (mmap_write_lock_killable(me->mm)) 2636 2636 return -EINTR; 2637 2637 if (arg2) 2638 - set_bit(MMF_DISABLE_THP, &me->mm->flags); 2638 + mm_flags_set(MMF_DISABLE_THP, me->mm); 2639 2639 else 2640 - clear_bit(MMF_DISABLE_THP, &me->mm->flags); 2640 + mm_flags_clear(MMF_DISABLE_THP, me->mm); 2641 2641 mmap_write_unlock(me->mm); 2642 2642 break; 2643 2643 case PR_MPX_ENABLE_MANAGEMENT: ··· 2770 2770 if (arg2 || arg3 || arg4 || arg5) 2771 2771 return -EINVAL; 2772 2772 2773 - error = !!test_bit(MMF_VM_MERGE_ANY, &me->mm->flags); 2773 + error = !!mm_flags_test(MMF_VM_MERGE_ANY, me->mm); 2774 2774 break; 2775 2775 #endif 2776 2776 case PR_RISCV_V_SET_CONTROL: