From patchwork Wed Jan 31 18:56:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10194675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 718B860380 for ; Wed, 31 Jan 2018 18:57:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B301028767 for ; Wed, 31 Jan 2018 18:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6CC62877F; Wed, 31 Jan 2018 18:57:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 28BE628767 for ; Wed, 31 Jan 2018 18:57:27 +0000 (UTC) Received: from localhost ([::1]:51678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egxZW-0001vI-4V for patchwork-qemu-devel@patchwork.kernel.org; Wed, 31 Jan 2018 13:57:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egxYn-0001T9-G7 for qemu-devel@nongnu.org; Wed, 31 Jan 2018 13:56:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egxYm-0001lm-Ab for qemu-devel@nongnu.org; Wed, 31 Jan 2018 13:56:41 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:42921) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egxYm-0001kL-13 for qemu-devel@nongnu.org; Wed, 31 Jan 2018 13:56:40 -0500 Received: by mail-lf0-x243.google.com with SMTP id q17so22304729lfa.9 for ; Wed, 31 Jan 2018 10:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2kaHPZgFkZ8LITIug6yhCTCfifzVekrHHcSoVeC1zY4=; b=sHNfv3q1KkIoXLWGY2av3q1YeN6sFwINuq5QteZO1rz+kJiVYnVuzM6cBm0q7jmx5U 6vv+nuBhfxInTPJqjFnwD1ef267ggwCrPjKpM4wzp5mZrQBfINTY6KpPuqNBD7ByPe2E UzH2xqj3clAjkH0qvsva+6LNsD4wtbdxqryNvs718qVDG7UCyhSdriMP7PR9DDsAd03Y TUONtm0tB+dcm6ZyKYH4n1SueRwf9IpBq5oF2ckd8pKH9cEGbsUcdApSr3VPpsu57CCC au3NlQ7y0LbVToz43v1GETtf9rCyPOGtBhkiXH5TCXM6/OzyN2Vi6YG+48qBrZyihJiQ Ff4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2kaHPZgFkZ8LITIug6yhCTCfifzVekrHHcSoVeC1zY4=; b=IHxpn+/XqQEFbvfe99nxTnY7z1mCJJu8VwErLbhUQpg4Agsu+JTwX3AyYWEGNZGGTa DaQCcox72fOQjsDM6wA1PhkKp9wUvCzeCVecSyWTlVS3sTTq5YxeeNxzEiruLjrmGF7F sxoG+5/B5zdEs7ep0gr/qcLRK3S4j+j8MpfMmkti7koXAm+TQY63SxmASSkKsNjQWzA1 HAsn43hvLdts8hNhBx4PdzY0yDKM+WjfqtafhhZhmLGXkF4LwTjVfwlRX6x3+n6EDVIs mk4t1MEGNcfC93nVLXhhMn4urLY0dD7Vmh/IIGgF11iszS0iIG1vOYsqsjp/59Okbmug UY2g== X-Gm-Message-State: AKwxyteYZzPpIbcgIYKL6X7+q+R9eZb4x5NkSiSGtRMu3ytbkSHGeuaP KPFe4Rgvh4pxNSVqofCk4o6VqFj2P+Xmx0I1LjU= X-Google-Smtp-Source: AH8x224/GFErUdh5LqwUWwjQMW+/7fO6JNt8h+DBaZMhE6GU3wxY3MdnFgfgmxYI7yaGH1eXs/bZGNgF0qiOtnM01To= X-Received: by 10.46.71.81 with SMTP id u78mr13525503lja.35.1517424998667; Wed, 31 Jan 2018 10:56:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.45.10 with HTTP; Wed, 31 Jan 2018 10:56:08 -0800 (PST) In-Reply-To: References: <8942a41a-a924-f626-3613-3c74b9db0da6@redhat.com> From: Alistair Francis Date: Wed, 31 Jan 2018 10:56:08 -0800 X-Google-Sender-Auth: viJjSilVVQ9tAJZvdHy_sOAfsa8 Message-ID: To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: Re: [Qemu-devel] MTTCG External Halt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "qemu-devel@nongnu.org Developers" , Alistair Francis Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jan 31, 2018 at 10:51 AM, Alistair Francis wrote: > On Wed, Jan 31, 2018 at 10:48 AM, Peter Maydell > wrote: >> On 31 January 2018 at 18:17, Alistair Francis wrote: >>> On Wed, Jan 31, 2018 at 9:13 AM, Paolo Bonzini wrote: >>>> cpu->halted = false likewise should not be needed here, but you cannot >>>> just clear CPU_INTERRUPT_HALT either. You need to set a *different* >>>> interrupt request bit (the dummy CPU_INTERRUPT_EXITTB will do) and >>>> cpu_handle_halt will clear cpu->halted. >>> >>> The problem with that is that I hit this assert for ARM CPUs: >>> >>> qemu-system-aarch64: ./target/arm/cpu.h:1446: arm_el_is_aa64: >>> Assertion `el >= 1 && el <= 3' failed. >> >> Backtrace from when you hit that might be useful... > > Here it is: > > (gdb) bt > #0 0x00007ffff1a030bb in __GI_raise (sig=sig@entry=6) at > ../sysdeps/unix/sysv/linux/raise.c:51 > #1 0x00007ffff1a04f5d in __GI_abort () at abort.c:90 > #2 0x00007ffff19faf17 in __assert_fail_base (fmt=, > assertion=assertion@entry=0x555555cf86c4 "el >= 1 && el <= 3", > file=file@entry=0x555555cf8660 > "/scratch/alistai/master-qemu/target/arm/cpu.h", line=line@entry=1446, > function=function@entry=0x555555d314e8 <__PRETTY_FUNCTION__.24916> > "arm_el_is_aa64") at assert.c:92 > #3 0x00007ffff19fafc2 in __GI___assert_fail > (assertion=assertion@entry=0x555555cf86c4 "el >= 1 && el <= 3", > file=file@entry=0x555555cf8660 > "/scratch/alistai/master-qemu/target/arm/cpu.h", line=line@entry=1446, > function=function@entry=0x555555d314e8 <__PRETTY_FUNCTION__.24916> > "arm_el_is_aa64") at assert.c:101 > #4 0x00005555557eb872 in arm_el_is_aa64 (el=0, env=0x55555723c7f8) at > /scratch/alistai/master-qemu/target/arm/cpu.h:1446 > #5 0x0000555555951233 in arm_el_is_aa64 (el=0, env=0x55555723c7f8) at > /scratch/alistai/master-qemu/target/arm/cpu.h:1838 > #6 0x0000555555951233 in arm_cpu_do_interrupt (cs=0x555557234550) at > /scratch/alistai/master-qemu/target/arm/helper.c:8020 > #7 0x000055555585e75b in cpu_handle_exception (ret= pointer>, cpu=0x555556c64200) > at /scratch/alistai/master-qemu/accel/tcg/cpu-exec.c:532 > #8 0x000055555585e75b in cpu_exec (cpu=cpu@entry=0x555557234550) at > /scratch/alistai/master-qemu/accel/tcg/cpu-exec.c:748 > #9 0x000055555582d963 in tcg_cpu_exec (cpu=0x555557234550) at > /scratch/alistai/master-qemu/cpus.c:1297 > #10 0x000055555582d963 in qemu_tcg_cpu_thread_fn (arg=0x555557234550) > at /scratch/alistai/master-qemu/cpus.c:1502 > #11 0x00007ffff1db37fc in start_thread (arg=0x7ffef6b43700) at > pthread_create.c:465 > #12 0x00007ffff1ae0b5f in clone () at > ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 This diff works around it, at least for now: > > Alistair > >> >> thanks >> -- PMM diff --git a/target/arm/helper.c b/target/arm/helper.c index eebc898b37..06b40809d9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -8015,6 +8015,10 @@ void arm_cpu_do_interrupt(CPUState *cs) return; } + if (is_a64(env) && new_el == 0) { + return; + } + assert(!excp_is_internal(cs->exception_index)); if (arm_el_is_aa64(env, new_el)) { arm_cpu_do_interrupt_aarch64(cs);