Re: [PATCH v3] ARM: kprobes: Add test cases for stack consuming instructions

From: Jon Medhurst (Tixy)
Date: Wed Dec 10 2014 - 08:49:55 EST


On Wed, 2014-12-10 at 21:18 +0800, Wang Nan wrote:
[...]
> Well, I'm just working on a patch which introducing a TEST_INTOFF and disable interrupts
> for "MRS" testcase. Do you think it is inappropriate?

That's what I started to do, implementing in a similar way to
DONT_TEST_IN_ITBLOCK, and thought the same ints off feature could be
used for the stack consuming instructions checks as well.

Then I realised that for the MRS case it's no use turning ints off for a
single iteration of a test, because the next iteration could see
different results, so that would mean turning interrupts off for all
iterations, which we can't do.

Also, the FIQ flag may not be under our control if Linux isn't running
in secure mode, and I was worried that in such cases we could see the
value of the flag change if secure mode code chose to do so. (Though
perhaps non-secure mode will always read FIQ flag as zero in such a
case?)

So in the end I thought the only robust way of writing the tests would
be to ignore the values of the A and F flags.

--
Tixy


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/