From patchwork Mon Mar 4 18:17:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 1051257 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=209.51.188.17; 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="xoEyVUe9"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YUxpTxN5"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44CpNs5dbgz9s3q for ; Tue, 5 Mar 2019 05:25:33 +1100 (AEDT) Received: from localhost ([127.0.0.1]:58662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0sHL-0005cU-Lh for incoming@patchwork.ozlabs.org; Mon, 04 Mar 2019 13:25:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0sAW-0008G2-6S for qemu-devel@nongnu.org; Mon, 04 Mar 2019 13:18:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0sAV-0000sW-BA for qemu-devel@nongnu.org; Mon, 04 Mar 2019 13:18:28 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:50649) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0sAV-0000s6-6B for qemu-devel@nongnu.org; Mon, 04 Mar 2019 13:18:27 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F19C523149; Mon, 4 Mar 2019 13:18:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 04 Mar 2019 13:18:26 -0500 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=KkVB19/XOoA3XZvP3dgoznBiMceDqOUbY4qS2wrE5NA=; b=xoEyV Ue9HUHhOMst97M48VjF/zFuiHWAGQnIvGF7HVBjRij5drKnTqhMes+dKyujpA7v6 nceeg2bjvbXEvpeDOHBnQBrqdW8WkJ8+Qc+/epQGzsiPdPtM565erbtXZUdR8VJM D26G0uWA2zQhluKn8kNOe1Ek6vZzAublQfM/TY= 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=fm2; bh=KkVB19/XOoA3XZvP3dgoznBiMceDq OUbY4qS2wrE5NA=; b=YUxpTxN5MrfJ5DtJSCKlL9dPtq7oK6yDeZb9W27A8pKEz bCz3DFK+ctLedeLpxX/TwW16Le+db1zdyY8zdXyLdI0ufJ2kNrZ7j3vn1Uln/Biy /gh2Wca25LvKFbVoknKNZTtuZB0u3ykpRq9wRhiCcrZV6SAkYwiIYU5C2BAUFMsz KuEagShE2ggSr0hZNY1hlyRaj8sLfbm09/h11KJiZqqGkUvpgCLLLDymq9i6vw02 i3S2aSTYLJw3J+HHyIiUbYPlY5oUVZ27ZFnmGHB/fxv9shnDaMjpro5vi4QEjnZS z6mIuWtPNqOFgR0gocnjj+cwxrHDZpTPjfSXIaZOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfedugdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfsedttdertdertddtnecuhfhrohhmpedfgfhmihhlihho ucfirdcuvehothgrfdcuoegtohhtrgessghrrggrphdrohhrgheqnecukfhppeduvdekrd ehledrvddtrddvudeinecurfgrrhgrmhepmhgrihhlfhhrohhmpegtohhtrgessghrrggr phdrohhrghenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 9257C10312; Mon, 4 Mar 2019 13:18:26 -0500 (EST) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 4 Mar 2019 13:17:50 -0500 Message-Id: <20190304181813.8075-51-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190304181813.8075-1-cota@braap.org> References: <20190304181813.8075-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.26 Subject: [Qemu-devel] [PATCH v7 50/73] mips: 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: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Aleksandar Markovic , Aurelien Jarno , James Hogan Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Cc: Aurelien Jarno Cc: Aleksandar Markovic Cc: James Hogan Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- target/mips/cpu.c | 7 ++++--- target/mips/kvm.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index e217fb3e36..fdae8cf440 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -56,11 +56,12 @@ static bool mips_cpu_has_work(CPUState *cs) MIPSCPU *cpu = MIPS_CPU(cs); CPUMIPSState *env = &cpu->env; bool has_work = false; + uint32_t interrupt_request = cpu_interrupt_request(cs); /* Prior to MIPS Release 6 it is implementation dependent if non-enabled interrupts wake-up the CPU, however most of the implementations only check for interrupts that can be taken. */ - if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && + if ((interrupt_request & CPU_INTERRUPT_HARD) && cpu_mips_hw_interrupts_pending(env)) { if (cpu_mips_hw_interrupts_enabled(env) || (env->insn_flags & ISA_MIPS32R6)) { @@ -72,7 +73,7 @@ static bool mips_cpu_has_work(CPUState *cs) if (env->CP0_Config3 & (1 << CP0C3_MT)) { /* The QEMU model will issue an _WAKE request whenever the CPUs should be woken up. */ - if (cs->interrupt_request & CPU_INTERRUPT_WAKE) { + if (interrupt_request & CPU_INTERRUPT_WAKE) { has_work = true; } @@ -82,7 +83,7 @@ static bool mips_cpu_has_work(CPUState *cs) } /* MIPS Release 6 has the ability to halt the CPU. */ if (env->CP0_Config5 & (1 << CP0C5_VP)) { - if (cs->interrupt_request & CPU_INTERRUPT_WAKE) { + if (interrupt_request & CPU_INTERRUPT_WAKE) { has_work = true; } if (!mips_vp_active(env)) { diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 0b177a7577..568c3d8f4a 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -135,7 +135,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run) qemu_mutex_lock_iothread(); - if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && + if ((cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) && cpu_mips_io_interrupts_pending(cpu)) { intr.cpu = -1; intr.irq = 2;