Re: [PATCH] x86/mm: Simplify redundant overlap calculation

From: Dave Hansen
Date: Tue Jan 23 2024 - 11:52:45 EST


On 1/23/24 08:36, Dave Hansen wrote:
> There have been a couple of reports that the two sides of the
> overlaps() calculation are redundant. I spent way too much time
> looking at this, but I became convinced that they are redundant
> when a little test program of mine produced identical disassembly
> for both versions of the check.
>
> Remove the second condition. It is exactly the same as the first.
>
> Fixes: 91ee8f5c1f50 ("x86/mm/cpa: Allow range check for static protections")
> Reported-by: David Binderman <dcb314@xxxxxxxxxxx>

Gah, that one escaped a moment too soon:

Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>

.. obviously