Re: [PATCH] MIPS: Handle address errors for accesses above CPU max virtual user address

From: Maciej W. Rozycki
Date: Thu Mar 10 2022 - 05:46:16 EST


On Tue, 22 Feb 2022, Thomas Bogendoerfer wrote:

> Address errors have always been treated as unaliged accesses and handled
> as such. But address errors are also issued for illegal accesses like
> user to kernel space or accesses outside of implemented spaces. This
> change implements Linux exception handling for accesses to the illegal
> space above the CPU implemented maximum virtual user address and the
> MIPS 64bit architecture maximum. With this we can now use a fixed value
> for the maximum task size on every MIPS CPU and get a more optimized
> access_ok().

Decades ago I had a patch to handle this with CPU-specific limits, which
in the end I have not submitted for one reason or another. I guess we
didn't have what is `cpu_vmbits' nowadays. I'll see if I can dig it out
and check if there's anything interesting there we might also require.

Overall good work, and I'm rather embarassed we have gone so far without
it. Thanks!

Maciej