Re: [PATCH] powerpc: Fix mprotect on book3s32

From: Dave Vasilevsky
Date: Sat Nov 08 2025 - 17:25:35 EST


On 2025-11-08 14:16, Ritesh Harjani wrote:
> Shouldn't we flush all if we get tlb_flush request for full mm? e.g.
> Something like this maybe?
>
> +void hash__tlb_flush(struct mmu_gather *tlb)
> +{
> + if (tlb->fullmm || tlb->need_flush_all)
> + hash__flush_tlb_mm(tlb->mm);
> + else
> + hash__flush_range(tlb->mm, tlb->start, tlb->end);
> +}

That seems reasonable, I should be able to test it next by next
weekend and re-submit.

> Thanks again for pointing this out. How did you find this though?
> What hardware do you use?

I'm on an iBook G3 from 2001, running Arch Power:
https://archlinuxpower.org/. I found the bug because SheepShaver has a
configure test for mprotect, which was failing--I was quite surprised!

The bug reproduces easily on qemu (with the `mac99` machine), if you'd
like to try yourself.

-Dave