|
|
Log in / Subscribe / Register

vmalloc_exec for modules and BPF programs

From:  Song Liu <song-AT-kernel.org>
To:  <linux-mm-AT-kvack.org>, <linux-kernel-AT-vger.kernel.org>
Subject:  [RFC 0/5] vmalloc_exec for modules and BPF programs
Date:  Thu, 18 Aug 2022 15:42:13 -0700
Message-ID:  <20220818224218.2399791-1-song@kernel.org>
Cc:  <akpm-AT-linux-foundation.org>, <x86-AT-kernel.org>, <peterz-AT-infradead.org>, <hch-AT-lst.de>, <kernel-team-AT-fb.com>, <rick.p.edgecombe-AT-intel.com>, <mcgrof-AT-kernel.org>, <dave.hansen-AT-intel.com>, Song Liu <song-AT-kernel.org>
Archive-link:  Article

This set is a prototype that allows dynamic kernel text (modules, bpf
programs, various trampolines, etc.) to share huge pages. The idea is
similar to Peter's suggestion in [1]. Please refer to each patch for
more detais.

The ultimate goal is to only host kernel text in 2MB pages (for x86_64).

Please share your comments on this.

Thanks!

[1] https://lore.kernel.org/bpf/Ys6cWUMHO8XwyYgr@hirez.progra...

Song Liu (5):
  vmalloc: introduce vmalloc_exec and vfree_exec
  bpf: use vmalloc_exec
  modules, x86: use vmalloc_exec for module core
  vmalloc_exec: share a huge page with kernel text
  vmalloc: vfree_exec: free unused vm_struct

 arch/x86/Kconfig              |   1 +
 arch/x86/kernel/alternative.c |  30 ++++-
 arch/x86/kernel/module.c      |   1 +
 arch/x86/mm/init_64.c         |   3 +-
 include/linux/vmalloc.h       |  16 +--
 kernel/bpf/core.c             | 155 ++------------------------
 kernel/module/main.c          |  23 ++--
 kernel/module/strict_rwx.c    |   3 -
 kernel/trace/ftrace.c         |   3 +-
 mm/nommu.c                    |   7 ++
 mm/vmalloc.c                  | 200 +++++++++++++++++++++++++++++-----
 11 files changed, 239 insertions(+), 203 deletions(-)

--
2.30.2



Copyright © 2022, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds