Commit a5b3d5df authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'riscv-for-linus-6.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:

 - avoid taking a mutex while resolving jump_labels in the mutex
   implementation

 - avoid trying to resolve the early boot DT pointer via the linear map

 - avoid trying to IPI kfence TLB flushes, as kfence might flush with
   IRQs disabled

 - avoid calling PMD destructors on PMDs that were never constructed

* tag 'riscv-for-linus-6.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: mm: Do not call pmd dtor on vmemmap page table teardown
  riscv: Fix IPIs usage in kfence_protect_page()
  riscv: Fix wrong usage of __pa() on a fixmap address
  riscv: Fixup boot failure when CONFIG_DEBUG_RT_MUTEXES=y
parents 243f750a 21f1b85c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect)
	else
		set_pte(pte, __pte(pte_val(ptep_get(pte)) | _PAGE_PRESENT));

	flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
	preempt_disable();
	local_flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
	preempt_enable();

	return true;
}
+9 −3
Original line number Diff line number Diff line
@@ -36,9 +36,15 @@ bool arch_jump_label_transform_queue(struct jump_entry *entry,
		insn = RISCV_INSN_NOP;
	}

	if (early_boot_irqs_disabled) {
		riscv_patch_in_stop_machine = 1;
		patch_insn_write(addr, &insn, sizeof(insn));
		riscv_patch_in_stop_machine = 0;
	} else {
		mutex_lock(&text_mutex);
		patch_insn_write(addr, &insn, sizeof(insn));
		mutex_unlock(&text_mutex);
	}

	return true;
}
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ static void __init init_resources(void)
static void __init parse_dtb(void)
{
	/* Early scan of device tree from init memory */
	if (early_init_dt_scan(dtb_early_va, __pa(dtb_early_va))) {
	if (early_init_dt_scan(dtb_early_va, dtb_early_pa)) {
		const char *name = of_flat_dt_get_machine_name();

		if (name) {
+4 −3
Original line number Diff line number Diff line
@@ -1566,7 +1566,7 @@ static void __meminit free_pte_table(pte_t *pte_start, pmd_t *pmd)
	pmd_clear(pmd);
}

static void __meminit free_pmd_table(pmd_t *pmd_start, pud_t *pud)
static void __meminit free_pmd_table(pmd_t *pmd_start, pud_t *pud, bool is_vmemmap)
{
	struct page *page = pud_page(*pud);
	struct ptdesc *ptdesc = page_ptdesc(page);
@@ -1579,6 +1579,7 @@ static void __meminit free_pmd_table(pmd_t *pmd_start, pud_t *pud)
			return;
	}

	if (!is_vmemmap)
		pagetable_pmd_dtor(ptdesc);
	if (PageReserved(page))
		free_reserved_page(page);
@@ -1703,7 +1704,7 @@ static void __meminit remove_pud_mapping(pud_t *pud_base, unsigned long addr, un
		remove_pmd_mapping(pmd_base, addr, next, is_vmemmap, altmap);

		if (pgtable_l4_enabled)
			free_pmd_table(pmd_base, pudp);
			free_pmd_table(pmd_base, pudp, is_vmemmap);
	}
}