From patchwork Sat Mar 23 17:29:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B57CC54E67 for ; Sat, 23 Mar 2024 17:31:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5C0-0002jF-4M; Sat, 23 Mar 2024 13:30:04 -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 1ro5By-0002iq-Mu for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:02 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5Bx-0005sp-4B for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:02 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1dca3951ad9so20794315ad.3 for ; Sat, 23 Mar 2024 10:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215000; x=1711819800; 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=kQVqrnpEFNAMTGSDkWy/XEPY0f16YIjRf/pXZgn4ChY=; b=I2+ldY4Eje/9tSyLa30imHZtyycUsA5MqKMLjm3KPcmAf8uLSbvaLGAY/rORvQu7lY +0CkmvJsZW3W596vKkwWGFtS0o9ozI5HKw+BrNt5xG4k8Jem1mc94EZMJJ93PqLUWo6w 6a+aopXovOjjiVcUVn2ltd6VDWSUHPlfQIYBVdySY1jfavcMii1AkAXiqRTuDjh8SnXX JqTBciJHiI1tX+rlWTpFmLIPga43g9Epolg7e90lZmN2wi2Us3Fv4AgQIu19I8uRWR7o JwakUK2nJu1s40BKdCFGNHua1BP9ist6oSCbGCIDcI26jh0fKocn0f/b6GKLcgX9y9dh fldQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215000; x=1711819800; 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=kQVqrnpEFNAMTGSDkWy/XEPY0f16YIjRf/pXZgn4ChY=; b=vkuwFw35prCAcBD88DxuybU/hVroXnZVACcYZMc8qJAuWKdBlr1EZ472CZiU5OJcK5 wpXoeqTAvdObqgDU+sFvR47hjJ3UdzcS7WHPtSl1ebopKLldicojYrAHthKupZMtby1e 6trwzjINPm2mM1lgiNTGTBTl8iw4nfCku0qheyt3HPwTatBVI1o00Ep9znFpmqj27V9X QsSDgEzFHLG94u/d5y9rjc603vdPYEbSrtJzqoigzpGbOn84G/u/GKWbfFodvTuHSWBw sZG08KjtXd4fQmvQDWnYNNOf0uVJ/Hb7sFINReu+++Dm12ch6/jDVgrpS1bP8PolRpN7 VrlQ== X-Gm-Message-State: AOJu0YyZbB5mJppGY6LuS373Qnus7PLagJGCqAs2Ql7ApnYVHItocup1 DuR5r0y3w/0TijaTOoG6cABoKANNR7NhnrNWe0dEc/fAIwm+T82scXIigTVaPcmRb4dV6iZIPLF Y X-Google-Smtp-Source: AGHT+IFa4UXqa78gLeMkvX8GrNGZiTS7y9HCnoFhfi1LSa0/QZURkiuuANcruLwT2WmrvOPrIu7ing== X-Received: by 2002:a17:903:247:b0:1dc:9118:515a with SMTP id j7-20020a170903024700b001dc9118515amr3897128plh.37.1711214999773; Sat, 23 Mar 2024 10:29:59 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.29.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:29:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de Subject: [PATCH v2 1/7] target/hppa: Fix BE,L set of sr0 Date: Sat, 23 Mar 2024 07:29:48 -1000 Message-Id: <20240323172954.1041480-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The return address comes from IA*Q_Next, and IASQ_Next is always equal to IASQ_Back, not IASQ_Front. Signed-off-by: Richard Henderson Tested-by: Helge Deller --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 19594f917e..1766a63001 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3817,7 +3817,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) load_spr(ctx, new_spc, a->sp); if (a->l) { copy_iaoq_entry(ctx, cpu_gr[31], ctx->iaoq_n, ctx->iaoq_n_var); - tcg_gen_mov_i64(cpu_sr[0], cpu_iasq_f); + tcg_gen_mov_i64(cpu_sr[0], cpu_iasq_b); } if (a->n && use_nullify_skip(ctx)) { copy_iaoq_entry(ctx, cpu_iaoq_f, -1, tmp); From patchwork Sat Mar 23 17:29:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E35EC54E67 for ; Sat, 23 Mar 2024 17:31:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5C1-0002jd-U0; Sat, 23 Mar 2024 13:30:05 -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 1ro5C0-0002jU-D1 for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:04 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5By-0005tg-O5 for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:04 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1e036b76725so23062375ad.1 for ; Sat, 23 Mar 2024 10:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215001; x=1711819801; 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=zUaBJKSO6H1bbGryp1PQTqH1TE2lEnHyVoVrY4Z6LJ4=; b=EKUQBHz/gWiXootyOgWrvCZyndOG6d6PZhWUr9CRXifHOo4swQlQZJCynMp3US5bAi QQY137/SB4CISSeVML3f/KaqadQaguc0o4MoXmcderDA6GSp0RpKj5GV3EoQ/oksyHzY CoWurv8teL8wg683+8LX2ChcONRB8Jcq6/TqB+FkqjMIRN1UY9D/NwQKMt2KKbQU/BuQ 8qofkMktOPLbm18UL+DYHZiOu9cczjpz3JpxQiz7W28HIndk/NJn6qEG2BSsECcojcee znX2rGAduqgpnE/ncJq0g1Aixo3sE88CYZklDlwLHj8oeFrGlqDj22AdZu+2dhL0DmxY aI/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215001; x=1711819801; 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=zUaBJKSO6H1bbGryp1PQTqH1TE2lEnHyVoVrY4Z6LJ4=; b=pgAp4sf6JC1aK5rdiCJNzNJAMZdezGBm+R+DCxx+rYj7zEdjlo2mIAn+42MucLkybZ OA9Q8lqgLUVeN+817kAhCPeBOC/lWeTXyTIWF+4TezckLyaqluo6TFPVteKdaTPbEc6g K5Gw7avEpHCv5Qv0NGz+SOxo6majCkMDgIStrrrKBIFqVooUVbsCxQ8Azg/i26H5drZR L4PSUGBQcTOYwYM4iJR0qQNjoUw2eh98/vRmWMYcDUWBA6ZUG1HBlo0vWEW653S6WgPN 9vD2DQK+MTjOhRpbb6xFwT6ytFgfZ/BPOFHARdZoXG9ezPdHGtPj/KDJ0Grv/VT9gF0d Rqyw== X-Gm-Message-State: AOJu0YyV9TIrFd8pWjgVU9CJK9DBL8XLRqpQZgk7Gw6z5MLXaLKjNnb5 Cr8xIVsapMgLO6RynbrQZoWPIB5FHMAkrzCJxzSaFMjW0TPZAE8RwgdT2ayTiW8aElRm7N3L5vr X X-Google-Smtp-Source: AGHT+IFGoxjdaizMWgMcVEb0sCy8IeIqKCiVhhAWD8E6hyVywhwuNbEu9Otl4VO4PcD2uP9bLLv+Nw== X-Received: by 2002:a17:902:c412:b0:1e0:a7c0:1806 with SMTP id k18-20020a170902c41200b001e0a7c01806mr1948749plk.25.1711215001297; Sat, 23 Mar 2024 10:30:01 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:30:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 2/7] target/hppa: Fix B,GATE for wide mode Date: Sat, 23 Mar 2024 07:29:49 -1000 Message-Id: <20240323172954.1041480-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Do not clobber the high bits of the address by using a 32-bit deposit. Reviewed-by: Helge Deller Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1766a63001..f875d76a23 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3880,7 +3880,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) } /* No change for non-gateway pages or for priv decrease. */ if (type >= 4 && type - 4 < ctx->privilege) { - dest = deposit32(dest, 0, 2, type - 4); + dest = deposit64(dest, 0, 2, type - 4); } } else { dest &= -4; /* priv = 0 */ From patchwork Sat Mar 23 17:29:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24FBFC54E58 for ; Sat, 23 Mar 2024 17:31:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5C3-0002k6-FY; Sat, 23 Mar 2024 13:30:07 -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 1ro5C2-0002jj-9m for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:06 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5C0-0005wl-4e for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:05 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1e0000cdf99so23295295ad.0 for ; Sat, 23 Mar 2024 10:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215003; x=1711819803; 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=S0QfsALuaN0+wWbot0bFHlDdwooZi0EKVcDM5oK6qSA=; b=ya7exnbKQSbmOU2Up43gR7iH6jvNIB6sMR/OlwQHuaMpj0vGdDOO3ROeg4VYflclTG zGpK7ihdCEVCUm5PCHYa4tyDxNPcE5CaCeXoO3Fy7xD+3yHb9Kgm4EWj/TGAuUtWg/7M CA6EooZR3d6LAZnowT4jxQDEfjzLju6zbTe33skMXa/tOgXX3YklBjCn7jPejTAoP6Yd 7T/Zr0nF7k8Rr8uu7d/obk2K5Tl+CHvNFMrEi6OeCv/yPHjZjYgma6Y1E7VdHQQwABw9 tn5ACtVP+gBT8eWuJgZsjE9+QOGFTil7No/ZbdjkDUiW1CJDvogpdb8/a5jG2huzDsHv bXNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215003; x=1711819803; 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=S0QfsALuaN0+wWbot0bFHlDdwooZi0EKVcDM5oK6qSA=; b=WRZ/PE3i7a11YUqJSkz+CPO/WUbZEsEKEpK+fftt8uU2Uxk09nCLSu2BxDdV59uKWy GuJ/Kh6QEZjPEIKO//G6tqZSKeMiKYKEyPGyCzsJniuHvYrPEdpvZro0+EbtLBiQy4gm 5DWmP0oWiOWSui7iOiesA3GB7VvYFt+o2Fqyfa+08zYctDgv0AAKBOfvGcyxnRFHSS+A UvrOtE45bSjmH6AS26hhvl5RKTNYxdeliePCz0JRKNVo4f2jSZNa8P+2mcYT+NzIeF6l lEDmtl8KQi/OohyS6QSLm2XwHTCMGiGHmhmbWPafCa94opqITzOiEY4oc2htshGA6qxR Fk5w== X-Gm-Message-State: AOJu0YyinrSTgz91fj2bqutwNFE6euzBLkMuT331PpvXCjwICZKm4dW6 6l1RFIjeE6hXLBhoorsiudYMq3vuWKJQu4CPico3NtL3gT2tK0Dm/UV7s6unKe+EU9Nxw/HRqJL u X-Google-Smtp-Source: AGHT+IHywGztXRFljRFfY5CVp2Oeev1pcDtzO+dvVHYbkxJ5XYgHsWj5bqAt6m2dRc6YbViRPAe9VA== X-Received: by 2002:a17:902:e887:b0:1e0:aa4d:747f with SMTP id w7-20020a170902e88700b001e0aa4d747fmr1583147plg.6.1711215002766; Sat, 23 Mar 2024 10:30:02 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:30:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de Subject: [PATCH v2 3/7] target/hppa: Handle unit conditions for wide mode Date: Sat, 23 Mar 2024 07:29:50 -1000 Message-Id: <20240323172954.1041480-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Sven Schnelle Wide mode provides two more conditions, add them. Fixes: 59963d8fdf42 ("target/hppa: Pass d to do_unit_cond") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson Message-Id: <20240321184228.611897-1-svens@stackframe.org> Signed-off-by: Richard Henderson --- target/hppa/translate.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f875d76a23..2cb91956da 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -967,11 +967,22 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, switch (cf >> 1) { case 0: /* never / TR */ - case 1: /* undefined */ - case 5: /* undefined */ cond = cond_make_f(); break; + case 1: /* SBW / NBW */ + if (d) { + tmp = tcg_temp_new_i64(); + tcg_gen_subi_i64(tmp, res, d_repl * 0x00000001u); + tcg_gen_andc_i64(tmp, tmp, res); + tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80000000u); + cond = cond_make_0(TCG_COND_NE, tmp); + } else { + /* undefined */ + cond = cond_make_f(); + } + break; + case 2: /* SBZ / NBZ */ /* See hasless(v,1) from * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord @@ -996,6 +1007,16 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, cond = cond_make_0(TCG_COND_NE, cb); break; + case 5: /* SWC / NWC */ + if (d) { + tcg_gen_andi_i64(cb, cb, d_repl * 0x80000000u); + cond = cond_make_0(TCG_COND_NE, cb); + } else { + /* undefined */ + cond = cond_make_f(); + } + break; + case 6: /* SBC / NBC */ tcg_gen_andi_i64(cb, cb, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, cb); From patchwork Sat Mar 23 17:29:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57BA7C54E58 for ; Sat, 23 Mar 2024 17:32:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5C6-0002kr-3G; Sat, 23 Mar 2024 13:30: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 1ro5C3-0002k7-Fd for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:07 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5C1-00065S-OI for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:07 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1dffa5e3f2dso19830045ad.2 for ; Sat, 23 Mar 2024 10:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215004; x=1711819804; 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=iCXMa8NXK4SslxAJzO8oJ4YsLhlZ/FlXinB3WAZag7c=; b=UnDychnUrUw8jo2e7a5xYAVECR2PLxrLWY4Oi3XRjrnAqrI9OoL8iU+G1XcUz6fzAD uJg/2WcxZOvWoj96oLcLwyY4f5PBQjUKfAMZp5q/ne5FmZwlHPoOHi0lRwt75X9xdshi pf+he90x5t2elKn/8we1HQXE4ukPu6aPOU7VsLQHmBJBSWxRFZ5BWqAmMW+kTF2OYHaY YvHyIxovU1p5JsXjxwt/uedB3Voc84gMdZEvds2C0I2BFzAqe9hTDX5F8C2mw6SzTDcx NsyS1ksBkjjAZRKemXbLhom7oc071bePz87MNw/wLjBvEyzB5XtXxqFbUr+XX4gK8Mhg Dqxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215004; x=1711819804; 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=iCXMa8NXK4SslxAJzO8oJ4YsLhlZ/FlXinB3WAZag7c=; b=GnI4gxf4VLCiXqdZdjBlKZ7skFVlMhTR0ckV+cnRhSzrpQPbULelKyNkO8BnjjJ8i1 rMJsK8t0ZGbEx/aaU5ubRSJPrKKTpiurzM+lpRHRQ7gMsjnJ2Ux040ZIo7Ox6WwNrxBJ 7QYTySh0XlKxqhMPmnpE8+TJQgxcU7/r2EPGB262a5xD8qzenf8EQY7O3mI2tIIpwgv/ hVzGut4c3FDQISfEKZAhgnpJKPWshM6U0advCQH4SyOJ1QKossVhh3kQ+iAcxwANOHI0 ppLquP3yu3Vz9D5TN8hzA4j6xay8WEOckAHP9qLwI0xNfZBwz7ptRcf3BXx8WyPKShij yWog== X-Gm-Message-State: AOJu0Yxe8vQgDljjEKdKLxqhrHQRlCIGcnwuyZE9tYsDxzIfcDfiIVO6 hwXo2axWraBPd0Tz8/du89/4mZjRnn4DFa14r+raJLB3UKH17vGhEvkpAyBgw8pmsq4giwDtQTH V X-Google-Smtp-Source: AGHT+IEKuFCX3s8lMRFtdAhZDVmpO87xwPgvk9b68sY+eIX/e6Xn59kdAPEBkBtx6d0XPoe/gaTt0w== X-Received: by 2002:a17:902:bb8b:b0:1de:ebb7:d1ed with SMTP id m11-20020a170902bb8b00b001deebb7d1edmr2529598pls.45.1711215004144; Sat, 23 Mar 2024 10:30:04 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:30:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de Subject: [PATCH v2 4/7] target/hppa: Fix ADD/SUB trap on overflow for narrow mode Date: Sat, 23 Mar 2024 07:29:51 -1000 Message-Id: <20240323172954.1041480-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Sven Schnelle Fixes: c53e401ed9ff ("target/hppa: Remove TARGET_REGISTER_BITS") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson Message-Id: <20240321184228.611897-2-svens@stackframe.org> Signed-off-by: Richard Henderson --- target/hppa/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2cb91956da..ceb739c54a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1126,6 +1126,9 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, if (is_tsv || cond_need_sv(c)) { sv = do_add_sv(ctx, dest, in1, in2); if (is_tsv) { + if (!d) { + tcg_gen_ext32s_i64(sv, sv); + } /* ??? Need to include overflow from shift. */ gen_helper_tsv(tcg_env, sv); } @@ -1217,6 +1220,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, if (is_tsv || cond_need_sv(c)) { sv = do_sub_sv(ctx, dest, in1, in2); if (is_tsv) { + if (!d) { + tcg_gen_ext32s_i64(sv, sv); + } gen_helper_tsv(tcg_env, sv); } } From patchwork Sat Mar 23 17:29:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0ECAC54E67 for ; Sat, 23 Mar 2024 17:32:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5C7-0002l9-3a; Sat, 23 Mar 2024 13:30:11 -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 1ro5C4-0002kU-IR for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:08 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5C2-00065f-RX for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:08 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1e0b213efa3so628515ad.0 for ; Sat, 23 Mar 2024 10:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215005; x=1711819805; 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=RF8MIQWUQ8ggE/MlTolxsgSJT5vy8jgQgVDGU2A+dUw=; b=qO0SLNpjo2ernSZmuk9kzJeQwnm9pqZde5znaOZpLHKzGXeK8z6ffCKtRl8y8wUb5z JNSc6e3ivhcvrcSMOup+/2trKi03n7MZMUSsPkGgnqTQ0NTew8GoMxWRna0568HTVcJ/ 6HY1czKEuCjPqgqoZLSui6gCEtFyqX72qOCKYXuaQt/rbNf9UGjS/Br4vfjCF3hbK305 IT7GQYRASh50OtuD+sVZTUMmzYSuFG4DeL1BvhsBUAq15L2CRSJ6/RjmN/sgqHr7+n0s 9opb5dxZ/CuvYmGZOlZK4wEPjPGRsYwP4P+OqliG6z818eP07d6mlUSrUyqdBdOf1lCe ngNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215005; x=1711819805; 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=RF8MIQWUQ8ggE/MlTolxsgSJT5vy8jgQgVDGU2A+dUw=; b=ml4DMcic0Xr2NV8xCyWvTR9KXLEPQILXka1t1hG6sONC1GMjIOdVcXwLaniLbdAT/0 kbT1FC87il9o4/QJD6+5fElqi1Zcj7lJpdNalrRPGVhlQ0zaAAC/wAsFyfKvUXghyH0Q EsfmStSPQKd/QpGiFHsxyHJRLPfZXS0V9HlLLGk2ZoqCWBvlf6GSuubdr25hwCfT7z7c Gh+jB++Old8fj0hWOMEiC7yglJjFywwfM4KaVR5NqdnjmUVtU875xTSz6ll+srD4bg++ 6g2oQ+EzPU8A/GlrzDu7klvzfkGcTyZqE79GBkMm+iF3WxpkUsCie6pXR7I/iz8rcY/I UaRQ== X-Gm-Message-State: AOJu0YxijKo3qignh++dk20hlC42FkC+c9mBQfxqxf5WtQcBR7WB8R7M LCliYF9kNYnbt8HzXO+LkEkfMDZSYK9q/eG5dd+RJSOIc4zOarCxs5R0dKh+YBMIu3DmTIx8YTg l X-Google-Smtp-Source: AGHT+IGfjxIo8Hl1YsHZ+qQ22LcH6XsCHK8+eLrREr8y4AdToXKj/lANl45kTDBeJv6bIqpYVmNwAA== X-Received: by 2002:a17:903:442:b0:1e0:319a:2677 with SMTP id iw2-20020a170903044200b001e0319a2677mr2720704plb.8.1711215005543; Sat, 23 Mar 2024 10:30:05 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:30:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de Subject: [PATCH v2 5/7] target/hppa: Mark interval timer write as io Date: Sat, 23 Mar 2024 07:29:52 -1000 Message-Id: <20240323172954.1041480-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Helge Deller Tested-by: Helge Deller --- target/hppa/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ceb739c54a..8c1a564c5d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2162,6 +2162,9 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) switch (ctl) { case CR_IT: + if (translator_io_start(&ctx->base)) { + ctx->base.is_jmp = DISAS_IAQ_N_STALE; + } gen_helper_write_interval_timer(tcg_env, reg); break; case CR_EIRR: From patchwork Sat Mar 23 17:29:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23724C54E67 for ; Sat, 23 Mar 2024 17:31:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5CA-0002lQ-Rz; Sat, 23 Mar 2024 13:30:14 -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 1ro5C9-0002lH-80 for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:13 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5C4-000663-CQ for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:12 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1e07cd7b798so19707435ad.2 for ; Sat, 23 Mar 2024 10:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215007; x=1711819807; 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=tqxxoJyz/Tp0Fx2Av8AP+03UJeuM8REKvV5gu6VjKFY=; b=spRDOE1iUdXA0sup6cNevxjuWFZWjRIfO0lgMHtk4IiJ0sTEJ1kB2y/vlzgrYYp2TA MX0E7gErMWPVSexk8GR4uKpgzYyRwIWW9WM+ScLGydcDLtuZvyHUyUqRhEI4Yz/PofvJ bbIUL2dXdmgyszbTbCA9ieRV/RiZ3+WSGHyyWbIPhj9pvhMb9ooBALEpu/PkVaNqfAtw AzELcIftKQA1+KSGA4LRisCUfOvX5EDVdlBlOqyXRoiXUkQo5jVVXBnJwDuITYKN5K1G hygUaHSuAo2SjG9gLX3Sz1mkWvp+/D2rY7zbwmRQf6lmrk7vr3x9fT+TJPVPnEQSbDVX WuHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215007; x=1711819807; 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=tqxxoJyz/Tp0Fx2Av8AP+03UJeuM8REKvV5gu6VjKFY=; b=sL/7FtoAdT83DTXKi2z5Ip3QvznaAIDja04HVY+bLZJLcQMoliqegxPyh1Ev1ykVvu m17CGGGxKahAhuHQeFxiVG43Vs2Lrl59xLqf3OMbNwaR69hcekN3e6NuMNkJ5M5h1hod BsCB4X01NtE3mV33CJAgU0MyLIbTows092za1E1g2zq4tEVvXu4OwyepuHI9jMb6Gzlb 0gQzw/gZNz69Ke+XWWFAOlgBfFEjOEEE+KhTfQp7SrWgA2KVOWP7VoUo2DbK49nFC8AQ xl0z4ZhbpdhXmMKyoq+RQTlRkzoKBnUut1DcSZT3lyuq435+7WpAUjFVRTYP6GO1AS6m c5hw== X-Gm-Message-State: AOJu0YzVLExhS6GxQCd3L2GxrTfQ81wswvHzlQxqG6uLzm6Q266LsglK ovY8VZ3s4lf9Mnuxljbc1kpJXhAxdS4C7PcZAfZgEwYxFgfpHdz0vXNl+K3YKMV02u+6SbTdgBg e X-Google-Smtp-Source: AGHT+IHSU8qNa1qitJYT+rWhIigugrDSdIb3Sc+cb+aqELfg07mD41+axlyMAjA/zq5qlZXkbaQZiw== X-Received: by 2002:a17:903:40c2:b0:1e0:1174:6360 with SMTP id t2-20020a17090340c200b001e011746360mr3451396pld.14.1711215007005; Sat, 23 Mar 2024 10:30:07 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:30:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de Subject: [PATCH v2 6/7] target/hppa: Tidy read of interval timer Date: Sat, 23 Mar 2024 07:29:53 -1000 Message-Id: <20240323172954.1041480-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The call to gen_helper_read_interval_timer is identical on both sides of the IF. Signed-off-by: Richard Henderson Reviewed-by: Helge Deller Tested-by: Helge Deller --- target/hppa/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 8c1a564c5d..5b8c1b06c3 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2082,11 +2082,9 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) nullify_over(ctx); tmp = dest_gpr(ctx, rt); if (translator_io_start(&ctx->base)) { - gen_helper_read_interval_timer(tmp); ctx->base.is_jmp = DISAS_IAQ_N_STALE; - } else { - gen_helper_read_interval_timer(tmp); } + gen_helper_read_interval_timer(tmp); save_gpr(ctx, rt, tmp); return nullify_end(ctx); case 26: From patchwork Sat Mar 23 17:29:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 13600715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D815C54E58 for ; Sat, 23 Mar 2024 17:31:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro5CF-0002mN-Ef; Sat, 23 Mar 2024 13:30:19 -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 1ro5CD-0002m3-NM for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:17 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro5C6-00066L-1P for qemu-devel@nongnu.org; Sat, 23 Mar 2024 13:30:17 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5d8b70b39efso2237718a12.0 for ; Sat, 23 Mar 2024 10:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711215008; x=1711819808; 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=APeG/8zopMeZ+EKfHuhSVKWY0YScOPqHRLuO02LWlN4=; b=hSydgXbMKBcw1FiSlZAAtb2w2F8ssg3MHr4jmjrX99U8AMUoXx4lMdwDbStUWg2xU1 5Ya+rf2MRpWk/zxOylMWqEWIIjw3LRvQaYmA0gsP3H6QwZE9T/U9GMLPVpkHWMaiyjJV ijOrX4s0nFHIL495mP7nUBGHBHCZ+0g4ePQnmwkZQbuaAxU8wzFeGYNRL/AuSGsnZJ6L 4kgDUt4cxmbDUKyDO6F8xhT8Bs8HGbRUCkbdlgQYE0wP35iIV13GOFfVXuFQCH2hEsZw eYUEzjvH1d8XdRi27M4lOCvcDcJ/jjxyU0NJ6RLRUdI9A2+O0/1sSDJWBKRh8aH0+4Os CmXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215008; x=1711819808; 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=APeG/8zopMeZ+EKfHuhSVKWY0YScOPqHRLuO02LWlN4=; b=bkZ3UC0gshM/bq3sbwlSQDNSYFmw8Ql2n2pEmQi0AUOr6m+yYxo5AQNC3KaLwqY/eo dV3KQerm9wLpULM1KS/DHUutrTbRsM2euBjkriAMGuMF6i3eC2TghqdeY520KRHfwceg QwqFgRMMgElLS3B4uGCVhT6uM5NOTeDZH4KpkKR7s5UdatJHdzNQEuPvYmFgo38ZlAwN f8CfIVFGBlh0XBjxlYcRi3nDU+pPCLQmKfDUq2LW5BWxmqemaGcddEoW8l4DRIhJ6kZo in3+LkHM+hRID++XBqD4O7IgCaJ4seYr4S2GzQ1zPGBxh2f3umAxH8hxFNQ4Oake14bl Uv4g== X-Gm-Message-State: AOJu0Yxl68fZR8DgeW5vRE7H0bChEZUQnWTaXUczDl1s1BuTnXb36tkj WtCMI0GiVkJXzaa5+/9io8zshDmcEsFTo3uKw5HWV9W6VhmS58iRmkOuRasangv77wFvi4TF4UG z X-Google-Smtp-Source: AGHT+IFVWefvO/kOLQLT8VoMELhOKeQUHilMQDhivOpUx8S792WCq8ngmfEVw25mwvumTF1POCdDCw== X-Received: by 2002:a17:902:e54d:b0:1d9:4ede:66b5 with SMTP id n13-20020a170902e54d00b001d94ede66b5mr3428591plf.15.1711215008371; Sat, 23 Mar 2024 10:30:08 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b001dcfaab3457sm1811758plc.104.2024.03.23.10.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:30:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@stackframe.org, deller@gmx.de Subject: [PATCH v2 7/7] target/hppa: Fix EIRR, EIEM versus icount Date: Sat, 23 Mar 2024 07:29:54 -1000 Message-Id: <20240323172954.1041480-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240323172954.1041480-1-richard.henderson@linaro.org> References: <20240323172954.1041480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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, T_SPF_TEMPERROR=0.01 autolearn=ham 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Call translator_io_start before write to EIRR. Move evaluation of EIRR vs EIEM to hppa_cpu_exec_interrupt. Exit TB after write to EIEM, but otherwise use a straight store. Signed-off-by: Richard Henderson Reviewed-by: Helge Deller Tested-by: Helge Deller --- target/hppa/helper.h | 1 - target/hppa/int_helper.c | 14 ++++---------- target/hppa/translate.c | 10 +++++++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 1bdbcd8f98..8fd7ba65d8 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -91,7 +91,6 @@ DEF_HELPER_1(rfi, void, env) DEF_HELPER_1(rfi_r, void, env) DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tl) -DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tl, env, tl) DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index efe638b36e..90437a92cd 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -28,7 +28,7 @@ static void eval_interrupt(HPPACPU *cpu) { CPUState *cs = CPU(cpu); - if (cpu->env.cr[CR_EIRR] & cpu->env.cr[CR_EIEM]) { + if (cpu->env.cr[CR_EIRR]) { cpu_interrupt(cs, CPU_INTERRUPT_HARD); } else { cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); @@ -89,14 +89,6 @@ void HELPER(write_eirr)(CPUHPPAState *env, target_ulong val) bql_unlock(); } -void HELPER(write_eiem)(CPUHPPAState *env, target_ulong val) -{ - env->cr[CR_EIEM] = val; - bql_lock(); - eval_interrupt(env_archcpu(env)); - bql_unlock(); -} - void hppa_cpu_do_interrupt(CPUState *cs) { HPPACPU *cpu = HPPA_CPU(cs); @@ -280,7 +272,9 @@ bool hppa_cpu_exec_interrupt(CPUState *cs, int interrupt_request) } /* If interrupts are requested and enabled, raise them. */ - if ((env->psw & PSW_I) && (interrupt_request & CPU_INTERRUPT_HARD)) { + if ((interrupt_request & CPU_INTERRUPT_HARD) + && (env->psw & PSW_I) + && (env->cr[CR_EIRR] & env->cr[CR_EIEM])) { cs->exception_index = EXCP_EXT_INTERRUPT; hppa_cpu_do_interrupt(cs); return true; diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 5b8c1b06c3..46b2d6508d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2166,10 +2166,10 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) gen_helper_write_interval_timer(tcg_env, reg); break; case CR_EIRR: + /* Helper modifies interrupt lines and is therefore IO. */ + translator_io_start(&ctx->base); gen_helper_write_eirr(tcg_env, reg); - break; - case CR_EIEM: - gen_helper_write_eiem(tcg_env, reg); + /* Exit to re-evaluate interrupts in the main loop. */ ctx->base.is_jmp = DISAS_IAQ_N_STALE_EXIT; break; @@ -2195,6 +2195,10 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) #endif break; + case CR_EIEM: + /* Exit to re-evaluate interrupts in the main loop. */ + ctx->base.is_jmp = DISAS_IAQ_N_STALE_EXIT; + /* FALLTHRU */ default: tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); break;