From patchwork Tue Jun 15 03:07:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 460482 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3861527jae; Mon, 14 Jun 2021 20:10:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE/wsk4PCIVWcEijrHz36E/ShLRCLewvxlnT1m7/LVEvyzqGJF3G9MwtnffDltut2AVdjL X-Received: by 2002:a67:f5c5:: with SMTP id t5mr2960404vso.50.1623726626385; Mon, 14 Jun 2021 20:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623726626; cv=none; d=google.com; s=arc-20160816; b=Kfv5rMiHX6r6obFqzzLXa+hu4lMDogj9LH7CSwG85sFgQBEpNxbzfCXGqO3LJP+jkV r3Xho3S+x8cHzsU23wFtZI9pesmrvWPyzOoZU164ZdqtxQrtsYhkXUFik5NPrqhylsNU a2dn2BQ5mN5Y+P7ZOn4UtqAQHwotHZdobW2f3/o4NCNAnznY8rOqZqpvsy4/2wnOJLqg +odkHH/+HC0lonGTlpgZp4ygxqD7sd9c6foWhLu20Dd0Hdy9BK6BnEiREDs7HOQ3iEJ+ v73d/ZyPO8GYLy5eCrV4wDNFhCgSbQQuFrbbaCnBClQQSYos0DwbdJTbBAoicOyZbuqw PaQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=rxs30+5uAa9OunefGQHMVoUkynnQ1zCC+uwySj1YTHA=; b=w5ToiZzhMc/4Cjd0QiG+eH+9w7qckoPZnmHN58K5pjpLXt9wzOJekkRcV5tAcA+YBW dvMEezrCBydcjUVv0zBBcG4OWLbQyqRnFbQxGrefviA4GgcA1VXkDVSO19d4e4mOkZ6q D/hZYKDyy4jTirMwVg59awffa22eVwE1GuPiPXSWQm2yxcX8c4lghXD43glK5XMJgxXd UFVa9TneEuxol1VVwtZX+hRJg06+mmrwOH7CUc0+ed03yEtzkxb9PmDvtb+Mu3NZtn3L T5xjzLtIkmo+jNDxrnBjyYP/0zCP+7GpE7W/crsXCe7FXKZjCQb5njalrCh7g6JQ5jwA WEtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ph5NFs73; 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=fail (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 x10si7976658vsx.119.2021.06.14.20.10.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jun 2021 20:10:26 -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=fail header.i=@linaro.org header.s=google header.b=ph5NFs73; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lszT7-0000aQ-Pt for patch@linaro.org; Mon, 14 Jun 2021 23:10:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lszQf-0004ew-Jw for qemu-devel@nongnu.org; Mon, 14 Jun 2021 23:07:54 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:45654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lszQd-0008A3-OP for qemu-devel@nongnu.org; Mon, 14 Jun 2021 23:07:53 -0400 Received: by mail-pj1-x1031.google.com with SMTP id z3-20020a17090a3983b029016bc232e40bso1317647pjb.4 for ; Mon, 14 Jun 2021 20:07:51 -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=rxs30+5uAa9OunefGQHMVoUkynnQ1zCC+uwySj1YTHA=; b=ph5NFs73tU0nzEs0hJ/7pO/9mjO6LIuUWtE1RCTv/zJCYwvpAhZZIxQSRNqB+48UZ2 rrZK2lyOP4LDJ4PYtElI03nDZ3fBPi8oi0PdbToreQ850PlrGq3JVuVM316SuM7zuKIR 2Qkaa+zakDiIvuPBwB8xe0taZYSavcHrb4dKYMsmH2fA/6hUUQvuoA9utFCENvIK9Wby 8ls08GqQrEysKm178TqUegnDAIPNmg8xgJ2m1dZ4aMF1giTYdMzko5HRyK2zFEB2MEgh hz8krDUpLx+ljY7hcXsstuw3iOYZOaTWFl0R+BWSvTiFTnCRdNCHzrcwO03CbADy9+jE pKjg== 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=rxs30+5uAa9OunefGQHMVoUkynnQ1zCC+uwySj1YTHA=; b=ZH1l14ubL3E+6C1M4SLFyoCPz8dn95LMehYjW64eCmbLiGTJ/HUOb8NsbwrJEm7iSR VoX3dZThGCcDAFTKm0+uhuxIa4bsBcqtkG/rK+75qa987iECeG4s0O6RJFOfymU5Z4HF dBLR2KMGviiucnqlDuU5kF4l2DYCgXZvHQ3B9isPtybjt2R3oquj9MXIfDRnnplxrDHI aEIpqxvjQPmZSaXdYOaARlRe3qkE3gnpvqM1TwrseBKxI3u+OfW7TUeC8TGqI3Aw/rbt SYkg7Yv/9CMKV653LGfEYTxV7eCH6VmtmvrvL3v9NY3gbdmyCgTaMh23ntjxHrnfQajI IRqw== X-Gm-Message-State: AOAM53128ndbJgLm5W2CG8IDgdaSliWBt7Cmf37o5LG3jZ6EPThGFvlA BKXlwUWJ4c6d2ynDkjPtK6Z704kYK6sXZA== X-Received: by 2002:a17:902:d3c3:b029:101:af83:cb1f with SMTP id w3-20020a170902d3c3b0290101af83cb1fmr2207550plb.80.1623726470520; Mon, 14 Jun 2021 20:07:50 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id w71sm7554666pfc.164.2021.06.14.20.07.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 20:07:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/5] target/s390x: Use s390_cpu_{set_psw, get_psw_mask} in gdbstub Date: Mon, 14 Jun 2021 20:07:43 -0700 Message-Id: <20210615030744.1252385-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210615030744.1252385-1-richard.henderson@linaro.org> References: <20210615030744.1252385-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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=ham autolearn_force=no X-Spam_action: no action 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: ruixin.bao@ibm.com, jonathan.albrecht@linux.vnet.ibm.com, cohuck@redhat.com, qemu-s390x@nongnu.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" No change in behaviour, as gdbstub was correctly written to install and extract the cc value. Signed-off-by: Richard Henderson --- target/s390x/gdbstub.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 2.25.1 Reviewed-by: David Hildenbrand diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index d6fce5ff1e..5b4e38a13b 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -31,18 +31,10 @@ int s390_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; - uint64_t val; - int cc_op; switch (n) { case S390_PSWM_REGNUM: - if (tcg_enabled()) { - cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, - env->cc_vr); - val = deposit64(env->psw.mask, 44, 2, cc_op); - return gdb_get_regl(mem_buf, val); - } - return gdb_get_regl(mem_buf, env->psw.mask); + return gdb_get_regl(mem_buf, s390_cpu_get_psw_mask(env)); case S390_PSWA_REGNUM: return gdb_get_regl(mem_buf, env->psw.addr); case S390_R0_REGNUM ... S390_R15_REGNUM: @@ -59,10 +51,7 @@ int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_PSWM_REGNUM: - env->psw.mask = tmpl; - if (tcg_enabled()) { - env->cc_op = extract64(tmpl, 44, 2); - } + s390_cpu_set_psw(env, tmpl, env->psw.addr); break; case S390_PSWA_REGNUM: env->psw.addr = tmpl;