Thread (78 messages) flat view 78 messages, 10 authors, 2016-02-18

KASAN issues with idle / hotplug area

From: mark.rutland@arm.com (Mark Rutland)
Date: 2016-02-18 11:34:07

On Thu, Feb 18, 2016 at 12:38:09PM +0300, Andrey Ryabinin wrote:

On 02/18/2016 11:22 AM, Andrey Ryabinin wrote:
quoted
I see two options here:
 * completely disable instrumentation for drivers/firmware/psci.c
 * get back to assembly implementation
One more option is to allocate struct arm_smccc_res on stack of arm_smccc_[hvc, smc](), and return res.a0
from arm_smccc_[hvc,smc]().
In general ARM SMCCC calls can return multiple values, and there are
callers that may care (even if they're not here just yet).

So we can't change the arm_smccc_{smc,hvc} prototypes, and adding
another asm function is somewhat self-defeating (an asm caller
of arm_smccc_* is more complex and slower than a direct SMC/HVC).
So it will look like this:

asmlinkage unsigned long arm_smccc_hvc(unsigned long a0, unsigned long a1,
			unsigned long a2, unsigned long a3, unsigned long a4,
			unsigned long a5, unsigned long a6, unsigned long a7);


static unsigned long __invoke_psci_fn_hvc(unsigned long function_id,
			unsigned long arg0, unsigned long arg1,
			unsigned long arg2)
{
	return arm_smccc_hvc(function_id, arg0, arg1, arg2, 0, 0, 0, 0);
}
While this looks like it might work today, it's going to be _extremely_
fragile -- other instrumentation might cause stack allocation and hence
shadow dirtying.

I'm not keen on this.

Thanks,
Mark.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help