From patchwork Thu Nov 30 15:33:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 748500 Delivered-To: patch@linaro.org Received: by 2002:adf:e9c2:0:b0:32d:baff:b0ca with SMTP id l2csp949471wrn; Thu, 30 Nov 2023 07:35:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2nBTBWUid9HbIrOjhhjNjasCqiPGzSFQvc1cdoTqr429sn5wmEcBgaln9Fq8exoZx7yTj X-Received: by 2002:a05:622a:354:b0:421:b909:de9e with SMTP id r20-20020a05622a035400b00421b909de9emr26848279qtw.2.1701358502044; Thu, 30 Nov 2023 07:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701358502; cv=none; d=google.com; s=arc-20160816; b=aXra4EDR0BUvkvu7OCR8eWLp2UFUbtg61+k1DC+P/1ryhyrD5AzwKsvfA1x1Lbiopy b8SwydS1Jp3+hu360Ctpbj00roaDzrUaAM+4JUNYsyFni8X0jUbJsTvVAA2tZEfyb9EO OK75vYrxYF6zBKi/L0PyFpLRQW2ghl+b/sxbk77zV22piR/8kRXL9oDeWswNpA6Gu753 vPniio92Rj5V2mIvtjcIA34IqaM4n+C68sBcr9ZGMngY+H/MShg1G0M+eLBpNoEr1HLD dYe5CNYta5TyCVtK/8GjnxUle25UvWWa4428K3rgnfFLpk8LRRqHuWDpXAgPtNEJeuIR kRJw== 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=hJMauOfyWGFYkIZAfq/bsS5e9jl1HNaFLiAxTQwxJLQ=; fh=QEL8HPqYwGRdUt3uNuApdxuVe453Kai+Ga5G4X9eCVA=; b=qPYAbymy2mPGeMHhnaCgcH1FPQVFrPgcxej3a6ZHIJw32Si325lV1i/0VKDilYTw/5 qWMrwOq1sZbBCX+nPV7ngBKIn346AL42clKIs/hTL0LLbJof9rYfk4okYcpnIoo25/DK rHIrKdNgHNpqEU+knFhA5DBHYXi3gWySmidAV0PvCcR2nqQ0eRFcUB/DZBXsoAo1t73u QB8iJpoprBslNYVsvieiHwG0C1SZZmhKR4zxyOqMm9J3QEncQsXqTenDLLm4y0svsrjP ZX4pKnYkhBlsZATfSf8JRHdRBt/gwkyJAZnCWAMroe083HQPtKAvlvFdVmpJhEksWuNG BA6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hrwRl8j+; 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 r20-20020ac87ef4000000b00423733fbed8si1173318qtc.520.2023.11.30.07.35.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Nov 2023 07:35:02 -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=hrwRl8j+; 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 1r8j3O-0007g8-Dr; Thu, 30 Nov 2023 10:34:16 -0500 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 1r8j2w-0007XM-Kt for qemu-devel@nongnu.org; Thu, 30 Nov 2023 10:33:49 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8j2n-0004zk-Rp for qemu-devel@nongnu.org; Thu, 30 Nov 2023 10:33:46 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40b31232bf0so9003455e9.1 for ; Thu, 30 Nov 2023 07:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701358414; x=1701963214; 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=hJMauOfyWGFYkIZAfq/bsS5e9jl1HNaFLiAxTQwxJLQ=; b=hrwRl8j+DADBqe0XuG2jTjWLpAl6dAjPZ9pSaSPQXzlv1U7pcrMz9OOm/qRd7TsnYb Cm2OG5Uk0FDLyhzd7kueQvgJX31IzzejpDUX7BtscetRflMeEjxXl/MxUZZPNJvO4Yyi qm8RhOdcWk2dRX7SV+63NUKrquF/GFyFWgjlfS55d5Rs4cAN8MskB42Jr2FGPK16sDYD g9uWn274tEp5chQHZUHmna5KwICFnGYtS1967moSPuXkwW7k0hXn7oEy1CB4+z5G6KDi mR9bG3Bs1m4gU/xSXdXB4AJxM5ur3u5izT5DJG5s7A1nVCEEgTI5Q6opJAG+2IJ/X1uF mW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701358414; x=1701963214; 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=hJMauOfyWGFYkIZAfq/bsS5e9jl1HNaFLiAxTQwxJLQ=; b=kwC1Yz3P7QDsP4YNpnvWg5UuWaCBz1B5WlXa57GzlHbjs5DgOUtM3JKF73QbYkRocq 8dPwLdIqut2g11oc0iNuRX8aYT8wbdPi6p4OVVAeL1uzyHrB+YmE2uKWPBQpEv6iWzjH icbmI/uSf9Im+pTJfn3go4o+iyr8iIthPm5HPbzNostKypzVzzE2C+0pfnbgy/OUpL3H ooRbJJfnVLVPpm522kqyzijtpDEMg7NbM9ejuhWosY3SpnO2GmWRkSTnHEB+y7EiVqsn G6YKiB5sy6kzced6ext5VnMOwa5kXlbLo3liWJZ5c6lqd+Me5GHHvp4cafoDXqau0RIX FuOQ== X-Gm-Message-State: AOJu0YwIFAqUOXWmRRbRM9uANqrDxgh7W+3EDSB9UDigGaYWJoImFuEy HQPczmR/WbRCa+UKs1Bmo2YHmQ== X-Received: by 2002:a05:600c:314f:b0:40b:2a18:f1be with SMTP id h15-20020a05600c314f00b0040b2a18f1bemr15981841wmo.1.1701358414168; Thu, 30 Nov 2023 07:33:34 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q15-20020adff50f000000b00332eaede976sm1822881wro.86.2023.11.30.07.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:33:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 869325FB4F; Thu, 30 Nov 2023 15:33:33 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Eric Farman , Cleber Rosa , Andrew Jeffery , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Yoshinori Sato , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Eric Auger , qemu-arm@nongnu.org, Peter Maydell , Halil Pasic , Pavel Dovgalyuk , Aurelien Jarno , qemu-s390x@nongnu.org, Beraldo Leal , Joel Stanley , Paolo Bonzini , Christian Borntraeger , Thomas Huth , Luis Machado Subject: [PATCH 1/3] gdbstub: use a better signal when we halt for IO reasons Date: Thu, 30 Nov 2023 15:33:31 +0000 Message-Id: <20231130153333.2424775-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130153333.2424775-1-alex.bennee@linaro.org> References: <20231130153333.2424775-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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 The gdb description GDB_SIGNAL_IO is "I/O possible" and by default gdb will try and restart the guest, getting us nowhere. Report GDB_SIGNAL_STOP instead which should at least halt the session at the failure point. Signed-off-by: Alex Bennée Cc: Luis Machado Message-Id: <20231123131905.2640498-1-alex.bennee@linaro.org> --- gdbstub/internals.h | 1 + gdbstub/system.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 465c24b36e..5c0c725e54 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -24,6 +24,7 @@ enum { GDB_SIGNAL_TRAP = 5, GDB_SIGNAL_ABRT = 6, GDB_SIGNAL_ALRM = 14, + GDB_SIGNAL_STOP = 17, GDB_SIGNAL_IO = 23, GDB_SIGNAL_XCPU = 24, GDB_SIGNAL_UNKNOWN = 143 diff --git a/gdbstub/system.c b/gdbstub/system.c index 783ac140b9..83fd452800 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -183,7 +183,7 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state) break; case RUN_STATE_IO_ERROR: trace_gdbstub_hit_io_error(); - ret = GDB_SIGNAL_IO; + ret = GDB_SIGNAL_STOP; break; case RUN_STATE_WATCHDOG: trace_gdbstub_hit_watchdog();