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

Commit 713d52a0 authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Matt Wagantall
Browse files

iommu: io-pgtable-arm: flush tlb for stale mappings



There seems to be a bug in the unmap code that results in us leaving
stale mappings in the page table.  We can actually live with this as
long as we invalidate the tlb when a new mapping comes in on the same
virtual address (to prevent the walker from using the old, bogus
iova->phys mappings).

Change-Id: If5923e853e7ec542b12ca954d5f1c22dec5e5bb2
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent cba1ac43
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -207,9 +207,13 @@ static int arm_lpae_init_pte(struct arm_lpae_io_pgtable *data,

	/* We require an unmap first */
	if (iopte_leaf(*ptep, lvl)) {
		WARN_ON(!selftest_running);
		if (!selftest_running) {
			*ptep = 0;
			data->iop.cfg.tlb->tlb_flush_all(data->iop.cookie);
		} else {
			return -EEXIST;
		}
	}

	if (data->iop.cfg.quirks & IO_PGTABLE_QUIRK_ARM_NS)
		pte |= ARM_LPAE_PTE_NS;