From patchwork Tue Feb 8 11:39:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 540767 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp451714imo; Tue, 8 Feb 2022 04:33:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiHl5oXm3Jh/P80cb8tYih0c/m89tIr6j6gE6tixBixS1CSxYj2VqQ32xAHPxXt1pqYENL X-Received: by 2002:a25:b09f:: with SMTP id f31mr4191122ybj.406.1644323636577; Tue, 08 Feb 2022 04:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644323636; cv=none; d=google.com; s=arc-20160816; b=M8mRObomQnrAyAqFA/PnApUMLqREyzDiQhbeG8bx6rX42A67JdntsMYsjxplavQMTg iOPOMOVgmIx1cX7Wl4uKUFRjiR0qqCuhLSJpSD1o0v/KK+I7rKp/pgEH6SXzm7x4FZV2 KPh4vcEfY6klX1UhNmhZ9m0qcanp+ueidENVBbj6YF17Ol3O+2h6yyHPYt2FibXy1rDW hJNWLO3uEz9tJdU0QxvrzEgCOgKMGcpdXP1Xsdyo7ABPyu5Cr/BhIJuMKr0CFlj6t6zE GOugRV8xxXwKtgAK9y1x1w/CK+/4jHvMv+cSpsz3ChyHdKCnX/KyUoIy4SnBKhY7kN2P bG0w== 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:to:from :dkim-signature; bh=BBV95CWsxDrWvVC9C6IsOCCdTEjqLMSargWjpZxMzYw=; b=TZ1FjED/F7OesyA6Nh0ScPmN7iWA27PEJwiCMCZupsVb+CS4v6+fY8uL0Ac69iaq5m I3pe3wAslGIaHDw5HzVWxjvKsxXOkIQHNtscm4ZlMP4tnjvIVOo7do+ctzbwn0obHvMa 6gYZOcNBjXT0wOOmbhYMdiSb8bulxRJq8PVEu6UNrtmLBke1ua7msoD3vPOsVAph+qJG +5XAdtYV6XT92uy5LwEggaQPv/kO1mX2AjE/3ffafHarW++/kLuGZ/dNNYtmbwSMjOEp ozgv3aBOtS0wbGtPA34ASkidwxfxUDuAj4C89druEx6JxBqZN/YDMY+6wccowmxqriTf 2O3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="X7/9h0bR"; 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 w1si11511926ybu.271.2022.02.08.04.33.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Feb 2022 04:33:56 -0800 (PST) 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="X7/9h0bR"; 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]:34468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHPgy-0001zi-3K for patch@linaro.org; Tue, 08 Feb 2022 07:33:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHOqw-0000p7-Nj for qemu-devel@nongnu.org; Tue, 08 Feb 2022 06:40:10 -0500 Received: from [2a00:1450:4864:20::42e] (port=37437 helo=mail-wr1-x42e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHOqt-00029Q-80 for qemu-devel@nongnu.org; Tue, 08 Feb 2022 06:40:08 -0500 Received: by mail-wr1-x42e.google.com with SMTP id w11so30204489wra.4 for ; Tue, 08 Feb 2022 03:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BBV95CWsxDrWvVC9C6IsOCCdTEjqLMSargWjpZxMzYw=; b=X7/9h0bRBaQ+1muTp/W2It/S2Uspmx0PWoodWrnPntpDFCH/e/5iRhFjbTOwPxlcoj pq7WnadD1mbQuq1SLnDhBNhUcZoYm3bwAi1aouSDyurrUimuv+tSBBBm5KjZGW4d2Z21 LHZjFvETbVvNCZ3dwghjv02H2A3HiAXXHQiqocg+piiIiWtzvixW8dorGT+6/tLr0T/L QwVrsig5JL9DBNoHpytzUBkwwnM/PDA7j6W2nhQk+s4WPigXXzhIgkzh0eoFN2oEB03m pxBpMO6tq5Id3klbO4wBy+imN47TbmRfUB/9+AyOKL6lYSzGlYl70nCGBosbtsKDxAta xGLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BBV95CWsxDrWvVC9C6IsOCCdTEjqLMSargWjpZxMzYw=; b=TIdH362/RrQhwI7E4NWFUJ6xx8EH9TFVCLOcSR1vrjdM19949RRI5Nx+bvVtUAFTmz AC4OM05CJt3cETIXGaD7fK9q9KAyUSs25ELZQV/nv0LgYatC/Lz5yBAyKDwQZGSc8Mdd sWm33macBT70JlK48UcbjkBvMqVmH9S+wvfkJpF+H4bYTU5rolnY/Tn8yoAD8VQ4uktD rMoGL8P3K0qdVq1143HzMpTnrj2gMVcWhbZT4Yt0gBj0HOxw9mMAgqoxYJDa2m2Mdcpg MmsJBtikmrNMkno88Al8F55FYFWhHabM828E9FSGlZ7iI0rHMk6AaCWHcxgRKpnv/PN8 iVmg== X-Gm-Message-State: AOAM532ol0kmKF6or0TCcP10F10xVJvE+fzeaT4eBHrstU7B+xwAN8zl 1UbqozqpVaaShpkfkv21hMSfwqBYhoe/lg== X-Received: by 2002:a05:6000:170c:: with SMTP id n12mr3304385wrc.380.1644320405087; Tue, 08 Feb 2022 03:40:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r11sm4245199wrt.28.2022.02.08.03.40.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:40:04 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/39] arm: force flag recalculation when messing with DAIF Date: Tue, 8 Feb 2022 11:39:32 +0000 Message-Id: <20220208113948.3217356-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208113948.3217356-1-peter.maydell@linaro.org> References: <20220208113948.3217356-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42e (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" From: Alex Bennée The recently introduced debug tests in kvm-unit-tests exposed an error in our handling of singlestep cause by stale hflags. This is caught by --enable-debug-tcg when running the tests. Signed-off-by: Alex Bennée Reported-by: Andrew Jones Tested-by: Andrew Jones Reviewed-by: Richard Henderson Message-id: 20220202122353.457084-1-alex.bennee@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper-a64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index d6a6fd73d96..7cf953b1e64 100644 --- a/target/arm/helper-a64.c +++ b/target/arm/helper-a64.c @@ -83,12 +83,14 @@ void HELPER(msr_i_daifset)(CPUARMState *env, uint32_t imm) { daif_check(env, 0x1e, imm, GETPC()); env->daif |= (imm << 6) & PSTATE_DAIF; + arm_rebuild_hflags(env); } void HELPER(msr_i_daifclear)(CPUARMState *env, uint32_t imm) { daif_check(env, 0x1f, imm, GETPC()); env->daif &= ~((imm << 6) & PSTATE_DAIF); + arm_rebuild_hflags(env); } /* Convert a softfloat float_relation_ (as returned by