Skip to content

Commit f1c4069

Browse files
JoonsooKimtorvalds
authored andcommitted
mm, vmalloc: export vmap_area_list, instead of vmlist
Although our intention is to unexport internal structure entirely, but there is one exception for kexec. kexec dumps address of vmlist and makedumpfile uses this information. We are about to remove vmlist, then another way to retrieve information of vmalloc layer is needed for makedumpfile. For this purpose, we export vmap_area_list, instead of vmlist. Signed-off-by: Joonsoo Kim <js1304@gmail.com> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Dave Anderson <anderson@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d4033af commit f1c4069

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎include/linux/vmalloc.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);
130130
/*
131131
* Internals. Dont't use..
132132
*/
133-
extern rwlock_t vmlist_lock;
134-
extern struct vm_struct *vmlist;
133+
extern struct list_head vmap_area_list;
135134
extern __init void vm_area_add_early(struct vm_struct *vm);
136135
extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
137136

‎kernel/kexec.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ static int __init crash_save_vmcoreinfo_init(void)
15771577
VMCOREINFO_SYMBOL(swapper_pg_dir);
15781578
#endif
15791579
VMCOREINFO_SYMBOL(_stext);
1580-
VMCOREINFO_SYMBOL(vmlist);
1580+
VMCOREINFO_SYMBOL(vmap_area_list);
15811581

15821582
#ifndef CONFIG_NEED_MULTIPLE_NODES
15831583
VMCOREINFO_SYMBOL(mem_map);

‎mm/nommu.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
228228
}
229229
EXPORT_SYMBOL(follow_pfn);
230230

231-
DEFINE_RWLOCK(vmlist_lock);
232-
struct vm_struct *vmlist;
231+
LIST_HEAD(vmap_area_list);
233232

234233
void vfree(const void *addr)
235234
{

‎mm/vmalloc.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ struct vmap_area {
261261
};
262262

263263
static DEFINE_SPINLOCK(vmap_area_lock);
264-
static LIST_HEAD(vmap_area_list);
264+
/* Export for kexec only */
265+
LIST_HEAD(vmap_area_list);
265266
static struct rb_root vmap_area_root = RB_ROOT;
266267

267268
/* The vmap cache globals are protected by vmap_area_lock */
@@ -272,6 +273,10 @@ static unsigned long cached_align;
272273

273274
static unsigned long vmap_area_pcpu_hole;
274275

276+
/*** Old vmalloc interfaces ***/
277+
static DEFINE_RWLOCK(vmlist_lock);
278+
static struct vm_struct *vmlist;
279+
275280
static struct vmap_area *__find_vmap_area(unsigned long addr)
276281
{
277282
struct rb_node *n = vmap_area_root.rb_node;
@@ -1283,10 +1288,6 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
12831288
}
12841289
EXPORT_SYMBOL_GPL(map_vm_area);
12851290

1286-
/*** Old vmalloc interfaces ***/
1287-
DEFINE_RWLOCK(vmlist_lock);
1288-
struct vm_struct *vmlist;
1289-
12901291
static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va,
12911292
unsigned long flags, const void *caller)
12921293
{

0 commit comments

Comments
 (0)