Re: [PATCH] selftests: breakpoints: Add "WINE" test for x86

From: Thomas Gleixner
Date: Fri Jan 29 2021 - 14:11:40 EST


On Fri, Jan 29 2021 at 10:08, Peter Zijlstra wrote:
> On Fri, Jan 29, 2021 at 12:28:41AM +0100, Thomas Gleixner wrote:
>
>> Add a test case which covers this scenario. This is modeled after the
>> WINE testcase, but changes the expect in step #2 to:
>>
>> - Expect DR6::BS == 1 and DR6::BR0 == 1 and IP == second instruction
>>
>> to ensure that the GDB expectations are met as well.
>
>> + /*
>> + * Expect: DR6::BS == 1 DR6::BR0 == 1 IP == instr[1]
>> + * Wine does not care about BR0 here but GDB does ...
>> + */
>> + wine_test_step(1, addr, 1, 1, buf);
>
>
> So my v2 patch will fail this, while it will pass the actual gdb
> testcase.
>
> The thing it does is process _data_ breakpoints along with TF, but it
> will exclude instruction breakpoints and TF.
>
> Since the above test is using instruction breakpoints, it will report
> 0x4000 and 0x0001 respectively for two consequtive exceptions.

Yes, I'm a moron....