[PATCH] selftests/powerpc: Check FP/VEC on exception in TM

Gustavo Romero gromero at linux.vnet.ibm.com
Fri Nov 3 23:28:10 AEDT 2017


Hi Cyril!

On 01-11-2017 20:10, Cyril Bur wrote:
> Thanks Gustavo,
> 
> I do have one more thought on an improvement for this test which is
> that:
> +	/* Counter for busy wait *
> +	uint64_t counter = 0x1ff000000;
> is a bit fragile, what we should do is have the test work out long it
> should spin until it reliably gets a TM_CAUSE_FAC_UNAV failure and then
> use that for these tests.
> 
> This will only become a problem if we were to change kernel heuristics
> which is fine for now. I'll try to get that added soon but for now this
> test has proven too useful to delay adding as is.

I see. Yup, 'counter' value was indeed determined experimentally under many
different scenarios (VM and BM, different CPU loads, etc). At least if the
heuristics changes hurting the test it will catch that pointing out that
the expected failure did not happen, like:

Checking if FP/VEC registers are sane after a FP unavailable exception...
If MSR.FP=0 MSR.VEC=0:
    Expecting the transaction to fail, but it didn't
    FP ok VEC ok
...

So it won't let the hurting change pass fine silently :-)


>> Signed-off-by: Gustavo Romero <gromero at linux.vnet.ibm.com>
>> Signed-off-by: Breno Leitao <leitao at debian.org>
>> Signed-off-by: Cyril Bur <cyrilbur at gmail.com>

Thanks a lot for reviewing it.

Cheers,
Gustavo



More information about the Linuxppc-dev mailing list