2024-01-23 16:52:53

by Dave Hansen

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

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 <[email protected]>

Gah, that one escaped a moment too soon:

Signed-off-by: Dave Hansen <[email protected]>

.. obviously