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

Commit b22f0aa9 authored by Laura Abbott's avatar Laura Abbott Committed by Mark Salyzyn
Browse files

BACKPORT: arm64: Use __pa_symbol for kernel symbols (partial)



(cherry-pick from commit 2077be6783b5936c3daa838d8addbb635667927f)

__pa_symbol is technically the marcro that should be used for kernel
symbols. Switch to this as a pre-requisite for DEBUG_VIRTUAL which
will do bounds checking.

Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarLaura Abbott <labbott@redhat.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Bug: 20045882
Bug: 63737556
Orig-Change-Id: Ibef89e5935c9562fa69e946778c705636c1ca61e
Change-Id: Ic60b1a5efb2a22317063666a7d271279707c8655
parent bf3b6174
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ static inline void *phys_to_virt(phys_addr_t x)
#define __va(x)			((void *)__phys_to_virt((phys_addr_t)(x)))
#define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
#define virt_to_pfn(x)      __phys_to_pfn(__virt_to_phys(x))
#define sym_to_pfn(x)	    __phys_to_pfn(__pa_symbol(x))

/*
 *  virt_to_page(k)	convert a _valid_ virtual address to struct page *
+5 −2
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ static struct vm_special_mapping vdso_spec[2];
static int __init vdso_init(void)
{
	int i;
	unsigned long pfn;

	if (memcmp(&vdso_start, "\177ELF", 4)) {
		pr_err("vDSO is not a valid ELF object!\n");
@@ -131,11 +132,13 @@ static int __init vdso_init(void)
		return -ENOMEM;

	/* Grab the vDSO data page. */
	vdso_pagelist[0] = virt_to_page(vdso_data);
	vdso_pagelist[0] = phys_to_page(__pa_symbol(vdso_data));

	/* Grab the vDSO code pages. */
	pfn = sym_to_pfn(&vdso_start);

	for (i = 0; i < vdso_pages; i++)
		vdso_pagelist[i + 1] = virt_to_page(&vdso_start + i * PAGE_SIZE);
		vdso_pagelist[i + 1] = pfn_to_page(pfn + i);

	/* Populate the special mapping structures */
	vdso_spec[0] = (struct vm_special_mapping) {