From patchwork Thu May 26 19:00:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 576243 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp847122mab; Thu, 26 May 2022 12:02:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk+3qVQ5em5NyhE+v5elQe7Froit+gZqi+wKxIMsN7bPx8EDcu556bu9mFjr2lDLoEGQys X-Received: by 2002:a05:620a:40c8:b0:6a3:5599:3b74 with SMTP id g8-20020a05620a40c800b006a355993b74mr20618938qko.769.1653591749796; Thu, 26 May 2022 12:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653591749; cv=none; d=google.com; s=arc-20160816; b=UFRQqfQ+8hCzKOly9WMtjprEgZ/F/Yh5/8W4Etv31L3G8mdy0lk3zDy6vpU3GaEaus kBdjzW5F1wTfC964upt1eSGksdYOC8lv0xjdZNtX/pD5Y210qz3yUUdMVgVP56oYf+Xy DLxKT2V0vd5dr3j0Ps6G5ruvZlriMHwGCqCgek3Q7ZXf2+okPmyXK6e+x3fLUSygjUun Wi6QAWofY/32yvEBXGRDGUB8XxX37F2232RM0D9WwXB6IhTsC7ZEQPYdTt1n71vifh8n JwmSmhJIHqjYWC17l2kj5y1/dDMg8BjY3wvxeSNbGTgRWyc+rLKEh6kk+4xUTZzwTp9I nujQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=Za1W8Z73LYJQMLq+DoV9xFchiuaB+gEh8w/v5DMmpF0=; b=GE4Cpez4zvOnysIKuuzSE2Uj2rwPkjGOOoEBTYxaMuvto7ExBMC17Qxwzg50rpp/Am 7elPBk1fzENgrlcsa2Zjqxpo8ODdefkOjQGCr9iT7zplk7mTqFKoSaxd4z/vex/3sLkL 7sF+7ZOUpg6CfSlIQ9dlru1wsGErI/UZV0WFbDuRNx982e5j038EIrLgs+yeW5hTVO7t H7qzLUiZi2MprPChUpG1c3F5N2M/ESeqgQHXw54pMDX8LJ4wI+/qq5BWxgr5njaTi8dD 7qSx72gVkR3bXrm7Ls1EpGgXOOqcBKgEiTXIR4I/3pY3MtsMoiDdUHgeoXClYqs53jd0 fTTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BSmBDpK1; 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 t16-20020ac85890000000b002f3b8bf4968si1451441qta.32.2022.05.26.12.02.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 May 2022 12:02:29 -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=pass header.i=@linaro.org header.s=google header.b=BSmBDpK1; 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]:36576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuIkf-0002XX-DQ for patch@linaro.org; Thu, 26 May 2022 15:02:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuIjF-0002X9-6l for qemu-devel@nongnu.org; Thu, 26 May 2022 15:01:01 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:52078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuIjC-0008OI-HV for qemu-devel@nongnu.org; Thu, 26 May 2022 15:01:00 -0400 Received: by mail-wm1-x330.google.com with SMTP id z17so1490477wmf.1 for ; Thu, 26 May 2022 12:00:58 -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:mime-version :content-transfer-encoding; bh=Za1W8Z73LYJQMLq+DoV9xFchiuaB+gEh8w/v5DMmpF0=; b=BSmBDpK12emCGIESA/EOpAl6vty5vJhOCP/WP1fBTlQDnAwmWla5fOniROv65PFpCD Rn18mQLwt7PdvtG4xyvb5LXAk/Wa6V+cJrAhSjwEJjF3CcRS+KnpZMaVKxpjynlJwiJp QZGHYkhvkK0qK4UGWJwuPABh/jlbBKo1crYSyl1b41GZ3ndqw+v409gREckKZOtRg0EJ JLC37RadFc7G02Z2vwyT2jL5esocOHj0t/Ybu4N9t7yNIghe5BCDlUaEQezUtd5aRFMW SjXwysbFRUHVYpcbTYvgBOcSWY22TIvM5qfDso89i8bKx0VQ2tcI1a1OD/cqO/OBKX/0 Z0cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Za1W8Z73LYJQMLq+DoV9xFchiuaB+gEh8w/v5DMmpF0=; b=4KsfKEW0V8G4AB4N7oi8XeRgrGlBM96jlNnbYLxyEwHFZphRASwd2nM3egrX6h64tY 67MN2b+56gbzw9l6Y9fu8K01dI8qEST6EAOcxA2wUKrjf/iud0YPeGZft+ZSDih5T8er xNujozLSAGs0wfRX+BfUzOjRUkDsjVtytRed0DG/j8lz2ObZP3rbEtPwjJcCtIFhghN4 od4P0U7ju06QXWZIId1FeXrkmsxho0cs6Y9CgGuit7ozH3NYGXat3X5XLBRk/DhPd91P GaFnmLc3XKw6JaKn4AvB3uUYPmR3R/fM3X+8JJp5W5fBXo6Lh0edlKAqgwHAULIaJwra QeeA== X-Gm-Message-State: AOAM531DfS3ZjqyXwx+GcLasJIhsZJTQG7bOq7pj3UDs242+nKQGB2r+ GCYT5p9kpW/cD3L9nOxm8jNMIJnNUn12Zg== X-Received: by 2002:a7b:c346:0:b0:397:626d:d2c4 with SMTP id l6-20020a7bc346000000b00397626dd2c4mr3568656wmj.172.1653591655783; Thu, 26 May 2022 12:00:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id h10-20020a1ccc0a000000b0039763d41a48sm2507476wmb.25.2022.05.26.12.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 12:00:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Liviu Ionescu Subject: [PATCH 0/2] gdbstub: don't crash if no gdb attached and gdb syscall attempted Date: Thu, 26 May 2022 20:00:51 +0100 Message-Id: <20220526190053.521505-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This patchset fixes a couple of bugs reported by Liviu Ionescu related to semihosting syscall handling. Firstly, if the user sets up the gdbstub but doesn't connect a gdb (ie passes '-s' but not '-S'), and we try to use gdb for semihosting syscalls (either because the user explicitly set target=gdb or else via autodetection) then we currently segfault. This patch adjusts the behaviour so that "gdbstub initialized but no gdb attached to a vCPU" is treated the same way we already treat "gdbstub not initialized". Secondly, we weren't handling commandlines where --semihosting-config appears multiple times: these ought to be merged together but instead we were effectively ignoring all but the last one. thanks -- PMM Peter Maydell (2): gdbstub: Don't use GDB syscalls if no GDB is attached semihosting/config: Merge --semihosting-config option groups gdbstub.c | 14 +++++++++++--- semihosting/config.c | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) Acked-by: Alex Bennée