From patchwork Fri Feb 9 19:47:25 2024 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: 771339 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036736wre; Fri, 9 Feb 2024 11:49:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQo9Qkou7bbIcZi21F9QUIESZ+oRdm7Vos6S6uvJZlKoy5CMLASoUzp5mX62Q0MNXXWHbF X-Received: by 2002:ac8:5784:0:b0:42c:503d:1a0 with SMTP id v4-20020ac85784000000b0042c503d01a0mr306804qta.9.1707508160841; Fri, 09 Feb 2024 11:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508160; cv=none; d=google.com; s=arc-20160816; b=EL5Im/wm7/K0hpqw+1QDQXrWcPeF5a8KDsUQsySPxxXX8cXyqZ8Pzw+9AeOgSyApIn J8hIE25rg9tk1MxUCgSi9vjTB+hiyLpkvAzRQAYMTRUipu2ELxmwBdMdcPOnhgCHmtYj cI05YEMLsln+ao5yvfmqBPscq6Y52r5RjRYvw4PycMTz1dArswR5scEf6nJjIIk02Hhc 6wjiQsTzK3ApnvsnVRx1gR4+EFG09RI0I1ADbb4UfXmxsKCCsfSgPABy1nVtfD1ETo3A urCNtEvEQHGCt2K3ll0fz5N6WuBpgFbt4lMsktm2N88QyvTbnOtmc5pxYmIvAxcoseXG o+nQ== 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=jDST6ZYRUBMYsgR5athhw3QaJCGBzoioSBcURkEVIhM=; fh=hZzoEVQ+P2RTMdwwbGxVayrpa0Kfqp1s+JmoPf1T048=; b=kbyTkVsHpgb+E49lkp3kijNYOrm6NPUfrB12uLEhgB9MmBq9uidI2u4Ve75Gq+7i4Q s9439i/0n8IlwY63Ous8WziLCD7fjgTZiQEs23136nIu33QyanlzAiCbCjdqVjccOfbS dDEiun1nVDnTnleXp/82kb4/Iq7VTtfTkdDTGL70ghxNOE7F4NEpNQBQIz29NG8oPXr9 LMYA5+pb50K+KVBiHjpqeKzk6qTpKod2MqRwIHAA/fyqUyrzjvTioqNzDJiFS5Wm1kEw C3pp1zDs6hE2mya1+DLm/mv1mBfL6JSmDFxRDs1ZEttut6aVr97b8EWBz/Q1QjGKpgQX 1ekg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UuXNDLTh; 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 X-Forwarded-Encrypted: i=1; AJvYcCUK4IQw3kU+ikb+DFaEk/K1hUMNYFr83iaNjySPaNKB+yz4Y7IUOL+btsoTZqtlpl7LGYFYJZAakrHWlHBMHN+h Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g12-20020ac87d0c000000b0042be10e2e58si2593909qtb.683.2024.02.09.11.49.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:49:20 -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=UuXNDLTh; 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 1rYWqa-0005Tg-BV; Fri, 09 Feb 2024 14:47:40 -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 1rYWqY-0005S1-Pg for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:38 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqX-0005AU-7V for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:38 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3394ca0c874so738492f8f.2 for ; Fri, 09 Feb 2024 11:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508055; x=1708112855; 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=jDST6ZYRUBMYsgR5athhw3QaJCGBzoioSBcURkEVIhM=; b=UuXNDLThMSsIBTTo+CRbRJG4gQRg+tasXJKjS4Bvxq3Cr6IOY9VA7lwP6HhuwrdFML ROpUynbQEO6rzyY3eGm8Yc9rHUWFYZ9QWSdA6ISAyDWZlc9ePAoCn+3mBJGw0Jsnt+7z XTnrwhUNZGn+DQAFziOvFt9S3kZoUoXwf+qORo0N0LdMbXl8Qoa14w0UVclNuTi/dOsn pBt2GFyXKSjPtb8HL0sP1v5p/tbuLSDS7iX4EaSZKt6fBpHWSwPCYAfmbvSHJxvu2CIP FOmpo6bMTRCsaUCA1qoaI/rp59SXC2K8tG5Z/uMBuzT4foK5XySITz4o1iJK1APaL7rU hmAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508055; x=1708112855; 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=jDST6ZYRUBMYsgR5athhw3QaJCGBzoioSBcURkEVIhM=; b=pSJAnPOtAIJxeRCLssMFgm08B7P0BJqqDJJPvmebizdXI2X/uC0g7IS7wmrXgdm0HA gMAEGDPd5fTpcUxeSCxFPX6RyY4ZLeyvqQfaz7b7huzpmIT6B1299rGhdkB+QRZ2yQuo gVHiTY+IYddS4l4VYztGxmXTHUW3g4CXZFF6u3T0EVeqH2krgQzTKm7hbmWz+xq8HZ0F HbpgfAhsanYPECi1ppGuxrVwgVsyQwRwvA26rNwhROIpfE7/6keiWl8/0nJyL310A9Jz YILm0YvXY5qP9FF0FqMlc/zT3zf8GAOOELIMezepMP0MWLC9nKJva6/1/WdCUGIttD1O 9TMw== X-Gm-Message-State: AOJu0Yw/ew2k3mu5IEBuR5XatUuHcDx1eYV6ZB4PU4w7HStqeEvkhkyA PALF08HC2qzunjGRok2wCliJbkGJTF8KLx14/CVK5pqCkIzeesy57UZTgQPUWAY= X-Received: by 2002:adf:e384:0:b0:33b:1588:2250 with SMTP id e4-20020adfe384000000b0033b15882250mr27416wrm.8.1707508055512; Fri, 09 Feb 2024 11:47:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVwe3OEzZ1eq9nSs36RIp/eIyudTPV4jue8K1Wi0UQvlbiHGcXbW8fgs7TI5XXfYZ5OLm29aAwUvcRjmL1tfLeMoU4mj58Ad4+npX4fADLZAe6zGNQgqSqXhMzGSjyyMTMM6gE/R7zwUTtxj84Pz3t0aeZ79REbwiv1OGhKsHAEg4x16L0XB8eBh11SCCxGR3n93BGtv12Hw1b2nKwHyVpciOyheWtbsA== Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g7-20020a5d5407000000b003392206c808sm42277wrv.105.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:35 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BE9AE5F7DF; Fri, 9 Feb 2024 19:47:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Andrea Bolognani , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 01/10] tests/docker: Add sqlite3 module to openSUSE Leap container Date: Fri, 9 Feb 2024 19:47:25 +0000 Message-Id: <20240209194734.3424785-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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-bounces+patch=linaro.org@nongnu.org From: Fabiano Rosas Avocado needs sqlite3: Failed to load plugin from module "avocado.plugins.journal": ImportError("Module 'sqlite3' is not installed. Use: sudo zypper install python311 to install it") >From 'zypper info python311': "This package supplies rich command line features provided by readline, and sqlite3 support for the interpreter core, thus forming a so called "extended" runtime." Include the appropriate package in the lcitool mappings which will guarantee the dockerfile gets properly updated when lcitool is run. Also include the updated dockerfile. Signed-off-by: Fabiano Rosas Suggested-by: Andrea Bolognani Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240117164227.32143-1-farosas@suse.de> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-2-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker index dc0e36ce488..cf753383a45 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -90,6 +90,7 @@ RUN zypper update -y && \ pcre-devel-static \ pipewire-devel \ pkgconfig \ + python311 \ python311-base \ python311-pip \ python311-setuptools \ diff --git a/tests/lcitool/mappings.yml b/tests/lcitool/mappings.yml index 0b908882f1d..407c03301bf 100644 --- a/tests/lcitool/mappings.yml +++ b/tests/lcitool/mappings.yml @@ -59,6 +59,10 @@ mappings: CentOSStream8: OpenSUSELeap15: + python3-sqlite3: + CentOSStream8: python38 + OpenSUSELeap15: python311 + python3-tomli: # test using tomllib apk: diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml index 82092c9f175..149b15de57b 100644 --- a/tests/lcitool/projects/qemu.yml +++ b/tests/lcitool/projects/qemu.yml @@ -97,6 +97,7 @@ packages: - python3-pip - python3-sphinx - python3-sphinx-rtd-theme + - python3-sqlite3 - python3-tomli - python3-venv - rpm2cpio From patchwork Fri Feb 9 19:47:26 2024 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: 771331 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036287wre; Fri, 9 Feb 2024 11:47:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGp8tWV8U/oNKyZZ9fDeAKcIIM8JOs/zihMu+phvmFqGsTVRgamL1awwDCK8csiqbi6HRRh X-Received: by 2002:a05:6830:258b:b0:6e2:c284:7df7 with SMTP id u11-20020a056830258b00b006e2c2847df7mr34687ott.36.1707508079735; Fri, 09 Feb 2024 11:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508079; cv=none; d=google.com; s=arc-20160816; b=nMoVZG0vbl3a7LOkELDnA1rBsqfy3okE3SCdoPUX+wNxb+9cyK02oJmxJjJWrh10My IpJ3U4pmj6Jx1KO79csbomZIBJrUQ7OIk5VpNXEXw0vfHOZs+jss4vhWsGoWZlGHqPcS IhroURyXFV3R8J+VY4TspP2Kz1AlaoKYyCEKnSoiS1RWEwRMC+DF+NCIm5RnEFle3eMG nBpfpz2+loAle7mlNE94iuQbMn1CeB+aC+nqAkLkZwmr5clxbV7yBq/XMZQj/w5ryKOZ Rkaygj0A772A6ASEZYnevcJjoS0D2QP2GaX/C7YMMShbAtEtL3YSIGyKeJCOC6yyrcYO 8yLg== 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=QuY1O9E5szKTCV5MMy0oqz5P+mAsVHcaMG4FXksjYKo=; fh=kjpzQbT5tC+PjqN+7cV9GT5z7kWEn2k75yq8bIm1feI=; b=vKcCriHK87Bkextf8YYCbD33UvRrL4ydEPydKdiyiXJYzXwDZt6MLDGUhGBqX3q9jd TFFxWJDRaYKLYHdOmuR2DXtvE/YNa8+nVlsrVnmZVRdKryMva11PZ4NweeHwLjJIeIVQ J6PJxxMx5HuSCxWmTTUtbRn7zHHDLpLDdNlg8DLqcQp8cHdLPeEg4ePvTac8EdNPVavm PSXt27kycAII0zX3o9KGs0wU6RCKKYd7TAgpSopA/HjmMa4MhHEWCdMKD5/kpmOXHBhr 26lv4WzXMARG9u9xEYwCBzYtQCLfSZG8zsSgypmnzLg7vOvvkiDUMgwNJA5goPM0KgNb 2HlQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rdt9j9GS; 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 X-Forwarded-Encrypted: i=1; AJvYcCWYxaaYw9jYHk64WbqBrrO4a95jMqUAX1UZWyFs0SFs90Z2Ss51Wu2t/aqytiDQzQOnxY2QyY0r+1NPftmDibNX Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k2-20020ac85fc2000000b0042c59516ef2si2369280qta.489.2024.02.09.11.47.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:47:59 -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=Rdt9j9GS; 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 1rYWqb-0005Ua-OL; Fri, 09 Feb 2024 14:47:41 -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 1rYWqZ-0005Sh-2F for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:39 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqX-0005AW-Jo for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:38 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-33b4e6972f6so654963f8f.2 for ; Fri, 09 Feb 2024 11:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508056; x=1708112856; 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=QuY1O9E5szKTCV5MMy0oqz5P+mAsVHcaMG4FXksjYKo=; b=Rdt9j9GSlsLH/DxySMwtyC3prrPxFSPBmUhoVqQW8+jIEwox2TUYA9Y8SV7CuFrbk3 i2DZHqzMEnEM+KdIUz9za5T6NzQxsu7ggW8vxXFnQBzRQvBA9JF0rx/TxwM/i6IQNRnd rX12j0yaz1lN+futtyDfmQ639pwt+LFGUeDmFkNvYpJG0C3FcBxOJqKZjBDLouOAp9zp y+VWt+pTdnk6ijZgE8PonXJt7nJSp8ky+WWKHEnnsqJvB59JXQQmJmJixEL/emaawLvR AHLQyuEr8KeFXzl1zHWWHKjuVRLdzTb0fsstQCNCm7xn481ge7MvA8DutIseQr9nIvo6 xsSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508056; x=1708112856; 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=QuY1O9E5szKTCV5MMy0oqz5P+mAsVHcaMG4FXksjYKo=; b=DatitNqFklUyFRGsP9XZov07ImINuATsIcnADPp+RAwnFtgRjtSd2+HM3nvh/FSdzL BZuSYbHawm9j9hs0wwWb/MAsliC+uENWAxc+hoW1HK9a924uF9qUCKqjd9rB5c/KsqSN iB9vnqTqSfuC25UdkuI9JpXg6PwwrHu4+d15OyFrjVJM6lyX9s8yHz/qNnH4fdflGxYH lgzKhZvbzeYRKxpxyPC71m8dNqSwXmmdHoh4pOmO2HwgGUlhcEzd5YWa5xG1GN4pjgeW wtNUkYucWiW87h5BHJmsnIqCnsG6pFLKmQZ45Rr4AJBJmHO2QQACh2FeE2hvZdJEoyk/ V8mg== X-Gm-Message-State: AOJu0YxtKhzX1AjIAKCyAEPc0wt22CtnrUZ1RhR0VqQmQBqhydh5/g7P l0sRIsdR1AsLY6DV2AYd/IgdNNKntwkiZLbIfan2YAcPq36rETFns8Ulqz4vD3BbNXaqi5EKTOL I X-Received: by 2002:adf:f607:0:b0:33b:5e7a:cf02 with SMTP id t7-20020adff607000000b0033b5e7acf02mr19638wrp.31.1707508055847; Fri, 09 Feb 2024 11:47:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWjdOrjh7VQeo9X+GxhNkCwTZBjRXwTqmmwCkS3H9AJ1bA8DcYhIrpN3XW6Z/FC1ouzGIQakAmP7qfCzwTxjXlq2dsOX6SlNY7R5ffqYw7mavabLl3G86LxZ+fIguPeGyhkubfi/UeM1tl9CBlcGd5CPTnpITF1wdcZPzwRozq5d+Fe5eQ= Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l13-20020a056000022d00b0033b1b1da2adsm42649wrz.99.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:35 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D53C45F876; Fri, 9 Feb 2024 19:47:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Rabin Vincent , Thomas Huth , "Edgar E . Iglesias" , devel@lists.libvirt.org (reviewer:Incompatible changes) Subject: [PULL 02/10] docs: mark CRIS support as deprecated Date: Fri, 9 Feb 2024 19:47:26 +0000 Message-Id: <20240209194734.3424785-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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-bounces+patch=linaro.org@nongnu.org This might be premature but while streamlining the avocado tests I realised the only tests we have are "check-tcg" ones. The ageing fedora-cris-cross image works well enough for developers but can't be used in CI as we need supported build platforms to build QEMU. Does this mean the writing is on the wall for this architecture? Cc: Rabin Vincent Reviewed-by: Thomas Huth Acked-by: Edgar E. Iglesias Reviewed-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-3-alex.bennee@linaro.org> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index c7b95e6068e..7b0c59919e5 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -192,6 +192,13 @@ in the QEMU object model anymore. ``power5+``, ``power5+_v2.1``, an alias, but for consistency these will get removed in a future release, too. Use ``power5p_v2.1`` and ``power7p_v2.1`` instead. +CRIS CPU architecture (since 9.0) +''''''''''''''''''''''''''''''''' + +The CRIS architecture was pulled from Linux in 4.17 and the compiler +is no longer packaged in any distro making it harder to run the +``check-tcg`` tests. Unless we can improve the testing situation there +is a chance the code will bitrot without anyone noticing. System emulator machines ------------------------ From patchwork Fri Feb 9 19:47:27 2024 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: 771332 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036436wre; Fri, 9 Feb 2024 11:48:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWqGRmgULk9CTR9yy7oB9kqU4R4HLjj0zi7/e/aOKH5zd4YgUbKYtNsMtqqeH1Kl5tkY1TNw+6f6BkKF6xH7F9w X-Google-Smtp-Source: AGHT+IHAzwcLr7IxxwUS9gFZmzUZZe+H39ABvLy3KvNy+T8AhNxtWUtrag1pXnG9VLZNZei1Du87 X-Received: by 2002:ae9:f44c:0:b0:785:a232:9549 with SMTP id z12-20020ae9f44c000000b00785a2329549mr103308qkl.70.1707508104875; Fri, 09 Feb 2024 11:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508104; cv=none; d=google.com; s=arc-20160816; b=Y/HkntXQkVaHM/5UY8bDN9GmfyEfQsb1wxFpVFc0dg2TILzF74s/Nwg/Mq3qSqcMDu 2nC+7p31H1/OWjKToPtQrKzsvGzb3p4tgNsAp9CQHylv97E9fqR9RtBcSJDhuxh7iYYw 7qh7xL+CEKaBaBQn37mJkM13SjHeuCHvn015ZgzHm10r/Pea5JpnlmKT4b40WLQVZqIi L7EoUPnJujiJIV4ole8xxfTiiTqwaxTFs99H4XbsS0bn6YJH8qRlYWftlZcAHDuPZuyv 5SDtLtFyHy5aavh3mod2kk6Ps8pYjLzWDTaQtUoSSXZ6+Dyua7bkO/Fa3uXp2VVCAWjr TbFw== 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=z5lqtHDdYR44xIv7ErGYBoC322q69wLbs7IK5BRXf84=; fh=u79MenTulUrxLCVDXjJ8CKxOWo3akbednkPFHuRG2tY=; b=SjLuMQ6W2b0euwAA4Va8x3eFBn5r6ByVsOapiIxeyECEemQNuoEerSdjjVBoJTQocR fxKH36NfTeRBv+sBVwKj967s8mzJsiuEUaa0OnpAQwp5TkIUEMpN3boH8Hjn8LP4uwWg UPLyjMpKhiliV7QGkET0zrXvkma63Bt8FWMGu12sqNP2WQLqwWJsU16w33yCBSvOT6us DpMhf2jUj7kjBoXpRXjRUbkXZ3CFDGUg7N/GvG6sVT7fnmdMJD8SIqXcj6kQvxC0p6U9 BeB3HzLWC/E/RW3WUctmA/FZrnv7z58n7abF4b9Dlge/S5khaymhmHF/Bi5F83Fds65i ntnA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xz+eznKx; 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 X-Forwarded-Encrypted: i=1; AJvYcCVARTqVAHz3PWz34sjGOANuuxkV/9uZg6xm6peNSyr6bdc33y4kkGeSJ49vEdAMdzFDGm4K7lrferKha4GCpWDG Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p27-20020a05620a113b00b007859f9aa7b5si122972qkk.603.2024.02.09.11.48.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:48:24 -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=Xz+eznKx; 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 1rYWqe-0005WP-M9; Fri, 09 Feb 2024 14:47:44 -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 1rYWqa-0005U0-Kw for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:40 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqZ-0005Am-4N for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:40 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4106cf2e9e2so8214625e9.3 for ; Fri, 09 Feb 2024 11:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508057; x=1708112857; 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=z5lqtHDdYR44xIv7ErGYBoC322q69wLbs7IK5BRXf84=; b=Xz+eznKxzreKL7z7UWuWRCrjvUM375gtYhSW67640n+lURYsJLrPyrctg70oal+1ic xaHGSaz0vL0XQ5Agb3DXMoUERDIRc8NOnpTB5qd3WtSfQo9j0QjL/LpU+GN12FUoEn51 mzQwu+g5zhCM1je0GoVRLwKwUprDUNYeSXxpq1dw+vC7rA13qdjq58V/uD60wMc4f6eV Z0riGc1m+1uYBSfsFOKvBqa5HYpS5hhqeBy+DczzWK8uQpGXsZwfW8yUqhJMOYoVLH9E lhZGbw01xImReY+r9W6mrVE6ZfunBUUyN9zT05YyIDFBo0Or4B4sMMrANFBXofWQRebx 5B5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508057; x=1708112857; 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=z5lqtHDdYR44xIv7ErGYBoC322q69wLbs7IK5BRXf84=; b=M2BNMuzCgMaQ/7J2qzH5e7T72EJorAFo+zSVKjBtSPhGcbQuo0c0fgIX3PMKorjC3T zEQKmKFSEXTR9UB0e24fVtzMBYp/5VJQdyvi2NNA6l5eURStALWVUtkjj10q1ok5nI2R b+t79eKN+bhu+fLeCHFOLnvgv4VJGt2kMZKjVS8NC6xG6rXbowaLCbv+bvWUK9t+cE6w eNhBWRltWcjj/z3zvrRSgdGFpWKxsTrdVlyvzbq6NryRAAyjjJsxCTJzilUU8b17U+PE KCs/ONpDeWpxy4CnNl1ga0zvyBohz7uhcT/SXuoIovzojqwYR0SFdrb51nxh55nR3s85 8yQQ== X-Gm-Message-State: AOJu0Yy72MgeS1Id6chWFsyv/yD+r75lF25XMLKM7vCIDaygQQDRCUNn VbWDBwHMJWv7cozrcidbz8CFBrAQQeZyCHZ4RBLBezGWCgy2JDe9BD1TJ+IlP4Q= X-Received: by 2002:a05:600c:45ca:b0:410:3151:8025 with SMTP id s10-20020a05600c45ca00b0041031518025mr220718wmo.28.1707508057677; Fri, 09 Feb 2024 11:47:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUs0eCkbpSluA1CCUrNIwTKeZqP4GgMnyVvMy8kc8L0e24lThsCzgjrF0aJdV0t61LFB7yCljF7Z7l86B2kKW+VA6ZkHYLdlSzR7qDdwgR9aFtEbUeve8Ic Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id jz15-20020a05600c580f00b004101f27737asm1469255wmb.29.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:35 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E9E015F879; Fri, 9 Feb 2024 19:47:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , alex.bennee@linaro.org, Thomas Huth Subject: [PULL 03/10] configure: run plugin TCG tests again Date: Fri, 9 Feb 2024 19:47:27 +0000 Message-Id: <20240209194734.3424785-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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-bounces+patch=linaro.org@nongnu.org From: Paolo Bonzini Commit 39fb3cfc28b ("configure: clean up plugin option handling", 2023-10-18) dropped the CONFIG_PLUGIN line from tests/tcg/config-host.mak, due to confusion caused by the shadowing of $config_host_mak. However, TCG tests were still expecting it. Oops. Put it back, in the meanwhile the shadowing is gone so it's clear that it goes in the tests/tcg configuration. Cc: Fixes: 39fb3cfc28b ("configure: clean up plugin option handling", 2023-10-18) Signed-off-by: Paolo Bonzini Message-Id: <20240124115332.612162-1-pbonzini@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-4-alex.bennee@linaro.org> diff --git a/configure b/configure index 3d8e24ae011..ff058d6c486 100755 --- a/configure +++ b/configure @@ -1644,6 +1644,9 @@ fi mkdir -p tests/tcg echo "# Automatically generated by configure - do not modify" > tests/tcg/$config_host_mak echo "SRC_PATH=$source_path" >> tests/tcg/$config_host_mak +if test "$plugins" = "yes" ; then + echo "CONFIG_PLUGIN=y" >> tests/tcg/$config_host_mak +fi tcg_tests_targets= for target in $target_list; do From patchwork Fri Feb 9 19:47:28 2024 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: 771335 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036637wre; Fri, 9 Feb 2024 11:49:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXhohBlCHrAceKw1Q9QSqsVoK9EAwkNFujiY/6iy/YGixGXnJJbtTSqwBWA01jWC3yqm2YFx6nIZ7N6PGvlWuY9 X-Google-Smtp-Source: AGHT+IFOmv/EO7Dk1IMqoTSTXIinrJiYdRd6gbg1WkDp7FjF0sjGQLinLk3QfeSiy7JCVLTZwLRb X-Received: by 2002:a05:6830:1dba:b0:6e1:4dc2:9912 with SMTP id z26-20020a0568301dba00b006e14dc29912mr57698oti.19.1707508145128; Fri, 09 Feb 2024 11:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508145; cv=none; d=google.com; s=arc-20160816; b=RpyaqpsOqYPSz0HfsJVlFQu+PmyN7XPZtFsoVWAMa7lqmrU3868gbgpGlBnByR7rMw WVizUVH6tgH06EmdKc5rqEwGkzvzGl1jT6+0d0ONRoYPuKvWukyRjRy+v6O8z/hyXA1g P3IWlPSEnbS8vfh6QEjEqUQNg4gy8aFTEvUInqS4D3Eug9awBJpeWsJ40loB5Y1MO0Tb iBw/sa0UgJ9z5tEGSfb6rcPYdJ1U/6IXRWd2fNLCvzezQNLRJeNTKdT3imGg1kGISbxO 7puxKVFbgZOE9xlak4qFR7GeK/p527cczg8+NF9ESn16DeZA5pq2jT9o80aRyYApGPrY 0RBA== 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=2LPZ5f6J+7DZZSWTcdB8sRpzvNp85w3nAGoLqoRKgsw=; fh=Gdtt+ryTb9tu52eMC4SFlN+r12Ejvk6GUaJeNZxoTP0=; b=YMDcMjewmdqX9yfOayInw+YdWykBLYnTamiZcxvBgj/vk01xeey/wOBXrgk4kiWAkJ Chsg5C3vCW6n7H3vE4iBZ+nl8oNLYBgM6amsiB9qanTRtSN3quir02h8xx/wVb0YbmTI UNQLpIfyRM9a9yov6tevg4lehX4VlFrrylIDnr95vjyrEyud9/T4C69pLyNRSqPypHtr VTsJVH8ZG6Fg78cs2FGf036UpVdR8Z13mPtFTlW2yuqVBs+TtxnFAjFtCk4SZl9NYBsU XI26KNckxzQAO4fQpynqeS1Fc7qD5vAqL011uqKbIM7oKjFa31j5LTJxGh4ZQ9hg82g0 wF2g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HRROj/aw"; 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 X-Forwarded-Encrypted: i=1; AJvYcCU/hRbjsNb5axf5W1F8XskOAzJBQRLsqyL6itbaWaxAaWkKsymbqo0z/Y53F1/QtFqJ7qQwO20Enk6YAgmwyAhe Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g9-20020ac85d49000000b0042c2109e0e6si2620640qtx.438.2024.02.09.11.49.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:49:05 -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="HRROj/aw"; 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 1rYWqr-0005YV-T0; Fri, 09 Feb 2024 14:48:04 -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 1rYWqd-0005Vs-Ix for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:43 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqa-0005Ap-ON for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:43 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33b29b5eab5so650414f8f.2 for ; Fri, 09 Feb 2024 11:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508058; x=1708112858; 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=2LPZ5f6J+7DZZSWTcdB8sRpzvNp85w3nAGoLqoRKgsw=; b=HRROj/awN8A5LUR200KIH+IV8QwhtEjzlNJ1OJ2EAJdhgxOq+4jfLE3/RA41uhyhsC ycLPEpcrXIH6L5LQttEqL+JZsv3BomvI/9ZnAYAUKtYF/Y2wcMcNkCfWAN3HG9jGIZy9 XO1v2OgmC0N8x7Eh7NTSSZBw0rukQfYeqiEngTMq37VgwUsfv0kynpMKwEu67lEM7EeK ABTur091BhBwlZsuFmeA5cohbz+9omJnmHHPA30SdNkJfz1Ew98axNnuy+al01zksJLZ sV7pMqf5f6KQr5qonD/v3lcCtOL7CvFQrAxM3OxZo3N4cAer55HwgWUHMbhejTIFMJfW wpmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508058; x=1708112858; 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=2LPZ5f6J+7DZZSWTcdB8sRpzvNp85w3nAGoLqoRKgsw=; b=cSwi8o/fdpoqAwF5JFfX6qzEeKMRZSjuEUCHgRxwbLq5FTuQuU/TqnRvy92lKmFnGp D3z81u2PRrMJDFAuNSMZyjAzddhTrhMMH1NMqD9uhWpRUBT/ZdBJrQaKXMqOctUWaFjk aHMD/T1Fukj3HJBp6fQjOQ5OuXMkQ7lx0Bb+ZTnIGe5NDomo3rU4Ty2z4jKw9sSHPq2K MIVx+s0AYZM9VY+KvfnUVG8bKhEHG6sRATA5KVLb5d/pgbdV+9afj8vEAPyoOXnIrdj2 hdZrJ1PpiibFmvawijh1BuA4Yq6FGEDrfJEqd1jQpF1DGqc0Uehf97jzmGwqJ4HFRew7 ig5g== X-Gm-Message-State: AOJu0Yw7+jfw8cMLPg8UmVo3c+2WPSHl1NuXeebNl10NZ89l4sGy6oCQ PIL5EOhpw4OoeZPk2sq/6yh85VfeIJ3KDLX9LpWe3oxqFB+y4uDpqG/45x9Iz72rpyrVY6PDQD6 / X-Received: by 2002:adf:e4cf:0:b0:33b:998:3643 with SMTP id v15-20020adfe4cf000000b0033b09983643mr5665wrm.34.1707508057871; Fri, 09 Feb 2024 11:47:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWxrhbjiyT22CxsKfl6zNEko5qEizQpvyV5EYy52uqvfHT5+xIuWPN26Sn2v4/pNusVdWizMGMBmZoQ8vPjrMZl Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c1-20020a056000104100b0033905a60689sm53030wrx.45.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:35 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0AF455F8A7; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PULL 04/10] Revert "hw/elf_ops: Ignore loadable segments with zero size" Date: Fri, 9 Feb 2024 19:47:28 +0000 Message-Id: <20240209194734.3424785-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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-bounces+patch=linaro.org@nongnu.org This regressed qemu-system-xtensa: TEST test_load_store on xtensa qemu-system-xtensa: Some ROM regions are overlapping These ROM regions might have been loaded by direct user request or by default. They could be BIOS/firmware images, a guest kernel, initrd or some other file loaded into guest memory. Check whether you intended to load all this guest code, and whether it has been built to load to the correct addresses. The following two regions overlap (in the memory address space): test_load_store ELF program header segment 1 (addresses 0x0000000000001000 - 0x0000000000001f26) test_load_store ELF program header segment 2 (addresses 0x0000000000001ab8 - 0x0000000000001ab8) make[1]: *** [Makefile:187: run-test_load_store] Error 1 This reverts commit 62570f1434160d356311e1c217537e24a4ac85cd. Reviewed-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-5-alex.bennee@linaro.org> diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 3e966ddd5a1..9c35d1b9da6 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -427,16 +427,6 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, file_size = ph->p_filesz; /* Size of the allocated data */ data_offset = ph->p_offset; /* Offset where the data is located */ - /* - * Some ELF files really do have segments of zero size; - * just ignore them rather than trying to set the wrong addr, - * or create empty ROM blobs, because the zero-length blob can - * falsely trigger the overlapping-ROM-blobs check. - */ - if (mem_size == 0) { - continue; - } - if (file_size > 0) { if (g_mapped_file_get_length(mapped_file) < file_size + data_offset) { @@ -540,38 +530,45 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, *pentry = ehdr.e_entry - ph->p_vaddr + ph->p_paddr; } - if (load_rom) { - g_autofree char *label = - g_strdup_printf("%s ELF program header segment %d", - name, i); - - /* - * rom_add_elf_program() takes its own reference to - * 'mapped_file'. - */ - rom_add_elf_program(label, mapped_file, data, file_size, - mem_size, addr, as); - } else { - MemTxResult res; - - res = address_space_write(as ? as : &address_space_memory, - addr, MEMTXATTRS_UNSPECIFIED, - data, file_size); - if (res != MEMTX_OK) { - goto fail; - } - /* - * We need to zero'ify the space that is not copied - * from file - */ - if (file_size < mem_size) { - res = address_space_set(as ? as : &address_space_memory, - addr + file_size, 0, - mem_size - file_size, - MEMTXATTRS_UNSPECIFIED); + /* Some ELF files really do have segments of zero size; + * just ignore them rather than trying to create empty + * ROM blobs, because the zero-length blob can falsely + * trigger the overlapping-ROM-blobs check. + */ + if (mem_size != 0) { + if (load_rom) { + g_autofree char *label = + g_strdup_printf("%s ELF program header segment %d", + name, i); + + /* + * rom_add_elf_program() takes its own reference to + * 'mapped_file'. + */ + rom_add_elf_program(label, mapped_file, data, file_size, + mem_size, addr, as); + } else { + MemTxResult res; + + res = address_space_write(as ? as : &address_space_memory, + addr, MEMTXATTRS_UNSPECIFIED, + data, file_size); if (res != MEMTX_OK) { goto fail; } + /* + * We need to zero'ify the space that is not copied + * from file + */ + if (file_size < mem_size) { + res = address_space_set(as ? as : &address_space_memory, + addr + file_size, 0, + mem_size - file_size, + MEMTXATTRS_UNSPECIFIED); + if (res != MEMTX_OK) { + goto fail; + } + } } } From patchwork Fri Feb 9 19:47:29 2024 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: 771330 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036277wre; Fri, 9 Feb 2024 11:47:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfuyRT4DL977IAmF3sGztA6m1QpueVme+6kluVTSAAWaJWRnTPCbLgjpiOU3skdjMQ0mdf X-Received: by 2002:a05:620a:ec6:b0:785:bf01:b8fc with SMTP id x6-20020a05620a0ec600b00785bf01b8fcmr273552qkm.1.1707508078032; Fri, 09 Feb 2024 11:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508078; cv=none; d=google.com; s=arc-20160816; b=wOq9eBQNEaLsFT0K7nQY8/BvFK2cKV4IYkN5CJXf0GvRLBvx6n5+fnJR4BuAudfp+2 PWqR2yxhcrgT3lll7wJFhCelTEnx0kCljARnKnEvyxSkAMRHPzsWsWVH7D7eMMS91X5z 9Ed4eLoYM3iyt7C+NxkTS3CoYqA3DViCEVOdDORt5NHJ1oMADi0GkhpC6pw1khSt8KU+ fTiTCesv0YpQ1NrdPUeCKKYZzsQlUvMZXNaRWbHizyJbrtg21s14vD52OhWD2jgeQHSx IiceeyEL57HAx3zqjxuPY27QaCBjPu2aepvph93boRGTR2Jmt+40cC60I0u6i3liyzgO qsQw== 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=A5tqpuQsjOSCV46teFHGbLfU2/LuhZbJZLNOyxR8wfM=; fh=xhQbTVCJfjGLq4w+ozwv4aDmSjEIu3Acgnpr3GoPcts=; b=aaguxxI0Vv0d0frDuhwE9CCs4+0wSiB2wdzuIkizgxkjocetGCNci7wWOu2kdQnVZT NLZojYH1JNm+qhisnw730MgYbTAscDSK9gBx+T6DVNor/mRDKA/yVcPtxzRFBn4QP46K GWFHN6GiWP3/nNBgfQQVrgPlpBQLsEIHnQoeBHWT5vH/rNIyq/0e2wVcqJdaQY/bukn2 5IwGi/HzhdtHMo+KyVUHIqgfSXxfLblD/PVOCKDEeQhqKdHQpbL81m47PR6oR9QDaFpH nx+5BWp7FJpMrAj8CYVnnhC2IA3XNeYirolKOltc77D2caZtXMyS6WVFTQDpw3bQhgG8 A2fg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z3c6egYO; 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 X-Forwarded-Encrypted: i=1; AJvYcCUSoOlCvKPgxFgaw+8yqD3bpXua0Lm7p/VRTCIMGhCQv1s75IOwnLfi6jtw7F1Vrif2rynGuBI17+ch2CNRipQM Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j29-20020a05620a001d00b00785a50b5a99si155705qki.12.2024.02.09.11.47.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:47:58 -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=z3c6egYO; 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 1rYWqd-0005Vo-8E; Fri, 09 Feb 2024 14:47:43 -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 1rYWqc-0005Ul-7Z for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:42 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqa-0005BI-I0 for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:41 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33b0e5d1e89so830169f8f.0 for ; Fri, 09 Feb 2024 11:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508059; x=1708112859; 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=A5tqpuQsjOSCV46teFHGbLfU2/LuhZbJZLNOyxR8wfM=; b=z3c6egYOaZFh8YSHsVkcTglBB5WjWD13xmWt54tLDQvPsW4gUWCJqzQxawPqgyT4Vf jpTwWJzWWYExQw1596CVLTntsuAIFz7qUU5VKUjDrcDhDfnWXH0/pO2iIqgl6ZlTUVwk 4LuipOysoPGNLWL8QeEd7zUSw3pUEjBpTFinwghFhZa78w6yEzLwDjOC9u5G+dDCzBA7 i5C2eqLH3S1/ndxRim9M/tzD25/NCx8U3iau9KAUYPQv+W/sWzino+JNF9UK8w8gYvlS ej1gcIljvN4SIqY9mP8Y+Fm9XMx9qxtanMwZ+LLC4e/j5B+BNlc+FnejEvrN+luP+yAQ j5sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508059; x=1708112859; 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=A5tqpuQsjOSCV46teFHGbLfU2/LuhZbJZLNOyxR8wfM=; b=rGnEWP7dfEcrv8FhzwQxjxAXm1qp277cXHzO55IRxan6il0kV+W8Qqsd3ivw7rxHmJ Hv+GEtiYxVd+zdQYXQDZgjZF+V1Ske+0izCeno/amiHVWVWTQfN8tE7uw8wLIrigZJ6R MHALM1IbVqXQNGi0tgS4sDR+VjfBDyc4Rclp5hA9f0qQob+Dk/3Q4QMhLJ84eoKY8DTy RHKRQEc+d69uujtncTPHitgfNKUAIMDLNfe6WoopWzyABDa1+VWw28MCZ4kRNraLPGN4 k43t91asjh+f2GG/ek9rPDSMTcc4dPLx/JHptKE4VHTd+OaQUDLO6hwjOzf7ceMWo/Xa /BTg== X-Gm-Message-State: AOJu0YzO4o+uoa9j1yoddZzHHlhPJ34b9B/05VB94ME/RCvzHulx4T0n W+GHBLVbIxnkwYn9L1KHhg7cU6/nXVwbU1C0biNJz3qlYB71x4Ncc8BQ9oVwDrs= X-Received: by 2002:adf:e7c7:0:b0:33a:ff90:77ca with SMTP id e7-20020adfe7c7000000b0033aff9077camr11062wrn.29.1707508059299; Fri, 09 Feb 2024 11:47:39 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXtYP2yMbUmNpzljPhpPogBDIDrVhr3RrjB4JGeXC29ZnDUGyVQHl39yAAhaEZ6tK0PkiV+eUlMxhW2/97+V3mEQqdW9h770RZxPLNd6Q4i5WXuE4vYoNAAPLOg9KQUCKdAlrgNamNtln06nHTEcDPZxIRd2IcES3Ade6lna3tYxPQvvJuR+mwGVHt6gloBF2YCjJrd9evixN9REsM0kgnp1B0RW2xVEiDzLxr4uaA2vbgMQZ00xY0HTyGVceusHpBgBQmvfaATz0RNLncFhEwCK6Bnwd3fofjX37PiIg5rHQ8z0D0/rDfMz3IazIBh5Rtd6KODrNPEByvT5KvuO+zdfvI2gPm6bMaBzoAcRYpQgTMHjRvjpS7ou15V4ESjfFsmMP+MWn2PVSzF092NUChFO8EDnuESsDCPAxjCLW1tEgWagLWMA5nly/wPX9M58hlen8dBytLGmWMQBAW0Xfi/WeCY2PhXb6OgqK9n40zzbRaZxicphz8Q5kMYfGKvY8wlHRgn3X6ITbigi+ZIROWwxz1d2RfgjcwjBqKdrwL21cugdmsLtppJ30wvWQ== Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i19-20020a05600c355300b0040ff2933959sm1550368wmq.7.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2CFCA5F8A9; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Alistair Francis , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Chris Wulff , Marek Vasut , Max Filippov , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Palmer Dabbelt , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PULL 05/10] kconfig: use "select" to enable semihosting Date: Fri, 9 Feb 2024 19:47:29 +0000 Message-Id: <20240209194734.3424785-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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-bounces+patch=linaro.org@nongnu.org From: Paolo Bonzini Just like all other dependencies, these can be expressed in Kconfig files rather than in the default configurations. Signed-off-by: Paolo Bonzini Acked-by: Alistair Francis Reviewed-by: Thomas Huth Message-Id: <20240129115809.1039924-1-pbonzini@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-10-alex.bennee@linaro.org> diff --git a/configs/devices/m68k-softmmu/default.mak b/configs/devices/m68k-softmmu/default.mak index 7f8619e4278..8dcaa28ed38 100644 --- a/configs/devices/m68k-softmmu/default.mak +++ b/configs/devices/m68k-softmmu/default.mak @@ -1,7 +1,5 @@ # Default configuration for m68k-softmmu -CONFIG_SEMIHOSTING=y - # Boards: # CONFIG_AN5206=y diff --git a/configs/devices/mips-softmmu/common.mak b/configs/devices/mips-softmmu/common.mak index 7da99327a77..1a853841b27 100644 --- a/configs/devices/mips-softmmu/common.mak +++ b/configs/devices/mips-softmmu/common.mak @@ -1,8 +1,5 @@ # Common mips*-softmmu CONFIG defines -# CONFIG_SEMIHOSTING is always required on this architecture -CONFIG_SEMIHOSTING=y - CONFIG_ISA_BUS=y CONFIG_PCI=y CONFIG_PCI_DEVICES=y diff --git a/configs/devices/nios2-softmmu/default.mak b/configs/devices/nios2-softmmu/default.mak index 1bc4082ea99..e130d024e62 100644 --- a/configs/devices/nios2-softmmu/default.mak +++ b/configs/devices/nios2-softmmu/default.mak @@ -1,7 +1,5 @@ # Default configuration for nios2-softmmu -CONFIG_SEMIHOSTING=y - # Boards: # CONFIG_NIOS2_10M50=y diff --git a/configs/devices/riscv32-softmmu/default.mak b/configs/devices/riscv32-softmmu/default.mak index d847bd5692e..94a236c9c25 100644 --- a/configs/devices/riscv32-softmmu/default.mak +++ b/configs/devices/riscv32-softmmu/default.mak @@ -3,8 +3,6 @@ # Uncomment the following lines to disable these optional devices: # #CONFIG_PCI_DEVICES=n -CONFIG_SEMIHOSTING=y -CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y # Boards: # diff --git a/configs/devices/riscv64-softmmu/default.mak b/configs/devices/riscv64-softmmu/default.mak index bc69301fa4a..3f680594484 100644 --- a/configs/devices/riscv64-softmmu/default.mak +++ b/configs/devices/riscv64-softmmu/default.mak @@ -3,8 +3,6 @@ # Uncomment the following lines to disable these optional devices: # #CONFIG_PCI_DEVICES=n -CONFIG_SEMIHOSTING=y -CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y # Boards: # diff --git a/configs/devices/xtensa-softmmu/default.mak b/configs/devices/xtensa-softmmu/default.mak index 4fe1bf00c94..49e4c9da88c 100644 --- a/configs/devices/xtensa-softmmu/default.mak +++ b/configs/devices/xtensa-softmmu/default.mak @@ -1,7 +1,5 @@ # Default configuration for Xtensa -CONFIG_SEMIHOSTING=y - # Boards: # CONFIG_XTENSA_SIM=y diff --git a/target/m68k/Kconfig b/target/m68k/Kconfig index 23debad519a..9eae71486ff 100644 --- a/target/m68k/Kconfig +++ b/target/m68k/Kconfig @@ -1,2 +1,3 @@ config M68K bool + select SEMIHOSTING diff --git a/target/mips/Kconfig b/target/mips/Kconfig index 6adf1453548..eb19c94c7d4 100644 --- a/target/mips/Kconfig +++ b/target/mips/Kconfig @@ -1,5 +1,6 @@ config MIPS bool + select SEMIHOSTING config MIPS64 bool diff --git a/target/nios2/Kconfig b/target/nios2/Kconfig index 1529ab8950d..c65550c861a 100644 --- a/target/nios2/Kconfig +++ b/target/nios2/Kconfig @@ -1,2 +1,3 @@ config NIOS2 bool + select SEMIHOSTING diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig index b9e5932f13f..adb7de3f37d 100644 --- a/target/riscv/Kconfig +++ b/target/riscv/Kconfig @@ -1,5 +1,7 @@ config RISCV32 bool + select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting() config RISCV64 bool + select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting() diff --git a/target/xtensa/Kconfig b/target/xtensa/Kconfig index a3c8dc7f6d7..5e46049262d 100644 --- a/target/xtensa/Kconfig +++ b/target/xtensa/Kconfig @@ -1,2 +1,3 @@ config XTENSA bool + select SEMIHOSTING From patchwork Fri Feb 9 19:47:30 2024 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: 771334 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036625wre; Fri, 9 Feb 2024 11:49:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJXjJ6/Z31k6tQ8dFL+XsT54LlXgCPKmAJwy2AdFnI/mfF7p3PifkxALIGUNPU8FSS+Nl6rKWl5RKn81EW+A1L X-Google-Smtp-Source: AGHT+IGA64wjGJtnUSl3UApiTLKJ7u1xPMkea3in2FmJvYdBTLpVLWbCukJO4c736YjyoOojWrVc X-Received: by 2002:a81:9293:0:b0:604:5b3:d7e8 with SMTP id j141-20020a819293000000b0060405b3d7e8mr229994ywg.11.1707508143565; Fri, 09 Feb 2024 11:49:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508143; cv=none; d=google.com; s=arc-20160816; b=pqa4mIrpDWtZ/mD1hfgq8pUDkugOkr7dnp9xpWaCpv+i3Jhco7mSvn1IEQAkM3FcXg aXcCkeHPgTaC+MoHo0ClbJnvmn3i6SV9MxbrQ/VOrTGnvE3giUyztud/TduN2mtEYCq/ 06/43Gr5bwL167FTP3LB5jwKHF1TjwzFXLkuNIjNpaEk1o6nPK4i9dPa61dYEfFLLYlq wdHVb0dyVj1cSnK2OxiUxHvLVhZSeDHvFiX4PM2RubwhuiIyOCK4EBzvy+mibrwMGgmC gh6qm04mm6Gcy3v6KQllWB8ixRIn8njlHffPiX7v+OFvq3UZ+lMGb49OOGANSX/RV09V fWTg== 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=0LL5Dv7JkupzeOyiQ5GcSbTiVFGuPgwqizfiHIcw9nM=; fh=7Q5irn1vDmnaH13D4hsJ6UXf6vZvJBoBbU+Bxnpk53o=; b=WWc8cFKhqrqa0IR6JOjn8J2iDNXRpPi4ueY2HiP3YcJUgREvv3wfWfOte80kvt4TFE JCDQB5xNXvKV8onLqalP+B6yo362oAVwrHfCuAiy3qm0lkDD+PmKFhDLZJLcigO+T1po AejmH5A2W9muJKFl2lBSFdC3ak82VvNhqGlPMJW3DZvISlDWShbLwUTtyee57IyQPp1u g4ky+S/Nr5iMYhM1+RnaVlEwpmfb5y9xWSfQQmY3CQGD9Dnw5LfT1SNjKIVlyuyi4SXV RUZwaXu8oPDGl6c0WeEHvtMga8GO33DDZlb9LFvweeVfQxyqTA4gyYzkkm0omAZAvFgE L0Sg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FTnPI0Qc; 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 X-Forwarded-Encrypted: i=1; AJvYcCWEp1Kx0rBRij0rIRsO9foFFPM4BvQ95xq8AoyF4xMteQHvWi8S8a7jzuhKoAVh+ZSsasS2J+QCGaljOFF9Hz16 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v27-20020a05620a123b00b00783fb7d5b15si130122qkj.506.2024.02.09.11.49.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:49:03 -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=FTnPI0Qc; 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 1rYWqh-0005WS-Rt; Fri, 09 Feb 2024 14:47:49 -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 1rYWqc-0005Um-7e for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:42 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqa-0005BA-Ho for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:41 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33b6847df67so312477f8f.3 for ; Fri, 09 Feb 2024 11:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508059; x=1708112859; 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=0LL5Dv7JkupzeOyiQ5GcSbTiVFGuPgwqizfiHIcw9nM=; b=FTnPI0QcXFKV28UZit3ZqGXqOt7tENnFzzeb/ROMzVJKqhbsW5d3e1Lqdx82aMuTzA sdR9+Mai/FRpO9dEl8PBLsR31yqJB1atP0iYr6EdVPsj950bxKKzo2v421Cr3zBMN4bo g0C1l4ZSvWgTecX7tYYT1A02vZIfAnn5EsRb4ix6Z0NuQ325i+AeDtco1yXn7TIxvoWA JXVJgw+iRAF1qotYc73D/y6oq6f4lpjmX8eoftdh5mLNNWJtwfRFzzWglkPpuo8dDYx6 VbFG84lvgDzcBauHzszt6tPejVcAlY+x2sZwLF58oWFtSLuPTcD4MbWbvMJKuv/WmpKH t94Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508059; x=1708112859; 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=0LL5Dv7JkupzeOyiQ5GcSbTiVFGuPgwqizfiHIcw9nM=; b=UAfoOjjC5Qsz/MfAOEq03+nNjj3NfvFJlLj8O2gsne9H2PChrET5elFS6PsiKSf3BB MA+YCirISWxinV2lGxdspylc7o6RAgAdTw/7fOlZBQve56oAtOJ7gIoiNzQw62IHHPRf 5I6roHktmyYRvmr/2a7Dh97rVw/skCSWTk/SrPRdIh96YR3OqnkeG0zqSVWQoGDqmS2G K87qCQzmH0ZeMFkOZVxbVjxFGajPsji+vKVbeOrpl1zIjG2iXm1nVrf+tGUoYZNQCw2w ND0kQcks45SZG3eCJr7xXAVv+05uyBIdglqQNVaBeGam41Ty4sl4/OTkEPTVJzdTQB/c wGwg== X-Gm-Message-State: AOJu0Yybv3VgP4wiCEsYcRbmlVrgnT2Ib6hmBjuGCWhNIY1ejwv4H+zE XjtOSN4Pg8powKSeaDhI6npf00VlqHpHntfhMrwb0f5ahiCM69DPBEVUwHOZv04= X-Received: by 2002:a5d:55d0:0:b0:33b:4020:8710 with SMTP id i16-20020a5d55d0000000b0033b40208710mr3336wrw.61.1707508059066; Fri, 09 Feb 2024 11:47:39 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW4E5RUiUi04GFWYcpsLZbwepDjXv1N7PkVQBPlXi/KPMY6ok8yIAr/7rjgPzlcK1fSBe/MuQGW5zvCGhGMjM6RWwnLUXuWPOophNCfD74vPuO22H2wC2NIKw== Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y12-20020a056000108c00b0033b40a3f92asm56264wrw.25.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 45A9C5F8AB; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 06/10] gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way Date: Fri, 9 Feb 2024 19:47:30 +0000 Message-Id: <20240209194734.3424785-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich The upcoming syscall catchpoint support needs to send SIGTRAP stop packets to GDB. Being able to compile this support only once for all targets is a good thing, and it requires hiding TARGET_SIGTRAP behind a function call. Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-2-iii@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-11-alex.bennee@linaro.org> diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 5c0c725e54c..aeb0d9b5377 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -136,6 +136,7 @@ void gdb_append_thread_id(CPUState *cpu, GString *buf); int gdb_get_cpu_index(CPUState *cpu); unsigned int gdb_get_max_cpus(void); /* both */ bool gdb_can_reverse(void); /* softmmu, stub for user */ +int gdb_target_sigtrap(void); /* user */ void gdb_create_default_process(GDBState *s); diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index c4bba4c72c7..b7d4c37cd81 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -418,3 +418,8 @@ void gdb_handle_query_xfer_exec_file(GArray *params, void *user_ctx) ts->bprm->filename + offset); gdb_put_strbuf(); } + +int gdb_target_sigtrap(void) +{ + return TARGET_SIGTRAP; +} From patchwork Fri Feb 9 19:47:31 2024 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: 771333 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036609wre; Fri, 9 Feb 2024 11:48:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWdzvNhhFke4TzOilhwcret3zwszjiMrEP7J6k8D4cqIGe0+FR5H7LmaibzVV7I4O7ZbZ9cBq285qyYryX4lT+q X-Google-Smtp-Source: AGHT+IFDf67SDq2/I1Q4V/KLlDHnLDG2TUtfskV8uRhPqFCGLPNKFpKrsmVNz8yi9DU7Cff7zVt6 X-Received: by 2002:a0c:9a41:0:b0:68c:9b50:b839 with SMTP id q1-20020a0c9a41000000b0068c9b50b839mr145512qvd.61.1707508139067; Fri, 09 Feb 2024 11:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508139; cv=none; d=google.com; s=arc-20160816; b=FkT8kOQTKcovt3zbDtL11yS8wHZMr6R0slyFNwCMPFB95H1YAV7YBbwbU9bB2rC5+Q R2Nda2n7bKKYE52/3c2/XYQks/TQLwC92g43WM3gW8DhN25C60K4rmgxzNVAD8r7A3PK 9IEUDYm3TBii80SlSSAMYIxAQEkhHiAREmDJya0wueQ+G4hO92bvONjDSZ/ZYEVyOXyk uj11+TmSmWzATMKGO/XOPWHUfvrf4oRgPUUMeLlNSv98Nb6cjHyYAf+Vcmo0gTZtDVMn y6/XY6E/GRCxhZC21LLwCPbBy/ZShSOjijtVDOvtbyUREqurfEykVkhPtdZ0UMq2IMpw xKZA== 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=LHFkIMQcrdC3j/6Cul4tcisSWhVhPHeZYHnbMVO8ZNY=; fh=c2ErNGA/AAnatwEE6SM+9iNF+QIzx9afvhHC1JsY+zY=; b=ICXaugjX4JyYPwAXp48XFfmwjGpSCfjqb/AbTNMOze4dyGlF2aPQwRUoXksQLaqrFg jyk6XyROk9/vze6MD3AVgoy697695qvQIX2oAQFjkeHka3Y1hqpJxYI1t0k+t2vei2up 19aSHO2WEAGZYX8KRC881ctDSnxkoBqjKuuP1U8eipLXTBefdn2s8rlHz4L7DAOpKksP QnfVvWGjcqjngUUX/gUVwd/E+fn0iQnp3ovjO/44oRefFfBPYTLQjGTF7EJ+CYVvZy86 0YLfl4QSic9L62v9XXRIxuVF96n3OGL+igqtm9PbpSnwJARbCtSA/DQm5BDwMfvuaIUC Iirw==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cUVwwaub; 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 X-Forwarded-Encrypted: i=1; AJvYcCUUHnh54gUPHab6T9MMjENSMg/5LY7AWEOimaX0q6aH4AaO3Y/1ZoC2RMOTvD5LbnaU5bGrVt+Gg3QsrgxfE+VJ Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gs8-20020a056214226800b0068cc4d5271fsi2661184qvb.295.2024.02.09.11.48.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:48:59 -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=cUVwwaub; 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 1rYWrQ-0006Tn-I7; Fri, 09 Feb 2024 14:48:32 -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 1rYWqh-0005Xl-7O for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:47 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqf-0005Cd-Jv for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:47 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41059577f26so12395245e9.0 for ; Fri, 09 Feb 2024 11:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508063; x=1708112863; 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=LHFkIMQcrdC3j/6Cul4tcisSWhVhPHeZYHnbMVO8ZNY=; b=cUVwwaub8GiE4NXsW9p3yQjyk1JCjovwMigNno3XgInnr3/dPwF1x+z25qn/7Wh7El 8w1HtwM5ONoCqn8ZREsWrLwUxyOlhzfAjJW0CSELMd6zpJX/NhtHMcfvXgPHQJBk7D2B A0HYgHOmvmXZu/h7jbEve9/+7CtZVQxLOxdNSK/yy8PppUPdFvRvTqHPXEiySB/ofZyG 7DmW/od93+6XU5FSmfQnCaS+XWyB7P7VlkQ5mSDBEw0oBdH+SydwLam4R9q/jVIYDB9E ttmxl9xZ44zooUJd8UL19HpQdUzqpHH288QyUVenyLlEImKjGKxpHOcmg4iPWqCXi7iB zmRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508063; x=1708112863; 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=LHFkIMQcrdC3j/6Cul4tcisSWhVhPHeZYHnbMVO8ZNY=; b=Nv8/aX3y+x2fxmdsNIWLhJxyvMs3SoHiSJ+4GgEQVMSMNtWaldHfimFz1QgLJ8vIZw c+qUuaL2m3y5blvd0KR2C6TjNKCg56wO4DDL00AUS2+d6Qh1YhccDh6ViaUDzxklstqw YW8aBK/TyhqcPjd4auDjWPwaInJaFVcaQYQk6Qh0S0gKXHJHReKTnMlEkjruy//+oluq IrO2vA+X+9w35qQwze8F7rJCrvxq/UCGs1WIQFPCBOSRu/+YLVTYDhaP+Q5cA/qQXy7+ JgeAqZutql+JuSW65+x4KlvVBSMNvUCIJZum1oaUxtbj+hkoHZHo7J0/gA4+Xfzue/fg 8zTw== X-Gm-Message-State: AOJu0Yw5TPcVoa+vkWgpHqf7ecG7f6kpgE9HgBHwxdSKE5Muzxni3R/q APJoITCtD/LyfrevJ3ICTT914DkNuxYgw7HQtUZVW+5qooGAkQLzRwovNgPceh0= X-Received: by 2002:adf:b312:0:b0:33b:3774:ed0 with SMTP id j18-20020adfb312000000b0033b37740ed0mr28497wrd.2.1707508063437; Fri, 09 Feb 2024 11:47:43 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWC9N5Xl7IyApzeVR1Vlw3DDoCdLGELSz0IClmS1s/+8UulNKKFg6dstER+/cONtfC7vCyVkn7KT5EWuIu9mKY6R8HmAhkVKoc7Ye7yTRjsKtb1bBunF2kREw== Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y18-20020a1c4b12000000b00410723b14e4sm1468068wma.19.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5E6495F8AD; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 07/10] gdbstub: Allow specifying a reason in stop packets Date: Fri, 9 Feb 2024 19:47:31 +0000 Message-Id: <20240209194734.3424785-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.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-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich The upcoming syscall catchpoint support needs to send stop packets with an associated reason to GDB. Add an extra parameter to gdb_handlesig() for that, and rename it to gdb_handlesig_reason(). Provide a compatibility wrapper with an old name. Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-3-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-12-alex.bennee@linaro.org> diff --git a/include/gdbstub/user.h b/include/gdbstub/user.h index d392e510c59..1fc43e04af5 100644 --- a/include/gdbstub/user.h +++ b/include/gdbstub/user.h @@ -10,9 +10,10 @@ #define GDBSTUB_USER_H /** - * gdb_handlesig() - yield control to gdb + * gdb_handlesig_reason() - yield control to gdb * @cpu: CPU * @sig: if non-zero, the signal number which caused us to stop + * @reason: stop reason for stop reply packet or NULL * * This function yields control to gdb, when a user-mode-only target * needs to stop execution. If @sig is non-zero, then we will send a @@ -24,7 +25,18 @@ * or 0 if no signal should be delivered, ie the signal that caused * us to stop should be ignored. */ -int gdb_handlesig(CPUState *, int); +int gdb_handlesig_reason(CPUState *, int, const char *); + +/** + * gdb_handlesig() - yield control to gdb + * @cpu CPU + * @sig: if non-zero, the signal number which caused us to stop + * @see gdb_handlesig_reason() + */ +static inline int gdb_handlesig(CPUState *cpu, int sig) +{ + return gdb_handlesig_reason(cpu, sig, NULL); +} /** * gdb_signalled() - inform remote gdb of sig exit diff --git a/gdbstub/user.c b/gdbstub/user.c index dbe1d9b8875..63edca131ab 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -121,7 +121,7 @@ void gdb_qemu_exit(int code) exit(code); } -int gdb_handlesig(CPUState *cpu, int sig) +int gdb_handlesig_reason(CPUState *cpu, int sig, const char *reason) { char buf[256]; int n; @@ -141,6 +141,9 @@ int gdb_handlesig(CPUState *cpu, int sig) "T%02xthread:", gdb_target_signal_to_gdb(sig)); gdb_append_thread_id(cpu, gdbserver_state.str_buf); g_string_append_c(gdbserver_state.str_buf, ';'); + if (reason) { + g_string_append(gdbserver_state.str_buf, reason); + } gdb_put_strbuf(); gdbserver_state.allow_stop_reply = false; } From patchwork Fri Feb 9 19:47:32 2024 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: 771336 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036650wre; Fri, 9 Feb 2024 11:49:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRbk1dRywgGf4/nMgUxY8X0P1h9YDnIfMSSa5rBVXXjLoq85spcNYl6AltsKRjB/04fwf6 X-Received: by 2002:a05:620a:211c:b0:784:71a6:f8df with SMTP id l28-20020a05620a211c00b0078471a6f8dfmr70161qkl.44.1707508147498; Fri, 09 Feb 2024 11:49:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508147; cv=none; d=google.com; s=arc-20160816; b=NAnZxT7h86EE2jsi91MX3climr9tuKek9wlvt0/aQR3iVSIvEiOg4lnUwFyYX3nO8H FhEgvk+zXWwkHOqjKQTpiOl+boXZduBQUjWkcRnekKNMlk3VnCu1m49PTM8S0YkSiQO+ qCFioQzUXzk9xESc1DarwWimcsLoTrB78He0nnhSn5C3L+1ulYLCWOiJfukOfZguJlVP oIfLJEdAOPcHTTPGmJu1Eb+IwYnRFQsLlDpWBzzfoLrz9CXoifynUWOPgQS2xyQnO/0D FVTSRx99HEPQYv/pR0wi3p6VJcm+FRw5Vog0MShBgtR5P8ix7hFOWC0GrZoXsGfBAMSK Tt4A== 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=Wtk9GiV3W2xXFlYcJpJzbgDy4P/9SBqVnzDNRkRcVpY=; fh=dYN7x08IrTyS64rEMnxwAmlstbId7/8zyonUMdjaYUM=; b=xvl1TbAdBpA+l70kuf/yUY7+rfaQ0DxwLbKZbWyq7l8Q2+DRIxDuivU4wg6ASUSKIS heg9MJDbwLXQ+Et9OSe3khBpzq/5ZFZWB+AO4fbjorm1m4F3GxaFdaVaDFt5lYm4h7Mz hAPNGXz0/H5A6Puxr+18fxEYRMq/ZvnNBzD5bIjBdvkpBWj5Bp3ba21Da7wsaK8AKxDh iMYQN5qPqrgWqznpdwz2ZgnC00kMrsFIyfaaYlYbPWCU5qLlx1jkyGHrI7n7fnBzMdlg 2uPIpchul2WVsjY3u5msySn2hjgxAKt0rwXryt6Bm4wgNdOCm/vArqftLU7xnYbiQktf zYbg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ayRKH+ZY; 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 X-Forwarded-Encrypted: i=1; AJvYcCUPz77USW8HaG/vkyElGJRhDEhmbNiT+cyk6X/gaNa69tPX0bJOSgAQ+sUN3JfkOqyldvw4DqHNMlXTJEuYwik5 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s19-20020a05620a16b300b0078599afd89fsi147325qkj.164.2024.02.09.11.49.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:49:07 -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=ayRKH+ZY; 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 1rYWre-0006qp-Fh; Fri, 09 Feb 2024 14:48:46 -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 1rYWqi-0005Y7-GK for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:49 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqc-0005Bn-LJ for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:45 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40fd2f7ef55so14305385e9.0 for ; Fri, 09 Feb 2024 11:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508061; x=1708112861; 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=Wtk9GiV3W2xXFlYcJpJzbgDy4P/9SBqVnzDNRkRcVpY=; b=ayRKH+ZYMpOf+Q2W/eQr7tot9IviVxXXcO1gKOimc8oZq9sL98l5D5kSExgf7RMSxz uPfIQYqAY01Uk0o52ozJnHwI1xLdcieGJp28p96dhpxceTtyKNJfEK9V51Z7wxpOraEN G/jK9XgwAyF9l01FQZkR6p6FDkcjgQSRN2li7QiVOCwDmClg0dcu23hZc6dRRBT+5zIi 4oeYPG3LSGYcGlA81iezOwuZBCWVSvsDrEEFYV5E1jkMIKAIQHW8qmiws5t/3mKM9dyH 672uTiBQKnzR/hw2rRBaS/u0edgK+CMSO97tWUyoLQBoQQNQQqjeAVRd1S5IcwK5tjZ4 90+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508061; x=1708112861; 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=Wtk9GiV3W2xXFlYcJpJzbgDy4P/9SBqVnzDNRkRcVpY=; b=juUgfvsxtyG+BmoPelCuEUt74A4Jzady1yswM3VBhDUuAP10cQUY4uTjPwkHosfDf9 Zsu4F2deJEdFkqnmnvBSCsqKXSVum65tdbvzRKUwoMaQkI9f7JvJFn3d0crem4Ot+0hs hm3RJUQsThhhcM9AJB8yf9XMt8fgqmQYtduWzZVjbaYBYK+7jndDZ4kvHH66CTx84YBR v9FL1ecz06w6/X1YbC9Dm4XiEiEhSa+BsPydhoDQb9u+titp5sYTsoNA9/0qqkws+QeS yAdn3JA+rR8iHMfSicO4LIBddgxYIDqiX1wQXzGWt/v9aLgAoro+wGo2Qi6ZDAERLRLD VIVw== X-Gm-Message-State: AOJu0YxB6hRnEVnebXORRxWPwko6/w/rDGukqRLFcV5CaRwkYUAURcnH 1RWfLs2iZCkQHpmQAgQ6/NbF2AUpmyZJ807mAkBirq1HrFUlzFJNPiM3uTwCjYI= X-Received: by 2002:a5d:67cf:0:b0:33a:eb4b:c702 with SMTP id n15-20020a5d67cf000000b0033aeb4bc702mr1881597wrw.3.1707508061055; Fri, 09 Feb 2024 11:47:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV5oQwO/y1n7kDtfr4IPMQ/fwVunD2t7OHpvyurlz+5oPtWUULUQOVQikRRUXeW5j0P0j3WOAG4ypOw6tR8XHaVTWnVp8G24tDmXdKc4wWIAuRd9Ct+Fh4b4BJfHaldFq75mXQXPqaenCC4j/jb Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bq26-20020a5d5a1a000000b0033b4335dce5sm43840wrb.85.2024.02.09.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 755835F7D7; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Riku Voipio Subject: [PULL 08/10] gdbstub: Add syscall entry/return hooks Date: Fri, 9 Feb 2024 19:47:32 +0000 Message-Id: <20240209194734.3424785-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich The upcoming syscall catchpoint support needs to get control on syscall entry and return. Provide the necessary hooks for that, which are no-ops for now. Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-4-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-13-alex.bennee@linaro.org> diff --git a/include/gdbstub/user.h b/include/gdbstub/user.h index 1fc43e04af5..68b6534130c 100644 --- a/include/gdbstub/user.h +++ b/include/gdbstub/user.h @@ -51,5 +51,18 @@ void gdb_signalled(CPUArchState *as, int sig); */ void gdbserver_fork(CPUState *cs); +/** + * gdb_syscall_entry() - inform gdb of syscall entry and yield control to it + * @cs: CPU + * @num: syscall number + */ +void gdb_syscall_entry(CPUState *cs, int num); + +/** + * gdb_syscall_entry() - inform gdb of syscall return and yield control to it + * @cs: CPU + * @num: syscall number + */ +void gdb_syscall_return(CPUState *cs, int num); #endif /* GDBSTUB_USER_H */ diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 557f881a79b..b48b2b2d0ae 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -11,6 +11,7 @@ #define SYSCALL_TRACE_H #include "exec/user/abitypes.h" +#include "gdbstub/user.h" #include "qemu/plugin.h" #include "trace/trace-root.h" @@ -20,7 +21,7 @@ * could potentially unify the -strace code here as well. */ -static inline void record_syscall_start(void *cpu, int num, +static inline void record_syscall_start(CPUState *cpu, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6, @@ -29,11 +30,13 @@ static inline void record_syscall_start(void *cpu, int num, qemu_plugin_vcpu_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + gdb_syscall_entry(cpu, num); } -static inline void record_syscall_return(void *cpu, int num, abi_long ret) +static inline void record_syscall_return(CPUState *cpu, int num, abi_long ret) { qemu_plugin_vcpu_syscall_ret(cpu, num, ret); + gdb_syscall_return(cpu, num); } diff --git a/gdbstub/user.c b/gdbstub/user.c index 63edca131ab..2ba01c17faf 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -502,3 +502,11 @@ void gdb_syscall_handling(const char *syscall_packet) gdb_put_packet(syscall_packet); gdb_handlesig(gdbserver_state.c_cpu, 0); } + +void gdb_syscall_entry(CPUState *cs, int num) +{ +} + +void gdb_syscall_return(CPUState *cs, int num) +{ +} From patchwork Fri Feb 9 19:47:33 2024 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: 771338 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036685wre; Fri, 9 Feb 2024 11:49:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWuphjRdSvxC/Ej2rXOg8Q6yGH8yI1MqxyGa36D0FLDvx4DrSQv3d6txW0xy/VQQhwyKA8RNzJEyBJXbjgU67Wn X-Google-Smtp-Source: AGHT+IGXCiUzX3R4+ertNbtnzg0tDPMdzdTXzdg7tVbdCdmhTdhBRDsK3QUpqoBUZqmVAZiAmY0g X-Received: by 2002:a9d:7f14:0:b0:6dc:155b:49dc with SMTP id j20-20020a9d7f14000000b006dc155b49dcmr82990otq.12.1707508151543; Fri, 09 Feb 2024 11:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508151; cv=none; d=google.com; s=arc-20160816; b=GoFpZju0Ejx+Rh921MmZqsJk0p+aA7O8jSov35P8hef3EfVbQf72QwsLz1WJAaazQj JAmq/M3Ch91tkddRr1F4nkYbY1Pboswe32vfBr6a0TOwDWD2vXpcce12h8l+zMIMgKJh VfD9GMQF5Z6b0kXEwkAvG05A60BOpfu5bKp0cTpLuEDGBZHBFtbK7A3iACv7MKb/MwHQ BVIaiZychxFskQvHCho0NVx4tcAz+uaBQWInbCY8iKp2TpKSJks/ZjwVD59LvXGR/M4n OB+7atWPSR50QlaECvR6c0DxlNKd98DKMbBE44v8wajG2GPFfWBrk1Gw2V1me/ZZRg55 Vd9w== 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=Fspe01bX4KX8hKRjqhxvWfR3ZGNlHrXdv6yZvN6uP9U=; fh=R7dva3gNNX72u+nMZBgNy+AzwYRW0jmJRdOFJQZVGdI=; b=OCL5KH0F1C1ThlMQB/0UutLxFiNsG/tnz5cIEdK2kKg9hJAtryrP6pNc/N+s2pZaMW bHXZS0En+ns7qtPO5G0RnqyEwxjcGVOpWMhCjCrO1hM84xj2LvH7V8Vjc03+pwf8Ep8Z V0Bmn1m3j53ymUpffnCTKVW8RCxTsyCB4bgowWnoQJi0KURiY1k3JyjOHgq1jFU2gGbl 8V5vMHaJTB5x88Kun1GnFEqEukmt5dbumUXfZe+x3NABqHxGW4wImED+hWDQL7VpD1CR RFSbnp6jJQElL93PyesWomC06Dq2q26+QQ8/9zZy4/tz5vujwGOa9WoB4QS0eTkFC+tf b7UA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sHkbUqbA; 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 X-Forwarded-Encrypted: i=1; AJvYcCVYfLhAX9zqzqR2L6OVVrZ2euRNvSAjNGx5ekTKhP+YUGlcS6RxE+0yx+M1m2ZSew/qn9LJe/w6iqMsIZoz1W62 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m13-20020a05622a054d00b0042c2eac1cf6si2559622qtx.720.2024.02.09.11.49.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:49:11 -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=sHkbUqbA; 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 1rYWrH-0006Er-NQ; Fri, 09 Feb 2024 14:48:25 -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 1rYWqf-0005WY-1P for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:45 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqc-0005Bt-Pu for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:44 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3392b045e0aso703883f8f.2 for ; Fri, 09 Feb 2024 11:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508061; x=1708112861; 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=Fspe01bX4KX8hKRjqhxvWfR3ZGNlHrXdv6yZvN6uP9U=; b=sHkbUqbAFOKAQk+xxgir4LXkbp/BHkRBfdnTYY0gmMOnpL4AVu6gNtdeDH1SAYSUhj gEL++t2GbMos8YUR6p58sHL6HWA9MVVtPlctKkuSNwBx7pmi+QbxXq2Z6U9xDwmjBeSv 9rNyuekcAWIIlUxnoSYxpMI4BaLzDlPAcpvDApAINKicziQNIBTWx9nmUJpuo/Rwu0Uu BC3H6zT7vuBxHzc43c2X1tMG08F9UtzuICv8tMuWtuNb40LbkvuNRalkwQuV9+jT7dC/ wL6g7vYgBxBTV95J1SPdyb1Ja5dPNKgPig1grG+TaANcnIdZak37U9N40zCeFQUwmJ84 ZYdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508061; x=1708112861; 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=Fspe01bX4KX8hKRjqhxvWfR3ZGNlHrXdv6yZvN6uP9U=; b=U/iI0MzMglxgU2nta3mzl7O1pY6vAM16PoqcUSfljJk8deHUaEm7SksovbeRvSV+fg 1OVQ7isjSIRA/NpzuZbJuOKq/8SQF5COrp0iWE5357eppB/XFO7AN9aho1W7boZUdMR3 2kK29HnpM5vEP1DtqtemLAoiMbLlBf5wbHiguf24XsHpobqEdiwg8qTUgw/blVK4n0OK ZHr2f0K4g377EAAR5+4eJ4Enhoz376Bwz5Gt7K8X2NNSUv1q2qX4DEQEyJdCN7ccG4JK 7yThMyQwJyLYlLTrtgaE/kT/p50JEnVWrMhFrcoG/hrKCNKNzSzH+WBy/NQDGZRqrmrU tssA== X-Gm-Message-State: AOJu0YwyvXOVQODojLfJaND3v635xZiLtUYzCK711wwL71Sy0SdEjHas UsRHl48x1c363ZuutJaGzccHMX+ZmWgR36P3B1yA26k6OuEUmv+Zz8DOQbFeNfg= X-Received: by 2002:a5d:664d:0:b0:33b:649a:19f6 with SMTP id f13-20020a5d664d000000b0033b649a19f6mr8397wrw.35.1707508061471; Fri, 09 Feb 2024 11:47:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWmHZqaGAZO4uWzETZYAhM/YftpreNJ+82Ub/10ojXK9H/kKBD6m4VtlEfaI4CJ+9k6XiSO+D8ggz0smfe2USgGQvPLS1qBzZUSY4SmAkrPf1Hsx0RaMLL3Uw== Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m10-20020adff38a000000b0033b0d2ba3a1sm50386wro.63.2024.02.09.11.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8E0255F8E1; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 09/10] gdbstub: Implement catching syscalls Date: Fri, 9 Feb 2024 19:47:33 +0000 Message-Id: <20240209194734.3424785-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich GDB supports stopping on syscall entry and exit using the "catch syscall" command. It relies on 3 packets, which are currently not supported by QEMU: * qSupported:QCatchSyscalls+ [1] * QCatchSyscalls: [2] * T05syscall_entry: and T05syscall_return: [3] Implement generation and handling of these packets. [1] https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html#qSupported [2] https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html#QCatchSyscalls [3] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Stop-Reply-Packets.html Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-5-iii@linux.ibm.com> [AJB: GString -> g_strdup_printf] Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-14-alex.bennee@linaro.org> diff --git a/gdbstub/internals.h b/gdbstub/internals.h index aeb0d9b5377..56b7c13b750 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -195,6 +195,7 @@ void gdb_handle_v_file_close(GArray *params, void *user_ctx); /* user */ void gdb_handle_v_file_pread(GArray *params, void *user_ctx); /* user */ void gdb_handle_v_file_readlink(GArray *params, void *user_ctx); /* user */ void gdb_handle_query_xfer_exec_file(GArray *params, void *user_ctx); /* user */ +void gdb_handle_set_catch_syscalls(GArray *params, void *user_ctx); /* user */ void gdb_handle_query_attached(GArray *params, void *user_ctx); /* both */ diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 46d752bbc2c..7e73e916bdc 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -1617,6 +1617,7 @@ static void handle_query_supported(GArray *params, void *user_ctx) if (gdbserver_state.c_cpu->opaque) { g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+"); } + g_string_append(gdbserver_state.str_buf, ";QCatchSyscalls+"); #endif g_string_append(gdbserver_state.str_buf, ";qXfer:exec-file:read+"); #endif @@ -1810,6 +1811,14 @@ static const GdbCmdParseEntry gdb_gen_set_table[] = { .schema = "l0" }, #endif +#if defined(CONFIG_USER_ONLY) + { + .handler = gdb_handle_set_catch_syscalls, + .cmd = "CatchSyscalls:", + .cmd_startswith = 1, + .schema = "s0", + }, +#endif }; static void handle_gen_query(GArray *params, void *user_ctx) diff --git a/gdbstub/user.c b/gdbstub/user.c index 2ba01c17faf..14918d1a217 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/bitops.h" #include "qemu/cutils.h" #include "qemu/sockets.h" #include "exec/hwaddr.h" @@ -21,11 +22,20 @@ #include "trace.h" #include "internals.h" +#define GDB_NR_SYSCALLS 1024 +typedef unsigned long GDBSyscallsMask[BITS_TO_LONGS(GDB_NR_SYSCALLS)]; + /* User-mode specific state */ typedef struct { int fd; char *socket_path; int running_state; + /* + * Store syscalls mask without memory allocation in order to avoid + * implementing synchronization. + */ + bool catch_all_syscalls; + GDBSyscallsMask catch_syscalls_mask; } GDBUserState; static GDBUserState gdbserver_user_state; @@ -503,10 +513,91 @@ void gdb_syscall_handling(const char *syscall_packet) gdb_handlesig(gdbserver_state.c_cpu, 0); } +static bool should_catch_syscall(int num) +{ + if (gdbserver_user_state.catch_all_syscalls) { + return true; + } + if (num < 0 || num >= GDB_NR_SYSCALLS) { + return false; + } + return test_bit(num, gdbserver_user_state.catch_syscalls_mask); +} + void gdb_syscall_entry(CPUState *cs, int num) { + if (should_catch_syscall(num)) { + g_autofree char *reason = g_strdup_printf("syscall_entry:%x;", num); + gdb_handlesig_reason(cs, gdb_target_sigtrap(), reason); + } } void gdb_syscall_return(CPUState *cs, int num) { + if (should_catch_syscall(num)) { + g_autofree char *reason = g_strdup_printf("syscall_return:%x;", num); + gdb_handlesig_reason(cs, gdb_target_sigtrap(), reason); + } +} + +void gdb_handle_set_catch_syscalls(GArray *params, void *user_ctx) +{ + const char *param = get_param(params, 0)->data; + GDBSyscallsMask catch_syscalls_mask; + bool catch_all_syscalls; + unsigned int num; + const char *p; + + /* "0" means not catching any syscalls. */ + if (strcmp(param, "0") == 0) { + gdbserver_user_state.catch_all_syscalls = false; + memset(gdbserver_user_state.catch_syscalls_mask, 0, + sizeof(gdbserver_user_state.catch_syscalls_mask)); + gdb_put_packet("OK"); + return; + } + + /* "1" means catching all syscalls. */ + if (strcmp(param, "1") == 0) { + gdbserver_user_state.catch_all_syscalls = true; + gdb_put_packet("OK"); + return; + } + + /* + * "1;..." means catching only the specified syscalls. + * The syscall list must not be empty. + */ + if (param[0] == '1' && param[1] == ';') { + catch_all_syscalls = false; + memset(catch_syscalls_mask, 0, sizeof(catch_syscalls_mask)); + for (p = ¶m[2];; p++) { + if (qemu_strtoui(p, &p, 16, &num) || (*p && *p != ';')) { + goto err; + } + if (num >= GDB_NR_SYSCALLS) { + /* + * Fall back to reporting all syscalls. Reporting extra + * syscalls is inefficient, but the spec explicitly allows it. + * Keep parsing in case there is a syntax error ahead. + */ + catch_all_syscalls = true; + } else { + set_bit(num, catch_syscalls_mask); + } + if (!*p) { + break; + } + } + gdbserver_user_state.catch_all_syscalls = catch_all_syscalls; + if (!catch_all_syscalls) { + memcpy(gdbserver_user_state.catch_syscalls_mask, + catch_syscalls_mask, sizeof(catch_syscalls_mask)); + } + gdb_put_packet("OK"); + return; + } + +err: + gdb_put_packet("E00"); } From patchwork Fri Feb 9 19:47:34 2024 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: 771337 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp1036674wre; Fri, 9 Feb 2024 11:49:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXsB/w0rb9mEVmV/Sr8g9YcV7J65vuy/cFW+3JTuR7ZZk/p+kcG9oYnYinoBmGxWv+ueIsClrDXImK7/Z9VqU0Q X-Google-Smtp-Source: AGHT+IHZwYiBdEBZz9fYqjdAJIM7FgtWEeY+YMCqYOvjEG8qg8R4OVrMzpkNdWIu5CZw6XbJ9dQe X-Received: by 2002:a05:620a:39d:b0:785:be68:f991 with SMTP id q29-20020a05620a039d00b00785be68f991mr125893qkm.2.1707508151404; Fri, 09 Feb 2024 11:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707508151; cv=none; d=google.com; s=arc-20160816; b=VeXS58VBtOp/ds19wQPyxgIiIWb+gfPeA0WIafloL9ISC8PTqTx91zQjZul3Euhhh3 C3YQK3B25l9R0OpxiGspTlGF/atMj1Ff8Wy7MbtZV+MxcV9KTkoHWam1+XuATUgehKfh Ap6PTTmSw5qXq5EoVm1mjWhs1aWl5koW4aKDWrf+DH0X9z+L98cnOJVPJRNLhwj4jdRp 21SRS1S8MVoDT+E9MVAnM+X+bAHwJ6hK/VUUpWMcE3rNLaittcgJKGkeNQi8CEL3yPGb RSRzc4GmbpkKi3DqsZxh9tug3twIzd5Wo5Fx9gDdimoaiR5tVbNjy9jc+Z8MJ+AYDGB1 L9Kg== 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=0d2pZ0e5UPseU4WURy0h/XaynSRo4oQrGrKaJsFP1mk=; fh=8NQIUPTerK6UO6HnqnwoQQObssqkjQeOBpMInMJQlYQ=; b=EB4vtW3+Cgg7klVpeeVNAOqzqDOx5fsME3VDYzPRHx3uFMV16dIiNXLr8kDBFTu9am fiTwku/DwHAC5MuawEfLYJa9pXuJP6Z86F4G1bEEVEbQBaYRedAKN9DRdecbJvDPKK9c lP/bdmoFvnm8S+VisnEfOyfINSHqSPsXoQ/ApCqBns2uO65uv296QRWpUIYAF+gtgTCX lRC1UNndXPOlPjxIUa2qteznGoH2ESW5aXQowhWMGOIK9SOWaKg2ad3Z2NKTAGvlxZvS c4Ofruw395ksnjB/1maKlfbxw/v3lPGphSJAKIT6go+txoft2SLXRJ2nQ2jVsXeB2t0i E+WQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D04MeVw6; 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 X-Forwarded-Encrypted: i=1; AJvYcCX2B59zSAqlEoyqQH99RnYH+jMRKhzhQ+gMtS/TZF+uHkabTBDbk894iWfL6F8BYSnuznD5C7lCjAOVCdSpCBxq Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id vy15-20020a05620a490f00b0078591341b5asi127792qkn.556.2024.02.09.11.49.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 11:49:11 -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=D04MeVw6; 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 1rYWrG-0006CD-7k; Fri, 09 Feb 2024 14:48:22 -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 1rYWqg-0005XN-4U for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:46 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWqd-0005Bs-CN for qemu-devel@nongnu.org; Fri, 09 Feb 2024 14:47:45 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5114cd44f6aso1727827e87.1 for ; Fri, 09 Feb 2024 11:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707508061; x=1708112861; 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=0d2pZ0e5UPseU4WURy0h/XaynSRo4oQrGrKaJsFP1mk=; b=D04MeVw6XDM2wuEcccS4EWl4dfDc2uL0JAho5nfkoK1E6wkaTHWI7YYnaId0JfBfs9 ieCwt8xZnhKROJZHL/TF9zG9IyRqsES+odLEhlH2kjJrIf3Um5CmG3Vsl3ezUgVVAloo 9WaUR/GjzWIyuV1viOGyat3aNMPSvJ7cOBaj/okNROEwLBlu0AEl2vUE+ouGiNluhAl1 9VWb98LzIutt4sV99bWgtqbvH523ne1P2jxRa+JM83/JA1+TlQYymLBhpqqZukogU8lh Ij2Kq6HPrP6nVelIIJSqcXlc3WA6MO1s1I0vrk2Qj0LoymvV2qOCgP61NfNEtSR6v/7t F7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707508061; x=1708112861; 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=0d2pZ0e5UPseU4WURy0h/XaynSRo4oQrGrKaJsFP1mk=; b=MU+B98y45T09ZtCJzlftC1oEzVKzj9YJOpyJLvOt1qFYXjY0AixJ9xAJA9hFlTk++D iZ+sRkmVm6NKVHbkwi3NYfq+p/6MHdYMHmDQkZwA2+A3MszXGgao+wLu+1oK0b5JkQ8/ MDYgusRC4owI7wMIkmQAHk1Z7nzA+C8WevQ5glkR+S5MeK0jekdsj+XyU0U4JPS1iWhD xb/AP1J5T/JfLzqMwg0o3QNYqvVcraTALY6D9LAXN3dZETKkSBDUqZ65YhxQ9ocpMX2U uknded/Vz7/++h05QEwHPmbQcZBOea4IJmwiQvLf2M8mK2ghUW3CNoWJfkaABLjOqWQz Pd7Q== X-Gm-Message-State: AOJu0YxN1CUGLN3ulOweNXNXNn2RSHYODeCzplN0GGXSwH8wLgk73l0w XN/skRxgqWE176h+DABV54TDBiShlW3WwBK5DFUoxPrWsK+8Ql9YBYssFpEsGdE= X-Received: by 2002:ac2:46c9:0:b0:511:7a9f:58c4 with SMTP id p9-20020ac246c9000000b005117a9f58c4mr13997lfo.38.1707508061303; Fri, 09 Feb 2024 11:47:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV+GudEapOEZ8vtHIuZXPTnXLEBWebpO7XOzUgL8Vqawfr9vXcTZobC9GsRAPt6F8h31WrkA2MEJggGgMxf8k3oBpm3nKQghWIUpSSC8SS1EHgiQohmKViknw== Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bv4-20020a0560001f0400b0033b670b0a6asm43626wrb.74.2024.02.09.11.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:47:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A40AC5F7DF; Fri, 9 Feb 2024 19:47:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 10/10] tests/tcg: Add the syscall catchpoint gdbstub test Date: Fri, 9 Feb 2024 19:47:34 +0000 Message-Id: <20240209194734.3424785-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209194734.3424785-1-alex.bennee@linaro.org> References: <20240209194734.3424785-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x135.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-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich Check that adding/removing syscall catchpoints works. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-6-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-15-alex.bennee@linaro.org> diff --git a/tests/tcg/multiarch/catch-syscalls.c b/tests/tcg/multiarch/catch-syscalls.c new file mode 100644 index 00000000000..d1ff1936a7a --- /dev/null +++ b/tests/tcg/multiarch/catch-syscalls.c @@ -0,0 +1,51 @@ +/* + * Test GDB syscall catchpoints. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#define _GNU_SOURCE +#include +#include + +const char *catch_syscalls_state = "start"; + +void end_of_main(void) +{ +} + +int main(void) +{ + int ret = EXIT_FAILURE; + char c0 = 'A', c1; + int fd[2]; + + catch_syscalls_state = "pipe2"; + if (pipe2(fd, 0)) { + goto out; + } + + catch_syscalls_state = "write"; + if (write(fd[1], &c0, sizeof(c0)) != sizeof(c0)) { + goto out_close; + } + + catch_syscalls_state = "read"; + if (read(fd[0], &c1, sizeof(c1)) != sizeof(c1)) { + goto out_close; + } + + catch_syscalls_state = "check"; + if (c0 == c1) { + ret = EXIT_SUCCESS; + } + +out_close: + catch_syscalls_state = "close"; + close(fd[0]); + close(fd[1]); + +out: + catch_syscalls_state = "end"; + end_of_main(); + return ret; +} diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index 315a2e13588..e10951a8016 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -108,13 +108,21 @@ run-gdbstub-prot-none: prot-none --bin $< --test $(MULTIARCH_SRC)/gdbstub/prot-none.py, \ accessing PROT_NONE memory) +run-gdbstub-catch-syscalls: catch-syscalls + $(call run-test, $@, $(GDB_SCRIPT) \ + --gdb $(GDB) \ + --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ + --bin $< --test $(MULTIARCH_SRC)/gdbstub/catch-syscalls.py, \ + hitting a syscall catchpoint) + else run-gdbstub-%: $(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support") endif EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \ run-gdbstub-proc-mappings run-gdbstub-thread-breakpoint \ - run-gdbstub-registers run-gdbstub-prot-none + run-gdbstub-registers run-gdbstub-prot-none \ + run-gdbstub-catch-syscalls # ARM Compatible Semi Hosting Tests # diff --git a/tests/tcg/multiarch/gdbstub/catch-syscalls.py b/tests/tcg/multiarch/gdbstub/catch-syscalls.py new file mode 100644 index 00000000000..ccce35902fb --- /dev/null +++ b/tests/tcg/multiarch/gdbstub/catch-syscalls.py @@ -0,0 +1,53 @@ +"""Test GDB syscall catchpoints. + +SPDX-License-Identifier: GPL-2.0-or-later +""" +from test_gdbstub import main, report + + +def check_state(expected): + """Check the catch_syscalls_state value""" + actual = gdb.parse_and_eval("catch_syscalls_state").string() + report(actual == expected, "{} == {}".format(actual, expected)) + + +def run_test(): + """Run through the tests one by one""" + gdb.Breakpoint("main") + gdb.execute("continue") + + # Check that GDB stops for pipe2/read calls/returns, but not for write. + gdb.execute("delete") + try: + gdb.execute("catch syscall pipe2 read") + except gdb.error as exc: + exc_str = str(exc) + if "not supported on this architecture" in exc_str: + print("SKIP: {}".format(exc_str)) + return + raise + for _ in range(2): + gdb.execute("continue") + check_state("pipe2") + for _ in range(2): + gdb.execute("continue") + check_state("read") + + # Check that deletion works. + gdb.execute("delete") + gdb.Breakpoint("end_of_main") + gdb.execute("continue") + check_state("end") + + # Check that catch-all works (libc should at least call exit). + gdb.execute("delete") + gdb.execute("catch syscall") + gdb.execute("continue") + gdb.execute("delete") + gdb.execute("continue") + + exitcode = int(gdb.parse_and_eval("$_exitcode")) + report(exitcode == 0, "{} == 0".format(exitcode)) + + +main(run_test)