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

Commit 4f9c53c8 authored by Michael Ellerman's avatar Michael Ellerman
Browse files

powerpc: Fix compile errors with STRICT_MM_TYPECHECKS enabled



Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[mpe: Fix the 32-bit code also]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 5dd4e4f6
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -290,11 +290,11 @@ static inline pte_t kvmppc_read_update_linux_pte(pte_t *ptep, int writing,
	pte_t old_pte, new_pte = __pte(0);

	while (1) {
		old_pte = pte_val(*ptep);
		old_pte = *ptep;
		/*
		 * wait until _PAGE_BUSY is clear then set it atomically
		 */
		if (unlikely(old_pte & _PAGE_BUSY)) {
		if (unlikely(pte_val(old_pte) & _PAGE_BUSY)) {
			cpu_relax();
			continue;
		}
@@ -305,17 +305,19 @@ static inline pte_t kvmppc_read_update_linux_pte(pte_t *ptep, int writing,
			return __pte(0);
#endif
		/* If pte is not present return None */
		if (unlikely(!(old_pte & _PAGE_PRESENT)))
		if (unlikely(!(pte_val(old_pte) & _PAGE_PRESENT)))
			return __pte(0);

		new_pte = pte_mkyoung(old_pte);
		if (writing && pte_write(old_pte))
			new_pte = pte_mkdirty(new_pte);

		if (old_pte == __cmpxchg_u64((unsigned long *)ptep, old_pte,
					     new_pte))
		if (pte_val(old_pte) == __cmpxchg_u64((unsigned long *)ptep,
						      pte_val(old_pte),
						      pte_val(new_pte))) {
			break;
		}
	}
	return new_pte;
}

+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ __dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t
		do {
			SetPageReserved(page);
			map_page(vaddr, page_to_phys(page),
				 pgprot_noncached(PAGE_KERNEL));
				 pgprot_val(pgprot_noncached(PAGE_KERNEL)));
			page++;
			vaddr += PAGE_SIZE;
		} while (size -= PAGE_SIZE);
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static unsigned long map_mem_in_cams_addr(phys_addr_t phys, unsigned long virt,
		unsigned long cam_sz;

		cam_sz = calc_cam_sz(ram, virt, phys);
		settlbcam(i, virt, phys, cam_sz, PAGE_KERNEL_X, 0);
		settlbcam(i, virt, phys, cam_sz, pgprot_val(PAGE_KERNEL_X), 0);

		ram -= cam_sz;
		amount_mapped += cam_sz;
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
	 * atomically mark the linux large page PMD busy and dirty
	 */
	do {
		pmd_t pmd = ACCESS_ONCE(*pmdp);
		pmd_t pmd = READ_ONCE(*pmdp);

		old_pmd = pmd_val(pmd);
		/* If PMD busy, retry the access */
+2 −2
Original line number Diff line number Diff line
@@ -964,7 +964,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
		*shift = 0;

	pgdp = pgdir + pgd_index(ea);
	pgd  = ACCESS_ONCE(*pgdp);
	pgd  = READ_ONCE(*pgdp);
	/*
	 * Always operate on the local stack value. This make sure the
	 * value don't get updated by a parallel THP split/collapse,
@@ -1045,7 +1045,7 @@ int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
	if (pte_end < end)
		end = pte_end;

	pte = ACCESS_ONCE(*ptep);
	pte = READ_ONCE(*ptep);
	mask = _PAGE_PRESENT | _PAGE_USER;
	if (write)
		mask |= _PAGE_RW;
Loading