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

Unverified Commit 4889dec6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Palmer Dabbelt
Browse files

riscv: inline set_pgdir into its only caller



Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
parent 7549cdf5
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -39,16 +39,6 @@ static inline void destroy_context(struct mm_struct *mm)
{
}

static inline void set_pgdir(pgd_t *pgd)
{
	/*
	 * Use the old spbtr name instead of using the current satp
	 * name to support binutils 2.29 which doesn't know about the
	 * privileged ISA 1.10 yet.
	 */
	csr_write(sptbr, virt_to_pfn(next->pgd) | SATP_MODE);
}

/*
 * When necessary, performs a deferred icache flush for the given MM context,
 * on the local CPU.  RISC-V has no direct mechanism for instruction cache
@@ -93,7 +83,12 @@ static inline void switch_mm(struct mm_struct *prev,
		cpumask_clear_cpu(cpu, mm_cpumask(prev));
		cpumask_set_cpu(cpu, mm_cpumask(next));

		set_pgdir(next->pgd);
		/*
		 * Use the old spbtr name instead of using the current satp
		 * name to support binutils 2.29 which doesn't know about the
		 * privileged ISA 1.10 yet.
		 */
		csr_write(sptbr, virt_to_pfn(next->pgd) | SATP_MODE);
		local_flush_tlb_all();

		flush_icache_deferred(next);