From nobody Fri Nov 7 23:04:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548812445802801.0904633628413; Tue, 29 Jan 2019 17:40:45 -0800 (PST) Received: from localhost ([127.0.0.1]:58544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goerl-0001SY-M1 for importer@patchew.org; Tue, 29 Jan 2019 20:40:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goe4F-0000Y0-FU for qemu-devel@nongnu.org; Tue, 29 Jan 2019 19:49:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goe4E-0001ju-5B for qemu-devel@nongnu.org; Tue, 29 Jan 2019 19:49:27 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57535) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goe4B-000107-3W; Tue, 29 Jan 2019 19:49:23 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E121622155; Tue, 29 Jan 2019 19:48:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 29 Jan 2019 19:48:22 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B666E4559; Tue, 29 Jan 2019 19:48:22 -0500 (EST) 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=yk831HbKd5vwJg9BfpZlW22rFvgBxVFAiKaaqEReLsY=; b=XfKEg k4M1NCcrAgg9EFDFr4ngBnP++2iuxeZd+g/ONMWpGDV/Xus7lkTCcvfhH2Q203ih 1yzHgfur4+xy6jw8zcJmImxLOydsmCqIo+JTDbTTsOSwolUqnPV7Jq0iy235VVec 2wskrITmtlTDbkAMXtkSRyryUnmi+8//nIuUrA= 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=yk831HbKd5vwJg9BfpZlW22rFvgBx VFAiKaaqEReLsY=; b=sZ0fHJz2cI8aOkaZcwN1gJ/eWe8zfkdY8D3E6EIvaqjAp HOtzlVp/WghQO3eSNhcS7jIRgmtiAiC5z62pPDsnZ12pW08oOExwFQVJ9tTm7M5p i6v10rBvXqFNx6Kt52xVlJOBTY8o7oF/bABnXOoT+S/mi8YhgcTVfOiwyHdGSUh+ EAQ+GtUthAgnjzhPz4YdL4E6AqhT7us1WUbReWXou01OL+vm6F1rP2KislFSbQA7 agn4Gf+DZn4Eoig10dldANUO4jpaByZElZPgoIt0dShdpsE2z3uytPohNXPtINqS XKuusv4rzY7oFfxAxj7UgapdT3mLwuLxbLjir65hg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrjeefgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg hfsedttdertdertddtnecuhfhrohhmpedfgfhmihhlihhoucfirdcuvehothgrfdcuoegt ohhtrgessghrrggrphdrohhrgheqnecukfhppeduvdekrdehledrvddtrddvudeinecurf grrhgrmhepmhgrihhlfhhrohhmpegtohhtrgessghrrggrphdrohhrghenucevlhhushht vghrufhiiigvpeek X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Tue, 29 Jan 2019 19:47:36 -0500 Message-Id: <20190130004811.27372-39-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190130004811.27372-1-cota@braap.org> References: <20190130004811.27372-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.25 Subject: [Qemu-devel] [PATCH v6 38/73] 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Peter Maydell Cc: qemu-arm@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Reviewed-by: Alex Benn=C3=A9e --- target/arm/cpu.c | 6 +++--- target/arm/helper.c | 16 +++++++--------- target/arm/machine.c | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 8cf2f5466b..ef652ebdc2 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 =3D ARM_CPU(cs); =20 return (cpu->power_state !=3D PSCI_OFF) - && cs->interrupt_request & + && cpu_interrupt_request(cs) & (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_EXITTB); @@ -451,7 +451,7 @@ void arm_cpu_update_virq(ARMCPU *cpu) bool new_state =3D (env->cp15.hcr_el2 & HCR_VI) || (env->irq_line_state & CPU_INTERRUPT_VIRQ); =20 - if (new_state !=3D ((cs->interrupt_request & CPU_INTERRUPT_VIRQ) !=3D = 0)) { + if (new_state !=3D ((cpu_interrupt_request(cs) & CPU_INTERRUPT_VIRQ) != =3D 0)) { if (new_state) { cpu_interrupt(cs, CPU_INTERRUPT_VIRQ); } else { @@ -472,7 +472,7 @@ void arm_cpu_update_vfiq(ARMCPU *cpu) bool new_state =3D (env->cp15.hcr_el2 & HCR_VF) || (env->irq_line_state & CPU_INTERRUPT_VFIQ); =20 - if (new_state !=3D ((cs->interrupt_request & CPU_INTERRUPT_VFIQ) !=3D = 0)) { + if (new_state !=3D ((cpu_interrupt_request(cs) & CPU_INTERRUPT_VFIQ) != =3D 0)) { if (new_state) { cpu_interrupt(cs, CPU_INTERRUPT_VFIQ); } else { diff --git a/target/arm/helper.c b/target/arm/helper.c index 66faebea8e..cb42d19fe8 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1782,23 +1782,24 @@ static uint64_t isr_read(CPUARMState *env, const AR= MCPRegInfo *ri) CPUState *cs =3D ENV_GET_CPU(env); uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); uint64_t ret =3D 0; + uint32_t interrupt_request =3D cpu_interrupt_request(cs); =20 if (hcr_el2 & HCR_IMO) { - if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) { + if (interrupt_request & CPU_INTERRUPT_VIRQ) { ret |=3D CPSR_I; } } else { - if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + if (interrupt_request & CPU_INTERRUPT_HARD) { ret |=3D CPSR_I; } } =20 if (hcr_el2 & HCR_FMO) { - if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) { + if (interrupt_request & CPU_INTERRUPT_VFIQ) { ret |=3D CPSR_F; } } else { - if (cs->interrupt_request & CPU_INTERRUPT_FIQ) { + if (interrupt_request & CPU_INTERRUPT_FIQ) { ret |=3D CPSR_F; } } @@ -9435,10 +9436,7 @@ void arm_cpu_do_interrupt(CPUState *cs) return; } =20 - /* 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()); =20 arm_call_pre_el_change_hook(cpu); @@ -9453,7 +9451,7 @@ void arm_cpu_do_interrupt(CPUState *cs) arm_call_el_change_hook(cpu); =20 if (!kvm_enabled()) { - cs->interrupt_request |=3D CPU_INTERRUPT_EXITTB; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_EXITTB); } } =20 diff --git a/target/arm/machine.c b/target/arm/machine.c index b292549614..4f2099ecde 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -693,7 +693,7 @@ static int cpu_post_load(void *opaque, int version_id) if (env->irq_line_state =3D=3D UINT32_MAX) { CPUState *cs =3D CPU(cpu); =20 - env->irq_line_state =3D cs->interrupt_request & + env->irq_line_state =3D cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_VFIQ); } --=20 2.17.1