From patchwork Wed May 29 10:54:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 799835 Delivered-To: patch@linaro.org Received: by 2002:adf:e110:0:b0:35b:5a80:51b4 with SMTP id t16csp668013wrz; Wed, 29 May 2024 03:56:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWKXTHPyfnxnxpddz+IsndE5d8rt4uKn1QcZ0LGgEDPxbQpVK9SzRYFwPKP5AeMec3jFYPZQnQH6hKxCfzwxWmC X-Google-Smtp-Source: AGHT+IHp0EvGX/jG3/0yDki6dEnPegHfj23p9RCS6qK9zFdmNLn8naAMMAzN0d27Nhb6SUg17Mb+ X-Received: by 2002:ac8:5896:0:b0:43a:ac22:428c with SMTP id d75a77b69052e-43fb0f255aamr152307801cf.66.1716980215332; Wed, 29 May 2024 03:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716980215; cv=none; d=google.com; s=arc-20160816; b=NH417eoB9zq1JKqIJ3e+qBAyWWT+EpZLgO3nc6aejEmxrYGa78dfpvyrr9idynHBtn czRKKOrwNfEesnBmP04WxfjbANtkoyq+rqNqgDSYT1vXnK0VUfpbdHM+jPZL1lbbYELO mpsgAU7XgV8VcUrtwWwJDB1D/XrLUJV4UVMIECNXmfE50wOmAqF6TXWp8GznpplTD1Ji UYZnFJ+FVLP7Ggli9valNlv487wEvjfaFSETfWd3MvVgrNbPcP5Ic+QhA2Ov4GPNZp2c H1yS4FChvo0sZLFGRJc+VrK/rx3OPO0R+NVGy38m62Il1K1QAH0htZhhrRSJLIr3MFk+ oHaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D649wpf7fiL4benJY0EmDtgPf0hrsPfPJlzQXEO2rsk=; fh=LvDjHOtLmHsu9QDw2U5vQfic2aYV1dwSTRqXY4MzVo0=; b=elUpRnP0KFI8+OHtz1vTUsWN0Fiu/fqA3m3vw7/URDADE0vtSrwQgfaeZD35z/4/F9 e5yfcLjg3fEBYWjm50NlLTh8uXCSg+P4hxcvEnPlPsS9ciF2MgwU1KPUzI567+xhaSOt CIVyvxWuOpwS4gs0MX13drvGolZYWLl9p3D8Zi5sziiY+igvTKTdIBKFubRJMttmIlEy r7J3rmDDXAMN7cOCYVRKj8meeQocAe3Yl8Sp2VH8mtWd9FfyjtTxL7RbHHfqC2H5JURV ySBdzLqaWXjtWKjMmn2gy1PZp/JsN8ec8+dn0QclnBjb9rKN3uJeOFuN0iuVahA1xE6R kEUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gIQM/dJb"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18e9ad0si136762541cf.777.2024.05.29.03.56.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 May 2024 03:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gIQM/dJb"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxa-0004YZ-H6; Wed, 29 May 2024 06:55:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxY-0004Xx-Sa for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxU-000359-9w for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D649wpf7fiL4benJY0EmDtgPf0hrsPfPJlzQXEO2rsk=; b=gIQM/dJbfEa/Dgywt4VP257j+jOE6SgspoYjdS3BDk56a/tqgyFdkw3gA7BCktaXqyTdrP D6unomTEzd6hv5knz1EZV94+Rkg9nkghZDVQqMuJ4AzaWsEwQvuHOu9P8s7eDBp4lRdTdb BkGgMCS3tF5W3GTecoztSJQcDKyGrKo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-509-JgcYcQ2bOWG9vOeN-sNcaQ-1; Wed, 29 May 2024 06:54:59 -0400 X-MC-Unique: JgcYcQ2bOWG9vOeN-sNcaQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B4C481227E; Wed, 29 May 2024 10:54:59 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFC4B105480A; Wed, 29 May 2024 10:54:57 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 02/22] target/s390x: Move cpu_get_tb_cpu_state out of line Date: Wed, 29 May 2024 12:54:34 +0200 Message-ID: <20240529105454.1149225-3-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: Ilya Leoshkevich Message-ID: <20240502054417.234340-3-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/cpu.h | 23 ++--------------------- target/s390x/cpu.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 414680eed1..950f84f316 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -413,27 +413,8 @@ static inline int s390x_env_mmu_index(CPUS390XState *env, bool ifetch) #include "tcg/tcg_s390x.h" -static inline void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - if (env->psw.addr & 1) { - /* - * Instructions must be at even addresses. - * This needs to be checked before address translation. - */ - env->int_pgm_ilen = 2; /* see s390_cpu_tlb_fill() */ - tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); - } - *pc = env->psw.addr; - *cs_base = env->ex_value; - *flags = (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; - if (env->cregs[0] & CR0_AFP) { - *flags |= FLAG_MASK_AFP; - } - if (env->cregs[0] & CR0_VECTOR) { - *flags |= FLAG_MASK_VECTOR; - } -} +void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); #endif /* CONFIG_TCG */ diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index f7194534ae..a8428b5a1e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -324,6 +324,28 @@ static void s390_cpu_reset_full(DeviceState *dev) #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" +void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + if (env->psw.addr & 1) { + /* + * Instructions must be at even addresses. + * This needs to be checked before address translation. + */ + env->int_pgm_ilen = 2; /* see s390_cpu_tlb_fill() */ + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); + } + *pc = env->psw.addr; + *cs_base = env->ex_value; + *flags = (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; + if (env->cregs[0] & CR0_AFP) { + *flags |= FLAG_MASK_AFP; + } + if (env->cregs[0] & CR0_VECTOR) { + *flags |= FLAG_MASK_VECTOR; + } +} + static const TCGCPUOps s390_tcg_ops = { .initialize = s390x_translate_init, .restore_state_to_opc = s390x_restore_state_to_opc,