From nobody Wed Apr 16 15:37:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1595009897; cv=none; d=zohomail.com; s=zohoarc; b=RsOyEJ9+FImMkIpRPmhsCdd2ajeT8xyX0NLM11xWva9aFl4JE9qkiFe1q4zXmPcNz1W6OFFfmq654D00IXM58xHtinjJRtKqJdvAcRAfdtZwZuD/WLNUzyPN+3iztL/NZ4XE/VISSQt1Hc9VvotpxYba6ajrkBe/z2v09P+GtK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595009897; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1xo/F7/aAE6h7nPyZHFzXrWII41wbW4AOQQ3nfWZDVk=; b=Cnb+4rm/23AVF4C5i2K3+wiOZbH77ERUDwlzYt/6dBszfw2Z75q6mbtqQuMU5s/QfQao0ybWwTwnOXwRC2/rWCIOviI1Fgln7OGUBhtvmBAWE2EUAfpr1LdtV42xXe0hPjUDvVT8mhK01oqJrYQo+SKKdA4JbVWNJPv8U0qcRrI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1595009897369334.231094911784; Fri, 17 Jul 2020 11:18:17 -0700 (PDT) Received: from localhost ([::1]:38174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwUw4-0001JM-2D for importer@patchew.org; Fri, 17 Jul 2020 14:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwUuO-0008T4-Ap for qemu-devel@nongnu.org; Fri, 17 Jul 2020 14:16:32 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:52907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jwUuL-0003Gj-2s for qemu-devel@nongnu.org; Fri, 17 Jul 2020 14:16:30 -0400 Received: by mail-pj1-x102b.google.com with SMTP id gc9so6924495pjb.2 for ; Fri, 17 Jul 2020 11:16:27 -0700 (PDT) Received: from localhost.localdomain (216-160-65-90.tukw.qwest.net. [216.160.65.90]) by smtp.gmail.com with ESMTPSA id r7sm8698578pgu.51.2020.07.17.11.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 11:16:25 -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=1xo/F7/aAE6h7nPyZHFzXrWII41wbW4AOQQ3nfWZDVk=; b=QiNeEiMGpGrZ6xkpRErjKyWf1u+hT0g/Ix+B3362CKVmQqfSAzX4t+JoSwiK7rt1GI PnQ/pVwJrurcQkw7qE6YUYJxkPGuYq6jUSOTO7BHN97KKsXLG6wtcvNtLIcOoEpUlpkD om1dg+givkjG5/F1y/pt/J5o+J0VF/7hi3JnGjAx335eNbKMo1BFWmXo7b+sDEy3TfBB 03o05AQQsvklldqX5+hYmzYFkiJ2OlfP/3CiGnx6SWivmH3lYErloUydfvVUXGVoXUED oTliO4CGviN7kb0c0f92ZrxS0UzLzVph29PWK71gsYo+H1XLk3rxKOEYiUboQ3CUnbZw vT7Q== 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=1xo/F7/aAE6h7nPyZHFzXrWII41wbW4AOQQ3nfWZDVk=; b=Wot4jBr8gf0t4Sg+4a7Xa8Qxil0/Yc1Gv7XHSSsxa5zlplL24bQMViT+9+6Yn4XBkg 8pnrAGWHp+Jnz52EMY3RgWTcvS9/DYt405s0Tf8OLLcNlLO8o2or5TjJJObR4af+gDLm 3eOZn36/Fsgxi0FMu0rjYPzMRlpKnGjO+TTc5kWA/FiT0VOd0BXw44ncbhXjyZnO/BpF rDrAfs4M1LwsjCsF6LMosremSgqUio9HKr4f8lGfKjCXqaW3zfVYHZdunUuqCPVgJtAd eCNWYvyD/Iny2vUVj5TSujJKPFGv5x7e49dKcFFBoJRmoRyMTAjUj3a4Kv/PGBEaxoQQ JYgw== X-Gm-Message-State: AOAM5327674h/nyZ8YUQ9IptIj3wziiOguWu8aBwmE+dU2UOtKb/i1dS 2ZtvgBCENi5J6DcX7Px8tjq9XJIGg/k= X-Google-Smtp-Source: ABdhPJzKu46eNv/fCzl+i1f6Wk3rhb0eFtTxgE2UWZp/MezB8M9HypcjdczVNGDn24j5Sc2hHo9tnQ== X-Received: by 2002:a17:902:d392:: with SMTP id e18mr8347442pld.139.1595009786311; Fri, 17 Jul 2020 11:16:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.1 1/3] tcg: Save/restore vecop_list around minmax fallback Date: Fri, 17 Jul 2020 11:16:21 -0700 Message-Id: <20200717181623.2742758-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200717181623.2742758-1-richard.henderson@linaro.org> References: <20200717181623.2742758-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Forgetting this asserts when tcg_gen_cmp_vec is called from within tcg_gen_cmpsel_vec. Fixes: 72b4c792c7a Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index f784517d84..ed6fb55fe1 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -657,7 +657,9 @@ static void do_minmax(unsigned vece, TCGv_vec r, TCGv_v= ec a, TCGv_vec b, TCGOpcode opc, TCGCond cond) { if (!do_op3(vece, r, a, b, opc)) { + const TCGOpcode *hold_list =3D tcg_swap_vecop_list(NULL); tcg_gen_cmpsel_vec(cond, vece, r, a, b, a, b); + tcg_swap_vecop_list(hold_list); } } =20 --=20 2.25.1 From nobody Wed Apr 16 15:37:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1595009899; cv=none; d=zohomail.com; s=zohoarc; b=HK1jfrukVW6bGa6Enc0jVKqmQM/whma8Oiv70UVmBmLSN3Hfzt6ACPOjX+pkX4ft3tuugorkZUc0XBsQLMv++U07rexdtikvjaRKgW2+AKVf9oOo7CKzqiVDQ9p2/AhNLCN554uUU69dQW9lUWmF9ujMpsYBit3oAWR2RXkPLPY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595009899; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WF3WUUJ3102Nb47JAT2FiwU+zNqijVjebyKLsz6cFP8=; b=e+ziDVJc4zJ5I/j3q92xffBz6CUXlimv/KN2C3SIefBJ/h7fvUcIyin2shX7UChedNp22+mH9npb7NdJO7C6VFHSNjp2KCGbqaq8V3OvyU2E4VrpSoKQhTlA1iw8IcD3EX5hsqh9wyCBBz4GTAhAM8wGAJcmyZUJ5wbnb81r17Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1595009899218813.1620156840479; Fri, 17 Jul 2020 11:18:19 -0700 (PDT) Received: from localhost ([::1]:38300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwUw5-0001MN-OW for importer@patchew.org; Fri, 17 Jul 2020 14:18:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwUuO-0008TG-M0 for qemu-devel@nongnu.org; Fri, 17 Jul 2020 14:16:32 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:45045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jwUuL-0003H6-H2 for qemu-devel@nongnu.org; Fri, 17 Jul 2020 14:16:32 -0400 Received: by mail-pl1-x644.google.com with SMTP id w17so5779460ply.11 for ; Fri, 17 Jul 2020 11:16:28 -0700 (PDT) Received: from localhost.localdomain (216-160-65-90.tukw.qwest.net. [216.160.65.90]) by smtp.gmail.com with ESMTPSA id r7sm8698578pgu.51.2020.07.17.11.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 11:16:26 -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=WF3WUUJ3102Nb47JAT2FiwU+zNqijVjebyKLsz6cFP8=; b=ch9byqhMvr04Ympul6i2g749xIj1liOt1rbWppVh8yvfjRdjRMB5cbEDD5wMsoEZvf 0tQ+48CPQPQArSyfGeO0DevA4WesHKcdpZTP93Iul5n/ruEQxUyDTQNN5I1jTVh6feAY 5eQBUVPETM2a+0XsKL1KGAr2jhxAk7nTpWnn1+jUytwC0vgFdccvRRp8AIe52RFBdjgW e2UrJ3674khcXfjiQixF0fXxx4CjOP1BqlOFVwjDcwL3FHXitBRi7gyZlGEgBH+uglEu I0CdygBaVNkWbCnH9ASZZP9vce+34xzRDxXEkq8uR9sI+1r0he3Gdf9mjHo6A0Dmh45S z9oA== 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=WF3WUUJ3102Nb47JAT2FiwU+zNqijVjebyKLsz6cFP8=; b=bzNVHd1AXit4w07J4YM+qgB29MkVGPhvnjDFiH6XzXstpM/Ir0Fjab8kDnNENacsNB ZS0vwk+QRtuFEHugSNPaYb78RGiqmtsI0LM957dRs5Rb17LEy1YVqtWmxw3nVGzK4RmK +fKmkVgMRztTfM737CyLw4fzxWiVzRjYPNkCYuab7kauwakmVFzHL4rZryiD+eGIcXlc EkkN8eKvDGp89BqnJXqeD8Np32TPW1uePxs9Qpc3kCupkC66ZWAqEH1MLXztLlj+TfL1 hzsPVLa5k0H6bX//jszLcmO15vnBx9t3ROufT2Rcls58MlB7GTB5mWl6lxf6dcrkgpFP oRVA== X-Gm-Message-State: AOAM533PU9Fd0UZDzWRvpSX/d25AMO++T+qWprP8TQi4L16fbHYp0OM7 Mywv9ucja/xHAK8foaO4VuPfmR4QJR0= X-Google-Smtp-Source: ABdhPJw3T1bPoY0ytHRdhX5g2QSBZHEQlA9eF6X2tM5OrxGOzE2S8ks8YlkI+ZWGi2iRHaLNgA834Q== X-Received: by 2002:a17:90a:5d15:: with SMTP id s21mr11678190pji.154.1595009787587; Fri, 17 Jul 2020 11:16:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.1 2/3] tcg/cpu-exec: precise single-stepping after an exception Date: Fri, 17 Jul 2020 11:16:22 -0700 Message-Id: <20200717181623.2742758-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200717181623.2742758-1-richard.henderson@linaro.org> References: <20200717181623.2742758-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: peter.maydell@linaro.org, Luc Michel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Luc Michel When single-stepping with a debugger attached to QEMU, and when an exception is raised, the debugger misses the first instruction after the exception: $ qemu-system-aarch64 -M virt -display none -cpu cortex-a53 -s -S $ aarch64-linux-gnu-gdb GNU gdb (GDB) 9.2 [...] (gdb) tar rem :1234 Remote debugging using :1234 warning: No executable has been specified and target does not support determining executable automatically. Try using the "file" command. 0x0000000000000000 in ?? () (gdb) # writing nop insns to 0x200 and 0x204 (gdb) set *0x200 =3D 0xd503201f (gdb) set *0x204 =3D 0xd503201f (gdb) # 0x0 address contains 0 which is an invalid opcode. (gdb) # The CPU should raise an exception and jump to 0x200 (gdb) si 0x0000000000000204 in ?? () With this commit, the same run steps correctly on the first instruction of the exception vector: (gdb) si 0x0000000000000200 in ?? () Buglink: https://bugs.launchpad.net/qemu/+bug/757702 Signed-off-by: Luc Michel Message-Id: <20200716193947.3058389-1-luc.michel@greensocs.com> Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index d95c4848a4..6a3d3a3cfc 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -504,6 +504,17 @@ static inline bool cpu_handle_exception(CPUState *cpu,= int *ret) cc->do_interrupt(cpu); qemu_mutex_unlock_iothread(); cpu->exception_index =3D -1; + + if (unlikely(cpu->singlestep_enabled)) { + /* + * After processing the exception, ensure an EXCP_DEBUG is + * raised when single-stepping so that GDB doesn't miss the + * next instruction. + */ + *ret =3D EXCP_DEBUG; + cpu_handle_debug_exception(cpu); + return true; + } } else if (!replay_has_interrupt()) { /* give a chance to iothread in replay mode */ *ret =3D EXCP_INTERRUPT; --=20 2.25.1 From nobody Wed Apr 16 15:37:39 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1595009975; cv=none; d=zohomail.com; s=zohoarc; b=jkv+o9eTMDfsRlpL8uP+4ccDhVIxCFmFMOsopLn5cPDn7BPaBLkVL/AJugIxhYUXNvTDVbyNxRJ0gnagiqChrDHSAJA8aYae/6PBCOM5EI6Er5YKrJPyxnAah5VoMURbQdokOvDbMC5FWMySHvjAI2wIXhBqCOviNxlrH4iTu8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595009975; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=soz5/dc63AWvfYnTeEOXYkPjarLppwOrJCQsvAF2Sbw=; b=b5qFXe8AvbiAHjb3cb40TMtF6kdIxiW/PLZ4ODNRTSNrkUP3Mnre6hx/s1r8SGoeGVQ0JI2b+ugBKzA1HV41Hva/UI9A0WlIQrKbXlqbhnEp1CJA2FDfSXNBVVovmmU8kQX1y6ug33TvFAYx+nFz17B72LDw6zkQBcI9UBuuEBY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1595009975942657.7491718826432; Fri, 17 Jul 2020 11:19:35 -0700 (PDT) Received: from localhost ([::1]:43588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwUxK-0003ZE-Q8 for importer@patchew.org; Fri, 17 Jul 2020 14:19:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwUuP-0008U6-1i for qemu-devel@nongnu.org; Fri, 17 Jul 2020 14:16:33 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:38896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jwUuM-0003HK-Un for qemu-devel@nongnu.org; Fri, 17 Jul 2020 14:16:32 -0400 Received: by mail-pl1-x633.google.com with SMTP id m16so5792005pls.5 for ; Fri, 17 Jul 2020 11:16:29 -0700 (PDT) Received: from localhost.localdomain (216-160-65-90.tukw.qwest.net. [216.160.65.90]) by smtp.gmail.com with ESMTPSA id r7sm8698578pgu.51.2020.07.17.11.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 11:16:27 -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=soz5/dc63AWvfYnTeEOXYkPjarLppwOrJCQsvAF2Sbw=; b=gtEOIcjcSir6uFvFnTXVDiyfze6bhdwMBkKx2ZxGa1H7E9PSk6uAFCNXuVNEVUm1lU a91XLoqcSnUN6/wK8SPhT1VpCiguqm8uRiEqNXpwRC1XOB2xAwy76DXUnFFBLkcGaZtK 89jzGTEsufPI4cwSp7DqtDFrAnQ3oef738QHIEaV5exRLdti1Hbp3c96WpsxJpFQdWj4 k6LvLDlDxOH2WlhWGEsQ9O+ex11Uk/xzEhXk4Hgnu8uThqvN3Ppgd3Ech4x/ax8B/pRd ER/9n9ub4asA14dCSAdIMEG+JsRlxeITYDzOyX7XdrmxM6kXR/LN2SMRIbO/0dWdd2mb fjig== 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=soz5/dc63AWvfYnTeEOXYkPjarLppwOrJCQsvAF2Sbw=; b=dBw3Tjkn7ckfkEyTs/F5fPyFuLW8obPo225nmx2VH/Mdb66LDxJTGuQxEVgXGsStNQ Xjox4tPm69C1HgcxcYKkStWcsa5a7csSdnTSMNw8wN382V23dJ2L29gQahhUTzHuyB9r RKBZALdd53n4wPSTL7Zmr1p0jzosiJ4SYOnJYiu7sdGw5PjzdPivSfH4a31/gzspmod7 wPeExavkPI1rSYBlvWvslhl7f68oh5SPadQIOwk0CWbVFeA5EPnBYPwvqbmzVDHqq+/O Z5ddqY9xrptt5KuY0xl01cGym5o3hSJN1ZWDO3efHq3EST+kbhH7EfZYsAqxRJLm15Dq Pxfg== X-Gm-Message-State: AOAM533N7Ab6B/at1TgqPFFKigpRt5NARvABw+bVQVxyR1xZd3/4qUMi uBjzl/t/K/zLSIC/M5xxOIfH6kUYAks= X-Google-Smtp-Source: ABdhPJznO3+/rrrct3Yz4qitOk06c5qtaRzAHaWoHY7SiBfsLzGUdWlNzxZN2kCNKswXoK+peMSdAw== X-Received: by 2002:a17:902:be06:: with SMTP id r6mr8129071pls.143.1595009788686; Fri, 17 Jul 2020 11:16:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.1 3/3] tcg/cpu-exec: precise single-stepping after an interrupt Date: Fri, 17 Jul 2020 11:16:23 -0700 Message-Id: <20200717181623.2742758-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200717181623.2742758-1-richard.henderson@linaro.org> References: <20200717181623.2742758-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: peter.maydell@linaro.org, Luc Michel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" When single-stepping with a debugger attached to QEMU, and when an interrupt is raised, the debugger misses the first instruction after the interrupt. Tested-by: Luc Michel Reviewed-by: Luc Michel Buglink: https://bugs.launchpad.net/qemu/+bug/757702 Message-Id: <20200717163029.2737546-1-richard.henderson@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 6a3d3a3cfc..66d38f9d85 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -588,7 +588,13 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, else { if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { replay_interrupt(); - cpu->exception_index =3D -1; + /* + * After processing the interrupt, ensure an EXCP_DEBUG is + * raised when single-stepping so that GDB doesn't miss the + * next instruction. + */ + cpu->exception_index =3D + (cpu->singlestep_enabled ? EXCP_DEBUG : -1); *last_tb =3D NULL; } /* The target hook may have updated the 'cpu->interrupt_reques= t'; --=20 2.25.1