From patchwork Mon Apr 4 16:43:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8742891 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A84C4C0553 for ; Mon, 4 Apr 2016 16:46:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1830A201E4 for ; Mon, 4 Apr 2016 16:46:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 350C5201C8 for ; Mon, 4 Apr 2016 16:46:45 +0000 (UTC) Received: from localhost ([::1]:59972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an7eG-0002d8-AB for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Apr 2016 12:46:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an7b1-0004yf-8B for qemu-devel@nongnu.org; Mon, 04 Apr 2016 12:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1an7b0-0002uI-Dn for qemu-devel@nongnu.org; Mon, 04 Apr 2016 12:43:23 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:56333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an7b0-0002t2-72 for qemu-devel@nongnu.org; Mon, 04 Apr 2016 12:43:22 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1an7as-0003Gc-Kg for qemu-devel@nongnu.org; Mon, 04 Apr 2016 17:43:14 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 4 Apr 2016 17:43:09 +0100 Message-Id: <1459788192-26272-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459788192-26272-1-git-send-email-peter.maydell@linaro.org> References: <1459788192-26272-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 2/5] linux-user: arm: Handle (ignore) EXCP_YIELD in ARM cpu_loop() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The new-in-ARMv8 YIELD instruction has been implemented to throw an EXCP_YIELD back up to the QEMU main loop. In system emulation we use this to decide to schedule a different guest CPU in SMP configurations. In usermode emulation there is nothing to do, so just ignore it and resume the guest. This prevents an abort with "unhandled CPU exception 0x10004" if the guest process uses the YIELD instruction. Reported-by: Hunter Laux Signed-off-by: Peter Maydell Message-id: 1456833171-31900-1-git-send-email-peter.maydell@linaro.org --- linux-user/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index b432bf2..5f3ec97 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -907,6 +907,9 @@ void cpu_loop(CPUARMState *env) if (do_kernel_trap(env)) goto error; break; + case EXCP_YIELD: + /* nothing to do here for user-mode, just resume guest code */ + break; default: error: EXCP_DUMP(env, "qemu: unhandled CPU exception 0x%x - aborting\n", trapnr); @@ -1097,6 +1100,9 @@ void cpu_loop(CPUARMState *env) case EXCP_SEMIHOST: env->xregs[0] = do_arm_semihosting(env); break; + case EXCP_YIELD: + /* nothing to do here for user-mode, just resume guest code */ + break; default: EXCP_DUMP(env, "qemu: unhandled CPU exception 0x%x - aborting\n", trapnr); abort();