From nobody Wed Nov 19 05:52:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.43 as permitted sender) client-ip=209.85.208.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1614680890; cv=none; d=zohomail.com; s=zohoarc; b=YrLf/mY2b5aRr0E3tyaluekrLNc/JhY7va7PCVpcneNXMTkHKq2yswf9YeNb1GNG6bXTYXOsRaIoOJXMf1HIPCjEIDTzn33GVecIBXNY1ohMGp6Dr4pl5sWfLsM6V4of3I8TeiMcc4HqoXhL/UYJ9OyNx/LgAR+t3+TI4lI/bzc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614680890; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pjMzSGB3VrIz5KxFOb+6NNQW9N2HU550cTaWwJDZ/8A=; b=UunbZNtgwcIEGyYZahEDKsf7CWCUM2rDJHQ77dEA6etsAEKRj7laupR1ODelbTR/UMPA0OMIfXPcmKvGX9gsgS2mdYuhdnJvreND+AKfKN6jnpoGBg+aPCGF2sIjRU3lRqZta2Bffw7yl9BYZN5SveAR6TXmBlZloLg8ztJHJx4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx.zohomail.com with SMTPS id 1614680890253599.1811016763135; Tue, 2 Mar 2021 02:28:10 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id b7so10978500edz.8 for ; Tue, 02 Mar 2021 02:28:09 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id br13sm4397210ejb.87.2021.03.02.02.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 02:28:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pjMzSGB3VrIz5KxFOb+6NNQW9N2HU550cTaWwJDZ/8A=; b=G5cW5AURekQmkyrJ6xeJCQv3edRRJ8ZowZ2/mHrshd3o/HOnTy8r0r1Wkrd93i0mF+ mtmII75SZLx6cturdLpzSNbUx8PdoKT9uFWuDmfad1KxrZQI/LWFwv2TPlpn9YPCweFW 8IKjAQKz+PUtSpW56WCBYuIjNm76Gm43hEVc10r4j4Ah40F8Bf2xfMvqnX9meZ02ZnTN 6q6cem4/2iK5QTzWNuKHcpzkSq5CFfAG24luNZ+kj+BeIrcLKzbi86cmK/hfLEvTHWhc PkdROXLdXdue86d7PetG3j2V0RlsS0/FmKH0fhgHn6b2bQGdyDw3eQcuA7KXp8y3DnDH 6mFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pjMzSGB3VrIz5KxFOb+6NNQW9N2HU550cTaWwJDZ/8A=; b=UxV7Sali/rYDI5LGxKgzzYmHW3p8N9NHszawLN3jYiO7SPQeDc14SWOy+AmPCMU55f WzBvNSpGOXrJ9DL7Hl2STWH+jpwGZz2Ri3GxBWCLS4AT2qwcPiGVDv9nPgrdXywV2iEo nNbr9t/prG6de8nQpB4elc00aSWZepqiroOdIX/r/LNwaUCSZ/4yW4BGAwHH1+D4z8pm g5SlMqZFYcbudSFJNynUhQXUfcy9JK2BoQJ2Mws2t3O/yV5BP0vLfUGumkGfdI9eG+nS 8K1ksxFkulILWctWMpazNYs3wxiaKVgqhqJEPEeQ0AKBf47ahSZ5rV3kIq55CxU6jc9W 4y+g== X-Gm-Message-State: AOAM532iqmVoD3+ce0RWhzTH1sXpuCestPRKdtxNifkDF18Saq3UEej0 UxJmYW7dio50mNMIWPUarV4= X-Google-Smtp-Source: ABdhPJwrIthzky9aSjMOj2l7zu1IQyoGsU4Myc6vHwfgeJPx5pGxTKIGOWsBqqphOUFcNXqMeKFGDA== X-Received: by 2002:aa7:c9c9:: with SMTP id i9mr19642808edt.160.1614680888521; Tue, 02 Mar 2021 02:28:08 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yoshinori Sato , Chris Wulff , qemu-ppc@nongnu.org, Marcel Apfelbaum , Greg Kurz , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , Michael Walle , Palmer Dabbelt , Sarah Harris , Anthony Green , Eduardo Habkost , Bastian Koppelmann , Laurent Vivier , "Edgar E. Iglesias" , Claudio Fontana , Artyom Tarasenko , qemu-s390x@nongnu.org, Thomas Huth , Paolo Bonzini , Cornelia Huck , Taylor Simpson , Alistair Francis , Michael Rolnik , David Hildenbrand , Aleksandar Rikalo , Stafford Horne , Jiaxun Yang , Marek Vasut , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, David Gibson , Sagar Karandikar , Guan Xuetao , Max Filippov , Aurelien Jarno Subject: [PATCH 4/7] target/s390x: Move s390_cpu_has_work to excp_helper.c Date: Tue, 2 Mar 2021 11:27:34 +0100 Message-Id: <20210302102737.1031287-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210302102737.1031287-1-f4bug@amsat.org> References: <20210302102737.1031287-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) We will restrict the s390_cpu_has_work() function to TCG. First declare it in "internal.h" and move it to excp_helper.c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- target/s390x/internal.h | 1 + target/s390x/cpu.c | 17 ----------------- target/s390x/excp_helper.c | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/target/s390x/internal.h b/target/s390x/internal.h index 11515bb6173..7184e38631c 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -263,6 +263,7 @@ ObjectClass *s390_cpu_class_by_name(const char *name); =20 =20 /* excp_helper.c */ +bool s390_cpu_has_work(CPUState *cs); void s390x_cpu_debug_excp_handler(CPUState *cs); void s390_cpu_do_interrupt(CPUState *cpu); bool s390_cpu_exec_interrupt(CPUState *cpu, int int_req); diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index d35eb39a1bb..91142db1097 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -56,23 +56,6 @@ static void s390_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.psw.addr =3D value; } =20 -static bool s390_cpu_has_work(CPUState *cs) -{ - S390CPU *cpu =3D S390_CPU(cs); - - /* STOPPED cpus can never wake up */ - if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_LOAD && - s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING) { - return false; - } - - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { - return false; - } - - return s390_cpu_has_int(cpu); -} - #if !defined(CONFIG_USER_ONLY) /* S390CPUClass::load_normal() */ static void s390_cpu_load_normal(CPUState *s) diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index ce16af394b1..64923ffb83a 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -28,12 +28,30 @@ #include "hw/s390x/ioinst.h" #include "exec/address-spaces.h" #include "tcg_s390x.h" +#include "qapi/qapi-types-machine.h" #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" #include "hw/s390x/s390_flic.h" #include "hw/boards.h" #endif =20 +bool s390_cpu_has_work(CPUState *cs) +{ + S390CPU *cpu =3D S390_CPU(cs); + + /* STOPPED cpus can never wake up */ + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_LOAD && + s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING) { + return false; + } + + if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { + return false; + } + + return s390_cpu_has_int(cpu); +} + void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t ra) { --=20 2.26.2