From nobody Fri Nov 14 06:40:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1585253115; cv=none; d=zohomail.com; s=zohoarc; b=dapCLTMu73GkYtXs6pvMsKRNv5DE3zml1+jQa8xg5NgXcVjieTD6zJp6UqHk12jByYFWisMLuvOQyPVAGblt9lO2ur4n+DlNq6bAHDjhWVvS+Y4Udewj0+u7wz4YbhjZKN1EBevrlACc+JcJUvrBGn62Pin5VMaR2Ub4aN9YB+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585253115; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=peeEpurfJyQFOk/Y5mv4nylcNl/81VuZK9r+NVDwKgU=; b=h+sYo4wnK/ZEPDGKAjgdNRBTmd0GwrJCJWBqdCcdH4b6UhRdFSqISsD6smHRb8GBgeCeWNmS8YqNIsTWIiD12LzYdcbTvzkG+cRKpehbZwammtdIfRwms90sDDGhloIZyhGwJl3Z/qJ/GqZnZDC74WcnCOWZcgqyMajYlQbClWo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585253115039761.6916834205952; Thu, 26 Mar 2020 13:05:15 -0700 (PDT) Received: from localhost ([::1]:59388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYkb-0005P3-Gh for importer@patchew.org; Thu, 26 Mar 2020 16:05:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58964) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKl-0007G8-6r for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKj-0001qi-An for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:31 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:43639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKj-0001qG-5T for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:29 -0400 Received: by mail-qt1-x841.google.com with SMTP id a5so6515286qtw.10 for ; Thu, 26 Mar 2020 12:38:28 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=peeEpurfJyQFOk/Y5mv4nylcNl/81VuZK9r+NVDwKgU=; b=Pu/iQU0wjw5Q8m4vkpiyRh6hZHgO1MATDuKPcN52fchs4/yKvslhi3ViUfiC5XVrYv S0ufH3bi5B66iPearsRvFt4wrlX/KecUZxHge8HrIJcx7RPhbqmaRF7OsdDL0THRdqrK +dz4NXobhiU9EmgtJS/1i9UIEIPQL3cyni0YrLKAgWgjB+p+5NPJc9xILR70km/y5u8n gIJNYyT0HUXohkjQA9+v0/6o+HEUIsjFNuJQcds7Hconv0/3qaKjVJDuIXDf3SWivTcq 8Cmo3ie79lX0ebNTQOahscj6lqX7+pjy9rMeuYoWW5yrz5BzR+EBRdoEGT5Nj5BJKzrF SYHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=peeEpurfJyQFOk/Y5mv4nylcNl/81VuZK9r+NVDwKgU=; b=IY+Fx8+xB5m548W06xeWavNZiXIq//Ub3qYOAzVALnUzyNONj9ip/mFyukofVd2Sjm /RhkbX+D5bPHi89LihLMIQtz9Y594QODKDbY5YOZgIIroDMNjRS+e536H8iup1ZGIfgF fVEZtqVgC7iuVAoHqy8hAtqTfl4+HccIVYsqhhdhJWYECQOa7f5LN3zNLKnR+1DiE2IJ COpj4Z3yqKwMR3Ea+r0zidhV4IUsnjKWeTJuAeHOGlM49STM9Xvwlh3zXsuIV4K22Vat DedM2ZiXu3JJhxjgefLL9iYQ/0xKcmTavEkgz5Aq44grvYfAoYz7Crnzqv87B/mWU+MF 2ubg== X-Gm-Message-State: ANhLgQ0csQNi/tgHJ8rGK8KyA5O4npCJWhzT6BCvbisRAcz5g4IaBvOw nVgjvgcxhASENEhmCpMmi9LgdrgmV7hGsQ== X-Google-Smtp-Source: ADFU+vsRPu2bv++cyos4KLSlEBhrzmTtN5B5ntwiNulTvBwY1L/uAVQLMcEBOkw5jWSvC9zpfdGufg== X-Received: by 2002:aed:2415:: with SMTP id r21mr1157382qtc.82.1585251507974; Thu, 26 Mar 2020 12:38:27 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 39/74] arm: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:21 -0400 Message-Id: <20200326193156.4322-40-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , robert.foley@linaro.org, richard.henderson@linaro.org, "Emilio G. Cota" , qemu-arm@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: "Emilio G. Cota" Cc: Peter Maydell Cc: qemu-arm@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- 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 9fa514c999..e190604ae2 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -75,7 +75,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); @@ -611,7 +611,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 { @@ -632,7 +632,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 b7b6887241..19efdc0b00 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2132,26 +2132,27 @@ static uint64_t isr_read(CPUARMState *env, const AR= MCPRegInfo *ri) CPUState *cs =3D env_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); bool allow_virt =3D (arm_current_el(env) =3D=3D 1 && (!arm_is_secure_below_el3(env) || (env->cp15.scr_el3 & SCR_EEL2))); =20 if (allow_virt && (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 (allow_virt && (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; } } @@ -9676,10 +9677,7 @@ void arm_cpu_do_interrupt(CPUState *cs) } #endif =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); @@ -9694,7 +9692,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); } } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/arm/machine.c b/target/arm/machine.c index c5a2114f51..42f4368de3 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -713,7 +713,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