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: 989126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=braap.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="rRwfaar3"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="TZz+DYp7"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42gr6C6zQSz9sBN for ; Fri, 26 Oct 2018 02:05:39 +1100 (AEDT) Received: from localhost ([::1]:55054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFhCb-0003NJ-8J for incoming@patchwork.ozlabs.org; Thu, 25 Oct 2018 11:05:37 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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); } }