From patchwork Thu Oct 25 14:46:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 10655949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B6FD15A7 for ; Thu, 25 Oct 2018 15:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49CE12BC51 for ; Thu, 25 Oct 2018 15:06:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 387492BC71; Thu, 25 Oct 2018 15:06:29 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B5BF22BC51 for ; Thu, 25 Oct 2018 15:06:28 +0000 (UTC) Received: from localhost ([::1]:55064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFhDP-0004a2-Dq for patchwork-qemu-devel@patchwork.kernel.org; Thu, 25 Oct 2018 11:06:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFh5I-0002yq-St for qemu-devel@nongnu.org; Thu, 25 Oct 2018 10:58:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFgvP-0008R6-UD for qemu-devel@nongnu.org; Thu, 25 Oct 2018 10:47:52 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:52989) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFgvN-00082R-Mh; Thu, 25 Oct 2018 10:47:49 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8870F21F2B; Thu, 25 Oct 2018 10:46:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 25 Oct 2018 10:46:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=VbIEip8n9oE+z5PTq8aYajVjwOcR/rBLjOQFjrUxMo0=; b=rRwfa ar3pbSTuskoLIePGUnZiDcLexPDdbbRwUvbmhvQR6h7kqmhiYxlyX9XsWa4UyiQT g186bBJdLvYigoFPt9sfDW7J6M2+kVIzrevZdpDEYPCxiezEzyfpMxVJ0K9htqQZ q3jvbAZNjKl9R4kNp1SIMy+GiCKWtqg2YdWoUU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=VbIEip8n9oE+z5PTq8aYajVjwOcR/ rBLjOQFjrUxMo0=; b=TZz+DYp76UgpX7BOlaZdW8BlgJjQcnpRv6Jg1mHFb4+DS ULDWpMOasX3HhAjlaBduehv/LcZuy54nzAKGxrAJjDVWeY11l5IOSH5qWGyOnEMv 5ArX4RGye/NBiV6QkerB26w/DjOtP7rxKObrvNfx2xESYAkxbovEyVStfHdgxDei DtPJ45STBiog8mCVVmiPTMd1Pja6SZs28eHpCT3V7lhpeNfbwz3/DmtDidzONwVN XUeKgB9J8ptjlIDGI0VlZWQcpixp3S2nTcwv73c+vLotvGgU9sq4bz25frMNCfQA BzYC9CgR+pW+RnTjaz9ltr8D8u1iVd2hS5ziEtxOg== X-ME-Sender: X-ME-Proxy: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 0DF50E4A44; Thu, 25 Oct 2018 10:46:54 -0400 (EDT) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 25 Oct 2018 10:46:09 -0400 Message-Id: <20181025144644.15464-36-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025144644.15464-1-cota@braap.org> References: <20181025144644.15464-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 Subject: [Qemu-devel] [RFC v4 36/71] arm: convert to cpu_interrupt_request 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 , qemu-arm@nongnu.org, Richard Henderson , Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cc: Peter Maydell Cc: qemu-arm@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/arm/cpu.c | 2 +- target/arm/helper.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 9c5cda8eb7..7330c2dae1 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -49,7 +49,7 @@ static bool arm_cpu_has_work(CPUState *cs) ARMCPU *cpu = ARM_CPU(cs); return (cpu->power_state != PSCI_OFF) - && cs->interrupt_request & + && cpu_interrupt_request(cs) & (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_EXITTB); diff --git a/target/arm/helper.c b/target/arm/helper.c index c83f7c1109..454954a56c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1294,11 +1294,12 @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri) { CPUState *cs = ENV_GET_CPU(env); uint64_t ret = 0; + uint32_t interrupt_request = cpu_interrupt_request(cs); - if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + if (interrupt_request & CPU_INTERRUPT_HARD) { ret |= CPSR_I; } - if (cs->interrupt_request & CPU_INTERRUPT_FIQ) { + if (interrupt_request & CPU_INTERRUPT_FIQ) { ret |= CPSR_F; } /* External aborts are not possible in QEMU so A bit is always clear */ @@ -8579,10 +8580,7 @@ void arm_cpu_do_interrupt(CPUState *cs) return; } - /* Hooks may change global state so BQL should be held, also the - * BQL needs to be held for any modification of - * cs->interrupt_request. - */ + /* Hooks may change global state so BQL should be held */ g_assert(qemu_mutex_iothread_locked()); arm_call_pre_el_change_hook(cpu); @@ -8597,7 +8595,7 @@ void arm_cpu_do_interrupt(CPUState *cs) arm_call_el_change_hook(cpu); if (!kvm_enabled()) { - cs->interrupt_request |= CPU_INTERRUPT_EXITTB; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_EXITTB); } }