From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvLgb-0008Rp-V9 for qemu-devel@nongnu.org; Sat, 15 Oct 2016 05:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvLgW-00030V-Ux for qemu-devel@nongnu.org; Sat, 15 Oct 2016 05:55:24 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:37831) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvLgW-0002zv-M4 for qemu-devel@nongnu.org; Sat, 15 Oct 2016 05:55:20 -0400 Received: by mail-wm0-x234.google.com with SMTP id c78so23240759wme.0 for ; Sat, 15 Oct 2016 02:55:19 -0700 (PDT) References: <20161014151336.31418-1-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: Date: Sat, 15 Oct 2016 10:55:16 +0100 Message-ID: <87mvi6ey2j.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] target-arm/translate.c: fix movs pc, lr exception return on ARMv7 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-arm , QEMU Developers Peter Maydell writes: > On 14 October 2016 at 16:13, Alex Bennée wrote: >> This was broken by the fix for 9b6a3ea7a699594162ed3d11e4e04b98568dc5c0. >> Specifically a movs pc,lr in the kernels ret_fast_syscall returning to >> some thumb mode user space code but store_reg unconditionally aligned >> the return PC instead of treating the return as an "interworking" >> branch. >> >> I suspect we need to audit all calls to store_reg that might involve the >> PC to ensure "interworking" branches are correctly handled. Also I'm not >> quite sure how the code worked before 9b6a3e as the store_reg path >> wouldn't have triggered the store_cpu_field(var, thumb) to set the >> processor mode back to thumb. >> >> Signed-off-by: Alex Bennée > > I think this is the wrong fix to the problem -- see the > patch I sent a few days back. Well at least my analysis of the problem was correct even if the solution was too hacky. Your patch is obviously the better solution ;-) For ref: [PATCH] Fix masking of PC lower bits when doing exception returns > > thanks > -- PMM -- Alex Bennée