From nobody Mon Feb 9 20:35:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539912869253771.0507076566233; Thu, 18 Oct 2018 18:34:29 -0700 (PDT) Received: from localhost ([::1]:46025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDJgJ-00041x-Uj for importer@patchew.org; Thu, 18 Oct 2018 21:34:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDJFo-0004tR-R7 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 21:07:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDJFk-0003Li-3z for qemu-devel@nongnu.org; Thu, 18 Oct 2018 21:07:04 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50325) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDJFj-00033y-Gy for qemu-devel@nongnu.org; Thu, 18 Oct 2018 21:06:59 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4A15822988; Thu, 18 Oct 2018 21:06:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 18 Oct 2018 21:06:36 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id E77E0102E9; Thu, 18 Oct 2018 21:06:35 -0400 (EDT) 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=O8p5q93tcYiEYcoYvOek7Xzc6SkRzJy1xhJBQCo8Vhk=; b=YMYKl AS0Nt8sMQ7VudmADGEvUOUTHHtxQxRkVmdwUBD/Ux0tQWgkEkeQgxq1Ei3ooSnOw 8UgA4Q9cLTF7dsTxQ0XXimG6JjD7mOow4EbyPPZfrEG+nJpEON8+BzQiKQ38gsO/ NQYxyqA/yBKqkW5yqYROQSK+ky1DGvQLB45cbk= 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=O8p5q93tcYiEYcoYvOek7Xzc6SkRz Jy1xhJBQCo8Vhk=; b=GgzNyYnJ9uT276bmCs/Hf4y74N66hLC9BaVsauw6vOvIp QwVf77n6sl7wIdl1C2VhFntI8cBUX/rhze/aM/nG7xvmcTfPBuHq+4D/4y1yn5pD IAo5a7qsHcJ6NQDNo5jx2oODS9HDBFa1Uk3NGtfPUh2ZyGx0b5TRZWbELNh4BA4Q fm1K5VZHjJLpkNF35sTV6SArn4hR0tFrqWt1mYfqbEXWxt461SHPZG7hX9cmAjFW vDn7xaAgGJ2ni88DbFi+r8ZrrG5iYy3k292uy9vGaAsU5iqE7JaAUg1RTqCH8PPM 25luo6ReW9y1w91Wem9mbcHmNC3CNEwIxAfc1jIPg== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 21:06:11 -0400 Message-Id: <20181019010625.25294-43-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181019010625.25294-1-cota@braap.org> References: <20181019010625.25294-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.29 Subject: [Qemu-devel] [RFC v3 42/56] sparc: 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 , Mark Cave-Ayland , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Signed-off-by: Emilio G. Cota --- hw/sparc64/sparc64.c | 19 +++++++++++++------ target/sparc/cpu.c | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 372bbd4f5b..640c4b6a30 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -56,11 +56,13 @@ void cpu_check_irqs(CPUSPARCState *env) /* The bit corresponding to psrpil is (1<< psrpil), the next bit is (2 << psrpil). */ if (pil < (2 << env->psrpil)) { - if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + cpu_mutex_lock(cs); + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) { trace_sparc64_cpu_check_irqs_reset_irq(env->interrupt_index); env->interrupt_index =3D 0; cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } + cpu_mutex_unlock(cs); return; } =20 @@ -87,11 +89,16 @@ void cpu_check_irqs(CPUSPARCState *env) break; } } - } else if (cs->interrupt_request & CPU_INTERRUPT_HARD) { - trace_sparc64_cpu_check_irqs_disabled(pil, env->pil_in, env->softi= nt, - env->interrupt_index); - env->interrupt_index =3D 0; - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } else { + cpu_mutex_lock(cs); + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) { + trace_sparc64_cpu_check_irqs_disabled(pil, env->pil_in, + env->softint, + env->interrupt_index); + env->interrupt_index =3D 0; + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } + cpu_mutex_unlock(cs); } } =20 diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 0f090ece54..88427283c1 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -709,7 +709,7 @@ static bool sparc_cpu_has_work(CPUState *cs) SPARCCPU *cpu =3D SPARC_CPU(cs); CPUSPARCState *env =3D &cpu->env; =20 - return (cs->interrupt_request & CPU_INTERRUPT_HARD) && + return (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) && cpu_interrupts_enabled(env); } =20 --=20 2.17.1