Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 625a6492 authored by Matt Wagantall's avatar Matt Wagantall
Browse files

ARM: Don't dump vmalloc addresses with show_data()



Commit a744f794 ("ARM: Don't dump ioremapped memory with show_data()")
attempted to have show_data() return early if an ioremapped address
was passed for dumping. Unfortunately, this does not work in general
since find_vm_area() will only return an area pointer if it is passed
the starting address of the area.

Since no API presently exists to find the start of a VM area given
an address within that area, simplify show_data() to skip dumping
all vmalloc addresses rather than just ioremapped addresses. Other
non-ioremapped vmalloc addresses are not frequently necessary for
debugging anyway, so the impact of this trade-off should be small.

The motivation for this change is the same as before. For stability
reasons, we do not want to dump addresses corresponding to memory-
mapped peripherals that may be unclocked or otherwise inaccessible.

Change-Id: I1c5ac716926b5b573f83a16896acbe257e99bf12
Signed-off-by: default avatarMatt Wagantall <mattw@codeaurora.org>
parent ea19bfb9
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -321,16 +321,13 @@ static void show_data(unsigned long addr, int nbytes, const char *name)
	u32	*p;

	/*
	 * don't attempt to dump non-kernel addresses or
	 * values that are probably just small negative numbers
	 * don't attempt to dump non-kernel addresses, values that are probably
	 * just small negative numbers, or vmalloc addresses that may point to
	 * memory-mapped peripherals
	 */
	if (addr < PAGE_OFFSET || addr > -256UL)
	if (addr < PAGE_OFFSET || addr > -256UL ||
	    is_vmalloc_addr((void *)addr))
		return;
	if (is_vmalloc_addr((void *)addr)) {
		struct vm_struct *area = find_vm_area((void *)addr);
		if (area && area->flags & VM_IOREMAP)
			return;
	}

	printk("\n%s: %#lx:\n", name, addr);