From patchwork Thu May 2 05:44:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794090 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp77943wrr; Wed, 1 May 2024 22:45:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUzTBsfDmr+f0hi23xtbthECKIJhgvNxGNBgDDqejblq1RHOMQXfNmzv0xKWpxsL7m8NQmGjxxSV8Ou7Lfsv+Oo X-Google-Smtp-Source: AGHT+IHOza6pLUIMFIWV87sC8HMpMymIN8rYN1/KHfpcQxTYYTATi7Z80l8w5xdWBFpplYwZbF1l X-Received: by 2002:ad4:5bc3:0:b0:6a0:6668:f3f6 with SMTP id t3-20020ad45bc3000000b006a06668f3f6mr4970467qvt.21.1714628759439; Wed, 01 May 2024 22:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714628759; cv=none; d=google.com; s=arc-20160816; b=dT6fSpDn7VPJ7fSQlw53Wvf0ChliLN48oga653bs9Zl27LwSodKsRNdYfyO82Jz/Yv JysUxKnhNc5XljnOQPYt3F5xUlEcqH1k1chFwIg2YqhAn2hiuM4TTx9qwTQsz9xW7tsA 8W0iNvSaD6K6/Zd/HrhlKj3cuO4vbcAWHkAsfbn6AHi9b0R9iMr8YJJIp7EVukQEfKVh n2cL4aOfINx2MOEJjRF9nelV18LP6vmAFtp8EjHxfkUmQ3xbFCJiQJZX+AGZGmG4V+3p v1KJBy4kzGJF29TxuQdFu1oUTDs3iYrFWHHDKt3bMe+2VqBT3rW7UGyOeX26+qwVvfJj 2EfQ== 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=kvsEkhTyf169sgF1OovUL2phPwJdfZB/cbb8N0Y+skM=; fh=vvIHVEExtoxBacLa1w/xvEOdET6IjbTxlMJ0GExg4HQ=; b=awrQU25CuTgljM60vbMXUEy4SgeSatt4PeZn7t+KkDY2WHBOdY5vcUximGEZA9ehP0 rQN29FAHtMdkGF7ozHJp4F8dLNBe5+P1+pKxvIcSrAs+0++HmRZU7YAxdG5iMmZq9CtL 5Q8rcREkXuht9ymxB/zkVNEk8scuBAy4c2AtrhDSMNGleLhdSbAuiVtHrstGC8nHseRX GxxSl1e/DM9bP+qPY2WOAbr2rLuRpNVTAiA7cpJSSelHUcOCwfQCW2uZBKn4isWz6xpv xIGECGNDDg9t3hFr4Xlv518SmDrEx4VsoyAG+z3U4LS4YhrNO/+2h4MbhDE8aYoq+d1r SiNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rU4Ga/SV"; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f9-20020a0562141d2900b006a0af3c9124si235427qvd.358.2024.05.01.22.45.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 May 2024 22:45:59 -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=@linaro.org header.s=google header.b="rU4Ga/SV"; 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=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2PFE-0008Om-AG; Thu, 02 May 2024 01:44:38 -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 1s2PF7-0008Mc-U7 for qemu-devel@nongnu.org; Thu, 02 May 2024 01:44:29 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2PF1-0002bY-D1 for qemu-devel@nongnu.org; Thu, 02 May 2024 01:44:28 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6f43ee95078so28285b3a.1 for ; Wed, 01 May 2024 22:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714628662; x=1715233462; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kvsEkhTyf169sgF1OovUL2phPwJdfZB/cbb8N0Y+skM=; b=rU4Ga/SVeG7LO0tdfNSL/A8iTnPuh+Om3yG2gxqPuffoQLavZNv7OVl1O/jVnWHaAc qhF1QBMfmkaCvicNvOrTdau4UFuEsn8DWEvclpBxvzsZBHJtn2jP/+3mF0h2VmVgCYCo Wr0crZ9uG+g18hzkTGLJMKaaw/mYz7XIPAzGYvFXbv8o69iY2P0WCprxjgBssTJ55/nA K8W0gZgeXsZSKvUtGKVMolqJbfwTiea2G1D8ZCUo2p0UY5BhWXV2xCmYOXzSrpRxQ6lj UD4nIbQMD/Em/Z//z23S2FSlki1XdlFMPcOd1QhhnFpC85TIZSGCSIZZhL+UAxo9J9g/ Ivqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714628662; x=1715233462; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kvsEkhTyf169sgF1OovUL2phPwJdfZB/cbb8N0Y+skM=; b=TCiYi2DBMJ6iIEZl30CBwZt1o1UPAC7oSNM7WIYGhmmG4On4Qo+bLdm461EPURQ5wd Suf8JlFfXGg6oZI+iKRWrM+hNM4mxjQ2OgSddZqSK4K2OknRqsBX1sUqnasQnaPB6kuM hLZp7zcDK8/B4GcR/LBO0Rb/rIxnEpjgr8VlcDhIdcsjL2H3NT5CL5rchL78N7pGCJ40 nLNTuxW0tiEgBJ7v7A5oGAMxD6R3as01BEspzRej1BXyTBksGruI1fkmyOjFyyMHTYHK iBsXqUk9D5g4zp4KO0h9A733c4YYizSQz6M4rZJ70R4GO960COsqkcq6eDVhhgYHuWLL 2Brw== X-Gm-Message-State: AOJu0Yw9rJlg9sgCN0ba/Lg1pojuDcLlmAq5cvdU6Zip4wYqlIaReeW4 edaBjuPloti8QKmQbvAFJuI2icF4xEDGtGTk5tY1p5xb9UFPFHWhzlmcv9gpJ5jQiD/Jy65TuVi Q X-Received: by 2002:a05:6a00:842:b0:6f3:f062:c09b with SMTP id q2-20020a056a00084200b006f3f062c09bmr5716409pfk.6.1714628661898; Wed, 01 May 2024 22:44:21 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id e18-20020a656492000000b006089cf2cde5sm294401pgv.26.2024.05.01.22.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 22:44:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, iii@linux.ibm.com, david@redhat.com, thuth@redhat.com Subject: [PATCH 02/14] target/s390x: Move cpu_get_tb_cpu_state out of line Date: Wed, 1 May 2024 22:44:05 -0700 Message-Id: <20240502054417.234340-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240502054417.234340-1-richard.henderson@linaro.org> References: <20240502054417.234340-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 Signed-off-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: Ilya Leoshkevich --- 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,