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

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

BACKPORT: arm64: Use __pa_symbol for kernel symbols



(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
Change-Id: Ibef89e5935c9562fa69e946778c705636c1ca61e
parent b11250d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ static inline void __kvm_flush_dcache_pud(pud_t pud)
	kvm_flush_dcache_to_poc(page_address(page), PUD_SIZE);
}

#define kvm_virt_to_phys(x)		__virt_to_phys((unsigned long)(x))
#define kvm_virt_to_phys(x)		__pa_symbol(x)

void kvm_set_way_flush(struct kvm_vcpu *vcpu);
void kvm_toggle_cache(struct kvm_vcpu *vcpu, bool was_enabled);
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,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 *
+3 −3
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ static inline void contextidr_thread_switch(struct task_struct *next)
 */
static inline void cpu_set_reserved_ttbr0(void)
{
	unsigned long ttbr = virt_to_phys(empty_zero_page);
	unsigned long ttbr = __pa_symbol(empty_zero_page);

	asm(
	"	msr	ttbr0_el1, %0			// set TTBR0\n"
@@ -124,7 +124,7 @@ static inline void cpu_install_idmap(void)
	local_flush_tlb_all();
	cpu_set_idmap_tcr_t0sz();

	cpu_switch_mm(idmap_pg_dir, &init_mm);
	cpu_switch_mm(lm_alias(idmap_pg_dir), &init_mm);
}

/*
@@ -139,7 +139,7 @@ static inline void cpu_replace_ttbr1(pgd_t *pgd)

	phys_addr_t pgd_phys = virt_to_phys(pgd);

	replace_phys = (void *)virt_to_phys(idmap_cpu_replace_ttbr1);
	replace_phys = (void *)__pa_symbol(idmap_cpu_replace_ttbr1);

	cpu_install_idmap();
	replace_phys(pgd_phys);
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
 * for zero-mapped memory areas etc..
 */
extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
#define ZERO_PAGE(vaddr)	virt_to_page(empty_zero_page)
#define ZERO_PAGE(vaddr)	phys_to_page(__pa_symbol(empty_zero_page))

#define pte_ERROR(pte)		__pte_error(__FILE__, __LINE__, pte_val(pte))

+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <linux/acpi.h>
#include <linux/mm.h>
#include <linux/types.h>

#include <asm/cpu_ops.h>
@@ -102,7 +103,7 @@ static int acpi_parking_protocol_cpu_boot(unsigned int cpu)
	 * that read this address need to convert this address to the
	 * Boot-Loader's endianness before jumping.
	 */
	writeq_relaxed(__pa(secondary_entry), &mailbox->entry_point);
	writeq_relaxed(__pa_symbol(secondary_entry), &mailbox->entry_point);
	writel_relaxed(cpu_entry->gic_cpu_id, &mailbox->cpu_id);

	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
Loading