Received: from eggs.gnu.org ([2001:4830:134:3::10]:47702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L1O-0005FH-61 for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2L1H-00077h-85 for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:00:58 -0400 Received: from indium.canonical.com ([91.189.90.7]:38003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2L1F-00076l-NH for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:00:50 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1Z2L1E-00088e-Uv for ; Tue, 09 Jun 2015 15:00:48 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id E52512E80C2 for ; Tue, 9 Jun 2015 15:00:48 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 09 Jun 2015 14:52:11 -0000 From: Peter Maydell Sender: bounces@canonical.com References: <20150609095753.13548.3611.malonedeb@wampee.canonical.com> Message-Id: <20150609145212.16437.27387.malone@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1463338] Re: qemu-system-arm injects #UND exception with wrong PC Reply-To: Bug 1463338 <1463338@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Thanks for the clear bug report and the test case. I've submitted a patch w= hich fixes this: http://patchwork.ozlabs.org/patch/482273/ -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1463338 Title: qemu-system-arm injects #UND exception with wrong PC Status in QEMU: New Bug description: Usually all accesses to coprocessor registers are only possible in PL1 or higher. When accessing a coprocessor register in user mode, QEMU generates a trap and the PC of the trapping instruction is passed to the OS with an offset of+ 4. Some coprocessor registers can be configured to allow access to them in usermode (PL0). The latest qemu- git (ee09f84e6bf5383a23c9624115c26b72aa1e076c) seems to add an offest of 8 instead of four if such a register is accessed from user mode. This happens only if the coprocessors register that is accessed might also be accessed from PL0. In case all accesses to the coprocessor register from PL0 cause a trap, qemu injects the #UND trap with the correct PC value. Attached is a small test program that installs a signal handler for "SIGILL". On a pandaboard the progam prints "Val=3D0x2 Val2=3D0x2" whereas on the latest "qemu-system-arm" the output is : "Val=3D0x1 Val2=3D0x2" Qemu was configured with: "./configure --python=3D`which python2.7` --tar= get-list=3Darm-softmmu" The test can be compiled with: "gcc -g -static test2.c -o test2" If further information is needed, feel free to ask. Regards, Robert To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1463338/+subscriptions