[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RESEND PATCH] target-arm/abi32: check for segfault in

From: Seraphime Kirkovski
Subject: Re: [Qemu-devel] [RESEND PATCH] target-arm/abi32: check for segfault in do_kernel_trap
Date: Fri, 6 Jan 2017 15:35:27 +0100
User-agent: NeoMutt/20161104 (1.7.1)

<address@hidden>,qemu-arm <address@hidden>
Subject: Re: [Qemu-devel] [RESEND PATCH] target-arm/abi32: check for 
segfault in do_kernel_trap
Reply-To: In-Reply-To: 

Hi Peter,
thanks for the feedback.

On Thu, Jan 05, 2017 at 02:42:38PM +0000, Peter Maydell wrote:
> If you compare what happens with this segv code with
> what happens for the segvs detected inside
> arm_kernel_cmpxchg64_helper(), there's a difference.
> With this code we will queue the signal and then return,
> skipping the code which updates env->regs[15] and env->thumb.
> The existing codepath for cmpxchg64 doesn't skip that code.
> The effect is that for cmpxchg64 the SEGV signal handler
> will see a PC pointing at the call into the kernel commpage,
> whereas for this code it will see the PC actually in the
> kernel commpage.
> I'm not sure which of these options is the best choice,
> but I do think we should be consistent.

I think it would be safer to keep the current behaviour.

In terms of implementation, I find it would be better to extract the 
__kernel_cmpxchg code in a separate function. On the one hand, this 
would avoid code duplication or strange gotos and make do_kernel_trap
more readable. On the other hand, this would clutter a bit git history.
If it is acceptable, I will send a patch with those changes. If not, 
will try to find a cleaner solution without creating new functions.

Seraphime Kirkovski

reply via email to

[Prev in Thread] Current Thread [Next in Thread]