From nobody Fri May 17 04:49:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1690280786; cv=none; d=zohomail.com; s=zohoarc; b=GbU3vHjTaTkPnKs0MgMRTOtycvI8BO6bTbQYgPRnuHMNc96l80PKTAg+WW9+sN+PFj3feGav1nGKWhVBDJlAWSFM4bqU4Qys3QHrdjTa6N2GykIF7wgTGvArWNgH+ImItqdb0lCqwDS0vwB81NwA8bqPfxoUds0jMi9gy0RvTSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690280786; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1Jm/TnD4O7VFYNm2su9Cb/vD/nMW66SkothMb1GxbsM=; b=JNnC70rSX0U35cl45CkQFRswms0GoGC5nrSgjB94zCjxUstH+W+4EM+GmX/krVIwcNnaggiqY5QhYyZjg+cFIswqiQ6ZTiCnds6zLIHBMgugd06jyp2f+k/iTAIXYOoAok//Z+dE32Y7kh+g4RNcagnfPZUDbeW2AdM3N4AgQO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690280786566177.08483069897363; Tue, 25 Jul 2023 03:26:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOFEW-0000RF-3J; Tue, 25 Jul 2023 06:25:36 -0400 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 1qOFE6-0000Ge-UO for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:11 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOFE4-0007V3-MI for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:10 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fdfefdf5abso1234618e87.1 for ; Tue, 25 Jul 2023 03:25:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u19-20020a05600c211300b003fbc30825fbsm12567185wml.39.2023.07.25.03.25.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 03:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690280705; x=1690885505; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1Jm/TnD4O7VFYNm2su9Cb/vD/nMW66SkothMb1GxbsM=; b=VWSJ3nR/xVwi9T59lWXCEp41Dpkk8vZ6zqhcsrryL5CEoLRPcpAG2Hk7BoqLjRAaXI o2QdrLn3E0CqcSvi0mggkLMGMlUb10s8NTzZko/DX20imaVDGOiY3Wtl/YDpw+u8nrpl ZEW/VXuGJ/ZNHZFtlZ5NRjnDPWFpV2ZhiHscMUAuyW0dxUq0+hE/uo6mtQ9q4efkMjgA 6mQBubu2y896guVPy0XfeGFw6Wxi6sJ8Ap8w5Wv26wwoFVfEUSycZ7suBpksWQO7mcXl NKsPiXLLY217TJN2SH3xunDMwRxqzkb3KgvEE/qqGWn3XJLcJVT8l28afR8CWB0rSwsO cwfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690280705; x=1690885505; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Jm/TnD4O7VFYNm2su9Cb/vD/nMW66SkothMb1GxbsM=; b=E0FybhT8YjKUY12OC0D0h/1rwQoz/eQMn9oaq6jshf67ulY+eVtu+XPqFVgCLCSGIT AQELuP6b9T9rnZCKMx2DDsMOtROHRu3sB6UGE1JeJrwSRZf1CX2shofKsGvZCH4VSyAV KbYhzmRIbZcYMVq9EpovgEvuNCL4zBoRYqWXDxRsZV3sWP16/gQRY5tMtffis1LHzJxQ Ylp6hW5shtYcw7m2RoaGb4XKwt1XaiS5CSq2Q2Ll6/fKRnNSuYehtHOjZ/hJE8IAs7Rs pOt88pjZzEnb36E8aY5HPASL8/DPQ8vHlh1e4inumFR5wSk7ALdBtaww8jlX2oKUw/07 1U6w== X-Gm-Message-State: ABy/qLYkEVjt00waPTakWjAtYyfwpXsE4I2vLPDb99zN4XqmkWcilp4k shyK3bRz3Mx+72gsdEu4zdFyKvLc3hBrRg++Zw8= X-Google-Smtp-Source: APBJJlHoeXQREd0vC9uVBiJWgpIaO/nz05o/LfRpCT+BS3KHMxRhKexiDNLezkT3fK6Z0PcPZEsOtA== X-Received: by 2002:ac2:5e7b:0:b0:4f9:5711:2eb8 with SMTP id a27-20020ac25e7b000000b004f957112eb8mr6364981lfr.33.1690280705568; Tue, 25 Jul 2023 03:25:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/5] hw/arm/smmu: Handle big-endian hosts correctly Date: Tue, 25 Jul 2023 11:24:59 +0100 Message-Id: <20230725102503.2283907-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725102503.2283907-1-peter.maydell@linaro.org> References: <20230725102503.2283907-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x131.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1690280788560100003 The implementation of the SMMUv3 has multiple places where it reads a data structure from the guest and directly operates on it without doing a guest-to-host endianness conversion. Since all SMMU data structures are little-endian, this means that the SMMU doesn't work on a big-endian host. In particular, this causes the Avocado test machine_aarch64_virt.py:Aarch64VirtMachine.test_alpine_virt_tcg_gic_max to fail on an s390x host. Add appropriate byte-swapping on reads and writes of guest in-memory data structures so that the device works correctly on big-endian hosts. As part of this we constrain queue_read() to operate only on Cmd structs and queue_write() on Evt structs, because in practice these are the only data structures the two functions are used with, and we need to know what the data structure is to be able to byte-swap its parts correctly. Signed-off-by: Peter Maydell Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Message-id: 20230717132641.764660-1-peter.maydell@linaro.org Cc: qemu-stable@nongnu.org --- hw/arm/smmu-common.c | 3 +-- hw/arm/smmuv3.c | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 5ab9d45d58a..f35ae9aa22c 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -216,8 +216,7 @@ static int get_pte(dma_addr_t baseaddr, uint32_t index,= uint64_t *pte, dma_addr_t addr =3D baseaddr + index * sizeof(*pte); =20 /* TODO: guarantee 64-bit single-copy atomicity */ - ret =3D dma_memory_read(&address_space_memory, addr, pte, sizeof(*pte), - MEMTXATTRS_UNSPECIFIED); + ret =3D ldq_le_dma(&address_space_memory, addr, pte, MEMTXATTRS_UNSPEC= IFIED); =20 if (ret !=3D MEMTX_OK) { info->type =3D SMMU_PTW_ERR_WALK_EABT; diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 932f0096974..1e9be8e89af 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -102,20 +102,34 @@ static void smmuv3_write_gerrorn(SMMUv3State *s, uint= 32_t new_gerrorn) trace_smmuv3_write_gerrorn(toggled & pending, s->gerrorn); } =20 -static inline MemTxResult queue_read(SMMUQueue *q, void *data) +static inline MemTxResult queue_read(SMMUQueue *q, Cmd *cmd) { dma_addr_t addr =3D Q_CONS_ENTRY(q); + MemTxResult ret; + int i; =20 - return dma_memory_read(&address_space_memory, addr, data, q->entry_siz= e, - MEMTXATTRS_UNSPECIFIED); + ret =3D dma_memory_read(&address_space_memory, addr, cmd, sizeof(Cmd), + MEMTXATTRS_UNSPECIFIED); + if (ret !=3D MEMTX_OK) { + return ret; + } + for (i =3D 0; i < ARRAY_SIZE(cmd->word); i++) { + le32_to_cpus(&cmd->word[i]); + } + return ret; } =20 -static MemTxResult queue_write(SMMUQueue *q, void *data) +static MemTxResult queue_write(SMMUQueue *q, Evt *evt_in) { dma_addr_t addr =3D Q_PROD_ENTRY(q); MemTxResult ret; + Evt evt =3D *evt_in; + int i; =20 - ret =3D dma_memory_write(&address_space_memory, addr, data, q->entry_s= ize, + for (i =3D 0; i < ARRAY_SIZE(evt.word); i++) { + cpu_to_le32s(&evt.word[i]); + } + ret =3D dma_memory_write(&address_space_memory, addr, &evt, sizeof(Evt= ), MEMTXATTRS_UNSPECIFIED); if (ret !=3D MEMTX_OK) { return ret; @@ -298,7 +312,7 @@ static void smmuv3_init_regs(SMMUv3State *s) static int smmu_get_ste(SMMUv3State *s, dma_addr_t addr, STE *buf, SMMUEventInfo *event) { - int ret; + int ret, i; =20 trace_smmuv3_get_ste(addr); /* TODO: guarantee 64-bit single-copy atomicity */ @@ -311,6 +325,9 @@ static int smmu_get_ste(SMMUv3State *s, dma_addr_t addr= , STE *buf, event->u.f_ste_fetch.addr =3D addr; return -EINVAL; } + for (i =3D 0; i < ARRAY_SIZE(buf->word); i++) { + le32_to_cpus(&buf->word[i]); + } return 0; =20 } @@ -320,7 +337,7 @@ static int smmu_get_cd(SMMUv3State *s, STE *ste, uint32= _t ssid, CD *buf, SMMUEventInfo *event) { dma_addr_t addr =3D STE_CTXPTR(ste); - int ret; + int ret, i; =20 trace_smmuv3_get_cd(addr); /* TODO: guarantee 64-bit single-copy atomicity */ @@ -333,6 +350,9 @@ static int smmu_get_cd(SMMUv3State *s, STE *ste, uint32= _t ssid, event->u.f_ste_fetch.addr =3D addr; return -EINVAL; } + for (i =3D 0; i < ARRAY_SIZE(buf->word); i++) { + le32_to_cpus(&buf->word[i]); + } return 0; } =20 @@ -569,7 +589,7 @@ static int smmu_find_ste(SMMUv3State *s, uint32_t sid, = STE *ste, return -EINVAL; } if (s->features & SMMU_FEATURE_2LVL_STE) { - int l1_ste_offset, l2_ste_offset, max_l2_ste, span; + int l1_ste_offset, l2_ste_offset, max_l2_ste, span, i; dma_addr_t l1ptr, l2ptr; STEDesc l1std; =20 @@ -593,6 +613,9 @@ static int smmu_find_ste(SMMUv3State *s, uint32_t sid, = STE *ste, event->u.f_ste_fetch.addr =3D l1ptr; return -EINVAL; } + for (i =3D 0; i < ARRAY_SIZE(l1std.word); i++) { + le32_to_cpus(&l1std.word[i]); + } =20 span =3D L1STD_SPAN(&l1std); =20 --=20 2.34.1 From nobody Fri May 17 04:49:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1690280743; cv=none; d=zohomail.com; s=zohoarc; b=ZihoLgLlYU424p5qZS6Rltvwg9ntQ5m3QF4cw461fzkzqrn9LwGxYn9+yNJ0ErCawXm5plfrNf2qO2c3ImkOJFm09oU4bwKOUQdghUlUegGu5tUI4g7j81wz+4RCzDuOVVaogrJ5S17IkRnO2tZ7uM3iWbG+LWvy3DCN4zAkAzc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690280743; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=41mRUnFQ63Ww9Yf+9V896kHykCP+IOApwo6ThctCswg=; b=mZB6iLlRAlCvEZFiiqUhQ/dtPV1XG1kbICs59Xdqs1aPGPQQxiLLZ1DGgnDTWcCm5w1xhhM2ixuzTxW9n4wht8Qiw0Tkmq3+K6nP4Wcr8Rd+vYtnElgy+uWC9Q9wL5qKp3VD8rEGkiO9wOWjJPmsfRjcYuEFMJiu/y/xIEePQhI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690280743752477.23603048854943; Tue, 25 Jul 2023 03:25:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOFEN-0000KD-98; Tue, 25 Jul 2023 06:25:29 -0400 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 1qOFE5-0000Gc-ML for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:11 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOFE3-0007VC-Fw for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:09 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fb4146e8deso53871935e9.0 for ; Tue, 25 Jul 2023 03:25:06 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u19-20020a05600c211300b003fbc30825fbsm12567185wml.39.2023.07.25.03.25.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 03:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690280706; x=1690885506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=41mRUnFQ63Ww9Yf+9V896kHykCP+IOApwo6ThctCswg=; b=KcgvwJwJxFBsRZs3JzMUJP6BI9LNwdYnMiL/ogUeqirQH8im3pWDE5HA4BWBgeGJ2y q3MzNn1gMxx0XyUBiixhgcSiVQ3KLAT/Qw1R6GWbIMppjtJrI1GPkd1yaGR9A90HrJFA lPo7DxZEW+7yu0sKNt1BYoDatzuHUXYBJslHAP1uwtCE+yDtVJ5YGp7hyUwrKdDzjd+X JqmzrHtGBucgRSUBOBPFS0BID8tdrq7VZtrG+pyj4qeGoKEGck7JIhxaQR3aY+lmPx3i NC1Gk4/T9pAsjk2qfVrPRblJ2d4snEsFJVSDHlfBFP1lve+lMmgyA3Ld56aDAY2Tmspx kDow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690280706; x=1690885506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=41mRUnFQ63Ww9Yf+9V896kHykCP+IOApwo6ThctCswg=; b=PCHTJGRH7G8c0VQfx08eDTRZf4+mndEynqLKlddejBlmckM1hjC643GQ9I63pHSdG+ VOUX5/Dpi8i4ulRVB3X9CnDoYL/OKaxMXs439HGaXrDhFrA4HT3lSE+L2s+n1AbmrjHt PEcmKzbXxqV3Yyv0upqKD6Dui1gbT4ymH+HAZT6HTfIjO+G+TMj7C5Dz4DZqJ8Ag4CID Sx9qMrSaoc9+p83Jv4GJPQL3CkMndIp2ivU2NirRWCs7SFr36VKusI8E1j/mtVRdpxqV anV6GkR3O/76j8DgzEoi0a1F16P+A1yAlaN5pgz/jKZ/uk+rZoqJiJsq3XqWokdDElyE Cc7w== X-Gm-Message-State: ABy/qLYk+YeTPvC0b8s8Iyido3Sg0jiAVGw5gxwBEq9WHdCrAsJTUauM dZW8PAFJKP2VEPMo3VWll894kpWtWqlb6XFuaDU= X-Google-Smtp-Source: APBJJlG3pHS5QdDZXVF9VV8+RHghde6bddXH/eXtDBOka6ePAp3jw1IcTTm1TYfcanw2ylTesJQvAg== X-Received: by 2002:a7b:cd1a:0:b0:3fd:4880:2aa5 with SMTP id f26-20020a7bcd1a000000b003fd48802aa5mr5986334wmj.28.1690280706044; Tue, 25 Jul 2023 03:25:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 2/5] scripts/git-submodule.sh: Don't rely on non-POSIX 'read' behaviour Date: Tue, 25 Jul 2023 11:25:00 +0100 Message-Id: <20230725102503.2283907-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725102503.2283907-1-peter.maydell@linaro.org> References: <20230725102503.2283907-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1690280744436100001 The POSIX definition of the 'read' utility requires that you specify the variable name to set; omitting the name and having it default to 'REPLY' is a bashism. If your system sh is dash, then it will print an error message during build: qemu/pc-bios/s390-ccw/../../scripts/git-submodule.sh: 106: read: arg count Specify the variable name explicitly. Fixes: fdb8fd8cb915647b ("git-submodule: allow partial update of .git-submo= dule-status") Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20230720153038.1587196-1-peter.maydell@linaro.org --- scripts/git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh index 335f7f5fdf8..bb1222c7727 100755 --- a/scripts/git-submodule.sh +++ b/scripts/git-submodule.sh @@ -103,7 +103,7 @@ update) check_updated $module || echo Updated "$module" done =20 - (while read -r; do + (while read -r REPLY; do for module in $modules; do case $REPLY in *" $module "*) continue 2 ;; --=20 2.34.1 From nobody Fri May 17 04:49:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1690280791; cv=none; d=zohomail.com; s=zohoarc; b=Nu3T2dN5+mrsufGjEhwYDu1666uQ+Vc/ug3A6zHgTv6sg2S+jgWujDUGBT3TyzG3uKEZVQ1gyD5+VE0ZCX1h+wmW5UoIxergckBEHj6oFQBB4HEGrrHw9e5BJU1Pg04BUqnW3e4aOz49OGyQGMhgmSqrDZl3miNWpCGFyXP7snw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690280791; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LnZsXBbIrTDKV2igH/1OazM17WZlfyrZZU/qtmoKHRk=; b=Xt9x3qYFYt0zzMbXKyE9qd/27I31chBt7xFaDXtdg3pRCkLufxuuH7lt0ZJ7s5lj8PIGwpeU/bSBtxFl7HhY4tWQt3TD2hw96DMFQeStgG8a44xrnlSE4BzET4g6jaYWjADS++nQTIx5eiuQ2bXKootsny72Jdl6RUi9h8TjWbc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690280791747428.8856855604313; Tue, 25 Jul 2023 03:26:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOFF9-00010E-42; Tue, 25 Jul 2023 06:26:15 -0400 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 1qOFE7-0000Gf-BD for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:11 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOFE5-0007Vd-Bj for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:11 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fbaef9871cso8046729e87.0 for ; Tue, 25 Jul 2023 03:25:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u19-20020a05600c211300b003fbc30825fbsm12567185wml.39.2023.07.25.03.25.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 03:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690280706; x=1690885506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LnZsXBbIrTDKV2igH/1OazM17WZlfyrZZU/qtmoKHRk=; b=ZvYu7mZqBJG9XkWG7bzaqOpKSXZ6lwggmnmsExjR3r3e7tOJk+7Wgi3jm30EwTW4pC oTbEmX5MrOU1HcnhaaBjI8YNfjVyLnZRyBiduV0UENuGXpRqgx0WBr9f+mVDMQPz1Dxj mYTBYkqlrs8v0wqN74F+OPUnle0XHLDQsSF3uoYQ9m4vg/CMbG9Rz6WREse1PNu4pbK6 AoQVj7wJLv5KV5GT4yjuBN9VXP8U2ZsH7uCUhwTddC3l3QAv1HwaSzYx4wwTFZ7QijFm d2mva17VOoenhWDjcA3s/r74lBE5QUmbdAuzLCd5ZEHCATXKnUn5EnTTtAVPVk3kZtK1 B+Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690280706; x=1690885506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LnZsXBbIrTDKV2igH/1OazM17WZlfyrZZU/qtmoKHRk=; b=fHIpJv/IoUDbZx3jn9Tcf3w6bRBRVb66YBBAti+uXlV86fmec3w+kZgRXTtN7aKCSt gkVbe/L8seQyFJSrUM5xPPKEim4KhYnWh41jatrZusMZglwF/Bf7gydhj5umYIgzxK4O crRpI8ytQ50sK/E9EV5Ojd2KkP9geT6hyLZOxRv/9ofrfZcwCU2idYcfCHrd4NkzKKsg Wet29/DAPDRQWxxtT81dOFMRTvSqSU8RsjS/OZxypLdIxYeKkLfkWzcItO180K73awWk oi1pxsQjQTOjdv4lfuGzSmd204K1qBrhebzyYbJoTqi8857Vd6Q1QHoiVtumIoiQvWOy ZXMA== X-Gm-Message-State: ABy/qLas4U+eNYXeOpP8towNKctDALQ7KA46DmdeJa1nOaZy5oDWlhic rk1VcnoPY/5ytTGCHjBlkxCtUDUyt1K33r1UbCo= X-Google-Smtp-Source: APBJJlFDZ1q7Md7EICCrhFDpFQH+Yt1xYYr1MpL5EUwBGxUPT41wohAgcuO7G9VfC9l0708WaD8vQQ== X-Received: by 2002:a05:6512:39c5:b0:4f9:69af:9857 with SMTP id k5-20020a05651239c500b004f969af9857mr7786560lfu.51.1690280706469; Tue, 25 Jul 2023 03:25:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 3/5] target/arm: Special case M-profile in debug_helper.c code Date: Tue, 25 Jul 2023 11:25:01 +0100 Message-Id: <20230725102503.2283907-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725102503.2283907-1-peter.maydell@linaro.org> References: <20230725102503.2283907-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1690280792515100003 Content-Type: text/plain; charset="utf-8" A lot of the code called from helper_exception_bkpt_insn() is written assuming A-profile, but we will also call this helper on M-profile CPUs when they execute a BKPT insn. This used to work by accident, but recent changes mean that we will hit an assert when some of this code calls down into lower level functions that end up calling arm_security_space_below_el3(), arm_el_is_aa64(), and other functions that now explicitly assert that the guest CPU is not M-profile. Handle M-profile directly to avoid the assertions: * in arm_debug_target_el(), M-profile debug exceptions always go to EL1 * in arm_debug_exception_fsr(), M-profile always uses the short format FSR (compare commit d7fe699be54b2, though in this case the code in arm_v7m_cpu_do_interrupt() does not need to look at the FSR value at all) Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1775 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20230721143239.1753066-1-peter.maydell@linaro.org --- target/arm/debug_helper.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index 8362462a07e..abe72e35ae6 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -21,6 +21,10 @@ static int arm_debug_target_el(CPUARMState *env) bool secure =3D arm_is_secure(env); bool route_to_el2 =3D false; =20 + if (arm_feature(env, ARM_FEATURE_M)) { + return 1; + } + if (arm_is_el2_enabled(env)) { route_to_el2 =3D env->cp15.hcr_el2 & HCR_TGE || env->cp15.mdcr_el2 & MDCR_TDE; @@ -434,18 +438,20 @@ static uint32_t arm_debug_exception_fsr(CPUARMState *= env) { ARMMMUFaultInfo fi =3D { .type =3D ARMFault_Debug }; int target_el =3D arm_debug_target_el(env); - bool using_lpae =3D false; + bool using_lpae; =20 - if (target_el =3D=3D 2 || arm_el_is_aa64(env, target_el)) { + if (arm_feature(env, ARM_FEATURE_M)) { + using_lpae =3D false; + } else if (target_el =3D=3D 2 || arm_el_is_aa64(env, target_el)) { using_lpae =3D true; } else if (arm_feature(env, ARM_FEATURE_PMSA) && arm_feature(env, ARM_FEATURE_V8)) { using_lpae =3D true; + } else if (arm_feature(env, ARM_FEATURE_LPAE) && + (env->cp15.tcr_el[target_el] & TTBCR_EAE)) { + using_lpae =3D true; } else { - if (arm_feature(env, ARM_FEATURE_LPAE) && - (env->cp15.tcr_el[target_el] & TTBCR_EAE)) { - using_lpae =3D true; - } + using_lpae =3D false; } =20 if (using_lpae) { --=20 2.34.1 From nobody Fri May 17 04:49:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1690280816; cv=none; d=zohomail.com; s=zohoarc; b=LRrVnOoJgqouVzipl9AjoV+mZH9atRiJhEBPQUzvCfvRdhKa08xA8d1bUVez22gqOIxl2UxNnLzp93TaD6YB6iVMWGUu4lLmro2n4OzDZ+H67qtit/CG1eWT7hfRk/afoPYtgkzFG/19ZZT5MC2VZeOXdTHvmKNpGDx7PS6UQeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690280816; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LicjyZN3b/YUo5rE9Rcv6mrB/LPasqs2dSTgyc7oBvU=; b=ZYhJCFhefFU5lgju2G8DAivq+Wnjhv+lEM3JIe1gK1Vy4iSlwh3w0WOHsyLZONwkXPjhHR1zpeejnxNzsGGwnGF8OJx0GfnHPpJChYTdf4PAlaqtj1m8ZxVvrUU1mihRpTR72u85uVLG3fIceRUhfSsL/vHt1NJ7woxyuql+rGY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690280816477380.2818411283563; Tue, 25 Jul 2023 03:26:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOFFD-0001Ut-NL; Tue, 25 Jul 2023 06:26:20 -0400 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 1qOFE8-0000IK-8k for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:13 -0400 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 1qOFE5-0007Vp-Mh for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:11 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fc04692e20so52686205e9.0 for ; Tue, 25 Jul 2023 03:25:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u19-20020a05600c211300b003fbc30825fbsm12567185wml.39.2023.07.25.03.25.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 03:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690280707; x=1690885507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LicjyZN3b/YUo5rE9Rcv6mrB/LPasqs2dSTgyc7oBvU=; b=JgA3qk/RdInWcQKiQ0PPOOOrSkEaeSLJBucMWy7/HIn+Y001VkNGy9sk3qnojVFypD 7QE/SqE6zlGUBgvCumB6ozGVAseucr4Dat82QHPjGInn7A+Do4exeOHn67x1B9Xwo2qs DuTIk+Vd4tqQz+FjLBNgIPO9i4uTNIQ1wfcO/woVQR/vWmkoYJaoTdNL9wc862wYcSoU cbEkUlpPZmnH7HCYJE9G3xbx9RTOsXRE51oGvPmmw7fZkzZboq6wd7xut3eO9YtQFUoD Zc5Q7wapBM8Z56y/dXMu2LpXlvnONc9tU9Vp7FVTYR5DWZICyFWIE0hNK8fW+3zhKiPU 5ajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690280707; x=1690885507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LicjyZN3b/YUo5rE9Rcv6mrB/LPasqs2dSTgyc7oBvU=; b=MVyDlEK89ktJ5x9o26htlsRkNfz7gh0K+2D9aZNHbZ7XqW2UMEhvver8KqTbvb1oC7 6vPjZxwrDMEcV8QwwzJBHWXyE4uOCquR7Z/iRmssdkHwc6M9++yQ2+NaWr5vuUWJtRmC MB6dLtowuuHfiqAWuDGKOZ41Q74P/uRoLiVLbkStTwizx5C+0MYBKuiyuQfgxGtEIxXa UBac25QvchTpgXZd/YJydSlNCOUwFArFAqKX6hCQUFPk0CjGUPNrsZSGEwQaAOV7nL5K u0XApK3wTKo7dzbAJdlp6wB27aM3FkQTTCPPDHs/4KhYyQW/SFc0FcXOUrliiSFriHq4 APrQ== X-Gm-Message-State: ABy/qLYPWzNKasjJ9qixQPIX3rwjEGJuatnU+W4NJLrReVbdPIUofZIp YeDL4UQaIABUY4675D9vCeVksn/Wn0+5/BsUTc8= X-Google-Smtp-Source: APBJJlFlcM0awL6uLv7XbsPrWdV4ht5R8RwSXx5sF7xvVC0A5kbian6Ur/yoKcKImqnvp8MwyL8CTw== X-Received: by 2002:a1c:6a13:0:b0:3fb:b3aa:1c8a with SMTP id f19-20020a1c6a13000000b003fbb3aa1c8amr9888741wmc.16.1690280706906; Tue, 25 Jul 2023 03:25:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 4/5] For curses display, recognize a few more control keys Date: Tue, 25 Jul 2023 11:25:02 +0100 Message-Id: <20230725102503.2283907-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725102503.2283907-1-peter.maydell@linaro.org> References: <20230725102503.2283907-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1690280818542100003 Content-Type: text/plain; charset="utf-8" From: Sean Estabrooks The curses display handles most control-X keys, and translates them into their corresponding keycode. Here we recognize a few that are missing, Ctrl-@ (null), Ctrl-\ (backslash), Ctrl-] (right bracket), Ctrl-^ (caret), Ctrl-_ (underscore). Signed-off-by: Sean Estabrooks Message-id: CAHyVn3Bh9CRgDuOmf7G7Ngwamu8d4cVozAcB2i4ymnnggBXNmg@mail.gmail.= com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- ui/curses_keys.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/curses_keys.h b/ui/curses_keys.h index 71e04acdc75..88a2208ed18 100644 --- a/ui/curses_keys.h +++ b/ui/curses_keys.h @@ -210,6 +210,12 @@ static const int _curses2keycode[CURSES_CHARS] =3D { ['N' - '@'] =3D 49 | CNTRL, /* Control + n */ /* Control + m collides with the keycode for Enter */ =20 + ['@' - '@'] =3D 3 | CNTRL, /* Control + @ */ + /* Control + [ collides with the keycode for Escape */ + ['\\' - '@'] =3D 43 | CNTRL, /* Control + Backslash */ + [']' - '@'] =3D 27 | CNTRL, /* Control + ] */ + ['^' - '@'] =3D 7 | CNTRL, /* Control + ^ */ + ['_' - '@'] =3D 12 | CNTRL, /* Control + Underscore */ }; =20 static const int _curseskey2keycode[CURSES_KEYS] =3D { --=20 2.34.1 From nobody Fri May 17 04:49:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1690280808; cv=none; d=zohomail.com; s=zohoarc; b=nkLRkW3yqbDbmuJiNuT3q3uZWej+Jc993Rw4dCBir21rHBa4noQmWYO4657lz81kts4ju3gR5Pq79+Pi6tkAYRbWB85Hpxehc0lIEl31kczpW8X/TWuLYCkWUpIFpwbKPY8UDB7rKDC7u/2cHfu61hJ3GPC1hti4PysFKZ8gwTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690280808; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9C6PfLlU2O818ZwPOAqAi3d27sGlX9QQgbc+eDlrhGY=; b=YxPbcJn8Zz8S6cCUK+Zcm+7/s42a8mmd9jN+uY6Cw4WjS1vbA/gwJGMqsuVwREVpqD6aSodC6r+POI1uZ+t45+Oi04q6pCBEnhn2jkhz59N8tPTqaWMPkwXK8w9idezOiXDBeXP/eUYHwZkdEjmjBx5eYTJyUjGWEaKnP+87mt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690280808167691.7402418510935; Tue, 25 Jul 2023 03:26:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOFFE-0001Xp-Be; Tue, 25 Jul 2023 06:26:20 -0400 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 1qOFE8-0000Ix-CC for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:13 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOFE5-0007WG-Q2 for qemu-devel@nongnu.org; Tue, 25 Jul 2023 06:25:12 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc63c2e84so53543925e9.3 for ; Tue, 25 Jul 2023 03:25:09 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u19-20020a05600c211300b003fbc30825fbsm12567185wml.39.2023.07.25.03.25.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 03:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690280707; x=1690885507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9C6PfLlU2O818ZwPOAqAi3d27sGlX9QQgbc+eDlrhGY=; b=DtiJDRKzQ6LC69Z7UhI7WOfXygH36DCkqUZqSr6AB/A8gX96oYoxuxboOlegc3Npbh dVu98nazkFFEbvkvmAv3oIWTT3v92+tRWnJsvdM3PtHRzy0JftggZ7Byca49ORk4hJy6 rInsc809qsj05DODNJ83TBjrVImyJ+qQ024xgqdg0TW45JBjumofd0GC4FAJwE2HfC+Q q8+QCVY/Ve7PPwbbPvSnzHFUMS7bQhF/H+YlYUbv0CHR+LLkDQ+IW+T4IykP4tFuLrJR WEumbDzp8z/0spIjITYrdg5ZO6FMweF7cI1WYvtL5HT2Q5/f72eIhg6e9xIcNB+W6tJj Gr1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690280707; x=1690885507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9C6PfLlU2O818ZwPOAqAi3d27sGlX9QQgbc+eDlrhGY=; b=Vl5IVPUrGbYT2NH8xku2yuTPBU4UlvnZ6fJYbaaHLoBMKhBswRVGH/DZiy7lNyRJyb 4W4G8g6+SXfCt+FsXUZiR/llCB8jv79tpJzoiGvTZlSTXhabO7ZI/ufob7LTmKm+VLuC tSoH2+RypdYnJkB1JRLtu7w/N0YjPoQmwfUF+dor0xEUuFxEHDx2MNCd6FAhqX2IajZe JAczkh8wJqUvJ/9IZqUxX2WNoF+JKQHq+O5O5GHhoogUO4qKKchMG2OzkKc5K+BnoSzQ 09RMfE2jtNfSMkTzM4KGlbTuGYQnBgpw6RIMIAnzOSF6i7VRxrvAsRca5JPKYq02wupt yrTA== X-Gm-Message-State: ABy/qLbUXCWb6svoBNpVkmvCJS7EatPH+ENJPk8YDL7++buMuoJk6tWf BODGKxQO58QAxf7w8F0JXJSbR8qOJrfOdGNK4AY= X-Google-Smtp-Source: APBJJlG87V9qTXpiUgCWGQUkMym1NMqm9BEwWvWpC4PQMeFmqJtF/X73wkebg3z4WkyqhtT+X0C5UQ== X-Received: by 2002:a05:600c:40c:b0:3fb:dd9c:72d2 with SMTP id q12-20020a05600c040c00b003fbdd9c72d2mr10012662wmb.31.1690280707298; Tue, 25 Jul 2023 03:25:07 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 5/5] tests/decode: Suppress "error: " string for expected-failure tests Date: Tue, 25 Jul 2023 11:25:03 +0100 Message-Id: <20230725102503.2283907-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725102503.2283907-1-peter.maydell@linaro.org> References: <20230725102503.2283907-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1690280808467100001 The "expected failure" tests for decodetree result in the error messages from decodetree ending up in logs and in V=3D1 output: >>> MALLOC_PERTURB_=3D226 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/= x86/pyvenv/bin/python3 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/scripts/d= ecodetree.py --output-null --test-for-error /mnt/nvmedisk/linaro/qemu-from-= laptop/qemu/build/x86/../../tests/decode/err_argset1.decode =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95 =E2=9C=80 =E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/x86/../../tests/decode/err= _argset1.decode:5: error: duplicate argument "a" =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95 1/44 qemu:decodetree / err_argset1 OK 0.05s This then produces false positives when scanning the logfiles for strings like "error: ". For the expected-failure tests, make decodetree print "detected:" instead of "error:". Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230720131521.1325905-1-peter.maydell@linaro.org --- scripts/decodetree.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index a8a6cb69cda..e8b72da3a97 100644 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -134,6 +134,10 @@ def error_with_file(file, lineno, *args): global output_file global output_fd =20 + # For the test suite expected-errors case, don't print the + # string "error: ", so they don't turn up as false positives + # if you grep the meson logs for strings like that. + end =3D 'error: ' if not testforerror else 'detected: ' prefix =3D '' if file: prefix +=3D f'{file}:' @@ -141,7 +145,7 @@ def error_with_file(file, lineno, *args): prefix +=3D f'{lineno}:' if prefix: prefix +=3D ' ' - print(prefix, end=3D'error: ', file=3Dsys.stderr) + print(prefix, end=3Dend, file=3Dsys.stderr) print(*args, file=3Dsys.stderr) =20 if output_file and output_fd: --=20 2.34.1