From nobody Sat Apr 20 14:03:47 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=1663867678; cv=none; d=zohomail.com; s=zohoarc; b=SPellfPOPC0Ycq4QKxWey7aPbtd6G4mfb5Br1bFRLavq+ZiqE+8gPRJU/XoN2d5KrSqSupFf/URmuqfP+fL3ijMrL/27iTNz/ZTF5ETKeeB40GXpjGmWNFFpqRpF45+wPULHAn3OnXThvbQF0+1dK4mUmBXFqFSWNx9qUVtVa3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663867678; 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=WMTybDGJFpIIsx2/QiH+5Roxvq0KadU/gkG/e5cvyQc=; b=epPMFi020L/lM1U5hwR1QNTKddUXoRQEUZGc5CXsvbqxDrv4mYOoKYobV+iAhr0zSJxvFwpXA3FcKozERJyS3dy4LGxVxNykJqADtvKoalX1yOKaBkZ3lSXmQWyUXIpS7PV21uZs3cUg++psjp3OlNm+E8l9zZVAx7UTFypz+lo= 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 1663867678506534.9061863046119; Thu, 22 Sep 2022 10:27:58 -0700 (PDT) Received: from localhost ([::1]:42332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPzR-0002w7-15 for importer@patchew.org; Thu, 22 Sep 2022 13:27:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAu-00029y-42 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:46895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAr-0005Nr-9e for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:42 -0400 Received: by mail-wr1-x432.google.com with SMTP id g3so16366022wrq.13 for ; Thu, 22 Sep 2022 09:35:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=WMTybDGJFpIIsx2/QiH+5Roxvq0KadU/gkG/e5cvyQc=; b=yKcIDV0QAeEV328ZjxOTTVxv7Qku8ukwc2S8ZbybWBYqo+9LJaDoYbpAbyW3tNvk6o wAeBWGluEfUVM/LDV8SWtk7zhfqdY2zm8RIr4GTJt4JbuOcrhOU+YItFdueWIoN/1bpu 8mvtce9e5mW5AYPYHTmDFqF3J5oeaNhw3ZbGDx0Pb+h3Lgx2rg0LPcZufFwp00YGnM2C 2IviZvmxgXlQE+1C0x3iFHc9OMdBD1NbDTlyn3mLoDNvQAJ9/kFK8BgK5/D3fdlQQEBC S48KIdEnMV7U0gEzoHrKxO2KC88H9+ba7A7eb+U5AINUxccC0kvt44nY6Be4PTD+ZWWL cUYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=WMTybDGJFpIIsx2/QiH+5Roxvq0KadU/gkG/e5cvyQc=; b=pcBvFePfxNBPyQQddIAyrYp5PEJXlQ2IC2UxQ3Ekyx3r6V21Q/ydL74kJJZv/I2oGa jri/X0Zi3WjCMUbSCDAEHwA6RZKi7o3ut6rjm3QkIqgy0z3YGY8oWkphykHpukdItfFr pSXmJysRXHn10xqpwbhGAZUnyeCwYOgeEkIDivA1vytrcmtaXrfq1RErdN0F89qr5l+H kHbQ/4BGjLBTGGYVg1G7cT352qQKQWy5BQjG+3lkwKyK6j5xNsB+iU+44n/wpV8hCDCG l1kwG9GJ34BbaKESkUkxthTInlXLGxTRvFCRp/uhALcs7Ks1qM3Vjstd+6+f05gVmh+W I47A== X-Gm-Message-State: ACrzQf057nb1oYfqpWmuF+6dF9C5LvcBeKGqCMFlv4ZJlpIVE0QvQ3sM zAlA+8w/PD8LXeowRl2RjZIO5zUU1dxoWA== X-Google-Smtp-Source: AMsMyM7ub6JhuJ8A11oXagb3hXRkLkcmwN1oUDOHMaOYL7ZMHUP18RX0qF6GYqOMLjqAyc/L03MjjQ== X-Received: by 2002:adf:e0c3:0:b0:226:d598:85ee with SMTP id m3-20020adfe0c3000000b00226d59885eemr2535169wri.589.1663864538783; Thu, 22 Sep 2022 09:35:38 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/39] hw/net/can: fix Xilinx ZynqMP CAN RX FIFO logic Date: Thu, 22 Sep 2022 17:34:58 +0100 Message-Id: <20220922163536.1096175-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663867678858100001 Content-Type: text/plain; charset="utf-8" From: Anton Kochkov For consistency, function "update_rx_fifo()" should use the RX FIFO register field names, not the TX FIFO ones, even if they refer to the same bit positions in the register. Signed-off-by: Anton Kochkov Reviewed-by: Francisco Iglesias Message-id: 20220817141754.2105981-1-anton.kochkov@proton.me Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1123 [PMM: tweaked commit message] Signed-off-by: Peter Maydell --- hw/net/can/xlnx-zynqmp-can.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/net/can/xlnx-zynqmp-can.c b/hw/net/can/xlnx-zynqmp-can.c index 82ac48cee24..e93e6c5e194 100644 --- a/hw/net/can/xlnx-zynqmp-can.c +++ b/hw/net/can/xlnx-zynqmp-can.c @@ -696,30 +696,30 @@ static void update_rx_fifo(XlnxZynqMPCANState *s, con= st qemu_can_frame *frame) timestamp)); =20 /* First 32 bit of the data. */ - fifo32_push(&s->rx_fifo, deposit32(0, R_TXFIFO_DATA1_DB3_SHIFT, - R_TXFIFO_DATA1_DB3_LENGTH, + fifo32_push(&s->rx_fifo, deposit32(0, R_RXFIFO_DATA1_DB3_SHIFT, + R_RXFIFO_DATA1_DB3_LENGTH, frame->data[0]) | - deposit32(0, R_TXFIFO_DATA1_DB2_SHIFT, - R_TXFIFO_DATA1_DB2_LENGTH, + deposit32(0, R_RXFIFO_DATA1_DB2_SHIFT, + R_RXFIFO_DATA1_DB2_LENGTH, frame->data[1]) | - deposit32(0, R_TXFIFO_DATA1_DB1_SHIFT, - R_TXFIFO_DATA1_DB1_LENGTH, + deposit32(0, R_RXFIFO_DATA1_DB1_SHIFT, + R_RXFIFO_DATA1_DB1_LENGTH, frame->data[2]) | - deposit32(0, R_TXFIFO_DATA1_DB0_SHIFT, - R_TXFIFO_DATA1_DB0_LENGTH, + deposit32(0, R_RXFIFO_DATA1_DB0_SHIFT, + R_RXFIFO_DATA1_DB0_LENGTH, frame->data[3])); /* Last 32 bit of the data. */ - fifo32_push(&s->rx_fifo, deposit32(0, R_TXFIFO_DATA2_DB7_SHIFT, - R_TXFIFO_DATA2_DB7_LENGTH, + fifo32_push(&s->rx_fifo, deposit32(0, R_RXFIFO_DATA2_DB7_SHIFT, + R_RXFIFO_DATA2_DB7_LENGTH, frame->data[4]) | - deposit32(0, R_TXFIFO_DATA2_DB6_SHIFT, - R_TXFIFO_DATA2_DB6_LENGTH, + deposit32(0, R_RXFIFO_DATA2_DB6_SHIFT, + R_RXFIFO_DATA2_DB6_LENGTH, frame->data[5]) | - deposit32(0, R_TXFIFO_DATA2_DB5_SHIFT, - R_TXFIFO_DATA2_DB5_LENGTH, + deposit32(0, R_RXFIFO_DATA2_DB5_SHIFT, + R_RXFIFO_DATA2_DB5_LENGTH, frame->data[6]) | - deposit32(0, R_TXFIFO_DATA2_DB4_SHIFT, - R_TXFIFO_DATA2_DB4_LENGTH, + deposit32(0, R_RXFIFO_DATA2_DB4_SHIFT, + R_RXFIFO_DATA2_DB4_LENGTH, frame->data[7])); =20 ARRAY_FIELD_DP32(s->regs, INTERRUPT_STATUS_REGISTER, RXOK, 1); --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663865280; cv=none; d=zohomail.com; s=zohoarc; b=F+XUG3wgB3kLaVHEgEgJOd8q9LqZnAekVvTafnXXNhLqJRrh/ClvYBEPO+exxhKDnwsahkHVN9ROlCHH4wCARFiazGHs4wgmoBbaXwJpwooaOfh64h8JIHoKVWw6oueZ6JKYUNTdEPzZkb/YSFESXLTb9hqiE1BQBu0JgJR7b9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663865280; 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=SJ1E1DN8UXVJBqdhqjrjiz3vYmJMmUFOalTcFegGjrQ=; b=hBMv7UAhax4NHyLvpdO5nhmUa3U9WPg7TjTF2rlTnhoqL20jSHHw8LROZTRnJFVj3Nsoo9EKmnqdSllF3R2THqMh5bL9vrQUeoQDri9I3hgiEP8dA61H3iG7k21DzJSTNCAsghGvhTwsU6uTTqb5a+vKN/Tv3cYo6GaMEejKd+k= 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 166386528041623.484076800904063; Thu, 22 Sep 2022 09:48:00 -0700 (PDT) Received: from localhost ([::1]:48216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPMk-0006Jm-GS for importer@patchew.org; Thu, 22 Sep 2022 12:47:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAs-00029p-QX for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAq-0005Nu-NB for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:42 -0400 Received: by mail-wr1-x431.google.com with SMTP id cc5so16439607wrb.6 for ; Thu, 22 Sep 2022 09:35:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=SJ1E1DN8UXVJBqdhqjrjiz3vYmJMmUFOalTcFegGjrQ=; b=axmsrd1dZZ8nN7yQ40caBOXFi7R+ZrgCi0oTF1SBQ9xmRxtJJxtmGNYQAgq7kxlTeN IMXPCLCr8FSxn46g9BI1iKOTNQm4x/a4YoJ5rD7Tvhwd/WZQ1g5Iz6WKOO3MZaeh6Lxh ZV0AFv64ADo0gmppyoYokL7rVB3a9l5GO/2fFzqam8B7QjD79ruwPaQKruXaVIBG+gsm 8Wzyw6VWtpvYZ2rglJzdsCIRyqPkl+GgyRjB9W3n/jPvUMJ1IeMcwe6MlcIz47o8t3Fe fyZi8029Z3nczwwNUak7t+4KjWdpb/lASJF6glI91jMpbZfkcbAzcd6eWwvzocodnHu/ pweQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=SJ1E1DN8UXVJBqdhqjrjiz3vYmJMmUFOalTcFegGjrQ=; b=5Em8D9GwOu/sLVKKPzjDgX2kbnzDFMSWjibMowoQsarS1cYAqi5ahA6K2PppEmCVLg Gi8BCpqLzGLc+bgeXh3mlCGJJNjSpxVzBeFDlVTEEdKU2sm/BYh9TDgaqIfhXUZHyp1i zxObjf1a90NmFKs2Y+6dFBRj7a//YzgfgTIExu1cm1Xkni+6ALJXKX+PZk7gIrHUgpGK kN6M36ndFhN3tKVHIG2SWdpYxMci8ERW3vbK8HsivUv0ueGnYPGU6+zxQtWMZzrVSFw0 NQMekzAFb+9KE+bNV9pjaU7kZSYzZdEmLYTst2nQF7Pbf10RDGZkmAZ2k9vf8wBKeL+G PrVA== X-Gm-Message-State: ACrzQf07DAcmWdmJa6AVbbKaV+EGWHzCEOIoJQq3rrLHf8yn2aLrObi8 bR3MYJ1/UZvMJ1IXtoTRudLZBkCmpOse9w== X-Google-Smtp-Source: AMsMyM45OjRYrimcjqPX4GrkUR2u35y0RFktCIsq2PwJj+xry4ELt+1s9GUr1FNby3MK9jQ6Ee/6Qg== X-Received: by 2002:adf:a50e:0:b0:22a:ede1:57e with SMTP id i14-20020adfa50e000000b0022aede1057emr2541427wrb.63.1663864539317; Thu, 22 Sep 2022 09:35:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/39] target/arm: Fix alignment for VLD4.32 Date: Thu, 22 Sep 2022 17:34:59 +0100 Message-Id: <20220922163536.1096175-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::431; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663865283419100001 From: Cl=C3=A9ment Chigot When requested, the alignment for VLD4.32 is 8 and not 16. See ARM documentation about VLD4 encoding: ebytes =3D 1 << UInt(size); if size =3D=3D '10' then alignment =3D if a =3D=3D '0' then 1 else 8; else alignment =3D if a =3D=3D '0' then 1 else 4*ebytes; Signed-off-by: Cl=C3=A9ment Chigot Reviewed-by: Richard Henderson Message-id: 20220914105058.2787404-1-chigot@adacore.com Signed-off-by: Peter Maydell --- target/arm/translate-neon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/arm/translate-neon.c b/target/arm/translate-neon.c index 321c17e2c7e..4016339d46f 100644 --- a/target/arm/translate-neon.c +++ b/target/arm/translate-neon.c @@ -584,7 +584,11 @@ static bool trans_VLD_all_lanes(DisasContext *s, arg_V= LD_all_lanes *a) case 3: return false; case 4: - align =3D pow2_align(size + 2); + if (size =3D=3D 2) { + align =3D pow2_align(3); + } else { + align =3D pow2_align(size + 2); + } break; default: g_assert_not_reached(); --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663870360; cv=none; d=zohomail.com; s=zohoarc; b=gwREmU/OLcKrQb3L2EtfTtTLB8fb+W2E8OedSRFsEMVg3Smmf4AlJ6vJOiAzIrxMbQMKbd6VALDTslzRFT1mF97iqnxHOR2XxBdIUOJbFgNXBAj2daqBGuWR1ZtiJacymRGJWdGbRr3LVG8Kb+Q00gAbsLCOYk6jsVjJwBpj7HY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663870360; 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=QsWOLsgF0/chVob90PgwZQ1AA7ITBpmicr/bUMVWE44=; b=kd0CKNX3P7g1iArApBlAs8wPnVITXJfPIHHhZIp6/sq8BsT8780CrJwtNgNneJFHH9klMBZSQDeu/n6Ye9AvjJhcfB8sAWyNLKYH/y1NeaNrza1wOIxDVGBQWcEoK23eqHXhG3pleQfUCxVik6CRz0qnCDDKd1JNCLCOs/eGBOE= 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 1663870360056950.5140443091298; Thu, 22 Sep 2022 11:12:40 -0700 (PDT) Received: from localhost ([::1]:41790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQgg-0006mM-UV for importer@patchew.org; Thu, 22 Sep 2022 14:12:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAy-0002Aa-59 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:49 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:40844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAs-0005O2-60 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: by mail-wm1-x32f.google.com with SMTP id v3-20020a1cac03000000b003b4fd0fe6c0so1682143wme.5 for ; Thu, 22 Sep 2022 09:35:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=QsWOLsgF0/chVob90PgwZQ1AA7ITBpmicr/bUMVWE44=; b=KhyVNE6p2RRtuycT+8xTzwi1IRkVWbnxhLNYhcENuv1dWom2TkfZZr8Codfh5aaTxb fFDvegnG7EgI6uavRtIk2wQpmGqfW/GCNOyPtKmXb5cTi5TKeWMl/pKMSS5ANc2AJFRN Sl9nj1n5PHkmiUjBb5xSpoRGK1NnFg/kTy+/yJ36DTwt6vGJkENvIMPFGsZmtMw3GEfe hPwO0eNK1mJY6+gOlWuCfI9rpl0IzzoKSPDsKwsp84qB/Jn3DuS2t5vU0OAnYFli/C3s Tma+U0873EtFz0Cqun2evHfWjFjrLuJSTYn8cp55HuJ5wyz5sKw5bMU+qW41b+Oac4Iy YrZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=QsWOLsgF0/chVob90PgwZQ1AA7ITBpmicr/bUMVWE44=; b=Q5QLZuLLP36YbjKfxlOjmIPRdBg2ReRUaASY9s6ofX6zMubg+KBQah/VVJi6juIauG /MVu5AoQv8uFxJitsyvhiB+WPCbJ0sEXVJxFW6rD3IxBsdR/oDWkNExjq1dqqqdWjNJV VdYYf21oB4bExWPX73TX3dF40bVMUJ11DiOaWm29TCTvIUYSwlR+tbWyJ6La6gLmLEBW BRV/A3WxcWY2gbrUi66ljho6MyUn/5nWVIm6cjUHE78/1XzW2gr02xNkCC6OaWGnkG89 wvo+kXpkoGpR792zgcv49I828BFyHWtMCC+/54oMFVtaSrJoVBlNOb78L46v8BGKbwQ2 wZlQ== X-Gm-Message-State: ACrzQf2brc0mryqAcnghiK7MFHOu7F6MEzMTud3Xkr2HC3rV+BgBOu1L 7/b2yzP9W+B8VIx8Itlu4zRoNbZ9Mo+fAw== X-Google-Smtp-Source: AMsMyM5UY/qIMlQLx36sOSZ6dUe8OrdWpwga7IO/cZfuy7v8ROIy43/FGxg8IcggHHrsjcECapgJRg== X-Received: by 2002:a7b:c4c8:0:b0:3b4:76c8:da4f with SMTP id g8-20020a7bc4c8000000b003b476c8da4fmr9699721wmk.63.1663864540506; Thu, 22 Sep 2022 09:35:40 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/39] target/arm: Create GetPhysAddrResult Date: Thu, 22 Sep 2022 17:35:00 +0100 Message-Id: <20220922163536.1096175-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663870362034100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Combine 5 output pointer arguments from get_phys_addr into a single struct. Adjust all callers. Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/internals.h | 13 ++++- target/arm/helper.c | 27 ++++----- target/arm/m_helper.c | 52 ++++++----------- target/arm/ptw.c | 120 +++++++++++++++++++++------------------- target/arm/tlb_helper.c | 22 +++----- 5 files changed, 109 insertions(+), 125 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index bf60cd5f845..e9743d3e220 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1142,11 +1142,18 @@ typedef struct ARMCacheAttrs { bool is_s2_format:1; } ARMCacheAttrs; =20 +/* Fields that are valid upon success. */ +typedef struct GetPhysAddrResult { + hwaddr phys; + target_ulong page_size; + int prot; + MemTxAttrs attrs; + ARMCacheAttrs cacheattrs; +} GetPhysAddrResult; + bool get_phys_addr(CPUARMState *env, target_ulong address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, MemTxAttrs *attrs, int *prot, - target_ulong *page_size, - ARMMMUFaultInfo *fi, ARMCacheAttrs *cacheattrs) + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) __attribute__((nonnull)); =20 void arm_log_exception(CPUState *cs); diff --git a/target/arm/helper.c b/target/arm/helper.c index 1a57d2e1d60..b5dac651e75 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3190,24 +3190,19 @@ static CPAccessResult ats_access(CPUARMState *env, = const ARMCPRegInfo *ri, static uint64_t do_ats_write(CPUARMState *env, uint64_t value, MMUAccessType access_type, ARMMMUIdx mmu_idx) { - hwaddr phys_addr; - target_ulong page_size; - int prot; bool ret; uint64_t par64; bool format64 =3D false; - MemTxAttrs attrs =3D {}; ARMMMUFaultInfo fi =3D {}; - ARMCacheAttrs cacheattrs =3D {}; + GetPhysAddrResult res =3D {}; =20 - ret =3D get_phys_addr(env, value, access_type, mmu_idx, &phys_addr, &a= ttrs, - &prot, &page_size, &fi, &cacheattrs); + ret =3D get_phys_addr(env, value, access_type, mmu_idx, &res, &fi); =20 /* * ATS operations only do S1 or S1+S2 translations, so we never * have to deal with the ARMCacheAttrs format for S2 only. */ - assert(!cacheattrs.is_s2_format); + assert(!res.cacheattrs.is_s2_format); =20 if (ret) { /* @@ -3313,12 +3308,12 @@ static uint64_t do_ats_write(CPUARMState *env, uint= 64_t value, /* Create a 64-bit PAR */ par64 =3D (1 << 11); /* LPAE bit always set */ if (!ret) { - par64 |=3D phys_addr & ~0xfffULL; - if (!attrs.secure) { + par64 |=3D res.phys & ~0xfffULL; + if (!res.attrs.secure) { par64 |=3D (1 << 9); /* NS */ } - par64 |=3D (uint64_t)cacheattrs.attrs << 56; /* ATTR */ - par64 |=3D cacheattrs.shareability << 7; /* SH */ + par64 |=3D (uint64_t)res.cacheattrs.attrs << 56; /* ATTR */ + par64 |=3D res.cacheattrs.shareability << 7; /* SH */ } else { uint32_t fsr =3D arm_fi_to_lfsc(&fi); =20 @@ -3338,13 +3333,13 @@ static uint64_t do_ats_write(CPUARMState *env, uint= 64_t value, */ if (!ret) { /* We do not set any attribute bits in the PAR */ - if (page_size =3D=3D (1 << 24) + if (res.page_size =3D=3D (1 << 24) && arm_feature(env, ARM_FEATURE_V7)) { - par64 =3D (phys_addr & 0xff000000) | (1 << 1); + par64 =3D (res.phys & 0xff000000) | (1 << 1); } else { - par64 =3D phys_addr & 0xfffff000; + par64 =3D res.phys & 0xfffff000; } - if (!attrs.secure) { + if (!res.attrs.secure) { par64 |=3D (1 << 9); /* NS */ } } else { diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 308610f6b4e..84c6796b8d6 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -183,19 +183,14 @@ static bool v7m_stack_write(ARMCPU *cpu, uint32_t add= r, uint32_t value, { CPUState *cs =3D CPU(cpu); CPUARMState *env =3D &cpu->env; - MemTxAttrs attrs =3D {}; MemTxResult txres; - target_ulong page_size; - hwaddr physaddr; - int prot; + GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; - ARMCacheAttrs cacheattrs =3D {}; bool secure =3D mmu_idx & ARM_MMU_IDX_M_S; int exc; bool exc_secure; =20 - if (get_phys_addr(env, addr, MMU_DATA_STORE, mmu_idx, &physaddr, - &attrs, &prot, &page_size, &fi, &cacheattrs)) { + if (get_phys_addr(env, addr, MMU_DATA_STORE, mmu_idx, &res, &fi)) { /* MPU/SAU lookup failed */ if (fi.type =3D=3D ARMFault_QEMU_SFault) { if (mode =3D=3D STACK_LAZYFP) { @@ -228,8 +223,8 @@ static bool v7m_stack_write(ARMCPU *cpu, uint32_t addr,= uint32_t value, } goto pend_fault; } - address_space_stl_le(arm_addressspace(cs, attrs), physaddr, value, - attrs, &txres); + address_space_stl_le(arm_addressspace(cs, res.attrs), res.phys, value, + res.attrs, &txres); if (txres !=3D MEMTX_OK) { /* BusFault trying to write the data */ if (mode =3D=3D STACK_LAZYFP) { @@ -276,20 +271,15 @@ static bool v7m_stack_read(ARMCPU *cpu, uint32_t *des= t, uint32_t addr, { CPUState *cs =3D CPU(cpu); CPUARMState *env =3D &cpu->env; - MemTxAttrs attrs =3D {}; MemTxResult txres; - target_ulong page_size; - hwaddr physaddr; - int prot; + GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; - ARMCacheAttrs cacheattrs =3D {}; bool secure =3D mmu_idx & ARM_MMU_IDX_M_S; int exc; bool exc_secure; uint32_t value; =20 - if (get_phys_addr(env, addr, MMU_DATA_LOAD, mmu_idx, &physaddr, - &attrs, &prot, &page_size, &fi, &cacheattrs)) { + if (get_phys_addr(env, addr, MMU_DATA_LOAD, mmu_idx, &res, &fi)) { /* MPU/SAU lookup failed */ if (fi.type =3D=3D ARMFault_QEMU_SFault) { qemu_log_mask(CPU_LOG_INT, @@ -308,8 +298,8 @@ static bool v7m_stack_read(ARMCPU *cpu, uint32_t *dest,= uint32_t addr, goto pend_fault; } =20 - value =3D address_space_ldl(arm_addressspace(cs, attrs), physaddr, - attrs, &txres); + value =3D address_space_ldl(arm_addressspace(cs, res.attrs), res.phys, + res.attrs, &txres); if (txres !=3D MEMTX_OK) { /* BusFault trying to read the data */ qemu_log_mask(CPU_LOG_INT, "...BusFault with BFSR.UNSTKERR\n"); @@ -2008,13 +1998,9 @@ static bool v7m_read_half_insn(ARMCPU *cpu, ARMMMUId= x mmu_idx, CPUState *cs =3D CPU(cpu); CPUARMState *env =3D &cpu->env; V8M_SAttributes sattrs =3D {}; - MemTxAttrs attrs =3D {}; + GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; - ARMCacheAttrs cacheattrs =3D {}; MemTxResult txres; - target_ulong page_size; - hwaddr physaddr; - int prot; =20 v8m_security_lookup(env, addr, MMU_INST_FETCH, mmu_idx, &sattrs); if (!sattrs.nsc || sattrs.ns) { @@ -2028,16 +2014,15 @@ static bool v7m_read_half_insn(ARMCPU *cpu, ARMMMUI= dx mmu_idx, "...really SecureFault with SFSR.INVEP\n"); return false; } - if (get_phys_addr(env, addr, MMU_INST_FETCH, mmu_idx, &physaddr, - &attrs, &prot, &page_size, &fi, &cacheattrs)) { + if (get_phys_addr(env, addr, MMU_INST_FETCH, mmu_idx, &res, &fi)) { /* the MPU lookup failed */ env->v7m.cfsr[env->v7m.secure] |=3D R_V7M_CFSR_IACCVIOL_MASK; armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_MEM, env->v7m.secur= e); qemu_log_mask(CPU_LOG_INT, "...really MemManage with CFSR.IACCVIOL= \n"); return false; } - *insn =3D address_space_lduw_le(arm_addressspace(cs, attrs), physaddr, - attrs, &txres); + *insn =3D address_space_lduw_le(arm_addressspace(cs, res.attrs), res.p= hys, + res.attrs, &txres); if (txres !=3D MEMTX_OK) { env->v7m.cfsr[M_REG_NS] |=3D R_V7M_CFSR_IBUSERR_MASK; armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_BUS, false); @@ -2060,17 +2045,12 @@ static bool v7m_read_sg_stack_word(ARMCPU *cpu, ARM= MMUIdx mmu_idx, */ CPUState *cs =3D CPU(cpu); CPUARMState *env =3D &cpu->env; - MemTxAttrs attrs =3D {}; MemTxResult txres; - target_ulong page_size; - hwaddr physaddr; - int prot; + GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; - ARMCacheAttrs cacheattrs =3D {}; uint32_t value; =20 - if (get_phys_addr(env, addr, MMU_DATA_LOAD, mmu_idx, &physaddr, - &attrs, &prot, &page_size, &fi, &cacheattrs)) { + if (get_phys_addr(env, addr, MMU_DATA_LOAD, mmu_idx, &res, &fi)) { /* MPU/SAU lookup failed */ if (fi.type =3D=3D ARMFault_QEMU_SFault) { qemu_log_mask(CPU_LOG_INT, @@ -2088,8 +2068,8 @@ static bool v7m_read_sg_stack_word(ARMCPU *cpu, ARMMM= UIdx mmu_idx, } return false; } - value =3D address_space_ldl(arm_addressspace(cs, attrs), physaddr, - attrs, &txres); + value =3D address_space_ldl(arm_addressspace(cs, res.attrs), res.phys, + res.attrs, &txres); if (txres !=3D MEMTX_OK) { /* BusFault trying to read the data */ qemu_log_mask(CPU_LOG_INT, diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 3261039d93a..8db2abac015 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -2300,18 +2300,12 @@ static ARMCacheAttrs combine_cacheattrs(CPUARMState= *env, * @address: virtual address to get physical address for * @access_type: 0 for read, 1 for write, 2 for execute * @mmu_idx: MMU index indicating required translation regime - * @phys_ptr: set to the physical address corresponding to the virtual add= ress - * @attrs: set to the memory transaction attributes to use - * @prot: set to the permissions for the page containing phys_ptr - * @page_size: set to the size of the page containing phys_ptr + * @result: set on translation success. * @fi: set to fault info if the translation fails - * @cacheattrs: (if non-NULL) set to the cacheability/shareability attribu= tes */ bool get_phys_addr(CPUARMState *env, target_ulong address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, MemTxAttrs *attrs, int *prot, - target_ulong *page_size, - ARMMMUFaultInfo *fi, ARMCacheAttrs *cacheattrs) + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { ARMMMUIdx s1_mmu_idx =3D stage_1_mmu_idx(mmu_idx); =20 @@ -2322,43 +2316,54 @@ bool get_phys_addr(CPUARMState *env, target_ulong a= ddress, */ if (arm_feature(env, ARM_FEATURE_EL2)) { hwaddr ipa; - int s2_prot; + int s1_prot; int ret; bool ipa_secure; - ARMCacheAttrs cacheattrs2 =3D {}; + ARMCacheAttrs cacheattrs1; ARMMMUIdx s2_mmu_idx; bool is_el0; =20 - ret =3D get_phys_addr(env, address, access_type, s1_mmu_idx, &= ipa, - attrs, prot, page_size, fi, cacheattrs); + ret =3D get_phys_addr(env, address, access_type, s1_mmu_idx, + result, fi); =20 /* If S1 fails or S2 is disabled, return early. */ if (ret || regime_translation_disabled(env, ARMMMUIdx_Stage2))= { - *phys_ptr =3D ipa; return ret; } =20 - ipa_secure =3D attrs->secure; + ipa =3D result->phys; + ipa_secure =3D result->attrs.secure; if (arm_is_secure_below_el3(env)) { if (ipa_secure) { - attrs->secure =3D !(env->cp15.vstcr_el2 & VSTCR_SW); + result->attrs.secure =3D !(env->cp15.vstcr_el2 & VSTCR= _SW); } else { - attrs->secure =3D !(env->cp15.vtcr_el2 & VTCR_NSW); + result->attrs.secure =3D !(env->cp15.vtcr_el2 & VTCR_N= SW); } } else { assert(!ipa_secure); } =20 - s2_mmu_idx =3D attrs->secure ? ARMMMUIdx_Stage2_S : ARMMMUIdx_= Stage2; + s2_mmu_idx =3D (result->attrs.secure + ? ARMMMUIdx_Stage2_S : ARMMMUIdx_Stage2); is_el0 =3D mmu_idx =3D=3D ARMMMUIdx_E10_0 || mmu_idx =3D=3D AR= MMMUIdx_SE10_0; =20 - /* S1 is done. Now do S2 translation. */ + /* + * S1 is done, now do S2 translation. + * Save the stage1 results so that we may merge + * prot and cacheattrs later. + */ + s1_prot =3D result->prot; + cacheattrs1 =3D result->cacheattrs; + memset(result, 0, sizeof(*result)); + ret =3D get_phys_addr_lpae(env, ipa, access_type, s2_mmu_idx, = is_el0, - phys_ptr, attrs, &s2_prot, - page_size, fi, &cacheattrs2); + &result->phys, &result->attrs, + &result->prot, &result->page_size, + fi, &result->cacheattrs); fi->s2addr =3D ipa; + /* Combine the S1 and S2 perms. */ - *prot &=3D s2_prot; + result->prot &=3D s1_prot; =20 /* If S2 fails, return early. */ if (ret) { @@ -2374,20 +2379,21 @@ bool get_phys_addr(CPUARMState *env, target_ulong a= ddress, * Outer Write-Back Read-Allocate Write-Allocate. * Do not overwrite Tagged within attrs. */ - if (cacheattrs->attrs !=3D 0xf0) { - cacheattrs->attrs =3D 0xff; + if (cacheattrs1.attrs !=3D 0xf0) { + cacheattrs1.attrs =3D 0xff; } - cacheattrs->shareability =3D 0; + cacheattrs1.shareability =3D 0; } - *cacheattrs =3D combine_cacheattrs(env, *cacheattrs, cacheattr= s2); + result->cacheattrs =3D combine_cacheattrs(env, cacheattrs1, + result->cacheattrs); =20 /* Check if IPA translates to secure or non-secure PA space. */ if (arm_is_secure_below_el3(env)) { if (ipa_secure) { - attrs->secure =3D + result->attrs.secure =3D !(env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW)); } else { - attrs->secure =3D + result->attrs.secure =3D !((env->cp15.vtcr_el2 & (VTCR_NSA | VTCR_NSW)) || (env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW))); } @@ -2406,8 +2412,8 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, * cannot upgrade an non-secure translation regime's attributes * to secure. */ - attrs->secure =3D regime_is_secure(env, mmu_idx); - attrs->user =3D regime_is_user(env, mmu_idx); + result->attrs.secure =3D regime_is_secure(env, mmu_idx); + result->attrs.user =3D regime_is_user(env, mmu_idx); =20 /* * Fast Context Switch Extension. This doesn't exist at all in v8. @@ -2424,20 +2430,22 @@ bool get_phys_addr(CPUARMState *env, target_ulong a= ddress, =20 if (arm_feature(env, ARM_FEATURE_PMSA)) { bool ret; - *page_size =3D TARGET_PAGE_SIZE; + result->page_size =3D TARGET_PAGE_SIZE; =20 if (arm_feature(env, ARM_FEATURE_V8)) { /* PMSAv8 */ ret =3D get_phys_addr_pmsav8(env, address, access_type, mmu_id= x, - phys_ptr, attrs, prot, page_size, f= i); + &result->phys, &result->attrs, + &result->prot, &result->page_size, = fi); } else if (arm_feature(env, ARM_FEATURE_V7)) { /* PMSAv7 */ ret =3D get_phys_addr_pmsav7(env, address, access_type, mmu_id= x, - phys_ptr, prot, page_size, fi); + &result->phys, &result->prot, + &result->page_size, fi); } else { /* Pre-v7 MPU */ ret =3D get_phys_addr_pmsav5(env, address, access_type, mmu_id= x, - phys_ptr, prot, fi); + &result->phys, &result->prot, fi); } qemu_log_mask(CPU_LOG_MMU, "PMSA MPU lookup for %s at 0x%08" PRIx32 " mmu_idx %u -> %s (prot %c%c%c)\n", @@ -2445,9 +2453,9 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, (access_type =3D=3D MMU_DATA_STORE ? "writing" : "ex= ecute"), (uint32_t)address, mmu_idx, ret ? "Miss" : "Hit", - *prot & PAGE_READ ? 'r' : '-', - *prot & PAGE_WRITE ? 'w' : '-', - *prot & PAGE_EXEC ? 'x' : '-'); + result->prot & PAGE_READ ? 'r' : '-', + result->prot & PAGE_WRITE ? 'w' : '-', + result->prot & PAGE_EXEC ? 'x' : '-'); =20 return ret; } @@ -2492,14 +2500,14 @@ bool get_phys_addr(CPUARMState *env, target_ulong a= ddress, address =3D extract64(address, 0, 52); } } - *phys_ptr =3D address; - *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; - *page_size =3D TARGET_PAGE_SIZE; + result->phys =3D address; + result->prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + result->page_size =3D TARGET_PAGE_SIZE; =20 /* Fill in cacheattr a-la AArch64.TranslateAddressS1Off. */ hcr =3D arm_hcr_el2_eff(env); - cacheattrs->shareability =3D 0; - cacheattrs->is_s2_format =3D false; + result->cacheattrs.shareability =3D 0; + result->cacheattrs.is_s2_format =3D false; if (hcr & HCR_DC) { if (hcr & HCR_DCT) { memattr =3D 0xf0; /* Tagged, Normal, WB, RWA */ @@ -2512,24 +2520,27 @@ bool get_phys_addr(CPUARMState *env, target_ulong a= ddress, } else { memattr =3D 0x44; /* Normal, NC, No */ } - cacheattrs->shareability =3D 2; /* outer sharable */ + result->cacheattrs.shareability =3D 2; /* outer sharable */ } else { memattr =3D 0x00; /* Device, nGnRnE */ } - cacheattrs->attrs =3D memattr; + result->cacheattrs.attrs =3D memattr; return 0; } =20 if (regime_using_lpae_format(env, mmu_idx)) { return get_phys_addr_lpae(env, address, access_type, mmu_idx, fals= e, - phys_ptr, attrs, prot, page_size, - fi, cacheattrs); + &result->phys, &result->attrs, + &result->prot, &result->page_size, + fi, &result->cacheattrs); } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) { return get_phys_addr_v6(env, address, access_type, mmu_idx, - phys_ptr, attrs, prot, page_size, fi); + &result->phys, &result->attrs, + &result->prot, &result->page_size, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, - phys_ptr, prot, page_size, fi); + &result->phys, &result->prot, + &result->page_size, fi); } } =20 @@ -2538,21 +2549,16 @@ hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *= cs, vaddr addr, { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; - hwaddr phys_addr; - target_ulong page_size; - int prot; - bool ret; + GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; ARMMMUIdx mmu_idx =3D arm_mmu_idx(env); - ARMCacheAttrs cacheattrs =3D {}; + bool ret; =20 - *attrs =3D (MemTxAttrs) {}; - - ret =3D get_phys_addr(env, addr, MMU_DATA_LOAD, mmu_idx, &phys_addr, - attrs, &prot, &page_size, &fi, &cacheattrs); + ret =3D get_phys_addr(env, addr, MMU_DATA_LOAD, mmu_idx, &res, &fi); + *attrs =3D res.attrs; =20 if (ret) { return -1; } - return phys_addr; + return res.phys; } diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c index 5a709eab56f..ad225b1cb20 100644 --- a/target/arm/tlb_helper.c +++ b/target/arm/tlb_helper.c @@ -209,11 +209,8 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, { ARMCPU *cpu =3D ARM_CPU(cs); ARMMMUFaultInfo fi =3D {}; - hwaddr phys_addr; - target_ulong page_size; - int prot, ret; - MemTxAttrs attrs =3D {}; - ARMCacheAttrs cacheattrs =3D {}; + GetPhysAddrResult res =3D {}; + int ret; =20 /* * Walk the page table and (if the mapping exists) add the page @@ -223,25 +220,24 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, in= t size, */ ret =3D get_phys_addr(&cpu->env, address, access_type, core_to_arm_mmu_idx(&cpu->env, mmu_idx), - &phys_addr, &attrs, &prot, &page_size, - &fi, &cacheattrs); + &res, &fi); if (likely(!ret)) { /* * Map a single [sub]page. Regions smaller than our declared * target page size are handled specially, so for those we * pass in the exact addresses. */ - if (page_size >=3D TARGET_PAGE_SIZE) { - phys_addr &=3D TARGET_PAGE_MASK; + if (res.page_size >=3D TARGET_PAGE_SIZE) { + res.phys &=3D TARGET_PAGE_MASK; address &=3D TARGET_PAGE_MASK; } /* Notice and record tagged memory. */ - if (cpu_isar_feature(aa64_mte, cpu) && cacheattrs.attrs =3D=3D 0xf= 0) { - arm_tlb_mte_tagged(&attrs) =3D true; + if (cpu_isar_feature(aa64_mte, cpu) && res.cacheattrs.attrs =3D=3D= 0xf0) { + arm_tlb_mte_tagged(&res.attrs) =3D true; } =20 - tlb_set_page_with_attrs(cs, address, phys_addr, attrs, - prot, mmu_idx, page_size); + tlb_set_page_with_attrs(cs, address, res.phys, res.attrs, + res.prot, mmu_idx, res.page_size); return true; } else if (probe) { return false; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871323; cv=none; d=zohomail.com; s=zohoarc; b=IcHykVLMxRL4dOunNfuVPslaMPjA02iLR/JZdgXuiMdz087FoVqANZibco1tmnMYRe4mep7CtfgWf3ul4C14ZdgOb2eP1vfltxt7raHtdVjb2adpyi03R4uOuBPcziLLboIBx0+ROa/cHtzz9VfYCoF+iuD4UtJ/d3gIJ2gXtPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871323; 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=gRurciE+TALpwZNtDPbsw3br2HBbVUeEcSlrHdrEwwM=; b=TR4EvPj4yMSfW0laZwYRMruRqQLMwf792/+oD8gP1qheHiihe0mdjpTGcLLHZBVsDq0pyqut4sGEbtsihXf/H5gfccQEoCMDyBlMF7Xb3dcxlm+FuIood3V7kPVSAjzZPF3qJEbTU8dEoAdOMfkkesrV7QCaO7FYX/aDJ1Ic6Ms= 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 1663871323480415.12913938180304; Thu, 22 Sep 2022 11:28:43 -0700 (PDT) Received: from localhost ([::1]:51408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQwD-0005Xq-Ko for importer@patchew.org; Thu, 22 Sep 2022 14:28:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAv-00029z-7v for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:50853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAs-0005Np-4W for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:44 -0400 Received: by mail-wm1-x334.google.com with SMTP id ay36so7182290wmb.0 for ; Thu, 22 Sep 2022 09:35:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=gRurciE+TALpwZNtDPbsw3br2HBbVUeEcSlrHdrEwwM=; b=Y7KZiyGtMcnKoE/LrGEkqenSMkTO/3bYbazi0A9vEO5CPthvzNyAfs+lDhrgefT0xd qLcfJ03eu4X0gnXgUFjCYqfIlje9rdTWfe+JBV9mSVUbKsGjIAxDvVAuPJk7+cff0uvY VabMTAUXNB01auZHwt483xe5vkfg6i21/eWAr+hF/1yKNxF9mrJQY6hT6VqHOwP3pvRX eGC303ut/WK1MZ7yIz224WRmiOWfuR8oMqoCrn/4co4NcJi6QLzFelarN3gpNAKR8e18 /9f7NlXXuNFbiXaoecSUsLUmMhrunTOgLcxd82hlJ9TNSRnOniObx1qTsdpWtMv4WQuK 0YDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=gRurciE+TALpwZNtDPbsw3br2HBbVUeEcSlrHdrEwwM=; b=6Zxp1icW3KHX7sGmUBKU4B7z6QQCjVuhUVa0xBQ1C8QHWV0D7cWaVVgFCpX8Qm0aPQ nbKWxbBELS+9GmCoFVhXJFDroWWvMA6zn0dRatoGA423jvNORvoBdZvw9qit+s9ACbI1 5FX9eJqJO0j+eh3dzWLUft6tcjPMQwBOWjJLvkg4sY5sxUHwxSLyutXMvMnh2F3JrHxK ii87Vmfo0gXnIiRnXvyGFS1yze7lH5nHI54HTX8ZrSMBR3JsN5EH6vnrRVAuHuAqtSqZ +aUS/gus4yJNlCUCFh7nK57AW/4gYINXQR1JGYwQbgVd9P22sEwRV/a3lg2owlMh8gVh FDlA== X-Gm-Message-State: ACrzQf1Bs+AyDoRKwMEhLi3j25aaupKiRxka1KV12/MSa00DqoQtGsO6 vl4GH/2cuRhVhfiY4HEsgWsPCvTCsVHKcA== X-Google-Smtp-Source: AMsMyM79cU9eQLnTJpbpJJ5zQHf5cV7W3ScaKGncCq8TvYoVyCugcvJU7LyPe2JLVOPBiFrTY7haeg== X-Received: by 2002:a05:600c:898:b0:3b4:8110:7fab with SMTP id l24-20020a05600c089800b003b481107fabmr9705548wmp.19.1663864541282; Thu, 22 Sep 2022 09:35:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/39] target/arm: Use GetPhysAddrResult in get_phys_addr_lpae Date: Thu, 22 Sep 2022 17:35:01 +0100 Message-Id: <20220922163536.1096175-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871324407100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-4-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 69 ++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 8db2abac015..e8d3f88628e 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -16,10 +16,8 @@ =20 static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, MMUAccessType access_type, ARMMMUIdx mmu_id= x, - bool s1_is_el0, hwaddr *phys_ptr, - MemTxAttrs *txattrs, int *prot, - target_ulong *page_size_ptr, - ARMMMUFaultInfo *fi, ARMCacheAttrs *cacheat= trs) + bool s1_is_el0, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) __attribute__((nonnull)); =20 /* This mapping is common between ID_AA64MMFR0.PARANGE and TCR_ELx.{I}PS. = */ @@ -204,18 +202,13 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMM= MUIdx mmu_idx, { if (arm_mmu_idx_is_stage1_of_2(mmu_idx) && !regime_translation_disabled(env, ARMMMUIdx_Stage2)) { - target_ulong s2size; - hwaddr s2pa; - int s2prot; - int ret; ARMMMUIdx s2_mmu_idx =3D *is_secure ? ARMMMUIdx_Stage2_S : ARMMMUIdx_Stage2; - ARMCacheAttrs cacheattrs =3D {}; - MemTxAttrs txattrs =3D {}; + GetPhysAddrResult s2 =3D {}; + int ret; =20 ret =3D get_phys_addr_lpae(env, addr, MMU_DATA_LOAD, s2_mmu_idx, f= alse, - &s2pa, &txattrs, &s2prot, &s2size, fi, - &cacheattrs); + &s2, fi); if (ret) { assert(fi->type !=3D ARMFault_None); fi->s2addr =3D addr; @@ -225,7 +218,7 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMU= Idx mmu_idx, return ~0; } if ((arm_hcr_el2_eff(env) & HCR_PTW) && - ptw_attrs_are_device(env, cacheattrs)) { + ptw_attrs_are_device(env, s2.cacheattrs)) { /* * PTW set and S1 walk touched S2 Device memory: * generate Permission fault. @@ -249,7 +242,7 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMU= Idx mmu_idx, assert(!*is_secure); } =20 - addr =3D s2pa; + addr =3D s2.phys; } return addr; } @@ -972,19 +965,13 @@ static bool check_s2_mmu_setup(ARMCPU *cpu, bool is_a= a64, int level, * table walk), must be true if this is stage 2 of a stage 1+2 * walk for an EL0 access. If @mmu_idx is anything else, * @s1_is_el0 is ignored. - * @phys_ptr: set to the physical address corresponding to the virtual add= ress - * @attrs: set to the memory transaction attributes to use - * @prot: set to the permissions for the page containing phys_ptr - * @page_size_ptr: set to the size of the page containing phys_ptr + * @result: set on translation success, * @fi: set to fault info if the translation fails - * @cacheattrs: (if non-NULL) set to the cacheability/shareability attribu= tes */ static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, MMUAccessType access_type, ARMMMUIdx mmu_id= x, - bool s1_is_el0, hwaddr *phys_ptr, - MemTxAttrs *txattrs, int *prot, - target_ulong *page_size_ptr, - ARMMMUFaultInfo *fi, ARMCacheAttrs *cacheat= trs) + bool s1_is_el0, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) { ARMCPU *cpu =3D env_archcpu(env); /* Read an LPAE long-descriptor translation table. */ @@ -1302,16 +1289,16 @@ static bool get_phys_addr_lpae(CPUARMState *env, ui= nt64_t address, if (mmu_idx =3D=3D ARMMMUIdx_Stage2 || mmu_idx =3D=3D ARMMMUIdx_Stage2= _S) { ns =3D mmu_idx =3D=3D ARMMMUIdx_Stage2; xn =3D extract32(attrs, 11, 2); - *prot =3D get_S2prot(env, ap, xn, s1_is_el0); + result->prot =3D get_S2prot(env, ap, xn, s1_is_el0); } else { ns =3D extract32(attrs, 3, 1); xn =3D extract32(attrs, 12, 1); pxn =3D extract32(attrs, 11, 1); - *prot =3D get_S1prot(env, mmu_idx, aarch64, ap, ns, xn, pxn); + result->prot =3D get_S1prot(env, mmu_idx, aarch64, ap, ns, xn, pxn= ); } =20 fault_type =3D ARMFault_Permission; - if (!(*prot & (1 << access_type))) { + if (!(result->prot & (1 << access_type))) { goto do_fault; } =20 @@ -1321,23 +1308,23 @@ static bool get_phys_addr_lpae(CPUARMState *env, ui= nt64_t address, * the CPU doesn't support TZ or this is a non-secure translation * regime, because the attribute will already be non-secure. */ - txattrs->secure =3D false; + result->attrs.secure =3D false; } /* When in aarch64 mode, and BTI is enabled, remember GP in the IOTLB.= */ if (aarch64 && guarded && cpu_isar_feature(aa64_bti, cpu)) { - arm_tlb_bti_gp(txattrs) =3D true; + arm_tlb_bti_gp(&result->attrs) =3D true; } =20 if (mmu_idx =3D=3D ARMMMUIdx_Stage2 || mmu_idx =3D=3D ARMMMUIdx_Stage2= _S) { - cacheattrs->is_s2_format =3D true; - cacheattrs->attrs =3D extract32(attrs, 0, 4); + result->cacheattrs.is_s2_format =3D true; + result->cacheattrs.attrs =3D extract32(attrs, 0, 4); } else { /* Index into MAIR registers for cache attributes */ uint8_t attrindx =3D extract32(attrs, 0, 3); uint64_t mair =3D env->cp15.mair_el[regime_el(env, mmu_idx)]; assert(attrindx <=3D 7); - cacheattrs->is_s2_format =3D false; - cacheattrs->attrs =3D extract64(mair, attrindx * 8, 8); + result->cacheattrs.is_s2_format =3D false; + result->cacheattrs.attrs =3D extract64(mair, attrindx * 8, 8); } =20 /* @@ -1346,13 +1333,13 @@ static bool get_phys_addr_lpae(CPUARMState *env, ui= nt64_t address, * that case comes from TCR_ELx, which we extracted earlier. */ if (param.ds) { - cacheattrs->shareability =3D param.sh; + result->cacheattrs.shareability =3D param.sh; } else { - cacheattrs->shareability =3D extract32(attrs, 6, 2); + result->cacheattrs.shareability =3D extract32(attrs, 6, 2); } =20 - *phys_ptr =3D descaddr; - *page_size_ptr =3D page_size; + result->phys =3D descaddr; + result->page_size =3D page_size; return false; =20 do_fault: @@ -2356,10 +2343,8 @@ bool get_phys_addr(CPUARMState *env, target_ulong ad= dress, cacheattrs1 =3D result->cacheattrs; memset(result, 0, sizeof(*result)); =20 - ret =3D get_phys_addr_lpae(env, ipa, access_type, s2_mmu_idx, = is_el0, - &result->phys, &result->attrs, - &result->prot, &result->page_size, - fi, &result->cacheattrs); + ret =3D get_phys_addr_lpae(env, ipa, access_type, s2_mmu_idx, + is_el0, result, fi); fi->s2addr =3D ipa; =20 /* Combine the S1 and S2 perms. */ @@ -2530,9 +2515,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, =20 if (regime_using_lpae_format(env, mmu_idx)) { return get_phys_addr_lpae(env, address, access_type, mmu_idx, fals= e, - &result->phys, &result->attrs, - &result->prot, &result->page_size, - fi, &result->cacheattrs); + result, fi); } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) { return get_phys_addr_v6(env, address, access_type, mmu_idx, &result->phys, &result->attrs, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871046; cv=none; d=zohomail.com; s=zohoarc; b=Jn9coyCoFBRuk62+h+A1SEYHV0Oa4g0N8yLzYQAMNt5LdxwK54fVIqnIDi55P/yEvuENuFQxNX2KcRLlDJcITTnvbFidgXZDRbwDkc0f4ScEw+iL7HGC7oZnNoBI0fP47fU5CLZ2eG5qM4YrF3Zu8yErk+7IUB+PjnnnBXyUBZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871046; 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=C+doTJSJOl2nd6rP7/lJYWFoQI5eFRk8b87lknsYPRs=; b=N18nEetf6jK+ZdggV9GLVEGxEIwzEKQl/lwfAJsO7WBwFIHaBl4Fxa0fEYPZv6uNOAVf6dQils/SwK0qRtcgQJRX3E58HNK7tlZ9tegDhJmfcU4p6+561DPh6Hs/sJQ0bzrsjYLt2svp9rgERDZxhGUybCDIoeE3IFgWdnRPgUg= 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 166387104668443.46313583155916; Thu, 22 Sep 2022 11:24:06 -0700 (PDT) Received: from localhost ([::1]:59470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQrl-0000v8-Gp for importer@patchew.org; Thu, 22 Sep 2022 14:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAw-0002AM-Gs for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:48 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAt-0005OU-L1 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:46 -0400 Received: by mail-wm1-x32d.google.com with SMTP id e18so7138556wmq.3 for ; Thu, 22 Sep 2022 09:35:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=C+doTJSJOl2nd6rP7/lJYWFoQI5eFRk8b87lknsYPRs=; b=uVPYNtCdvijZvx0PZIRbJ08oHw6MDi/KwhcUbsnfPg/+7WcbasInA55kaklCq8vjiz 6b3CD1ue5DW17T0QeZIASAR7AWS3FOzqno8lkUnTkaSRMEX18w6PFl/XD7SXQ6Z2yqvN sqMr8+6/YgoP6NW18vpQeovjM6MgiI3Mdm1mh7hEjO+kJFdLqVpZvytvBDObUCvaDY6a x/v29ATv9InWI6Kx9FnNLd620mvT1889rxKAkCaaJWet9XIG4qVFGh7tRAdUYJNqTkLf +RpTpFFgrD5wtQWpJ0NHAJFLlbL2KKVXU9uECuB2knWnu2024jEm5YzhyJgkj+aWYKgm 5gHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=C+doTJSJOl2nd6rP7/lJYWFoQI5eFRk8b87lknsYPRs=; b=cdLgRjyrxkIKEKfCVhKA9L/gD/OxtLdSJQTQuPSTILNhNsULJdBvEUgLQdT6fs5jGr Lrwi43Vj+fC6k7Bb6v8uhxXIxg+KcUM+b+0YcHXxdKvUrguBJR9ORVjAuPullB202nhl BJNG2XcKa+S7k9bN6U5Qt/e6dz77J6PQZmNg7oMXhb06gsNYYrK3v9Hvpth3mbg2YDRh qlew9hLnqpStoy8o4HLoM+KqEOLkD1j05kEHXJ78GswlrBoGr9CsM1KpLPUybUlq45Pd w5V/w2ca4ZxvwMP4o7oOaAzAv5683zMuso8O4IMKpOqiQyS6SNexlArS3ef4YVcR4ppm jq1w== X-Gm-Message-State: ACrzQf07nSKCcJ44rH0nj8jrT/RiZRdl1r2zfJ5xUGij0SqVXxlR2nVH L5jfX3YUNQneZ/i2cZOSfkzn88s1ZNEHpQ== X-Google-Smtp-Source: AMsMyM5kWLUiUef3p68G8+f20jmnAZ6Trpcc0Em5jZih7K6o73Hejpbpe+ei5XXwJOhRiLP3YIKexw== X-Received: by 2002:a05:600c:4352:b0:3b4:84c0:2006 with SMTP id r18-20020a05600c435200b003b484c02006mr3064717wme.205.1663864541979; Thu, 22 Sep 2022 09:35:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/39] target/arm: Use GetPhysAddrResult in get_phys_addr_v6 Date: Thu, 22 Sep 2022 17:35:02 +0100 Message-Id: <20220922163536.1096175-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871047838100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-5-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index e8d3f88628e..600d9e6650d 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -536,8 +536,7 @@ do_fault: =20 static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, MemTxAttrs *attrs, int *pro= t, - target_ulong *page_size, ARMMMUFaultInfo *fi) + GetPhysAddrResult *result, ARMMMUFaultInfo *f= i) { ARMCPU *cpu =3D env_archcpu(env); int level =3D 1; @@ -597,11 +596,11 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32= _t address, phys_addr =3D (desc & 0xff000000) | (address & 0x00ffffff); phys_addr |=3D (uint64_t)extract32(desc, 20, 4) << 32; phys_addr |=3D (uint64_t)extract32(desc, 5, 4) << 36; - *page_size =3D 0x1000000; + result->page_size =3D 0x1000000; } else { /* Section. */ phys_addr =3D (desc & 0xfff00000) | (address & 0x000fffff); - *page_size =3D 0x100000; + result->page_size =3D 0x100000; } ap =3D ((desc >> 10) & 3) | ((desc >> 13) & 4); xn =3D desc & (1 << 4); @@ -627,12 +626,12 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32= _t address, case 1: /* 64k page. */ phys_addr =3D (desc & 0xffff0000) | (address & 0xffff); xn =3D desc & (1 << 15); - *page_size =3D 0x10000; + result->page_size =3D 0x10000; break; case 2: case 3: /* 4k page. */ phys_addr =3D (desc & 0xfffff000) | (address & 0xfff); xn =3D desc & 1; - *page_size =3D 0x1000; + result->page_size =3D 0x1000; break; default: /* Never happens, but compiler isn't smart enough to tell. */ @@ -640,7 +639,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t= address, } } if (domain_prot =3D=3D 3) { - *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + result->prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; } else { if (pxn && !regime_is_user(env, mmu_idx)) { xn =3D 1; @@ -658,14 +657,14 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32= _t address, fi->type =3D ARMFault_AccessFlag; goto do_fault; } - *prot =3D simple_ap_to_rw_prot(env, mmu_idx, ap >> 1); + result->prot =3D simple_ap_to_rw_prot(env, mmu_idx, ap >> 1); } else { - *prot =3D ap_to_rw_prot(env, mmu_idx, ap, domain_prot); + result->prot =3D ap_to_rw_prot(env, mmu_idx, ap, domain_prot); } - if (*prot && !xn) { - *prot |=3D PAGE_EXEC; + if (result->prot && !xn) { + result->prot |=3D PAGE_EXEC; } - if (!(*prot & (1 << access_type))) { + if (!(result->prot & (1 << access_type))) { /* Access permission fault. */ fi->type =3D ARMFault_Permission; goto do_fault; @@ -676,9 +675,9 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t= address, * the CPU doesn't support TZ or this is a non-secure translation * regime, because the attribute will already be non-secure. */ - attrs->secure =3D false; + result->attrs.secure =3D false; } - *phys_ptr =3D phys_addr; + result->phys =3D phys_addr; return false; do_fault: fi->domain =3D domain; @@ -2518,8 +2517,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, result, fi); } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) { return get_phys_addr_v6(env, address, access_type, mmu_idx, - &result->phys, &result->attrs, - &result->prot, &result->page_size, fi); + result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, &result->phys, &result->prot, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663869803; cv=none; d=zohomail.com; s=zohoarc; b=j+sYQyW8iVDz67LDw64yBxrEJBak131/xabHAuSSzphKYh34DnlwPB5clEIXhuFXtxb1BQVQL9DNxSxTyZsUnHmHHoqNRF6/x6mpnhGqntDCPHKGD9ganlUgynHLBy/1s6Y7SqsEmABN6cOzYz+eQF3jTtJq923Ky2zCGFMv7cQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663869803; 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=eQDdX78ZoQvVzGawdbiqTYqIYpkUGBdGasPvevMFAeU=; b=ML6pvDNTM1pG6MJCwOcOZ7akRB89ZIq1Xxh517SE8lk/YgvRDKWkF0DYmhmGBXTxMMCb3UT/L2goO7jPY+HinVGISv8SUQCvPLgJH9FQJ1FvKqBJld6Pfk414UfO7gPRN/7J89dT+ZnZgdnOOQPnx32EtUD0CenFjD37mgtnAuA= 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 1663869803362944.8807235030459; Thu, 22 Sep 2022 11:03:23 -0700 (PDT) Received: from localhost ([::1]:34120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQXg-0004UR-Vf for importer@patchew.org; Thu, 22 Sep 2022 14:03:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAw-0002AO-Pp for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:48 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:53869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAu-0005Of-Ug for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:46 -0400 Received: by mail-wm1-x32f.google.com with SMTP id e18so7138577wmq.3 for ; Thu, 22 Sep 2022 09:35:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=eQDdX78ZoQvVzGawdbiqTYqIYpkUGBdGasPvevMFAeU=; b=u9r3Eytj/iz08hDVl8t3xIYPAy/5uG93jba9cYXVp76GviKCLwRE7UlmEUiX1OBObs +QYL1toZM7CeOt7vqA961AScic14ULglu4QrKAAeXwa0BVzgPOysuDAeZf6xffrEPQJL qHryaRE6xAmpxH8tu8zm5Q57xz8E9cFs5P97zAC+Bn8KZ4/7clT4xQr5OcnCXkWCAxM/ h1Znn7mU/dS8kUZsXYCaOyf5LcaAgUKN96FBhWsxf6SEuBi3yeiH8ZKFC4zyDccsOjgH +ofvgGQNXR+AgWFznPfcFAyqbrCoTxHoEMvsYXb6jv2FTQvopxPPXX/6P+Eg3iAMoIS4 wSxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=eQDdX78ZoQvVzGawdbiqTYqIYpkUGBdGasPvevMFAeU=; b=om3/Ii6Zpgy6mReHIcZ1uYJ4ExqlCyv4utQTT0wbAaNGBq/OszgsNxBrCgfDHn+9nS j16yFsEepdggZpQo/lo3ZWl9O9Qd3MYR6WC4Ad8nu20ohVJhivjOk6j7iPUwwSjUqTPx ahYVdAWSXlNUPivVd7tE1jTQGKcN84gSTFq9Za/BfCenWl4353L/wuwAOcEPDjcLb/1w jPh6koZx4GWnWbrAadmaL4XsPvf8bHuvkzwQm6++KD7Ynu5vgpf6tWlFC0D3H0+xNLEc oYhuYRh5GZAi8K46IPBTRSOUg0DTVFE38Mh304Z8mUa7aB2/xJvOcn5NVNRj8mX4cwAh UyeQ== X-Gm-Message-State: ACrzQf3Fqoa1NXFYvxFolYLbyFnKVvovaCh8D1HZv7hHdwoXyeyA7Vn+ U5CxNqv3KU8dY0ZG8kogZklQkWmdloqFLw== X-Google-Smtp-Source: AMsMyM7jLnwSzMylnz7EXGbOSZ1esVqPBODgcBOAkqqtnMbIzREtXEN4zFrdfBvuQcKrreXYSvheQw== X-Received: by 2002:a05:600c:2142:b0:3b4:92b6:73ba with SMTP id v2-20020a05600c214200b003b492b673bamr10409354wml.139.1663864542619; Thu, 22 Sep 2022 09:35:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/39] target/arm: Use GetPhysAddrResult in get_phys_addr_v5 Date: Thu, 22 Sep 2022 17:35:03 +0100 Message-Id: <20220922163536.1096175-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663869804881100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-6-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 600d9e6650d..4e2476278e1 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -414,9 +414,7 @@ static int simple_ap_to_rw_prot(CPUARMState *env, ARMMM= UIdx mmu_idx, int ap) =20 static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, int *prot, - target_ulong *page_size, - ARMMMUFaultInfo *fi) + GetPhysAddrResult *result, ARMMMUFaultInfo *f= i) { int level =3D 1; uint32_t table; @@ -464,7 +462,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t= address, /* 1Mb section. */ phys_addr =3D (desc & 0xfff00000) | (address & 0x000fffff); ap =3D (desc >> 10) & 3; - *page_size =3D 1024 * 1024; + result->page_size =3D 1024 * 1024; } else { /* Lookup l2 entry. */ if (type =3D=3D 1) { @@ -486,12 +484,12 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32= _t address, case 1: /* 64k page. */ phys_addr =3D (desc & 0xffff0000) | (address & 0xffff); ap =3D (desc >> (4 + ((address >> 13) & 6))) & 3; - *page_size =3D 0x10000; + result->page_size =3D 0x10000; break; case 2: /* 4k page. */ phys_addr =3D (desc & 0xfffff000) | (address & 0xfff); ap =3D (desc >> (4 + ((address >> 9) & 6))) & 3; - *page_size =3D 0x1000; + result->page_size =3D 0x1000; break; case 3: /* 1k page, or ARMv6/XScale "extended small (4k) page" */ if (type =3D=3D 1) { @@ -499,7 +497,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t= address, if (arm_feature(env, ARM_FEATURE_XSCALE) || arm_feature(env, ARM_FEATURE_V6)) { phys_addr =3D (desc & 0xfffff000) | (address & 0xfff); - *page_size =3D 0x1000; + result->page_size =3D 0x1000; } else { /* * UNPREDICTABLE in ARMv5; we choose to take a @@ -510,7 +508,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t= address, } } else { phys_addr =3D (desc & 0xfffffc00) | (address & 0x3ff); - *page_size =3D 0x400; + result->page_size =3D 0x400; } ap =3D (desc >> 4) & 3; break; @@ -519,14 +517,14 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32= _t address, g_assert_not_reached(); } } - *prot =3D ap_to_rw_prot(env, mmu_idx, ap, domain_prot); - *prot |=3D *prot ? PAGE_EXEC : 0; - if (!(*prot & (1 << access_type))) { + result->prot =3D ap_to_rw_prot(env, mmu_idx, ap, domain_prot); + result->prot |=3D result->prot ? PAGE_EXEC : 0; + if (!(result->prot & (1 << access_type))) { /* Access permission fault. */ fi->type =3D ARMFault_Permission; goto do_fault; } - *phys_ptr =3D phys_addr; + result->phys =3D phys_addr; return false; do_fault: fi->domain =3D domain; @@ -2520,8 +2518,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, - &result->phys, &result->prot, - &result->page_size, fi); + result, fi); } } =20 --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663864940; cv=none; d=zohomail.com; s=zohoarc; b=UFcazz73wd5tmn8YtoDc37XDv/ExUJOWIFEVTBImwBcKIb+MxEL9skvUjdXRwFAvJR1VHj8+ixY2YrIMO5LMsccvXDnZzAxRVwCxvYMQgfvSC6GjFZ0eVt3e6Es3Caerav2SdKQc3VjqXFaRA19HTygLz0PrPWpzw4r61unrHeA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663864940; 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=o5zeYSJg5vCaz9F7elm+Lb7yX0lwKPPrfwrGwePP0L0=; b=ABsOfGsBWc0hsN2XunWyBHVqPyN3tuFR31kR+7UxnaWeWUCvRUWvNhwjIswDqAc+O82ChZTvJ5DMdUsAah4r1o/279NIX93wxST9XGWEmGZQJr7IDuUvq3M5qI49/IjIcgCIek64N7e3CLkOyJMbNvcEgHQMP0TSMXhNFgp1Vk4= 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 166386494023363.1900215170125; Thu, 22 Sep 2022 09:42:20 -0700 (PDT) Received: from localhost ([::1]:47698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPHH-0007dR-6i for importer@patchew.org; Thu, 22 Sep 2022 12:42:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAw-0002AN-JZ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:48 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:35656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAu-0005Oi-OO for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:46 -0400 Received: by mail-wm1-x32c.google.com with SMTP id r133-20020a1c448b000000b003b494ffc00bso1729065wma.0 for ; Thu, 22 Sep 2022 09:35:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=o5zeYSJg5vCaz9F7elm+Lb7yX0lwKPPrfwrGwePP0L0=; b=pClGnQWnxKSJRIXzNXziopG1TS2foJc+Ju1mUf4fmsTg7SERjUe7FeBY71TLpSW4T5 +YO+p7Z3xXpxBnluGjylLpWWBmJNtrsXsCxSHeGxpF4iFGAzse7MERf5OJlO3wBvHyTg SAsjiLr6fAU/DcySJHnsTFvWFQb+CXUk/SYarxK5kMd8zoQwCZOi2dpU1peGrayPeLaY AIhPao8WvU3wfMOx5Bq4ST/CGjnkbVL8ccRohzXe1PACoRqRzh8py9rhyDMhxttuY9Wy VtYW9xQUP11Z9acy365btxPXIPlheNMD2XHxFxn8obrEr5jkT/a7u5BL2XhWhnyGZIMu oKXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=o5zeYSJg5vCaz9F7elm+Lb7yX0lwKPPrfwrGwePP0L0=; b=SMpGHexryiRKlC+Kqk5BNYkEDM52tCrpnnxFarlGNVHLHaIjfvOzQo9MkJUmg/SGCe nqjyjQhLeHLOJW8NHXRLVIJyKdEL0tYOVAUX2MBmaZxXRMLznIBo345730/Qi9Qo9vqA wKjTIrNt+/Kh49rECoZhw8v/DYmgYmFckdRYBpf1a/vBJUkIf+4gVcJBq2zqcgMbRr5K NCTcgGfKlWuphuB306XyVOEr5U/jvtRSSuSjPYJ79pRvffNz/3y56cp9cwjbW6nTfTEg OMdNS+dSet5Oglc0V034GueF2tuT+zJt5JPvVWa1gYkBKPjVjfRk3aAXOu9KUIlX/gwI BBIw== X-Gm-Message-State: ACrzQf2yhAAoGJBy2JGdiR5mvA+EA93Gk7hFJ9u9ne+hr0lY1ku2wX6c kCKZAR2g1tC7uFu5dfuMQVpz8lRKt0RSyQ== X-Google-Smtp-Source: AMsMyM6hhoQ3RSV40TLcJTGoKOi5/KNXt3ec7Tua/qfA2+VmbNw+e0ETPNrYU7cG0tzwTmWDIptn7A== X-Received: by 2002:a05:600c:350f:b0:3b4:c5f2:4295 with SMTP id h15-20020a05600c350f00b003b4c5f24295mr3097609wmq.200.1663864543226; Thu, 22 Sep 2022 09:35:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav5 Date: Thu, 22 Sep 2022 17:35:04 +0100 Message-Id: <20220922163536.1096175-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663864942515100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-7-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 4e2476278e1..70abcce81f9 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1351,7 +1351,7 @@ do_fault: =20 static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_= idx, - hwaddr *phys_ptr, int *prot, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { int n; @@ -1361,12 +1361,12 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, = uint32_t address, =20 if (regime_translation_disabled(env, mmu_idx)) { /* MPU disabled. */ - *phys_ptr =3D address; - *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + result->phys =3D address; + result->prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; return false; } =20 - *phys_ptr =3D address; + result->phys =3D address; for (n =3D 7; n >=3D 0; n--) { base =3D env->cp15.c6_region[n]; if ((base & 1) =3D=3D 0) { @@ -1402,16 +1402,16 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, = uint32_t address, fi->level =3D 1; return true; } - *prot =3D PAGE_READ | PAGE_WRITE; + result->prot =3D PAGE_READ | PAGE_WRITE; break; case 2: - *prot =3D PAGE_READ; + result->prot =3D PAGE_READ; if (!is_user) { - *prot |=3D PAGE_WRITE; + result->prot |=3D PAGE_WRITE; } break; case 3: - *prot =3D PAGE_READ | PAGE_WRITE; + result->prot =3D PAGE_READ | PAGE_WRITE; break; case 5: if (is_user) { @@ -1419,10 +1419,10 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, = uint32_t address, fi->level =3D 1; return true; } - *prot =3D PAGE_READ; + result->prot =3D PAGE_READ; break; case 6: - *prot =3D PAGE_READ; + result->prot =3D PAGE_READ; break; default: /* Bad permission. */ @@ -1430,7 +1430,7 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, ui= nt32_t address, fi->level =3D 1; return true; } - *prot |=3D PAGE_EXEC; + result->prot |=3D PAGE_EXEC; return false; } =20 @@ -2427,7 +2427,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, } else { /* Pre-v7 MPU */ ret =3D get_phys_addr_pmsav5(env, address, access_type, mmu_id= x, - &result->phys, &result->prot, fi); + result, fi); } qemu_log_mask(CPU_LOG_MMU, "PMSA MPU lookup for %s at 0x%08" PRIx32 " mmu_idx %u -> %s (prot %c%c%c)\n", --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663867473; cv=none; d=zohomail.com; s=zohoarc; b=MqEhffG5dgKRhvXgGmihSjOw7mN0czujYZUytcXcSl90QB/uFTGYipPL7/ooIi/el9ZCBPgpsKGgUIHTCSGWSNrYXdjrsPAEQuicE03bKcF/oEha431Vlwjsp9esI98kxtZcI64iWhVZKEyA6BP2q9v0PTTb8c3HeHS3gR/qT9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663867473; 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=7vq62INdvh89oZxGuCtLE86QHeaZAIKNvQoTb90xEPY=; b=i0LU/QTA46tapQhBI9FpVq2NzO63UgOGoLImPPKyOrUW39B01pYDknDfWB91YObgm8Qdf+SZDj8mB1FCZQLZVKzRUCRbEzISPYWZHq+BQY1ntAs8tpEhG0kvYGFlm/64f4iNVVhWMMBGhM+HN6QFU1e9FiLG51cchy3Ss0e0zH0= 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 166386747344162.436584119782765; Thu, 22 Sep 2022 10:24:33 -0700 (PDT) Received: from localhost ([::1]:58966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPw8-0005lN-E0 for importer@patchew.org; Thu, 22 Sep 2022 13:24:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAx-0002AQ-QG for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:48 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAv-0005Om-Cw for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: by mail-wm1-x32d.google.com with SMTP id e10-20020a05600c4e4a00b003b4eff4ab2cso1687692wmq.4 for ; Thu, 22 Sep 2022 09:35:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=7vq62INdvh89oZxGuCtLE86QHeaZAIKNvQoTb90xEPY=; b=etf4zzPqCOkJEHYvhSOiTkIc7xYU5aG3q1aNRl9VzRpSzvtV95bZ62g3sPAj2IZnRL DKKqbTuBKroUAKZaCDCPAj5YUh8f9MDSzTsao7HC21qll2pQ1h1NU593Tim4FjKLdRcX h0yaXW3xbOwU2lohcah4QDx0Wm2oNnuPZX+2FRwTTGpnlGLG0pDRDTwbF101Amc3ZoY/ SsjHfjfa6t1PJxaGXbwKCmr9mZ8u4WYBTDAkV5NSTipcq5Wgm3KJps8gxd6YOSHudU9I 8vjtdssSKEhRWfmHCWB/7Tq5m0og/dkg4tmh4SideNRwLYr2kuTnCfo4Of0DaQhDMZoX elxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=7vq62INdvh89oZxGuCtLE86QHeaZAIKNvQoTb90xEPY=; b=sknXRVNHmwdG5cTd8KK4ludjvIh3CGeq/dDVIghJ5d+lXSkJ6rg+l4OqrDS44oudDm mip1ri8jmpCDbjEo75w4xKqw+C6U8uNzuMYOz6akOhenToQagzWVHj+pC3e97uEqpGbW Y4BNs2iZ3IZkws0cPpi5G0TddSawk1EeJxzd5KFIgVvqKqSQIMSFE1bOIkbJq3lDnk4L cQYWEYP1aQ/gBAzDV+BQjTFPAcwKyWbCnjr0SipRmbWW7BOUBsFRfjVMFYQ4ZQ55AeH3 VrOYJV1LA0gRaw29L1TLkVH9CM2ISQhO/i6Q29FblWhVpKkfUQMZ7qbD+U+FuHei1XHX chYg== X-Gm-Message-State: ACrzQf3cgwayMF9Nnh5xpA9THzu7fXC4IwlW/fBYFJN0WWfeqVAvz75X Y+hOBqJ9B4l5wEtNsvh4JDVzJ8knw+BEPQ== X-Google-Smtp-Source: AMsMyM5qciVJj6dP1vxLXXa8BqZ6HJX2+CCXduc654WMSODM8EtFW28ENApNEtV5T7zwH1w0q8hasw== X-Received: by 2002:a05:600c:3ba0:b0:3b4:8ad0:6c with SMTP id n32-20020a05600c3ba000b003b48ad0006cmr9997444wms.186.1663864543911; Thu, 22 Sep 2022 09:35:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav7 Date: Thu, 22 Sep 2022 17:35:05 +0100 Message-Id: <20220922163536.1096175-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663867475249100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-8-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 70abcce81f9..36b108907fc 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1513,17 +1513,16 @@ static bool pmsav7_use_background_region(ARMCPU *cp= u, ARMMMUIdx mmu_idx, =20 static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_= idx, - hwaddr *phys_ptr, int *prot, - target_ulong *page_size, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { ARMCPU *cpu =3D env_archcpu(env); int n; bool is_user =3D regime_is_user(env, mmu_idx); =20 - *phys_ptr =3D address; - *page_size =3D TARGET_PAGE_SIZE; - *prot =3D 0; + result->phys =3D address; + result->page_size =3D TARGET_PAGE_SIZE; + result->prot =3D 0; =20 if (regime_translation_disabled(env, mmu_idx) || m_is_ppb_region(env, address)) { @@ -1535,7 +1534,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, * which always does a direct read using address_space_ldl(), rath= er * than going via this function, so we don't need to check that he= re. */ - get_phys_addr_pmsav7_default(env, mmu_idx, address, prot); + get_phys_addr_pmsav7_default(env, mmu_idx, address, &result->prot); } else { /* MPU enabled */ for (n =3D (int)cpu->pmsav7_dregion - 1; n >=3D 0; n--) { /* region search */ @@ -1577,7 +1576,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, if (ranges_overlap(base, rmask, address & TARGET_PAGE_MASK, TARGET_PAGE_SIZE)) { - *page_size =3D 1; + result->page_size =3D 1; } continue; } @@ -1615,7 +1614,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, continue; } if (rsize < TARGET_PAGE_BITS) { - *page_size =3D 1 << rsize; + result->page_size =3D 1 << rsize; } break; } @@ -1626,7 +1625,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, fi->type =3D ARMFault_Background; return true; } - get_phys_addr_pmsav7_default(env, mmu_idx, address, prot); + get_phys_addr_pmsav7_default(env, mmu_idx, address, &result->p= rot); } else { /* a MPU hit! */ uint32_t ap =3D extract32(env->pmsav7.dracr[n], 8, 3); uint32_t xn =3D extract32(env->pmsav7.dracr[n], 12, 1); @@ -1643,16 +1642,16 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, = uint32_t address, case 5: break; /* no access */ case 3: - *prot |=3D PAGE_WRITE; + result->prot |=3D PAGE_WRITE; /* fall through */ case 2: case 6: - *prot |=3D PAGE_READ | PAGE_EXEC; + result->prot |=3D PAGE_READ | PAGE_EXEC; break; case 7: /* for v7M, same as 6; for R profile a reserved value = */ if (arm_feature(env, ARM_FEATURE_M)) { - *prot |=3D PAGE_READ | PAGE_EXEC; + result->prot |=3D PAGE_READ | PAGE_EXEC; break; } /* fall through */ @@ -1668,16 +1667,16 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, = uint32_t address, case 1: case 2: case 3: - *prot |=3D PAGE_WRITE; + result->prot |=3D PAGE_WRITE; /* fall through */ case 5: case 6: - *prot |=3D PAGE_READ | PAGE_EXEC; + result->prot |=3D PAGE_READ | PAGE_EXEC; break; case 7: /* for v7M, same as 6; for R profile a reserved value = */ if (arm_feature(env, ARM_FEATURE_M)) { - *prot |=3D PAGE_READ | PAGE_EXEC; + result->prot |=3D PAGE_READ | PAGE_EXEC; break; } /* fall through */ @@ -1690,14 +1689,14 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, = uint32_t address, =20 /* execute never */ if (xn) { - *prot &=3D ~PAGE_EXEC; + result->prot &=3D ~PAGE_EXEC; } } } =20 fi->type =3D ARMFault_Permission; fi->level =3D 1; - return !(*prot & (1 << access_type)); + return !(result->prot & (1 << access_type)); } =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, @@ -2422,8 +2421,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, } else if (arm_feature(env, ARM_FEATURE_V7)) { /* PMSAv7 */ ret =3D get_phys_addr_pmsav7(env, address, access_type, mmu_id= x, - &result->phys, &result->prot, - &result->page_size, fi); + result, fi); } else { /* Pre-v7 MPU */ ret =3D get_phys_addr_pmsav5(env, address, access_type, mmu_id= x, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871637; cv=none; d=zohomail.com; s=zohoarc; b=h4KTFPZmiDamlWiBLvkeqzdkLYaF25vorBAavyQnlQm1JUrdawE7xlk9GEcI66v00ax8orCsd1ssCnknegO1ZljLpx9F8jbys/TzMd9dOl2wohrNpu7QsQQh3PW/ilS2YRcc4LwEfXfeVTktPuzMSl+lZtVM+wU4upQxL5qMihI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871637; 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=lW/oPgeXhT91EvmbPc8n7WToY6I3Ebq62IKaIqyShd4=; b=Q/43eHeOewBbJP5cHNypbNmuTyr0mT5YBKJD76Qz8G94Z4TcJmXp1D6Cq/lthcT2rgrwMcnf6iL9plMDmHCWdJAvevSbJciwGDE2Fi1AXOH4TfR2liMHJMXn8jtdRWf377PEAdqN+k9msM3ym6tV3cBKtzi87DFKPzU0J6kLU6s= 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 1663871637026359.8008993252306; Thu, 22 Sep 2022 11:33:57 -0700 (PDT) Received: from localhost ([::1]:43258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obR1H-0001gk-UQ for importer@patchew.org; Thu, 22 Sep 2022 14:33:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAy-0002AR-0g for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:49 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:50851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAw-0005P1-3L for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: by mail-wm1-x331.google.com with SMTP id ay36so7182404wmb.0 for ; Thu, 22 Sep 2022 09:35:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=lW/oPgeXhT91EvmbPc8n7WToY6I3Ebq62IKaIqyShd4=; b=peDWqQocGLGZep/lcTPq1KX6yj0bbg0iOBdiAiyhuFmh7kkLze7/32YHja7YPGo+Xl /hn5t4SHEPMRAIgt242G2HO4gm99IcTJYhqKbKZSo4I+/KwfgTnPE0BB/aGSLanjjucr rVtvKf5yzOLfObCbs0OKFptV2CXTp1dnMhuR2W7CgBNbFpfy1B/2xNRhL5SajV6Udf5f EkEHZ/QwuIuA+PBiLIMASLZ5EuYjAhqjfD4kbGLNxsqrfeJ3j7Adlh/aSEf1cg/dHeAe cI9PTCbv7YLdyD3cb1uT31l6pfV3LKz3hCd77zvyi+GgEZch7xNzBgXEyM5II0eD6xrq QHyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=lW/oPgeXhT91EvmbPc8n7WToY6I3Ebq62IKaIqyShd4=; b=fJMl0l2Wd8awiGj6Am50lVRe0mQEo9dNd6i5if8RCloZeq9G9nlJt/eySg2Vud/pOX HLMQIRGsWzgj6CyzdnqkW6TIVU7RwpL95dJMkOkC5a4NQZcXQFaKRMZW3ZCEbCNBPiNK IX4aD2oW7f25IBxCyb/wFxoGYNndhOxQzvNCrW31K8S+DqIqBoNjXNuvZQdSjukxRciK zKiE425px9e6XNer47hEYBS3Cz9xIC/J8E+YN/NvrhgVltJcLL80oXMDzDCrGRdvMXBW /ZUGKjIcbnU9ju2TVFEcq89ZYMLik0wPOB5ctpyBjakF85k8xtxh7e1pbV1M7kFCP1oe 5sKg== X-Gm-Message-State: ACrzQf02Rk/VCkLXJVJSk0r7P92QBkRxON/xU3o7mPK16NXsLjO54i5f A8gNWzyrGe+xU38II6eqz/j0/3lQ4OuXww== X-Google-Smtp-Source: AMsMyM5VclE3GgPb8bUv368bWRBgU+m5fxpwXeNG3oVEjSDfifwj7vx2NOLhXtfhI6axaI+5BvUdKg== X-Received: by 2002:a7b:c4c8:0:b0:3b4:76c8:da4f with SMTP id g8-20020a7bc4c8000000b003b476c8da4fmr9699947wmk.63.1663864544604; Thu, 22 Sep 2022 09:35:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav8 Date: Thu, 22 Sep 2022 17:35:06 +0100 Message-Id: <20220922163536.1096175-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871637997100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-9-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 36b108907fc..2286f6e12db 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1967,8 +1967,7 @@ void v8m_security_lookup(CPUARMState *env, uint32_t a= ddress, =20 static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_= idx, - hwaddr *phys_ptr, MemTxAttrs *txattrs, - int *prot, target_ulong *page_size, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { uint32_t secure =3D regime_is_secure(env, mmu_idx); @@ -2003,9 +2002,9 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, ui= nt32_t address, } else { fi->type =3D ARMFault_QEMU_SFault; } - *page_size =3D sattrs.subpage ? 1 : TARGET_PAGE_SIZE; - *phys_ptr =3D address; - *prot =3D 0; + result->page_size =3D sattrs.subpage ? 1 : TARGET_PAGE_SIZ= E; + result->phys =3D address; + result->prot =3D 0; return true; } } else { @@ -2015,7 +2014,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, ui= nt32_t address, * might downgrade a secure access to nonsecure. */ if (sattrs.ns) { - txattrs->secure =3D false; + result->attrs.secure =3D false; } else if (!secure) { /* * NS access to S memory must fault. @@ -2028,17 +2027,19 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, = uint32_t address, * for M_FAKE_FSR_SFAULT in arm_v7m_cpu_do_interrupt(). */ fi->type =3D ARMFault_QEMU_SFault; - *page_size =3D sattrs.subpage ? 1 : TARGET_PAGE_SIZE; - *phys_ptr =3D address; - *prot =3D 0; + result->page_size =3D sattrs.subpage ? 1 : TARGET_PAGE_SIZ= E; + result->phys =3D address; + result->prot =3D 0; return true; } } } =20 - ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, phys_ptr, - txattrs, prot, &mpu_is_subpage, fi, NULL); - *page_size =3D sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; + ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, + &result->phys, &result->attrs, &result->prot, + &mpu_is_subpage, fi, NULL); + result->page_size =3D + sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; return ret; } =20 @@ -2416,8 +2417,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, if (arm_feature(env, ARM_FEATURE_V8)) { /* PMSAv8 */ ret =3D get_phys_addr_pmsav8(env, address, access_type, mmu_id= x, - &result->phys, &result->attrs, - &result->prot, &result->page_size, = fi); + result, fi); } else if (arm_feature(env, ARM_FEATURE_V7)) { /* PMSAv7 */ ret =3D get_phys_addr_pmsav7(env, address, access_type, mmu_id= x, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663869869; cv=none; d=zohomail.com; s=zohoarc; b=m78LRNDXaEtsO13jagii8KeENC4zACUpxX+VBcMfQQqP61/HHkUvAr6JN2qW4HSsHjhlPVe6kapSlhTE1OweCwCNxor5nLpHTryZz6YtVyduSXSgYaCZH9ip/mLLt+PVVpS9iHUNVcVLSSbg1KDp7TtzigaaFUZ0TwXKngSer+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663869869; 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=J6uh2yvAURvOGI2KB27pPtR0TDZYnQFcux+7TXKe5wo=; b=fCMqTB8fPYJJ274mhGhh3oEaYAwbQqXJUSxGDwdd93IOyrx+3aW1ZBE5DA58dXwYcro7rCZKTvp4FIVxNzXfScqxILllgMQVXYeSksFwA8vpuSUm0HFQ8tgoBPnGMIGagCmKqn6PChcQNa45zgubEHufkQuZ+fXtr7r7591dvM0= 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 1663869869939626.3874714624294; Thu, 22 Sep 2022 11:04:29 -0700 (PDT) Received: from localhost ([::1]:55276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQYf-0005Si-FQ for importer@patchew.org; Thu, 22 Sep 2022 14:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB9-0002CE-00 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:41859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAx-0005P9-9i for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:57 -0400 Received: by mail-wm1-x32e.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so1732799wmb.0 for ; Thu, 22 Sep 2022 09:35:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=J6uh2yvAURvOGI2KB27pPtR0TDZYnQFcux+7TXKe5wo=; b=gjJhshDADrDbr3L9osRkKmYrvQQyHJMGoP79AVc6MpmalV41LyE+qh4lalxRACsCF+ 1Nlb3B6MAHsA1mHFfuwxyFrMaO4mMLOq3JiE8Mi2q2G8gYMnJPFZ9aQWALbAXbOuLU/j tmlzt/GrYOm2t8rJ2oXrlYriD9II21ry597oa7bLXjo6pindh+x8yQ7RCH2puk9J+4j0 R2oGXTy2vd7fp6fVree0ZFpNIPKKwA0knpyQKu8Jp7HCEr5668ZTuMQNky01SyjqOKZQ 7XHcBy/fHs/K8PX6YqKQniwo2ygvyVfKQM76Y5edMkFVS7r0sT4SLAAmHphAGnV0EFeQ mqsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=J6uh2yvAURvOGI2KB27pPtR0TDZYnQFcux+7TXKe5wo=; b=ykZDgHikr4sLTWmwr7J+QzrNyon8+KLzK5tDU9zvzz/3MNfxda+5xW+lFC/3yvoJAh lq2imp3pnVVSTw0EXvAGQ/syR7cMz2YqUtrPBBD10dL0OPSOsNGhXl7qLR1ZcB//4jWi kPY9YNJk5ZJ4VbV0LYxW528epL94XTzmOI1ndeB6rDR84iX/xROWqLKIl6phdCnyONC1 7N7rcd0MTMhLnrZmjwULXxmK336OWSFoTjDeN13Limm7NAH+IvbKhUSqFntDv9pwmxqh DYNfDZ/7MtOKCh78xyJG1NnGGdE/WTh03RAlGkIfUiQ2fHnhQYq9bMiCO/RtOQtcHfsv yFjw== X-Gm-Message-State: ACrzQf1CtrZ5GBfRlBu2qTJ51gyIO0R7JsKOl+n3VQYuMNCNYnCqfiDD mq+XKjlZAV5yNBJIzWEBk7JGcsSTicmteA== X-Google-Smtp-Source: AMsMyM47YQQ7MH710U/RKvrSEuZAwgAYXO0HPhq37Ciy5qLXzCN8TgTxl8wgiG7CzGJRisj8HOBaJg== X-Received: by 2002:a05:600c:1987:b0:3b4:9b03:c440 with SMTP id t7-20020a05600c198700b003b49b03c440mr2925004wmq.14.1663864545530; Thu, 22 Sep 2022 09:35:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/39] target/arm: Use GetPhysAddrResult in pmsav8_mpu_lookup Date: Thu, 22 Sep 2022 17:35:07 +0100 Message-Id: <20220922163536.1096175-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32e; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663869870764100001 From: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-10-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/internals.h | 11 +++++------ target/arm/m_helper.c | 16 +++++++--------- target/arm/ptw.c | 20 +++++++++----------- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index e9743d3e220..103ae743a75 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1125,12 +1125,6 @@ void v8m_security_lookup(CPUARMState *env, uint32_t = address, MMUAccessType access_type, ARMMMUIdx mmu_idx, V8M_SAttributes *sattrs); =20 -bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, - MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, MemTxAttrs *txattrs, - int *prot, bool *is_subpage, - ARMMMUFaultInfo *fi, uint32_t *mregion); - /* Cacheability and shareability attributes for a memory access */ typedef struct ARMCacheAttrs { /* @@ -1156,6 +1150,11 @@ bool get_phys_addr(CPUARMState *env, target_ulong ad= dress, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) __attribute__((nonnull)); =20 +bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, + MMUAccessType access_type, ARMMMUIdx mmu_idx, + GetPhysAddrResult *result, bool *is_subpage, + ARMMMUFaultInfo *fi, uint32_t *mregion); + void arm_log_exception(CPUState *cs); =20 #endif /* !CONFIG_USER_ONLY */ diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 84c6796b8d6..69d4a63fa6d 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -2770,15 +2770,10 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t = addr, uint32_t op) V8M_SAttributes sattrs =3D {}; uint32_t tt_resp; bool r, rw, nsr, nsrw, mrvalid; - int prot; - ARMMMUFaultInfo fi =3D {}; - MemTxAttrs attrs =3D {}; - hwaddr phys_addr; ARMMMUIdx mmu_idx; uint32_t mregion; bool targetpriv; bool targetsec =3D env->v7m.secure; - bool is_subpage; =20 /* * Work out what the security state and privilege level we're @@ -2809,18 +2804,21 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t = addr, uint32_t op) * inspecting the other MPU state. */ if (arm_current_el(env) !=3D 0 || alt) { + GetPhysAddrResult res =3D {}; + ARMMMUFaultInfo fi =3D {}; + bool is_subpage; + /* We can ignore the return value as prot is always set */ pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, - &phys_addr, &attrs, &prot, &is_subpage, - &fi, &mregion); + &res, &is_subpage, &fi, &mregion); if (mregion =3D=3D -1) { mrvalid =3D false; mregion =3D 0; } else { mrvalid =3D true; } - r =3D prot & PAGE_READ; - rw =3D prot & PAGE_WRITE; + r =3D res.prot & PAGE_READ; + rw =3D res.prot & PAGE_WRITE; } else { r =3D false; rw =3D false; diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 2286f6e12db..d6890048f13 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1701,8 +1701,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, MemTxAttrs *txattrs, - int *prot, bool *is_subpage, + GetPhysAddrResult *result, bool *is_subpage, ARMMMUFaultInfo *fi, uint32_t *mregion) { /* @@ -1724,8 +1723,8 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, uint32_t addr_page_limit =3D addr_page_base + (TARGET_PAGE_SIZE - 1); =20 *is_subpage =3D false; - *phys_ptr =3D address; - *prot =3D 0; + result->phys =3D address; + result->prot =3D 0; if (mregion) { *mregion =3D -1; } @@ -1807,7 +1806,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, =20 if (matchregion =3D=3D -1) { /* hit using the background region */ - get_phys_addr_pmsav7_default(env, mmu_idx, address, prot); + get_phys_addr_pmsav7_default(env, mmu_idx, address, &result->prot); } else { uint32_t ap =3D extract32(env->pmsav8.rbar[secure][matchregion], 1= , 2); uint32_t xn =3D extract32(env->pmsav8.rbar[secure][matchregion], 0= , 1); @@ -1822,9 +1821,9 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, xn =3D 1; } =20 - *prot =3D simple_ap_to_rw_prot(env, mmu_idx, ap); - if (*prot && !xn && !(pxn && !is_user)) { - *prot |=3D PAGE_EXEC; + result->prot =3D simple_ap_to_rw_prot(env, mmu_idx, ap); + if (result->prot && !xn && !(pxn && !is_user)) { + result->prot |=3D PAGE_EXEC; } /* * We don't need to look the attribute up in the MAIR0/MAIR1 @@ -1837,7 +1836,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, =20 fi->type =3D ARMFault_Permission; fi->level =3D 1; - return !(*prot & (1 << access_type)); + return !(result->prot & (1 << access_type)); } =20 static bool v8m_is_sau_exempt(CPUARMState *env, @@ -2036,8 +2035,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, ui= nt32_t address, } =20 ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, - &result->phys, &result->attrs, &result->prot, - &mpu_is_subpage, fi, NULL); + result, &mpu_is_subpage, fi, NULL); result->page_size =3D sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; return ret; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663870711; cv=none; d=zohomail.com; s=zohoarc; b=nSXAGefBNCrTPvj3O2/0Abn6IEz7iFoVc+oLqcXPvEvO/eZKezhBy4P4tr8+wIprB+/GfZiOO8I5TCBoUNdoOZu7Mv+m9pPG8SRVJh+ye2oPxvtT3fLrNmASz+9MF+O924nF1YNBaOr/C+XymbGKJMwf93anuNHqCqpkrgsFYmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663870711; 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=SNRGCqngHXuTKJa6F6FQoKgAN+UbaO3r3THYthr1idQ=; b=j2icUW974+T9A87jfb/RIf+qyJtmXdp8NTHZXv+YoqraXqU2bgRDQIGd5WkQ0qBPwHvTVcsRG6wHB4y+gN4FdLtSyDdpIpiJCede0wHLQ9t/qS9AViMagIZ1bbXbpnse30EyMAKqYoATpw0V/4Z6NbSMtNvDC5xYR9jFDObp9aw= 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 16638707113141010.9434535496977; Thu, 22 Sep 2022 11:18:31 -0700 (PDT) Received: from localhost ([::1]:48930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQmL-0003A6-3C for importer@patchew.org; Thu, 22 Sep 2022 14:18:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAy-0002Ak-VP for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:49 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:46895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAx-0005Nr-6Q for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:48 -0400 Received: by mail-wr1-x432.google.com with SMTP id g3so16366499wrq.13 for ; Thu, 22 Sep 2022 09:35:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=SNRGCqngHXuTKJa6F6FQoKgAN+UbaO3r3THYthr1idQ=; b=Lzs6ulw0bcOQ4VInqi9YoNw3PIoeYWmHYjQ6xpo8m/DaHeU5zOr7kDAMhBJqj3lVvh p7W9WD0zwOKBswwjpKsmbEDobYAIB2IsuxYyPOvsTfOGeWPI8YKguxNpD3zMbs5aKGYp S94iQ1sWM2NUw978crdLw5Yf7E/G8fwXrkQLo7qPzjOFeNaOVRqpSWyx8v+7Rm1HX+dx 9Wn13xa1i8CCoyvD/5s4cqQBScm6LeY5wX8nYq0+v5BCJ1S28LMSDxNyyhiwx6wNGanj bNjrxT1lSArfUgzXUdm6Sm2eUZBtECLQW6YRa4zxgCCF3UxjXuDnkrsshDFfDWkTLjXe QTxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=SNRGCqngHXuTKJa6F6FQoKgAN+UbaO3r3THYthr1idQ=; b=ECoFbgCIhitxwo289TD30XWOex5p9bpcqDU1GVVL3oWA3xV3DU9+NAJCuEJAdtxq7H 64q1FF84HbXkwA31WslaawolUiGP3OjyqJbw16dvtZz+pKd9Qcy33IdtY06wHxJweCQh 54neCgnrGKi5mU31olIia6UMkIExCfz4IXs57Lll7oN753xU3zTzKqdX4Ra74XPMoGg7 Lu/hTnU6WeZRq3SXktYy565al568XMXrLkvkMiYFre0HF/MrzahfzSZAPYpzeoA0/+Bu o5XZdNIfLC2dBCjZgYPFxJLsS5iyBevl4ULPvf0b27IPOfnpBoSORhmHhtFKFuS3ardK zKfg== X-Gm-Message-State: ACrzQf1rdYWG9Zl+Wjl+zjkwfDae/K2mtaPpNbofLPAblPMBc2t+aznG WlmXoip69JtZ+9gVDVfAAaVshjaXc26nzg== X-Google-Smtp-Source: AMsMyM70BPB+PBfE/3itWPttzyS6Yxrnn3JncYCJEQ7tO9VuNRNK1JbuoL06y1m4hg8MwH8Aeci3sA== X-Received: by 2002:a5d:598f:0:b0:22a:f74d:ae24 with SMTP id n15-20020a5d598f000000b0022af74dae24mr2684061wri.544.1663864546380; Thu, 22 Sep 2022 09:35:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/39] target/arm: Remove is_subpage argument to pmsav8_mpu_lookup Date: Thu, 22 Sep 2022 17:35:08 +0100 Message-Id: <20220922163536.1096175-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663870712408100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson This can be made redundant with result->page_size, by moving the basic set of page_size from get_phys_addr_pmsav8. We still need to overwrite page_size when v8m_security_lookup signals a subpage. Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-11-richard.henderson@linaro.org [PMM: Update a comment that used to refer to is_subpage] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/internals.h | 4 ++-- target/arm/m_helper.c | 3 +-- target/arm/ptw.c | 23 ++++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 103ae743a75..f8b22d3ab0b 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1152,8 +1152,8 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, bool *is_subpage, - ARMMMUFaultInfo *fi, uint32_t *mregion); + GetPhysAddrResult *result, ARMMMUFaultInfo *fi, + uint32_t *mregion); =20 void arm_log_exception(CPUState *cs); =20 diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 69d4a63fa6d..01263990dc3 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -2806,11 +2806,10 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t = addr, uint32_t op) if (arm_current_el(env) !=3D 0 || alt) { GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; - bool is_subpage; =20 /* We can ignore the return value as prot is always set */ pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, - &res, &is_subpage, &fi, &mregion); + &res, &fi, &mregion); if (mregion =3D=3D -1) { mrvalid =3D false; mregion =3D 0; diff --git a/target/arm/ptw.c b/target/arm/ptw.c index d6890048f13..bb3c709f8f5 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1701,8 +1701,8 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, bool *is_subpage, - ARMMMUFaultInfo *fi, uint32_t *mregion) + GetPhysAddrResult *result, ARMMMUFaultInfo *fi, + uint32_t *mregion) { /* * Perform a PMSAv8 MPU lookup (without also doing the SAU check @@ -1710,8 +1710,9 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, * mregion is (if not NULL) set to the region number which matched, * or -1 if no region number is returned (MPU off, address did not * hit a region, address hit in multiple regions). - * We set is_subpage to true if the region hit doesn't cover the - * entire TARGET_PAGE the address is within. + * If the region hit doesn't cover the entire TARGET_PAGE the address + * is within, then we set the result page_size to 1 to force the + * memory system to use a subpage. */ ARMCPU *cpu =3D env_archcpu(env); bool is_user =3D regime_is_user(env, mmu_idx); @@ -1722,7 +1723,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, uint32_t addr_page_base =3D address & TARGET_PAGE_MASK; uint32_t addr_page_limit =3D addr_page_base + (TARGET_PAGE_SIZE - 1); =20 - *is_subpage =3D false; + result->page_size =3D TARGET_PAGE_SIZE; result->phys =3D address; result->prot =3D 0; if (mregion) { @@ -1774,13 +1775,13 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t a= ddress, ranges_overlap(base, limit - base + 1, addr_page_base, TARGET_PAGE_SIZE)) { - *is_subpage =3D true; + result->page_size =3D 1; } continue; } =20 if (base > addr_page_base || limit < addr_page_limit) { - *is_subpage =3D true; + result->page_size =3D 1; } =20 if (matchregion !=3D -1) { @@ -1972,7 +1973,6 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, ui= nt32_t address, uint32_t secure =3D regime_is_secure(env, mmu_idx); V8M_SAttributes sattrs =3D {}; bool ret; - bool mpu_is_subpage; =20 if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { v8m_security_lookup(env, address, access_type, mmu_idx, &sattrs); @@ -2035,9 +2035,10 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, u= int32_t address, } =20 ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, - result, &mpu_is_subpage, fi, NULL); - result->page_size =3D - sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; + result, fi, NULL); + if (sattrs.subpage) { + result->page_size =3D 1; + } return ret; } =20 --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663868394; cv=none; d=zohomail.com; s=zohoarc; b=k3abK0WfOnQUJWYP1GR4fGBEIVKpGGxvIy/rsjbx7Odilg4NyeFajNsG4wyHYwC0ZmkO5Fgmi8SHw8v/Q7jYSfEg4IE/ZcoOOzGu60oqghGO0li+1g8g4rQkYt+sZXyh+OrPWOArxPj1a20VNqF1D8NOqYvwZJc6XjPg7RUCMG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663868394; 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=u3T0zAgMbu0p/+YyGjLWBqhH/EbkbWQ0NkCK9u4fEiQ=; b=fU4gNqP0+4l+AXY3IIKnlb0YXYOK6ybL+nCjCYu+OHS0wtGsoZ+C5ebdOTMrlCNLDbPRPMWaVnjwer6IXjCywAfeh7VwF15N7wTicNQQ3YHiq4aV76RXvYL8Du1zT0qPq3VcYGOBYbFpweYWciU3J3gDisGnzg7PWbqqCDHrBF8= 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 1663868394659879.7244599939087; Thu, 22 Sep 2022 10:39:54 -0700 (PDT) Received: from localhost ([::1]:41430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQAz-00065X-Kv for importer@patchew.org; Thu, 22 Sep 2022 13:39:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB0-0002Ax-Eu for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:56 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAy-0005Pe-JZ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:50 -0400 Received: by mail-wr1-x436.google.com with SMTP id n10so16377656wrw.12 for ; Thu, 22 Sep 2022 09:35:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=u3T0zAgMbu0p/+YyGjLWBqhH/EbkbWQ0NkCK9u4fEiQ=; b=sXjcJ5No6QiXM2ybWl2cRGICt5mla64tW3I+eEw24ZaHWEIjNidQOkepQNqNXCR+qk Nw++BlqPRkMLEg00lIx9F1rZVCwR84EH8J+3AU97LmdlSqySc3SR8U/MVI/QXRyKBzEw 59Ny0kFl7Ln70CF/BZsbNCH9VSXPtPv1rmnMD5ld66U80RafrTQmsKXgiCWRL2fgLTVl Ib+uuu/F8+DQC05ShIgeewJFRL6+WysM6EF7jTEnjTxrzEB+ObIntViQ4c998vuDC9t1 IfZixVGt+Rl+Yz7K3TW+CeagfaPWy4LWxizROw0SlsBkZaFc8BEeahk9atc5EfkZ93pV 7diQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=u3T0zAgMbu0p/+YyGjLWBqhH/EbkbWQ0NkCK9u4fEiQ=; b=JBrB0iCyPsPbjK++QNz6c/+mHJcV1zP1Z1UwsECTn5kT4auESskuH4QwhvIHkLpmYC Qcs1FTbmEJrtlu9AX35oCsv21PcigkTzq8tpyvzMz16BZ117BSL19PIvvwCmAhRDNLN/ AVeUhZKJvKb4/S/9WNIfh77ltW1suYxpM/uSQp3ukSfbaTMKBzzHScNjEMyZnYxbbRP/ 7Sx5P6cuPXFq0CPEe2L+Juz5JWKl4Thz8ye5jk6B1X5F3j1TwRihmYT9EOfWj1SnnOmw 6OscKwuEf1DSOQhg+mx+RT1Fd1batd9g+Y5GmULxWwiipLNvJhD777ETHs6T1J4Xknvx LmnA== X-Gm-Message-State: ACrzQf1LoT2W4UaUCtgBDMW6g3op5xjYDRWOz3XOi8B2XQGTIYd2SSxb 3GHOJc+VBFEBoTiRb9fx+qaJ6v5j4Uosvg== X-Google-Smtp-Source: AMsMyM7h7YGRfN8Hd2eLZRLeDccN+EwddDgPId+4yX6C4+op6xDxv4Hso23+EyyCmahUHmwCSzigcA== X-Received: by 2002:a05:6000:887:b0:21e:24a0:f302 with SMTP id ca7-20020a056000088700b0021e24a0f302mr2537644wrb.466.1663864546969; Thu, 22 Sep 2022 09:35:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/39] target/arm: Add is_secure parameter to v8m_security_lookup Date: Thu, 22 Sep 2022 17:35:09 +0100 Message-Id: <20220922163536.1096175-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::436; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663868396197100001 From: Richard Henderson Remove the use of regime_is_secure from v8m_security_lookup, passing the new parameter to the lookup instead. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-12-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/internals.h | 2 +- target/arm/m_helper.c | 9 ++++++--- target/arm/ptw.c | 9 +++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index f8b22d3ab0b..e97f5c3d47e 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1123,7 +1123,7 @@ typedef struct V8M_SAttributes { =20 void v8m_security_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - V8M_SAttributes *sattrs); + bool secure, V8M_SAttributes *sattrs); =20 /* Cacheability and shareability attributes for a memory access */ typedef struct ARMCacheAttrs { diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 01263990dc3..45fbf195590 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -689,7 +689,8 @@ static bool arm_v7m_load_vector(ARMCPU *cpu, int exc, b= ool targets_secure, if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { V8M_SAttributes sattrs =3D {}; =20 - v8m_security_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, &sattrs); + v8m_security_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, + targets_secure, &sattrs); if (sattrs.ns) { attrs.secure =3D false; } else if (!targets_secure) { @@ -2002,7 +2003,8 @@ static bool v7m_read_half_insn(ARMCPU *cpu, ARMMMUIdx= mmu_idx, ARMMMUFaultInfo fi =3D {}; MemTxResult txres; =20 - v8m_security_lookup(env, addr, MMU_INST_FETCH, mmu_idx, &sattrs); + v8m_security_lookup(env, addr, MMU_INST_FETCH, mmu_idx, + regime_is_secure(env, mmu_idx), &sattrs); if (!sattrs.nsc || sattrs.ns) { /* * This must be the second half of the insn, and it straddles a @@ -2826,7 +2828,8 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t ad= dr, uint32_t op) } =20 if (env->v7m.secure) { - v8m_security_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, &sattrs); + v8m_security_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, + targetsec, &sattrs); nsr =3D sattrs.ns && r; nsrw =3D sattrs.ns && rw; } else { diff --git a/target/arm/ptw.c b/target/arm/ptw.c index bb3c709f8f5..74d2f63359f 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1857,8 +1857,8 @@ static bool v8m_is_sau_exempt(CPUARMState *env, } =20 void v8m_security_lookup(CPUARMState *env, uint32_t address, - MMUAccessType access_type, ARMMMUIdx mmu_i= dx, - V8M_SAttributes *sattrs) + MMUAccessType access_type, ARMMMUIdx mmu_idx, + bool is_secure, V8M_SAttributes *sattrs) { /* * Look up the security attributes for this address. Compare the @@ -1886,7 +1886,7 @@ void v8m_security_lookup(CPUARMState *env, uint32_t a= ddress, } =20 if (idau_exempt || v8m_is_sau_exempt(env, address, access_type)) { - sattrs->ns =3D !regime_is_secure(env, mmu_idx); + sattrs->ns =3D !is_secure; return; } =20 @@ -1975,7 +1975,8 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, ui= nt32_t address, bool ret; =20 if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { - v8m_security_lookup(env, address, access_type, mmu_idx, &sattrs); + v8m_security_lookup(env, address, access_type, mmu_idx, + secure, &sattrs); if (access_type =3D=3D MMU_INST_FETCH) { /* * Instruction fetches always use the MMU bank and the --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663867924; cv=none; d=zohomail.com; s=zohoarc; b=FwJuymkfAcQU5DUH6EygfEQ2th28ve4aeD/rxJalYh7PVaT9ca4Zp1nm5d7vEFOyF8HsqI+8iyUO6JEwS9Ylb06cgFO0aV/SzTETvKb6Do4S+8WtXNHhmQcgZ2aRdJuq4FudUAP9UQ+aCrHNM4zRHTKhvGvSlx6xgt0BtTsy3wU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663867924; 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=S7xMDGIoF+c3kK5sdvwsAuiDPlnfpu+Z56njaQYlxFw=; b=IgaZHPYEH6sOjfm/HyFKhh2ChgoE3Pjm6kuNd5Bj7nPxq1C/eklVMUA0QHZ0EBoBWfZJMBUbqiYOVhWqkHGqlNGZYXbzLBR7/FCep2IyIi6iAWSvGG11WKMw/wBT+ACqpspYsmD/+xZOd5nxDsFePMoVujLclvpampJuCQ1D66I= 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 1663867924355601.4968400119294; Thu, 22 Sep 2022 10:32:04 -0700 (PDT) Received: from localhost ([::1]:47814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQ3O-00007P-8m for importer@patchew.org; Thu, 22 Sep 2022 13:32:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB0-0002Ay-JV for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:59 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:37751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAy-0005Ps-U6 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:50 -0400 Received: by mail-wr1-x431.google.com with SMTP id bq9so16458338wrb.4 for ; Thu, 22 Sep 2022 09:35:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=S7xMDGIoF+c3kK5sdvwsAuiDPlnfpu+Z56njaQYlxFw=; b=Qw7S/BuJ0JGisSaJjPXDNh3J63eWA3pZiSUVRcGDCGReZpKK/YHIceoMHj50KCWHfL ZfZnHtnpn6qZESePGmmjh2FvgduZ53YdnmmhrYg3XXdhgCI8iuR3pIUXBLU496qZev6n 8t/umVAoDSWZLZEOIUvn6/1gd2mTiWllMUsBOkpSO070pWiMOI8IHIeuUj72neY95W9x yyLbFewUciaLiKuFDNJiLrM+ux97W3Ws1P1jA3X4ryxB1Z1MqkpWvpUKSvCuKF7fgWBv 134+z1Ve3HPZvX36fJWnboTKUXSu3LHxDU5Qc5TZV+RyIOKUnX2Ys/eHF/7dh0YT4leS dK7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=S7xMDGIoF+c3kK5sdvwsAuiDPlnfpu+Z56njaQYlxFw=; b=B8UL4uCHjcLuVvwpk3GXOVO91Rcm1zhjnU7OHkw7qlYSlG5oUN7mic4XqWQceLaxDB BtPiWtKnFezDGquPc14X3QrRvS23VoWPQ09U3q7+xgGnPmHHJIBHRTfXiXteIQVZ0OJl dCADNbDwjwMOVbHc32tOC9tZVsx5U6ROFhEF7B6etmP7UBBli1T7M5rXj0CuYUg8sZ5s kuVKEN9Qr2u7csTEsFkwGMSKHdwqw+Q3+0S0nu/hns5JklAsvi065tSmWfQ0QJ5Ug5TL IyEANejy2H9JvAQ10ROZ0ygyTYIpjjvdioJ7VS9jspWH0QrRKIGXhz9rydgtapvVrWwD Yezw== X-Gm-Message-State: ACrzQf0c2z4/qPkheHW0HBneowlpU7yk3tcmAfZBFi7/oDxh4J9+hfzx c5P7zvcGwZhXSBrJ6gsg1cgBOlYDcGpCdA== X-Google-Smtp-Source: AMsMyM7COy6DMtTzN+MuSfzszNpwJPUUQJRa9p8cqpDPQ1Dn2qtjGX4kRGB4jAVBTARdUfqwo4kl0A== X-Received: by 2002:a5d:4a48:0:b0:22a:e55d:535d with SMTP id v8-20020a5d4a48000000b0022ae55d535dmr2633093wrs.308.1663864547527; Thu, 22 Sep 2022 09:35:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/39] target/arm: Add secure parameter to pmsav8_mpu_lookup Date: Thu, 22 Sep 2022 17:35:10 +0100 Message-Id: <20220922163536.1096175-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::431; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663867925429100001 From: Richard Henderson Remove the use of regime_is_secure from pmsav8_mpu_lookup, passing the new parameter to the lookup instead. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-13-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/internals.h | 4 ++-- target/arm/m_helper.c | 2 +- target/arm/ptw.c | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index e97f5c3d47e..307a5965053 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1152,8 +1152,8 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi, - uint32_t *mregion); + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi, uint32_t *mregion); =20 void arm_log_exception(CPUState *cs); =20 diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 45fbf195590..5ee4ee15b36 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -2810,7 +2810,7 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t ad= dr, uint32_t op) ARMMMUFaultInfo fi =3D {}; =20 /* We can ignore the return value as prot is always set */ - pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, + pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, targetsec, &res, &fi, &mregion); if (mregion =3D=3D -1) { mrvalid =3D false; diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 74d2f63359f..308a9cc3ac9 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1701,8 +1701,8 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi, - uint32_t *mregion) + bool secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi, uint32_t *mregion) { /* * Perform a PMSAv8 MPU lookup (without also doing the SAU check @@ -1716,7 +1716,6 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, */ ARMCPU *cpu =3D env_archcpu(env); bool is_user =3D regime_is_user(env, mmu_idx); - uint32_t secure =3D regime_is_secure(env, mmu_idx); int n; int matchregion =3D -1; bool hit =3D false; @@ -2035,7 +2034,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, ui= nt32_t address, } } =20 - ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, + ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, secure, result, fi, NULL); if (sattrs.subpage) { result->page_size =3D 1; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663865823; cv=none; d=zohomail.com; s=zohoarc; b=e7HzxPXaMQCizBBXRp8ggFfFJkEOu3NYiY/aM8ZFleU0QjV30vZgGn5+JEzjimD7jtQtqVByjnNbfYThQZ4SaCBhdnUkpBZuQDWwiMaepDzFi6NDAWLmA/m99BYTqXj09IQWjGlOMJERMGdP2DpQTnMt3qYk3EWtSzXlUEkESe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663865823; 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=oH2L/FyjI2KdEq5MITDl2AegrqX2BdO76qwDWANjXFo=; b=jQG9NlqIkE6zgU1RoAx1zQTFeJ0IBNqskBcqsB9YNUVfNkxaqx7bkkt8W0B29nLCNpDx6FNZX2fWQfms90yjcXENWtQ2x3CxyLfT1Qz5f1RSU6pGMa0V2TiMe/e19h/5oM0VD+R+6mF4WsHZ2k5CQhfp0JbyLNYNvGzeBbZ5qjo= 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 1663865823476357.1083337656254; Thu, 22 Sep 2022 09:57:03 -0700 (PDT) Received: from localhost ([::1]:54816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPVV-0004G7-69 for importer@patchew.org; Thu, 22 Sep 2022 12:57:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB1-0002B0-2g for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:59 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:42806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAz-0005Pz-Dt for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:50 -0400 Received: by mail-wm1-x32c.google.com with SMTP id o20-20020a05600c4fd400b003b4a516c479so1704933wmq.1 for ; Thu, 22 Sep 2022 09:35:49 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=oH2L/FyjI2KdEq5MITDl2AegrqX2BdO76qwDWANjXFo=; b=VfNM77wUOsfNPwA775z2CDAytoGbsMoXsUBjCeU9Sgy6bOUztVHn5BRAG301oUuvuD t96dmT5rO6UGQyDv7J3NFLGiR/3lVdLL1E8LDj4R2HBylX9qNvskDNY/F9cOr4mq8TOb iUAlnGtuHDSVyKt5AgHNj7nCc6QwGYet80pv/ky+5xKR1HzQwDV43cq7FopLb0o7F+EZ FwzlKyFKGLNG5yph21h399FjlrT7OsE/+ofGqt4UbhL9BCto6G7Zso+QGtKtfPCd+H1w 4rnzzmbuzZHdnCNk9BSCMgiedsAcTGK3gF+vmc4AOKY0cwJlneBYJDYF8VyJXvLfMPM5 YIJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=oH2L/FyjI2KdEq5MITDl2AegrqX2BdO76qwDWANjXFo=; b=0TEF24j6egVVEi9REJNOgnVJ+CFl9F0fKlHAWVG71W6U/UJogE8k8PelekL0qGglKJ Jb9zPYB7ZxN1SmicTakT4wzL9PklQnfFari5V5EaGp00Iq6sJKzNuB5EYSffsar1EkMv rtMCuV4h+JRRTyZ2HvdsO86CMNhgM2ykeeU+YtMYGLgqHi9f91qFzWVSiE7OllEGATK2 unUtiF8JTiHDfUVe2Cgm+xaWjARgjZ+g2vgrH/cBf6UG2+efnPlxygq5EAuCenBzQdoO C38Mzj712A6KN8aPgPEqE9CEjeTVHp/ZQmX6d24TK9x2gM0VXl7SStwy0BDiaHFdGHWt zvVA== X-Gm-Message-State: ACrzQf1wd/7yiqN505Uff3/DwKGc88yWKq1v7jVs0zfqhRxJ2VH7rv7O xeIjT86J3gIEETcE68negAAOLjerNIWk+w== X-Google-Smtp-Source: AMsMyM7u3FwP3U4YxnliKZueEwPhe3Kbu/cE0/Z7LyRNAPlVRB9KLFYKSVnh5z9T7bp9k9mr/LpWSg== X-Received: by 2002:a7b:c34c:0:b0:3b3:4067:d473 with SMTP id l12-20020a7bc34c000000b003b34067d473mr3061954wmj.52.1663864548114; Thu, 22 Sep 2022 09:35:48 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/39] target/arm: Add is_secure parameter to get_phys_addr_v5 Date: Thu, 22 Sep 2022 17:35:11 +0100 Message-Id: <20220922163536.1096175-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663865824552100001 From: Richard Henderson Remove the use of regime_is_secure from get_phys_addr_v5, passing the new parameter to the lookup instead. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson [PMM: Folded in definition of local is_secure in get_phys_addr(), since I dropped the earlier patch that would have provided it] Message-id: 20220822152741.1617527-14-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 308a9cc3ac9..96639da504e 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -414,7 +414,8 @@ static int simple_ap_to_rw_prot(CPUARMState *env, ARMMM= UIdx mmu_idx, int ap) =20 static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *f= i) + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) { int level =3D 1; uint32_t table; @@ -433,8 +434,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t= address, fi->type =3D ARMFault_Translation; goto do_fault; } - desc =3D arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc =3D arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type !=3D ARMFault_None) { goto do_fault; } @@ -472,8 +472,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t= address, /* Fine pagetable. */ table =3D (desc & 0xfffff000) | ((address >> 8) & 0xffc); } - desc =3D arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc =3D arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type !=3D ARMFault_None) { goto do_fault; } @@ -2291,6 +2290,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { ARMMMUIdx s1_mmu_idx =3D stage_1_mmu_idx(mmu_idx); + bool is_secure =3D regime_is_secure(env, mmu_idx); =20 if (mmu_idx !=3D s1_mmu_idx) { /* @@ -2393,7 +2393,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, * cannot upgrade an non-secure translation regime's attributes * to secure. */ - result->attrs.secure =3D regime_is_secure(env, mmu_idx); + result->attrs.secure =3D is_secure; result->attrs.user =3D regime_is_user(env, mmu_idx); =20 /* @@ -2515,7 +2515,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, - result, fi); + is_secure, result, fi); } } =20 --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663868946; cv=none; d=zohomail.com; s=zohoarc; b=Uj6mrKpfTGAbV8X0yTkDJzQ8M2ISAzBKOqliwdNXc0P0yqRVrUXxTJMQotRWTaYQZHyV3/c6Vk9ffwsLS5EhuDtUR+SKyQXM5UdvHuoDiT9FQvO2PrAdZQzIBJz8OMkyluvZzO91cQDFmyr2KyJAC6p6FHJlFr5DMYgWi/dqIVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663868946; 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=P6VqYbsDKhpYGPN8qnEH9BRbInbjOHH/i/5rsjAXUA4=; b=JSqOJgkGkuj51zSDttmG+lxsl2OgpCJrtlaBbWGuu284xdaVqO1QjhdmxbHROO5Zy1Nzulrq5eok+JMCqEVQMQ+klysHKFt5asithVpUddunjxHMPTlwS4LHCii1K/4I16RvLODW7WcX4JBkbUGY56Kz60/j/emF9V8X4luYh3s= 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 1663868946549998.8576916111613; Thu, 22 Sep 2022 10:49:06 -0700 (PDT) Received: from localhost ([::1]:56136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQJt-00054n-9i for importer@patchew.org; Thu, 22 Sep 2022 13:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB1-0002BR-Sh for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:59 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:45700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB0-0005Q7-0Y for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:51 -0400 Received: by mail-wm1-x32c.google.com with SMTP id d12-20020a05600c3acc00b003b4c12e47f3so1703382wms.4 for ; Thu, 22 Sep 2022 09:35:49 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=P6VqYbsDKhpYGPN8qnEH9BRbInbjOHH/i/5rsjAXUA4=; b=bdOdQoWWml0gAjOLKt3Uyl4E7h1oLGav26ja7M9o9VP9a/ehjXOxJJShB4OWbX/+nu o0HnWvCQvHwvXEfywgcHkwp+hSxUpEc9ddpCi9yC/NbEbre3ygudagItekfVkqyr4nbN O/NR+jlBQ/YRSTGWv5N2HajVw5e+hsqNGH/YrfW6U8cLtd+waN7w1CEHtaHvpDHGVYEi Cy9TZKA8VEjWyby8y5HUDR3ZFJI08HGdqj9B5uQovDv0L/Ddc54EbFS9E7fwMdF+KdsR XPAA4QVcNznVs00VLQ+B0JK6jDq0Auy46EZK2w89nnT0DECCdSLURGLqossEpBwGTsMR ENig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=P6VqYbsDKhpYGPN8qnEH9BRbInbjOHH/i/5rsjAXUA4=; b=QZjt+y63mjx8gfM9dIrQ83zb1AD1SFyrDDfy1aaQdR1jaWR2FCzE74+UhldB7883hI lva4W3obu1eLDK1JQIAVOPvpiLtOcZW4Io2mFufJbBO+UgTL0cmThrxZnFIIRXW8VoSY MLdVdEr/RHmCwW5BAt/kJpP/Wsa4mRUMiwXdgs9msVqvGuLQWkgRdj4ue5c5uOdq3MO7 AlTIjXZe+bVw1ZfgZxL4DzyDVT1/NqmZ+ivCLBPCnhNEfrmVrpBSmJlWoRBwic7OnbEs 4pQtyIN1ohDG4wXp/gPGQn27ENzQcSs/Y4Bf9cGSkZ/Yd9in9oQpKsNjiBPZ5Q3335Ik ppaA== X-Gm-Message-State: ACrzQf1nexy4D7PR2cIWSWkX0GH461Y81zH3Mx+4GR/+xPtTl/GxVuUh xPmGOHsayZmpY2nxJ6evN7rZBUjHBw+gAA== X-Google-Smtp-Source: AMsMyM4YVBwc2HYETCrPaEZZPWyUIo2fesTLBMaAPN30EZBuP9/pIBF+5ivZf6G4Q0GzNLGDvSP9bw== X-Received: by 2002:a05:600c:3786:b0:3b4:ef37:afdb with SMTP id o6-20020a05600c378600b003b4ef37afdbmr3099783wmr.164.1663864548706; Thu, 22 Sep 2022 09:35:48 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/39] target/arm: Add is_secure parameter to get_phys_addr_v6 Date: Thu, 22 Sep 2022 17:35:12 +0100 Message-Id: <20220922163536.1096175-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663868947397100001 From: Richard Henderson Remove the use of regime_is_secure from get_phys_addr_v6, passing the new parameter to the lookup instead. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-15-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 96639da504e..8f0810a1968 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -533,7 +533,8 @@ do_fault: =20 static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *f= i) + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) { ARMCPU *cpu =3D env_archcpu(env); int level =3D 1; @@ -556,8 +557,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t= address, fi->type =3D ARMFault_Translation; goto do_fault; } - desc =3D arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc =3D arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type !=3D ARMFault_None) { goto do_fault; } @@ -610,8 +610,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t= address, ns =3D extract32(desc, 3, 1); /* Lookup l2 entry. */ table =3D (desc & 0xfffffc00) | ((address >> 10) & 0x3fc); - desc =3D arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc =3D arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type !=3D ARMFault_None) { goto do_fault; } @@ -2512,7 +2511,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, result, fi); } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) { return get_phys_addr_v6(env, address, access_type, mmu_idx, - result, fi); + is_secure, result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, is_secure, result, fi); --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663869246; cv=none; d=zohomail.com; s=zohoarc; b=BTjCmr0WHA6FNrRMMtAQ2FKR/tNeenqw/SN3/RW3Nd+eZmOZDnFV+pjds9HOY57QzNZtdfqIGe/Fi0pkZFyDD5X4zwhjmPgQ9UYO7dPMHUXK+tfft6qVwTldPmuuNM/U99+0LicDcM0WZv1PIgrIt/Km9nU+6cRS6r+cd1zO7Go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663869246; 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=CrKz6cgBD504H1V9Pxtox14yL/5f8r5NQpbBSzrvaPw=; b=bOgGtD8F41q+hlVoBBlUiANmT9Sxd5+GVlz414lbE0QSYWGUsi1329P9wd2+hKNJMWS1lBEw+NtTlCnJA+lezvq14PByFSQxZ3l7ihm5ZvscxFMpcI+rrcK69PdZzoDCkfe4h+qohA4nWSltOTsj8V1EYdC/4umFKBBmmS5jF54= 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 1663869246574189.54049718849524; Thu, 22 Sep 2022 10:54:06 -0700 (PDT) Received: from localhost ([::1]:33298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQOj-0002RO-Iy for importer@patchew.org; Thu, 22 Sep 2022 13:54:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB2-0002Bp-BU for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:06 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:34774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB0-0005QC-Hx for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:51 -0400 Received: by mail-wm1-x32d.google.com with SMTP id n35-20020a05600c502300b003b4924c6868so4078660wmr.1 for ; Thu, 22 Sep 2022 09:35:50 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=CrKz6cgBD504H1V9Pxtox14yL/5f8r5NQpbBSzrvaPw=; b=GuYQW+VN/YTYTmck61sTXiu2xeFGx1A5YgohV6HCWmIjblBjv+w7gQxV3ypOMLI97i Ln5jDnlhKeB7bzuZgll8VMtzbfKSg9QCCim4ScbjsfRuuHgGniJ44nSABUPnoWxtyOq1 VVXsgtUjBX8n8eDEQ+Jn44hYY5dXVlq/IAlVHSISffYJkKJwFhUKsAJMhuPshibu59YQ +i1dNDkaJ0PsEFq9BUOtNyKZuInXaFW4JFeTyJhD/p59sq6Y8Lfif1hyasDNJPqU9Vic gkhpBbDcrq7fY89WEO51Y1/LI0Z+zgMgyDz4i00dgle5xOr0l+aTw4wErW02xVvwLX/c pTMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=CrKz6cgBD504H1V9Pxtox14yL/5f8r5NQpbBSzrvaPw=; b=bsd8rWMVYE3z/rEH5zU9ihqjt1Am5UyifvWWww4vKg/0tVFWduuCXP2OPBrO2ZJsly bxe/ARscemCRQbQ0f+eLfTdwj0uG4Wx5YtshAgAQOMx1rZc+7XtCW/vs3F3fa+wOCASk hEb0Rp5aWQct5OwN+9hUAceDOrSKA4E/Lsves3uPvSc79tuTot/70nbFpE8WpbbV/V+V Q/rrYt1rGaRIICo5t0RUhY2fuW60EZDTiKOR8q7AJQD5WxoWB5ZTIJrJ7PUMWFLTcgSK YQ3EQs9oqTp3bJXrbiqX3eyWS9m1B0vUAUxzzp9ARwBPb1Ih/QGL2Q46kDdBJR9JJ5EL x4Wg== X-Gm-Message-State: ACrzQf1fi2ny0e6egxIq7ddan1h/NNQK9UXCdFF2weWFAeGa6GiONcbD 2lmkO4B/C5DmAZC+spHzI5FDVYVISUO3Dg== X-Google-Smtp-Source: AMsMyM4de2AjFy0Gp8cyFBbWDx2M392IRNeZ2q4ath8Rtpi18DPfvOhInUKPXAl2PhzlTc1H5oI3fg== X-Received: by 2002:a05:600c:2142:b0:3b4:92b6:73ba with SMTP id v2-20020a05600c214200b003b492b673bamr10409755wml.139.1663864549302; Thu, 22 Sep 2022 09:35:49 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/39] target/arm: Add secure parameter to get_phys_addr_pmsav8 Date: Thu, 22 Sep 2022 17:35:13 +0100 Message-Id: <20220922163536.1096175-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663869248417100001 From: Richard Henderson Remove the use of regime_is_secure from get_phys_addr_pmsav8. Since we already had a local variable named secure, use that. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-16-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 8f0810a1968..6a73f16e092 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1964,10 +1964,9 @@ void v8m_security_lookup(CPUARMState *env, uint32_t = address, =20 static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_= idx, - GetPhysAddrResult *result, + bool secure, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { - uint32_t secure =3D regime_is_secure(env, mmu_idx); V8M_SAttributes sattrs =3D {}; bool ret; =20 @@ -2415,7 +2414,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, if (arm_feature(env, ARM_FEATURE_V8)) { /* PMSAv8 */ ret =3D get_phys_addr_pmsav8(env, address, access_type, mmu_id= x, - result, fi); + is_secure, result, fi); } else if (arm_feature(env, ARM_FEATURE_V7)) { /* PMSAv7 */ ret =3D get_phys_addr_pmsav7(env, address, access_type, mmu_id= x, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663865987; cv=none; d=zohomail.com; s=zohoarc; b=G5e2yNVsboYpwesPJ0cycpTUr0SSYtWff41NrkZGkOml6ke3rMWDazYMllPk9Y7AfQh9Da5geycXiBnssymVrg42Jbr0q6yDSR1yce2hF31hP7gRR09h32jwfaRcf+qn53+IsmmpUx5SZxljNiZ42eJmmI2hILBrigk6Isezjjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663865987; 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=LvDKHoXAgkm2T+dsnl2sSCZXSWJJItk6xpHr063ViKM=; b=C8XSeeDMX+ZTGunMb3oTs/G1UGUKmtU9jWloW4ONZvz/apnlDvMxawq/ZAJLnBWC9OMm0czukM4O3hyVMptuUggQ6B4+A0vqfGgcKabP0drdhRk3G5ItQIl4NGvaCNamAsTemRaVvttuSoQ90JBjlIQbKMKLqeq7kyPZn4kdR4E= 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 1663865987537912.9684825693621; Thu, 22 Sep 2022 09:59:47 -0700 (PDT) Received: from localhost ([::1]:44504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPYA-0001gO-DM for importer@patchew.org; Thu, 22 Sep 2022 12:59:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB2-0002Bq-Ji for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:06 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:40844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB0-0005O2-Lr for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:52 -0400 Received: by mail-wm1-x32f.google.com with SMTP id v3-20020a1cac03000000b003b4fd0fe6c0so1682468wme.5 for ; Thu, 22 Sep 2022 09:35:50 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=LvDKHoXAgkm2T+dsnl2sSCZXSWJJItk6xpHr063ViKM=; b=TgBOxyk35E9wrSEjxxe2z4PR27+miDty3MB5IeZstYCo0hW8fKSczre0suZOeBu4Mi jyOXi/wV++aaUv57TicuxoOS02BaOIHi5InHm9EsVmLkWcKvbI4JN8gCsd2dBuX5rOeD p9pLXPabkmQQ9uIsYbV9e6RubBWQ7xa802a+N6tT1gTRSk5QBgURzEH9C0hFZmAiNy71 3cjvaaBsjwZ8rhP+vcd0axAHQ8WeKiywkIgEU/8Vqwnt/I1vEvdLi66I04NcTs4L/TYv GhLgaU94nkkYjD1LpNYhVlzFCf9HDVqVhftIIEmifPL12/sU4bsGSce9wX1ELhnIpaMg Bu3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=LvDKHoXAgkm2T+dsnl2sSCZXSWJJItk6xpHr063ViKM=; b=p08WhgBJTP2hmnJ+n6C6M/cnjrSITFNw00tQ7hrjNANHupeb5mvtDzlKeLhhjHsDUl FN8DU1R/+FY9qIDw6PDMXIV0gcziAW53GYjSTzS+PueiQbMy+b1UtQUXooO7VqkJMf6F KJ/kfHQTpLESKTYhLkkGo3VLzQ9tZkjEQaotUWya0Mb7FNaHnffYSw+e46kw4jqJHS4L 9ySE5JIEwLN0Ir1lw0MOaGmcam5tbTN95dEydCEuy6B3ZW4x5qKhLw3SMbxQqwAFMaU1 R32M0DkZEW6hdZY7uGbQ8SwWgsKChjJ2hZSCGLtSgTU4X+z8fsA5dCzHmBaRwRJriRQn 9cQg== X-Gm-Message-State: ACrzQf31hO5WbyujgmDzz8CHFVZkwmBH3JFNe0kMiAjheBldAy1AjKdL DS9TA3OinNVwCdm4D0d0lLPVFfOMjuvi6A== X-Google-Smtp-Source: AMsMyM6hhsQiuvqXQLuqAYKb1comrVsZr0+QCooGnRBOJ87CyvOyNyjhj1sfEGqv8kFWZyTBSucwmQ== X-Received: by 2002:a05:600c:3844:b0:3b4:becc:e43 with SMTP id s4-20020a05600c384400b003b4becc0e43mr10156155wmr.33.1663864549915; Thu, 22 Sep 2022 09:35:49 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/39] target/arm: Add is_secure parameter to pmsav7_use_background_region Date: Thu, 22 Sep 2022 17:35:14 +0100 Message-Id: <20220922163536.1096175-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663865987950100001 From: Richard Henderson Remove the use of regime_is_secure from pmsav7_use_background_region, using the new parameter instead. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-17-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 6a73f16e092..9e1f60d10b4 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1489,7 +1489,7 @@ static bool m_is_system_region(CPUARMState *env, uint= 32_t address) } =20 static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx, - bool is_user) + bool is_secure, bool is_user) { /* * Return true if we should use the default memory map as a @@ -1502,8 +1502,7 @@ static bool pmsav7_use_background_region(ARMCPU *cpu,= ARMMMUIdx mmu_idx, } =20 if (arm_feature(env, ARM_FEATURE_M)) { - return env->v7m.mpu_ctrl[regime_is_secure(env, mmu_idx)] - & R_V7M_MPU_CTRL_PRIVDEFENA_MASK; + return env->v7m.mpu_ctrl[is_secure] & R_V7M_MPU_CTRL_PRIVDEFENA_MA= SK; } else { return regime_sctlr(env, mmu_idx) & SCTLR_BR; } @@ -1516,6 +1515,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, { ARMCPU *cpu =3D env_archcpu(env); int n; + bool secure =3D regime_is_secure(env, mmu_idx); bool is_user =3D regime_is_user(env, mmu_idx); =20 result->phys =3D address; @@ -1618,7 +1618,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, ui= nt32_t address, } =20 if (n =3D=3D -1) { /* no hits */ - if (!pmsav7_use_background_region(cpu, mmu_idx, is_user)) { + if (!pmsav7_use_background_region(cpu, mmu_idx, secure, is_use= r)) { /* background fault */ fi->type =3D ARMFault_Background; return true; @@ -1739,7 +1739,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, } else if (m_is_ppb_region(env, address)) { hit =3D true; } else { - if (pmsav7_use_background_region(cpu, mmu_idx, is_user)) { + if (pmsav7_use_background_region(cpu, mmu_idx, secure, is_user)) { hit =3D true; } =20 --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871900; cv=none; d=zohomail.com; s=zohoarc; b=lv29WXqpwhEBqRb7pGY2i4/afE2GBh3SpZi8mDd478JaMFpAraBOiir/WSfMSlCKg6gJcB5vZIEOilsAWysp2OKShNjEU5RMKxDX838ZhF7kXruDoivWJyT4SjhO+vZPE1xkdM9FYvh5HMb3vbEPIBM2B+xCsB0qMOPB8nmcPz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871900; 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=1rDY2/LSnTUCTndHvs7H1iIVK1L+jcasQz21+xSz1h0=; b=CeFGvvi5MRDn+VP9IMPbhoEsikb9XSV2IC0RICcbEgh4JcydJKJ5YLl2HNQq6Vb3/ZqM1HQ6VP4stuv3eqUp59nGBn37HuEMa1g+Lw10HizVtpCsUb9FU7kK41Hle9UHR00JowiQKySDP6YxJivsc4qYArI5tqLdOusj2pKQVWQ= 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 1663871900374416.38182399888103; Thu, 22 Sep 2022 11:38:20 -0700 (PDT) Received: from localhost ([::1]:59600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obR5W-0007FP-Ca for importer@patchew.org; Thu, 22 Sep 2022 14:38:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB9-0002CF-1S for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB2-0005Qb-45 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:53 -0400 Received: by mail-wr1-x432.google.com with SMTP id n15so9518379wrq.5 for ; Thu, 22 Sep 2022 09:35:51 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=1rDY2/LSnTUCTndHvs7H1iIVK1L+jcasQz21+xSz1h0=; b=a/+ZIOel66wrCbEc8p5P3CfiCUfnDlH6dgl330A94JAxbs+f1gdYVjI/vE1SOJY3vZ 3Q9wE8KU85h8PJPdNRlej3+wWozVZKhYoDuvQHQNM4Naxx+DItNnD6bg3RJ+nRfypmlN HopO+eYecWGVuYrscNgyD5aErMlOK1nmt2j6GR4YOeHXqe1HZM93jsBfAIhvQyYes5AB 5SwAHsHXYt0lRW1m0Wud9aTTQ/vrII6h9eCj9GN5xZ9SbnffCZCVrn47bcNLcxC7Wfcd 4fmhwit+gJkcIVzQYDNwvdWusvHaTBeRVmKZA1Bfcs4IyNK3FQYg9Ygdx45B8VjOq5AH 1D4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=1rDY2/LSnTUCTndHvs7H1iIVK1L+jcasQz21+xSz1h0=; b=NdQAY+ULghI8xEz4u8sJJbA1OSSrO8xfKyy9PUD9HapuJ7nWWeXMBpaKTzYId4zlTN i5TnQfKwmHEo7eExi58T+gnDPw8lk3sF5AKdxbiHXuhtdhnMuo780e6jqv6Pq2axthDG FfJT+o2sLiiEkOeJmOPwgzH/pTlthCVF3GxhtNGma8gfDKWIabTOqiqAzLYT6ndIHbcd xrjAbIXxS4M+AacLyELlOjfHSNlc8w0/pR5QEXbLf9mF/lwE+YQjpJEWkB4nLozhsveC f8vXHl7GF+zsRz8aBrnPiLC9ilN79lXEMiCVq2eGRpJisD87+o8xuveEpYQkCOqy7SMN tUaA== X-Gm-Message-State: ACrzQf0amay8ltyO1RNJyKt/Ufd2BVcruU6Id0KEyb+hMBPdVXlQtBUd oKIs7GnLgP9YYiU9elF3QO3lyC82GnxelQ== X-Google-Smtp-Source: AMsMyM4RD8Amj0S3dw30K+oGr5yuLh4QY88JTyV98J8oVctvRc90XerHPh/hrhlTGRjtyJyfG6wbkw== X-Received: by 2002:adf:d84f:0:b0:226:d37a:b2c4 with SMTP id k15-20020adfd84f000000b00226d37ab2c4mr2705460wrl.42.1663864550518; Thu, 22 Sep 2022 09:35:50 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/39] target/arm: Add secure parameter to get_phys_addr_pmsav7 Date: Thu, 22 Sep 2022 17:35:15 +0100 Message-Id: <20220922163536.1096175-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871902044100001 From: Richard Henderson Remove the use of regime_is_secure from get_phys_addr_pmsav7, using the new parameter instead. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-19-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 9e1f60d10b4..1e81eefa47a 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1510,12 +1510,11 @@ static bool pmsav7_use_background_region(ARMCPU *cp= u, ARMMMUIdx mmu_idx, =20 static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_= idx, - GetPhysAddrResult *result, + bool secure, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { ARMCPU *cpu =3D env_archcpu(env); int n; - bool secure =3D regime_is_secure(env, mmu_idx); bool is_user =3D regime_is_user(env, mmu_idx); =20 result->phys =3D address; @@ -2418,7 +2417,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, } else if (arm_feature(env, ARM_FEATURE_V7)) { /* PMSAv7 */ ret =3D get_phys_addr_pmsav7(env, address, access_type, mmu_id= x, - result, fi); + is_secure, result, fi); } else { /* Pre-v7 MPU */ ret =3D get_phys_addr_pmsav5(env, address, access_type, mmu_id= x, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663866365; cv=none; d=zohomail.com; s=zohoarc; b=UDnveGiIGghBKf/aWzL7OeXbZxwOBdSJXRZuThrctwGx0oxidoN+Nni++iaGmTdN2KEeVZw1QZQygVdc1QlAIOvz1XWueC0G3W6th7ubraGwy3EAd+rP8IdxtTEEE+BphN4ug0w0fqnHGzAN5K+ktHz+rUpFz0M+oEEkJ6YRK/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663866365; 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=aCTJbIT8uO+HceBgWHPJKhsRADhgD74hU3NYWDoWeL4=; b=LMKFuHJkm5FS27cIPYzfVXr7wHlwg0PvIwB4lZ/GQfDz42niiTzgLZyTWkjwu202ptZ1f0k56NdrsWC/9haFvE+CXwRt9kemA8y5jDMj7cW2KHxN4L2VGL96CPYTN2HAuPPaN0CMCC61XpDsRgqimbS2BdPhvwcBkWbKthwaoDQ= 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 1663866365238456.4662548217873; Thu, 22 Sep 2022 10:06:05 -0700 (PDT) Received: from localhost ([::1]:34036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPeF-0007jt-78 for importer@patchew.org; Thu, 22 Sep 2022 13:06:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB8-0002C8-MC for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:50853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB2-0005Np-3p for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:53 -0400 Received: by mail-wm1-x334.google.com with SMTP id ay36so7182552wmb.0 for ; Thu, 22 Sep 2022 09:35:51 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=aCTJbIT8uO+HceBgWHPJKhsRADhgD74hU3NYWDoWeL4=; b=KviiahCsT9elya7/QG2Ndv9rakhOxG4zyjAYDzP2xOvz1lfDgrhrzUpPn0peSgtaxQ yc4jTGCIj7VPhIkk+7anSv/VIy2oLVpoT4Rwp1aDwO5NBcMbnGoCe4cTKId08lfcgA9T tknHRX6AhlMmFlQEELZRDrkAiGq/OCzTDQg0NA5MRKRjMOkfDtyjwclQ4t42lTsnUQLQ PidfEYSk0UCkzItZw7cMhKHgOTJRJ7Y0sxy27ftSvLaV07A0F3Hizbsmqz4iE8p710/D 3Pd4+lBkmv20LwTizKg+KBIJ6ivrr2a/t6QblV8F57fPA1y5j/tcmxblV2YZZ9B1Ni/9 0t5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=aCTJbIT8uO+HceBgWHPJKhsRADhgD74hU3NYWDoWeL4=; b=L3b7xt16eYKugM/6M57IlhRBuDGl6m1CVyud3CKiw3o9wpnS1OTfG0AEeoBW563V9y 8//3cITMyuJdoAk2+R1zyAJnL8shF/ajh+/Aj2/6mLigaKLq9lAzqH41di8DI2N63ii0 bFjtRlFlNgWPk5blLSO7MZXnAsY0eWPK0tzxQSSYxnTQ9Kbz1mA4bFsROkNDUj0tchMp f2+tnjIhPoG3BhG/WjRaGJIJuK1Gugf1MQgV20X9UTW0N5ZpkiwdUUqh4+eibt2lJL9x D/Chir4a38R+k4ow8CZ8+jB8a6pU4V7kbKNJcfJLPrO7MKuyaryGaCDDvAfsglasmgwU p+pQ== X-Gm-Message-State: ACrzQf3TddaHg0N2l9XZ4sQ4H3lXGCe6dc1kjFCt+ZDA61vswwl/RDRP eAsPr2O+OxuE0jaa0nFG7myJK+FoG6x34A== X-Google-Smtp-Source: AMsMyM5cEQPoIgyVulyEzNSDs6AwpPHfDZUSfodmwTTmfvUgfGvXVuq5UlFyBfRNRL4m8C2/GFCjVA== X-Received: by 2002:a05:600c:350f:b0:3b4:c5f2:4295 with SMTP id h15-20020a05600c350f00b003b4c5f24295mr3098059wmq.200.1663864551125; Thu, 22 Sep 2022 09:35:51 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/39] target/arm: Add is_secure parameter to get_phys_addr_pmsav5 Date: Thu, 22 Sep 2022 17:35:16 +0100 Message-Id: <20220922163536.1096175-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663866365893100001 From: Richard Henderson Remove the use of regime_is_secure from get_phys_addr_pmsav5. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-21-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 1e81eefa47a..2ddfc028abb 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1349,7 +1349,7 @@ do_fault: =20 static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_= idx, - GetPhysAddrResult *result, + bool is_secure, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { int n; @@ -2421,7 +2421,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong add= ress, } else { /* Pre-v7 MPU */ ret =3D get_phys_addr_pmsav5(env, address, access_type, mmu_id= x, - result, fi); + is_secure, result, fi); } qemu_log_mask(CPU_LOG_MMU, "PMSA MPU lookup for %s at 0x%08" PRIx32 " mmu_idx %u -> %s (prot %c%c%c)\n", --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663872034; cv=none; d=zohomail.com; s=zohoarc; b=flR2XHLxn0Ofshkjkuc0Xn6aknk0hsQlUMw5lctRR74we8OztmUu+L0vt8AOLO1LK6LcoVQXqrduySv81SD5MeSut9qFFmxFbO4sGh/ryIs17jsATBPG8vLJFPmbX/QzPhvSrIilRp/rn07elHEQctGrXurxRxV/EhK06lg+fnw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663872034; 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=VGATNFAYBw8EtHTqtsDKOUj2+4XhHnTvCj4CQXtJ0zM=; b=dlY9JZawMUwPpXmEHxA2kV+4xDzQtKA9Oh8SdAu67/SrEk4BkDICTenSbJwngM8HEYjdkykTehUkZhVNc4UwEt1ESMfpUgwL9XPaLBcLAoW/177/uROlERX6Klc78lPJkR6XvaDPXb5zwhbHgrhfCY3DzAmt3aOFgXG2ZUxyji8= 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 1663872034148386.7585217274765; Thu, 22 Sep 2022 11:40:34 -0700 (PDT) Received: from localhost ([::1]:53448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obR7g-0001Xc-2D for importer@patchew.org; Thu, 22 Sep 2022 14:40:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBC-0002CL-6n for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:11 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:33531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005R3-P4 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:01 -0400 Received: by mail-wr1-x42b.google.com with SMTP id s14so14443237wro.0 for ; Thu, 22 Sep 2022 09:35:52 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=VGATNFAYBw8EtHTqtsDKOUj2+4XhHnTvCj4CQXtJ0zM=; b=mWnuW4St7g/bjSRCTI9iDoZj5+nYKO/E7xrvPq7H0VEwb/kTxF4K1bk2WjdiJPgrV4 H7wsLC9hUFi1shIeIeYQz0XmM0GnMVo56EoAMv4CSDk2R1aEBD+45SCoFxgtCIOXlWt7 L1qeYH6XPA1Ok2yIPT/TPU1Cf38uRbBNUAFmUuMHtAZasm5TAn4X+8YNGAjAT9ds+SVd iOiJag2k4P0txkwJZ/+hsxfJ5zCYvTSndaAwAXmkBe4oFe1tDGXTxG0HR7bK492RRqPZ OMJ+moL/Gp6fHaNF8zdYQtxPzXX+yQGGHt0aMjpAgvyn/hBnma1iCic6jFjgXzXT5X+0 BfMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=VGATNFAYBw8EtHTqtsDKOUj2+4XhHnTvCj4CQXtJ0zM=; b=fEB1i5JFjbEyCOd5Kw/bH4+IfzyZHBoLB6O4V3Aauerfg2/mc8Xd8N6jCAm7SV12W0 E2uJu+2YtDRW0p4gigfckpeynfRXLPepmFGoNSvENglbIIQ3nwaIfIH9hHipO72vMtp/ wXOEN+qZv2EXdEHpaJn/mTQ2WLam0TEEDH+AT3AgHQyLYum1414jBvvmCYIyK0AW4Slk eiwHH5lGVwq0fZsBCUPb+gSTS13qxWowHDJAKl6nRWvquooGt3iTLV3Q6dt1kHwb9dmk XmAwGNFUOAaZU2m2F8Xfagni211B39aE1pIkB5F/W82PW82NegIooUrDF75+6Z6jXZct 5wtA== X-Gm-Message-State: ACrzQf1317hsZNG05QwaArpOqI2qUnqRq+DTXglNk6ij4/WZXNh9Tj1R DAGa+qAVvuTYxkUg3dKwlOIm83mg3rvLLA== X-Google-Smtp-Source: AMsMyM6ohn80sFLQTeoK4BR6Ri5PlrcxYU2FPI34OeYbVNwhQNtCNtN6+qWqWmTTWnKq8yfkIF7wtw== X-Received: by 2002:a05:6000:1081:b0:22a:2ecf:9cf8 with SMTP id y1-20020a056000108100b0022a2ecf9cf8mr2540664wrw.205.1663864551727; Thu, 22 Sep 2022 09:35:51 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/39] hw/acpi: Add ospm_status hook implementation for acpi-ged Date: Thu, 22 Sep 2022 17:35:17 +0100 Message-Id: <20220922163536.1096175-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663872034841100001 Content-Type: text/plain; charset="utf-8" From: Keqian Zhu Setup an ARM virtual machine of machine virt and execute qmp "query-acpi-os= pm-status" causes segmentation fault with following dumpstack: #1 0x0000aaaaab64235c in qmp_query_acpi_ospm_status (errp=3Derrp@entry=3D= 0xfffffffff030) at ../monitor/qmp-cmds.c:312 #2 0x0000aaaaabfc4e20 in qmp_marshal_query_acpi_ospm_status (args=3D, ret=3D0xffffea4ffe90, errp=3D0xffffea4ffe88) at qapi/qapi-comma= nds-acpi.c:63 #3 0x0000aaaaabff8ba0 in do_qmp_dispatch_bh (opaque=3D0xffffea4ffe98) at = ../qapi/qmp-dispatch.c:128 #4 0x0000aaaaac02e594 in aio_bh_call (bh=3D0xffffe0004d80) at ../util/asy= nc.c:150 #5 aio_bh_poll (ctx=3Dctx@entry=3D0xaaaaad0f6040) at ../util/async.c:178 #6 0x0000aaaaac00bd40 in aio_dispatch (ctx=3Dctx@entry=3D0xaaaaad0f6040) = at ../util/aio-posix.c:421 #7 0x0000aaaaac02e010 in aio_ctx_dispatch (source=3D0xaaaaad0f6040, callb= ack=3D, user_data=3D) at ../util/async.c:320 #8 0x0000fffff76f6884 in g_main_context_dispatch () at /usr/lib64/libglib= -2.0.so.0 #9 0x0000aaaaac0452d4 in glib_pollfds_poll () at ../util/main-loop.c:297 #10 os_host_main_loop_wait (timeout=3D0) at ../util/main-loop.c:320 #11 main_loop_wait (nonblocking=3Dnonblocking@entry=3D0) at ../util/main-l= oop.c:596 #12 0x0000aaaaab5c9e50 in qemu_main_loop () at ../softmmu/runstate.c:734 #13 0x0000aaaaab185370 in qemu_main (argc=3Dargc@entry=3D47, argv=3Dargv@e= ntry=3D0xfffffffff518, envp=3Denvp@entry=3D0x0) at ../softmmu/main.c:38 #14 0x0000aaaaab16f99c in main (argc=3D47, argv=3D0xfffffffff518) at ../so= ftmmu/main.c:47 Fixes: ebb62075021a ("hw/acpi: Add ACPI Generic Event Device Support") Signed-off-by: Keqian Zhu Reviewed-by: Igor Mammedov Message-id: 20220816094957.31700-1-zhukeqian1@huawei.com Signed-off-by: Peter Maydell --- hw/acpi/generic_event_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index e28457a7d10..a3d31631fe0 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -267,6 +267,13 @@ static void acpi_ged_unplug_cb(HotplugHandler *hotplug= _dev, } } =20 +static void acpi_ged_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***li= st) +{ + AcpiGedState *s =3D ACPI_GED(adev); + + acpi_memory_ospm_status(&s->memhp_state, list); +} + static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBits ev) { AcpiGedState *s =3D ACPI_GED(adev); @@ -409,6 +416,7 @@ static void acpi_ged_class_init(ObjectClass *class, voi= d *data) hc->unplug_request =3D acpi_ged_unplug_request_cb; hc->unplug =3D acpi_ged_unplug_cb; =20 + adevc->ospm_status =3D acpi_ged_ospm_status; adevc->send_event =3D acpi_ged_send_event; } =20 --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663870188; cv=none; d=zohomail.com; s=zohoarc; b=FvgFjBpDkVu7q7jEsgGednZNBVjp0CRYljyTH+FMbq5VzpXx82toeF42yd3DJqks+cEROpC2l0F7qrvXNnAXLJhkg1aVYGV3Ui7Vf51QsOgyNx6MCKhZlU/z45I0iz6JYeKoN8BX2J7ufKlwoytwYoao57AKeED5Um/97w1AO0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663870188; 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=FWYlNaO7g+0N0S2l/ScS3UFVLAbgPMCsy0Gh9IEfsf0=; b=ZjrIy4aTLVGVCwMIlNkDFpNxBy4qEjmyReb3CJD/oPfpKU0md3cOYQ6rF16LeTew92zNy3V3J8g8d0Zk5Eo9eWsR7wbe+K16NNFuvTcRVnX5C22Kv0MaA3LK8hr80JeuinH9QFz4++C+qh57gOHyCHChpxvrPaPw7O8G6OxeufA= 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 1663870188178537.8072449110912; Thu, 22 Sep 2022 11:09:48 -0700 (PDT) Received: from localhost ([::1]:43626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQdu-00033R-6U for importer@patchew.org; Thu, 22 Sep 2022 14:09:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Db-Io for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:11 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:35834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB7-0005RN-8L for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:03 -0400 Received: by mail-wr1-x431.google.com with SMTP id r7so16471511wrm.2 for ; Thu, 22 Sep 2022 09:35:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=FWYlNaO7g+0N0S2l/ScS3UFVLAbgPMCsy0Gh9IEfsf0=; b=zRxJntQCbPrjm3O51eIwYarHIbJemNdXUxwqpQFuuuFyN0Dv+5uKQwy8cjHpd+XB72 6zKj/HgP5De5jlyDtPSWiZiDwHBl9pTNyaE0y8aGykU5rBcmAEAO6SN6y1TM+EAn9gdD vuqLZiqDBGOalWX2OlK4P6wFKftRHmRMEehgLvB3daaNYAycvU8VxLcp7GfObbTJ6qPw ktjStNmpv+GEIT0d6Jwq9clr8crWa/sJ+WeePqmKx+dJuBkgSJU4HUqfZLFSeHYUw0Qv SF4sl3yjfyaxwdQ7eJ7WSu6Cm9GkFlxQO7EbX8EbLnvbGWvUl2iX8M51Rx4whGRoo9Q8 hX7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=FWYlNaO7g+0N0S2l/ScS3UFVLAbgPMCsy0Gh9IEfsf0=; b=wZ2B+8IJCr0ON+Pp3i/SwQUy0J4E2kzVDIkJy5zhm6DSw8am7Dp6rClhCFYXX/AvDv TLbZm+OgLA3T6Uro47vNBfqaa4wpE8PlTQACDZwAKth8FukhQ/FYQnow6i9fRYS0x0S4 hv74fQnks/NDrmQZ/tJv07qA/S68P4lc7nzqKi6aDSz/yEKltKDGb2C1Feq8WGxXAUHs UUqkvcv5bAa7VgYAQDcYQ75ioqLCBSLpnnmtdBaIGpsCcLnQ/z9Y8kyCUuJeXaATUW8P d1Tj9uDy7VkCI13RzhduFL/rRg0eIqTWDG3Wd14XN8oQFewzNQMCSI67CMNXFU3/nCGh Zh/A== X-Gm-Message-State: ACrzQf3wZu4oFUyvUL4t0jsiifohb1m/JoGAZc/U5+D/y5droF78I8Vv BQ8rNVikWJA/obI+bVqyYL/QOT4gGByyrw== X-Google-Smtp-Source: AMsMyM4hoJYTFuC/TOlM9NKFL6xtUQeJg8CrVBHKaBnPHO3m/Yo0rO0XHCPZFllbvs6l6fjeCmlopA== X-Received: by 2002:a5d:5c0a:0:b0:228:db53:22cc with SMTP id cc10-20020a5d5c0a000000b00228db5322ccmr2476689wrb.126.1663864552267; Thu, 22 Sep 2022 09:35:52 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/39] hw/net/lan9118: Signal TSFL_INT flag when TX FIFO reaches specified level Date: Thu, 22 Sep 2022 17:35:18 +0100 Message-Id: <20220922163536.1096175-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::431; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663870190211100001 Content-Type: text/plain; charset="utf-8" From: Lucas Dietrich The LAN9118 allows the guest to specify a level for both the TX and RX FIFOs at which an interrupt will be generated. We implement the RSFL_INT interrupt for the RX FIFO but are missing the handling of the equivalent TSFL_INT for the TX FIFO. Add the missing test to set the interrupt if the TX FIFO has exceeded the guest-specified level. This flag is required for Micrium lan911x ethernet driver to work. Signed-off-by: Lucas Dietrich [PMM: Tweaked commit message and comment] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/net/lan9118.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index 456ae38107b..f1cba559672 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -696,6 +696,14 @@ static void do_tx_packet(lan9118_state *s) n =3D (s->tx_status_fifo_head + s->tx_status_fifo_used) & 511; s->tx_status_fifo[n] =3D status; s->tx_status_fifo_used++; + + /* + * Generate TSFL interrupt if TX FIFO level exceeds the level + * specified in the FIFO_INT TX Status Level field. + */ + if (s->tx_status_fifo_used > ((s->fifo_int >> 16) & 0xff)) { + s->int_sts |=3D TSFL_INT; + } if (s->tx_status_fifo_used =3D=3D 512) { s->int_sts |=3D TSFF_INT; /* TODO: Stop transmission. */ --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871288; cv=none; d=zohomail.com; s=zohoarc; b=JMnav6ZDqlYS953IHhAkTons08n33qStmVblzbmJszVSOD71OMTJ1dqyyjWqjKDyCvHVMNXR2ZXrXJYkeb8DMOYgmuguTGU3oz2nQD4I3/5kChlM3LrBcMHrgDjnnaAz+N6h7HX/i7y5rPDPIsUY5Ra2LdvT6Wf5VvxVnkILDlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871288; 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=ceS53dBC44zXtToPxcVfNPKGDYvq9xpEKY2mO0aTDyM=; b=FPVX4J60o6DdtEeXznNlm1mnJzZsmoYrIKtIxUwj5uwWfDwtimX/hHLApwtFSzq5/Ip2jC+rTHpiaCmgLPqHHov8TNDL4riTILv9wPyRA+yjJEFgiCNQfVNJ11HwqLiI/FE9LOlcsab/VYuukeehYklmxFXlfuvXIWdii4j1IMk= 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 1663871287977709.2506368211809; Thu, 22 Sep 2022 11:28:07 -0700 (PDT) Received: from localhost ([::1]:38358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQve-0003yA-Hk for importer@patchew.org; Thu, 22 Sep 2022 14:28:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Dc-J0 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:41878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005RV-Nr for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:02 -0400 Received: by mail-wr1-x42f.google.com with SMTP id t14so16402957wrx.8 for ; Thu, 22 Sep 2022 09:35:54 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=ceS53dBC44zXtToPxcVfNPKGDYvq9xpEKY2mO0aTDyM=; b=sZ54Rn3RUNXs1jYBeLTnqj6bRjbb+6Ic31Ug/F5+PBP8+IY9a9d029FSzRrVDvz/OK VqfCc3pu14Z0wJIjTGgZ3WJSLJc+7xRHCK5JktdGG381x9Rru2TUIHelPEf41Mlsi3Zy BwuhDl3BNHlreW+qTRSyrZGS5KQ8BRzhQRcEBc5qDwlY3S8w2qkNf2eDCdeHNnw3kNYy HiGyvEKwoOCtvePDnlgM5t98CMHgu51NP0mdsDOUZG1f2jwjN8Xi2O6jo2Ed7MzqsVrD bqF248Hx/WHTPTmY3gekem8q6hP5/SNlb/jpwdy9ISJ/Z/gqV/O6978CAWLK6JbYsygQ TDEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=ceS53dBC44zXtToPxcVfNPKGDYvq9xpEKY2mO0aTDyM=; b=6jm3gVBj0TxTPYr4RU+uvbhQGIl49NZjROubd2G6CT6nj/fRSht6jML3on6Q1nhSp0 KgMlMz+UdsOmPjLILPUCrn6w5W9ZDmB6jA2AVltv2o8iV38eZz42IQpyrbv3M6lH0T3U NG7EVQ6co1pI5BGED9+7WWdWyqyXCVmIJYD/RUJEyfzTI0zA/navlTFrnQYD0NpBGP95 uh0VWw1xHEmR53NlAsDUi+iSMK6Xoas1DH5qb2Nd+GNTeWXf/KtQeDbk045edVsEF3Bt gdLKGx6Vi/TVUDyk8eLef1H3fVTZa1K/o1julmkIFkdOD1tKGLfWN6Pdtt5zEMMFGtHc GguA== X-Gm-Message-State: ACrzQf1lAxa7jyRZcRqxWLbeKnmC2Df1BXf7SCquxnafYxoerZK6FZF9 j22ZEwYWFFF0KVHWsC1UjnjDbIjrHUZvKw== X-Google-Smtp-Source: AMsMyM4UQU4R7Qwdbp9zdtzTL+qCUnMXN/fpTILWDE4UWExnXI6JP2EsiSGsmhpADh2q2WCPQPK5+Q== X-Received: by 2002:a5d:5b19:0:b0:22b:237c:3de8 with SMTP id bx25-20020a5d5b19000000b0022b237c3de8mr2542401wrb.285.1663864553008; Thu, 22 Sep 2022 09:35:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/39] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions Date: Thu, 22 Sep 2022 17:35:19 +0100 Message-Id: <20220922163536.1096175-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871289413100001 From: Philippe Mathieu-Daud=C3=A9 Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-2-peter.maydell@linaro.org --- chardev/baum.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chardev/baum.c b/chardev/baum.c index 79d618e3504..6d538808a0f 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -87,6 +87,9 @@ =20 #define BUF_SIZE 256 =20 +#define X_MAX 84 +#define Y_MAX 1 + struct BaumChardev { Chardev parent; =20 @@ -244,11 +247,11 @@ static int baum_deferred_init(BaumChardev *baum) brlapi_perror("baum: brlapi__getDisplaySize"); return 0; } - if (baum->y > 1) { - baum->y =3D 1; + if (baum->y > Y_MAX) { + baum->y =3D Y_MAX; } - if (baum->x > 84) { - baum->x =3D 84; + if (baum->x > X_MAX) { + baum->x =3D X_MAX; } =20 con =3D qemu_console_lookup_by_index(0); --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663870950; cv=none; d=zohomail.com; s=zohoarc; b=BU0nhDsMe8YgqmtwIzD4mwYqI/bTyr9+3CqSrRPK6zzi2DwpaXk+9NIoewP5rJ0MRjkZs8Y9MI6vAYlnxdBH45FL6aTk1C0croeQrWc8YK4KA/xQE4vXyyznSuK84hEcV5jtWbse1ommFmRkHZP4FD5UQo3cAgo1Og0K/C4Nx1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663870950; 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=pWGWLI7V6s9hSnLclf2++UgbHO3xok2cYFgCGF9FY5E=; b=WaJnvZ4OZWW8AXzoJnJU3HlIqHvh7bYmXXUnhehZbWz0OZoeoTBFvUJNtXj0abSnBgR55TZkKtK0gRq6EVgCiEJRJGnRW1OIGPS8FZyOFsBzerrKZ1ropOH53f5tFC9bVeWpEOP0JNUCuJekxITAVVKZK8GTtmsvN6R6AF/plUY= 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 1663870950787576.4656621969973; Thu, 22 Sep 2022 11:22:30 -0700 (PDT) Received: from localhost ([::1]:34636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQqC-0007ly-P3 for importer@patchew.org; Thu, 22 Sep 2022 14:22:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBC-0002CM-7B for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:40844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005O2-P2 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:01 -0400 Received: by mail-wm1-x32f.google.com with SMTP id v3-20020a1cac03000000b003b4fd0fe6c0so1682646wme.5 for ; Thu, 22 Sep 2022 09:35:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=pWGWLI7V6s9hSnLclf2++UgbHO3xok2cYFgCGF9FY5E=; b=FcAK5RqGmh7IlaIZKmIQcWNWoElHC5uHTZ5wZI2zGScmuhTu1Ct4pb9VQfodKnf7CX DizxyzEN+6Yz7VljlYXN2FFAIds6rU324drKPVkRjmYjUwGcqI/cMxmvDjQBKwpi0JE8 mZo85V1Sp/dyg/xCGzlQxtfzir4xgddxY4umSteIWBcXpgq0Zae6CNFT31nyIurYZFxf T/HKjCLzqznQxDL1wnMriuu6hihNwC9NYW+zetcyDUH7i83aZl0E8poGi7J1NEiIYK1h 1QI1vwWRAfRVss7ptOLMao5OcSQ02/wzrI8QhfvY6WPM3UXEpxc2BUK9KRKSGSG7t+Pn VbFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=pWGWLI7V6s9hSnLclf2++UgbHO3xok2cYFgCGF9FY5E=; b=ezke81ZowlMH0qBjOhCHEGg139NnWE/GyNhEaI9B5RV4GZ539pmv7dmWRCxZTb65Rh /CTYquZvwZiwpP106OdsCKeZOVBIGClKyLjxSSJbPKrX0Fic2m8wBQhcZ+V8YP4h8fw+ 1xz0Eolh4wZBOOddlPCZTCrSn2yAA1mGME0ikQ7DKxEHu4F/cW9+XaU3mFRFgwB7fCAA 00LQGFLioTFt9ktteEIM7UNRsIjstRdWdTdsk76sdox6w0ksmrLOJCe5DPpy6oit7KQ0 dtkRLT6YQfUdOWGZ71xJ4APtT0A8DZdmoAG7L9BiR3j87oETngBnYA9daSixX7YxO8dC x/iQ== X-Gm-Message-State: ACrzQf3sR98tgMn8FpAZZ41V3S3pO1fELsfL6bj3XX4YlQEEtTeOUefw 8B88Aw4/Wr6Fl/8lptHuFH8oSZFygeq1Dw== X-Google-Smtp-Source: AMsMyM6/tdjAEZLK+AwtjeCn3wt3t2H2HRwN9jvmIrwskFj1TvlcUd/LIhDxuypK5PiyRW2W5fGDiw== X-Received: by 2002:a7b:c051:0:b0:3a6:36fc:8429 with SMTP id u17-20020a7bc051000000b003a636fc8429mr2936125wmc.78.1663864553607; Thu, 22 Sep 2022 09:35:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/39] chardev/baum: Use definitions to avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:20 +0100 Message-Id: <20220922163536.1096175-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663870952332100001 From: Philippe Mathieu-Daud=C3=A9 We know 'x * y' will be at most 'X_MAX * Y_MAX' (which is not a big value, it is actually 84). Instead of having the compiler use variable-length array, declare an array able to hold the maximum 'x * y'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-3-peter.maydell@linaro.org --- chardev/baum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chardev/baum.c b/chardev/baum.c index 6d538808a0f..6a210ffd815 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -383,9 +383,9 @@ static int baum_eat_packet(BaumChardev *baum, const uin= t8_t *buf, int len) switch (req) { case BAUM_REQ_DisplayData: { - uint8_t cells[baum->x * baum->y], c; - uint8_t text[baum->x * baum->y]; - uint8_t zero[baum->x * baum->y]; + uint8_t cells[X_MAX * Y_MAX], c; + uint8_t text[X_MAX * Y_MAX]; + uint8_t zero[X_MAX * Y_MAX]; int cursor =3D BRLAPI_CURSOR_OFF; int i; =20 @@ -408,7 +408,7 @@ static int baum_eat_packet(BaumChardev *baum, const uin= t8_t *buf, int len) } timer_del(baum->cellCount_timer); =20 - memset(zero, 0, sizeof(zero)); + memset(zero, 0, baum->x * baum->y); =20 brlapi_writeArguments_t wa =3D { .displayNumber =3D BRLAPI_DISPLAY_DEFAULT, --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663873053; cv=none; d=zohomail.com; s=zohoarc; b=NLWEIETnzhTiuVhJHjZBsDGWD06xpdVTy4V4+lXRlvOtuR33S/KxwzXgT0fUfnk4KskC800OnKYtKJ6p0oppCYS4gU+I9+JjIHDMFhiCfuJ+wD/mwFc1vVus+lOLzJKcbGy9zl3z8ipRc8IwRcY4Ewe5WVxNWecxKVg2DBu0h9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663873053; 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=Iq7GHbEjHTo1LvtpoRoRhaQR0OgzbS3qn4RhqhBWZ9U=; b=nVYdynnT3CNU+x9XMwa1LyhuQMD7Ov2zijT3GQo/IFvHCL8ZO+ztft2stKA/fRmNPH8YmVTZgXkbSiUG9wDyzWBhFqeIaA+6h1LuYYMfzlb4gS7WZx3lXD6TGnmdhXN7fQOchUoXaiui+gzsIksiMPt6ptoQ++HLWsFdvUQXD88= 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 1663873053335514.4415559517388; Thu, 22 Sep 2022 11:57:33 -0700 (PDT) Received: from localhost ([::1]:54996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRO7-0006PO-76 for importer@patchew.org; Thu, 22 Sep 2022 14:57:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Dd-J6 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:11 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005Nu-PL for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:02 -0400 Received: by mail-wr1-x431.google.com with SMTP id cc5so16440659wrb.6 for ; Thu, 22 Sep 2022 09:35:54 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=Iq7GHbEjHTo1LvtpoRoRhaQR0OgzbS3qn4RhqhBWZ9U=; b=w6gCJm0194grWynBYVtJVt/SgDR7NgGKmdUt9BJULpIxFDmW10NFCo+Oxds4k/1c7M EgoqM65Ss2VWt5PP4SeLNgpY2G89p+yNbuZ1QTbO71gvoCP9uz1uFOeIIF3m4B6velyE EKzAy3fkw6ApalH3oZSrkavyD9USFEK632RB2ZqIVpkSgEd0IgGXc+XMlTDCWywy8f+y VK0ctLEKVRGmGuuF9W2WJqc0+nel0K3Gga4s+0peU7t9rRdG0Dn/n1Bcfdrv53ByBrw2 XgkZ9hYdzDp3MC2ee+DppKekf+9mOIVY+lz3F47U3rmJp1M8NiYEv6ibTnYOPkDHGrN5 cO/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=Iq7GHbEjHTo1LvtpoRoRhaQR0OgzbS3qn4RhqhBWZ9U=; b=qcqZHSb7kcyGU5AdCdBISk9TVT2CmdEn0S8cD79E/znhITDiqxMjB+q6K+aZ7RDE9M 0abu6wSLyoj+ZVkyenCN9byLs3LWRL3Ftfi5QxfASq5u/AGZLRNvL4c6hIr8ZLMbLp6e L8o2rRWt3qGZJVRS7YRq4stqbSJZoFSvlQLylX/ul0jSa1QITQCGzJ0tQWxyVnKVrtCJ j472Hl0UlJ2NZIs6ZPwqdzmePEhyWxFEeZ7ojaNl/zyinYLui9M10C55fy4U7arobJQg tCRvHRffGenG/gDirXvwIMR0l9t4ZVTl7hSD8N4NULuAh3iS1VczR0CzaAMA/xg78pfh C4iw== X-Gm-Message-State: ACrzQf34FhTs/Ix8ZqMZ+xofelX4rLnXrxNKSMgdFxDXkZ1r0vAiyoDP QMICAnuK7zYeGwtWNJwAhfCBHgo5eukwqA== X-Google-Smtp-Source: AMsMyM6NoUjfR54+LHFrrL+JRbf8BgpGL2mSFTX7Evq66e9ijv7agr0OHrD6WjcIedZneDrHiI1ddQ== X-Received: by 2002:adf:f2cf:0:b0:22b:e4d:62cc with SMTP id d15-20020adff2cf000000b0022b0e4d62ccmr2586707wrp.27.1663864554244; Thu, 22 Sep 2022 09:35:54 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/39] chardev/baum: Avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:21 +0100 Message-Id: <20220922163536.1096175-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::431; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663873055479100001 From: Philippe Mathieu-Daud=C3=A9 Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-4-peter.maydell@linaro.org --- chardev/baum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chardev/baum.c b/chardev/baum.c index 6a210ffd815..0a0d12661a4 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -299,7 +299,8 @@ static void baum_chr_accept_input(struct Chardev *chr) static void baum_write_packet(BaumChardev *baum, const uint8_t *buf, int l= en) { Chardev *chr =3D CHARDEV(baum); - uint8_t io_buf[1 + 2 * len], *cur =3D io_buf; + g_autofree uint8_t *io_buf =3D g_malloc(1 + 2 * len); + uint8_t *cur =3D io_buf; int room; *cur++ =3D ESC; while (len--) --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663872657; cv=none; d=zohomail.com; s=zohoarc; b=MSGkOZaKQtySUoPD71V3RjIhXO8447jgG6HsV3tp+7Qjkzak9WjEoxiU8BiuGwQTegMnGFkf+QyvuCXLiprXgrlzfWUFpRdzU1atoeg8jYZxqzOpjdRFFVvvK9E2sHlngff6YZz/kgtnoFULjx39bD6pDQ6MXuJRmzG/Xn0LD54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663872657; 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=qX86iXQWy4diJSSYD9PIr2CHjWMIxQY9Dao4svxApxw=; b=A9C/QOWsSx9N5MgLQPBd51920HxT/y/rfl1fPHQHFmCmB7m68h64gMzydGbxgFwWCcJQZhoShxcCErWNDj5aQs9r3AFJkYhgyRrAG66MyoggEWjy9r0jca5K8rQjn2lM3G6IVTR3ppvPJ0dO3S7lYgHzLJkf2Dp3ZK5FWcRBYBw= 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 1663872657474216.96746756270204; Thu, 22 Sep 2022 11:50:57 -0700 (PDT) Received: from localhost ([::1]:43328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRHe-0005xQ-Oh for importer@patchew.org; Thu, 22 Sep 2022 14:50:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBA-0002CI-DS for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:37714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005Ri-DS for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:59 -0400 Received: by mail-wm1-x32d.google.com with SMTP id z13-20020a7bc7cd000000b003b5054c6f9bso1181426wmk.2 for ; Thu, 22 Sep 2022 09:35:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=qX86iXQWy4diJSSYD9PIr2CHjWMIxQY9Dao4svxApxw=; b=Yv6LuHE6V79ZfzLRyigT5YQlR86s3F7vRTGb1rN/+oCXugUM2wCOUpLICCmU8mrabT whwmkR0F96Rc7VMkTiApsKnUQco5vc/q+ud1hPrSYCpSw/jwt14eDjLuq4zP08J41xx1 tZrGqKxZD9Jpz1QK01Dexr+IWGS28YqtuP3NMvFt3wzzGfVC0GIPamqvpWPt1lsVkrcQ YxG3wXhvMR7pmFCXMJx3prTk6pu0dOEiYbfwND3ywDwWLWoK+0+45w4yI2bB+q9rhvTg R5HrrwmUFfEs6QchNLm1irqulY23lviN1fS10xX+PRMVAoc6konKp5VwWnY6o4a/a94K nq4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=qX86iXQWy4diJSSYD9PIr2CHjWMIxQY9Dao4svxApxw=; b=KcY/FhQ6fS/t4xLrGZz7RhO8gUoahpzMdrKeUQtpHCBUwiHUOYMSZCtUADyLrLHFEd rw8TTtHTdSAM9u35UmXss2sNQy8TbH3wp2KOypa+cQNDAe2LEmK87b0KdbfdNL8at3Yp /h9P2FSv0Dhv48RtHt5pIm640reLNSO/XmY0NH3HGghkfpG0THdTIGhZ8KH2Zns2UwFo ZKaGtXM2BeWAMoPoxthIyWjHtCqSx+IUYLv3vMn0NyamwnmiBTxbE6Gz2hiupjPIryV1 GJ4a1aiJlnzhuJIM5xAqfK6Ni8kQYvI/GejDKv1zDT/AtUSq1mrt+EkZpjotJUo5iQr9 jzxg== X-Gm-Message-State: ACrzQf2XLzmVAIRseMmRbveF1QDjVxNN6liZgNX5Qz0NUxNZuVu6qDW3 vNMeTgoginxG3py/6iFB/b8WZp7xIfGpWA== X-Google-Smtp-Source: AMsMyM5HddHVlowuOv4OsGqMML3ch2ZRK39b0sRWxNAaZGCpW8FGps+vQErO2gbetXL9S9ab7xHPWw== X-Received: by 2002:a05:600c:3ba0:b0:3b4:8ad0:6c with SMTP id n32-20020a05600c3ba000b003b48ad0006cmr9998060wms.186.1663864554831; Thu, 22 Sep 2022 09:35:54 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/39] io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1 Date: Thu, 22 Sep 2022 17:35:22 +0100 Message-Id: <20220922163536.1096175-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663872657739100001 From: Philippe Mathieu-Daud=C3=A9 The combined_key[... QIO_CHANNEL_WEBSOCK_GUID_LEN ...] array in qio_channel_websock_handshake_send_res_ok() expands to a call to strlen(QIO_CHANNEL_WEBSOCK_GUID), and the compiler doesn't realize the string is const, so consider combined_key[] being a variable-length array. To remove the variable-length array, we provide it a hint to the compiler by using sizeof() - 1 instead of strlen(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-5-peter.maydell@linaro.org --- io/channel-websock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/channel-websock.c b/io/channel-websock.c index 9619906ac36..fb4932ade70 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -32,7 +32,7 @@ =20 #define QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN 24 #define QIO_CHANNEL_WEBSOCK_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" -#define QIO_CHANNEL_WEBSOCK_GUID_LEN strlen(QIO_CHANNEL_WEBSOCK_GUID) +#define QIO_CHANNEL_WEBSOCK_GUID_LEN (sizeof(QIO_CHANNEL_WEBSOCK_GUID) - 1) =20 #define QIO_CHANNEL_WEBSOCK_HEADER_PROTOCOL "sec-websocket-protocol" #define QIO_CHANNEL_WEBSOCK_HEADER_VERSION "sec-websocket-version" --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663873218; cv=none; d=zohomail.com; s=zohoarc; b=aolYO4aXeg64DZrvyPbbxd4EOC6xYbhnUTqgN4X2o2ulXlWjGrX2YoiTbuHRRop2xQwDfn5wssd+UIwT6XlZGETTZaPU/7BDPSj37+xXIprucpjR3TdoHJE/+2t5b8lzWpmt61JDlx9ULNapO/daSMbSYrq5x60+WfW7rhS+BMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663873218; 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=CiM/H1ZT11GJiU4qYe1Z3GEoKJxYHvPyHuyNl3EOOzE=; b=eiMPcBdvzs1wMM1y4WLu+yJDR03u20/+RDk7Qt2bDFA8oLyQq8vNdeJRdBBBt0uc/j8gBLeDqvjRvSyxfMRjr30mv2OUOwm3A5gyJf9WyPsYESWnes8pxxARIWUr8HX9GylBgMd4QG0+3inEiOBh4SkBrB2sWYm2jP1MOY8uRFg= 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 1663873218304186.21238761311395; Thu, 22 Sep 2022 12:00:18 -0700 (PDT) Received: from localhost ([::1]:33022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRQn-0002KN-7T for importer@patchew.org; Thu, 22 Sep 2022 15:00:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Dh-K2 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:11 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:45700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB9-0005Q7-Q2 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:03 -0400 Received: by mail-wm1-x32c.google.com with SMTP id d12-20020a05600c3acc00b003b4c12e47f3so1703642wms.4 for ; Thu, 22 Sep 2022 09:35:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=CiM/H1ZT11GJiU4qYe1Z3GEoKJxYHvPyHuyNl3EOOzE=; b=ddwaR6VDQECPz2gmSi5yAAHXToTFhBHAMy/tPGSSJw26vPzI6km/jielm7QwW++DL2 wQi1+MEY/Lj/FxOSQQ45xr8s8zln+HaperzOee8QXbc31ZrRIYiGIfdc9kmWdSBJe69y 2HwjNzuxkA12fM+MbRAnB9NPIFK8Tz53aab28mCBHzmhy86GUp6Nzg5593NhKCiCxy/n EsSPnEyKv21i1aTLQUz3Y5CRMaEtBXXdjfHKeY6VeOFMSccUj9Rki8JnwOi9+kf/+AwC XMpaHaor/Ls4kkjT7QYSnFtM4ODxhCL09p0RcInw96fPaoNg1ax3aKpwfpJp/a7Rdw+r fOTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=CiM/H1ZT11GJiU4qYe1Z3GEoKJxYHvPyHuyNl3EOOzE=; b=4jKhjYPbqyiyTllqvwSmlLxafOTxsV9139jPdF3uBfeAFfvREYcEXVtBKsgdu5Yyra GWQ45l0bHVlP7bwkPCGKY7vzR7EVej1VfecsFkM1tY1vVj2PAK6WJx7os4Ffw8Sgxezp eNzoXO+Elq6mKP+fiSQrcR+KJRcx0VE+dKTCrZf0BOwl+uZQahscrpPYQ3kQA2ZMBhak D/pvfNRjFTKsGNVeJehkW08BhsSNtOiYPg8xAhdi1RJh9uUGXip1ve3nL1fHbAEh0KGe Hil/S7WzEMgMNQPZbwKPEu4bdLSDuy1rbVCUv/mJTFjBZElr7tUFa6C6/X6VNtIbMKne UQzQ== X-Gm-Message-State: ACrzQf1ycKfNTVg/yRvFueSxNJNct2P/lt0Jml84cHvEG69rU9PDRtXI 8HgBT0VLnKaJpZs2cdWTcSDF0cV98uCC+g== X-Google-Smtp-Source: AMsMyM5qC55yDvJeE51EuWHzlLk034F04xdWGdVlBoiCYiShtke2Eu3oyjfujF+2TZryvfePTzrJKA== X-Received: by 2002:a05:600c:3c8a:b0:3b4:eff4:a94f with SMTP id bg10-20020a05600c3c8a00b003b4eff4a94fmr9553825wmb.105.1663864555423; Thu, 22 Sep 2022 09:35:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/39] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:23 +0100 Message-Id: <20220922163536.1096175-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663873219030100001 From: Philippe Mathieu-Daud=C3=A9 The compiler isn't clever enough to figure 'min_buf_size' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Jason Wang Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-6-peter.maydell@linaro.org --- hw/net/e1000e_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 208e3e0d798..82aa61fedcd 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1622,15 +1622,16 @@ e1000e_rx_fix_l4_csum(E1000ECore *core, struct NetR= xPkt *pkt) } } =20 +/* Min. octets in an ethernet frame sans FCS */ +#define MIN_BUF_SIZE 60 + ssize_t e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt) { static const int maximum_ethernet_hdr_len =3D (14 + 4); - /* Min. octets in an ethernet frame sans FCS */ - static const int min_buf_size =3D 60; =20 uint32_t n =3D 0; - uint8_t min_buf[min_buf_size]; + uint8_t min_buf[MIN_BUF_SIZE]; struct iovec min_iov; uint8_t *filter_buf; size_t size, orig_size; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663872120; cv=none; d=zohomail.com; s=zohoarc; b=coKcxcNYUPL3L4GRMM3XP+lhd1iNmMwEA8Ao7JoMzbs1NN1WIONDfBFm1UMl6FkFAeI0Bu/xxSO1Z9p+ZVI3VrhZmK6+OEdToeC3DEATAhP096ojhrHhBlUOL6alzbNi862WgbildIPdtPNh5b9u5HjlGkta1hHVFQrBGv1zT7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663872120; 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=ztKwOrqkfodqtKzngCt55ZxSfx72kc5wCij+ohkVkGQ=; b=QdD6DYaO2kwMdVTl+4kdwIpmfLtp7/GA9lE8AWGqiO/mvUwBeMxCdQvS/M6xcpo8Zpw4yXTopJ2HWSDO0YmxEUJJc4Kj8kUNnbgsrfMfGaKhmfMLIlMh+N2EWC4PAmH+mSBQrZgyySUkT5soFVXDhFRHcxAyQBK2GY/PCzP2ndw= 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 1663872120524591.1738125659596; Thu, 22 Sep 2022 11:42:00 -0700 (PDT) Received: from localhost ([::1]:47272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obR95-0003pQ-EZ for importer@patchew.org; Thu, 22 Sep 2022 14:41:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBC-0002CP-V6 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:42607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005S3-P4 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:01 -0400 Received: by mail-wr1-x42c.google.com with SMTP id n12so16405127wrx.9 for ; Thu, 22 Sep 2022 09:35:57 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=ztKwOrqkfodqtKzngCt55ZxSfx72kc5wCij+ohkVkGQ=; b=j6osT53I1JIxRph3dpQ8pu9s0wx/bGZ50koQxPPKncKGSP8S9mzRyXy9BsGeQYxtBc Fogzoux2dPIQZmYDO/HEF3FNp1oG8Syjf4QlTzYAnLoVFsYWangGSedgdpHgmX4JdPuw 9vEVB8id+gq6A1tVl7u45WpOjtOvnPoDHFKP4mvEt6VMn7MyWcsckzmxW68sskQKyi1W 9v/NZT0XRVK9rI98paKkkjZmCz33m4UUmHanjchDctcIqXNDV9eByBOISOjTuAN878Kg ku4kx0L5q/vyskcCpavStXUiVn/Iqanln3gYEpAIdRkDW0hdTIwh0HyAR9nwVC7rar30 674Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=ztKwOrqkfodqtKzngCt55ZxSfx72kc5wCij+ohkVkGQ=; b=FMNOJ5XOK02Bi6joeFOD2mR26oHgYxz3l8vcVoOTJrsbSQkFk2A48Wggmop2b9+JWx K4ivdKPRHEBhkj4K+gq3zipjH60N8+/Ap9Ks9BE3MSxJPDWDuTGhbAf0JPk7T/H4WKzN LaKgkGhQHHb/U6ZKJbcH1ysk77h9S2d3QgfEhJWNNK9jtJ4OmnR1rg3Ufp8qapowFuW3 Yg0xgsViwhZMyFRtQUUz1JoCxX320YUVVDYdogzFgSO+bDXscV1uq/qgQZyZw+ruE3xH UI0SiymJJIS4LeCBYyRAzeF1xKLpGj+skEX+nmTrk09AGsQ9ADF5W1Abg0Vexo31WwPr NBtQ== X-Gm-Message-State: ACrzQf3FcZW4I7ESwxEjnosUkQPqEvV/sA7DoNLmMlGcLb50YxCF72kl O5pOZZnyRenfyGDhobrlMTCHNjnYM0tAKw== X-Google-Smtp-Source: AMsMyM7qRUmtQi2gdHjwXJPOFji7BGup1rVAEnjQrtoXPOXEzARL0WS6eI3e8VjP9HXEN/xJzepozg== X-Received: by 2002:adf:a50e:0:b0:22a:ede1:57e with SMTP id i14-20020adfa50e000000b0022aede1057emr2542199wrb.63.1663864556091; Thu, 22 Sep 2022 09:35:56 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/39] hw/ppc/pnv: Avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:24 +0100 Message-Id: <20220922163536.1096175-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663872122234100001 From: Philippe Mathieu-Daud=C3=A9 Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell Reviewed-by: Daniel Henrique Barboza Message-id: 20220819153931.3147384-7-peter.maydell@linaro.org --- hw/ppc/pnv.c | 4 ++-- hw/ppc/spapr.c | 8 ++++---- hw/ppc/spapr_pci_nvlink2.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 354aa289d18..78e00afb9b9 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -138,7 +138,7 @@ static void pnv_dt_core(PnvChip *chip, PnvCore *pc, voi= d *fdt) int smt_threads =3D CPU_CORE(pc)->nr_threads; CPUPPCState *env =3D &cpu->env; PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cs); - uint32_t servers_prop[smt_threads]; + g_autofree uint32_t *servers_prop =3D g_new(uint32_t, smt_threads); int i; uint32_t segs[] =3D {cpu_to_be32(28), cpu_to_be32(40), 0xffffffff, 0xffffffff}; @@ -241,7 +241,7 @@ static void pnv_dt_core(PnvChip *chip, PnvCore *pc, voi= d *fdt) servers_prop[i] =3D cpu_to_be32(pc->pir + i); } _FDT((fdt_setprop(fdt, offset, "ibm,ppc-interrupt-server#s", - servers_prop, sizeof(servers_prop)))); + servers_prop, sizeof(*servers_prop) * smt_threads))= ); } =20 static void pnv_dt_icp(PnvChip *chip, void *fdt, uint32_t pir, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index cc1adc23faf..8bbaf4f8a4e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -177,8 +177,8 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset= , PowerPCCPU *cpu, int smt_threads) { int i, ret =3D 0; - uint32_t servers_prop[smt_threads]; - uint32_t gservers_prop[smt_threads * 2]; + g_autofree uint32_t *servers_prop =3D g_new(uint32_t, smt_threads); + g_autofree uint32_t *gservers_prop =3D g_new(uint32_t, smt_threads * 2= ); int index =3D spapr_get_vcpu_id(cpu); =20 if (cpu->compat_pvr) { @@ -196,12 +196,12 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offs= et, PowerPCCPU *cpu, gservers_prop[i*2 + 1] =3D 0; } ret =3D fdt_setprop(fdt, offset, "ibm,ppc-interrupt-server#s", - servers_prop, sizeof(servers_prop)); + servers_prop, sizeof(*servers_prop) * smt_threads); if (ret < 0) { return ret; } ret =3D fdt_setprop(fdt, offset, "ibm,ppc-interrupt-gserver#s", - gservers_prop, sizeof(gservers_prop)); + gservers_prop, sizeof(*gservers_prop) * smt_threads = * 2); =20 return ret; } diff --git a/hw/ppc/spapr_pci_nvlink2.c b/hw/ppc/spapr_pci_nvlink2.c index 63b476c8f72..2a8a11be1d6 100644 --- a/hw/ppc/spapr_pci_nvlink2.c +++ b/hw/ppc/spapr_pci_nvlink2.c @@ -397,7 +397,7 @@ void spapr_phb_nvgpu_populate_pcidev_dt(PCIDevice *dev,= void *fdt, int offset, continue; } if (dev =3D=3D nvslot->gpdev) { - uint32_t npus[nvslot->linknum]; + g_autofree uint32_t *npus =3D g_new(uint32_t, nvslot->linknum); =20 for (j =3D 0; j < nvslot->linknum; ++j) { PCIDevice *npdev =3D nvslot->links[j].npdev; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663869520; cv=none; d=zohomail.com; s=zohoarc; b=RxuJ5o4eplLqvf7RLVaj32vRmGtfWRzuoe8IGeDpfo/Uu2xyuMpVooFiU/9eyeitcVeHMB8GrhQyP6b57Qe/7QIN47E7/L8XGEPpOmzNH9NAcLqDvxObhWdegi2pOJ14IsPanXRHvlOiOJeQZs4CoVMiuwdV1b7Dggu2L3ozG8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663869520; 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=325OKYY2nX8aI0G82FZc2RGAVSyYsN8rb3hEEYonRaA=; b=K2LVZABQ1VsoJTM7h/BP5a+5eA37hfhyDDNQmD2bCzRux3uwgeSO+pZdN6gaSwEcOIC9gZ8IVdFjoY4ydFjcHSNaVTYAdLsxBURk5unEYu5lamhU5jvvwH737Ergwzy7cBkPN4tHh+/SudyaUXF0Lp0Y6RBvHpA+U9hxBFJrf3U= 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 16638695209391002.8985078990139; Thu, 22 Sep 2022 10:58:40 -0700 (PDT) Received: from localhost ([::1]:54650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQTA-0008Mq-01 for importer@patchew.org; Thu, 22 Sep 2022 13:58:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBC-0002CN-7B for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:39871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005S5-Ne for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:01 -0400 Received: by mail-wr1-x42f.google.com with SMTP id cc5so16440835wrb.6 for ; Thu, 22 Sep 2022 09:35:57 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=325OKYY2nX8aI0G82FZc2RGAVSyYsN8rb3hEEYonRaA=; b=qTPOOld9YRvyrbeOp0FEA/UKgHmBt3i5wjTdpWupIXHKxxRHgyr188pcsSx48U9jRo VuWhWa6Cggzx+B0HoZiYAjDD0cHs+Zz6wx1M5KTMWiA98KB/0I4hK1NXptB6kXsY8N7L Y6FheLy9UiFL56CuUfDNuQsRdpydlQ/j4Qj0pMnHyK1DS2WX0qRe/PZU6Pa7XYIEjU3R wv9o/UrnaczpWKxVLM5nTZv46+z6zz/ZFPVU2WD9ybHmEwyWjC8aCUyRZcvtAyHUHIHJ I267nmpYG7Yx8Chl0ySNHgjEoH3ZX+gpuxS9yug9aAiuUmeiNSxi3bHvEjQHfpLkbRc2 HrEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=325OKYY2nX8aI0G82FZc2RGAVSyYsN8rb3hEEYonRaA=; b=s78h5LWlYDzUnhDg+wW+4hjSCBBkweSimJ+OqaOh1L8ET1xENf/IF+6+H0xx0wLBWH 4V8XqG2rxxipTNqBYCazkmRLJoJEd8dtG4dxnzJv4sSwkEGrIwmg3daP6mwR0Emta+zo P++QjimuQcpJt5vK5g/FJizh4Tu5toun5t2+MbYneIDmo9ItPxFnBYr126iduT/5cYGV E6/lvbUK+1I0S5+LZGR2tl2z8Ex0/3rPNt1Tl8e6zB3cER28SLttg5Jh9bJ9Pz8YBjW0 EEjngwb+jGIeL8VEGwyAwlCCPxFI7/mqCzoIZE99PItbQNosL4bdD92711scU3nQzkTb 5q1g== X-Gm-Message-State: ACrzQf2pAb+Vw1KjF1dVp5V5YWhoAhyHSV3Ol0zEkAXLzLUe79wYMv5r eGHvkrhdsTaLswx1GScXybWYViOg4kekyg== X-Google-Smtp-Source: AMsMyM6dT5ZlsM4C+/c6ye+RwBVB8dtfZS+3V/P0ScQiaHx5NynpyITqujfVM8GwvzNyGussMX0EtQ== X-Received: by 2002:a5d:598c:0:b0:22b:100f:c2e0 with SMTP id n12-20020a5d598c000000b0022b100fc2e0mr2588405wri.702.1663864556665; Thu, 22 Sep 2022 09:35:56 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/39] hw/intc/xics: Avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:25 +0100 Message-Id: <20220922163536.1096175-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663869523147100001 From: Philippe Mathieu-Daud=C3=A9 Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-8-peter.maydell@linaro.org --- hw/intc/xics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 5b0b4d96242..dcd021af668 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -567,8 +567,8 @@ static void ics_reset_irq(ICSIRQState *irq) static void ics_reset(DeviceState *dev) { ICSState *ics =3D ICS(dev); + g_autofree uint8_t *flags =3D g_malloc(ics->nr_irqs); int i; - uint8_t flags[ics->nr_irqs]; =20 for (i =3D 0; i < ics->nr_irqs; i++) { flags[i] =3D ics->irqs[i].flags; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871552; cv=none; d=zohomail.com; s=zohoarc; b=IblZqW7v5kuLi6f2mejNnOD+R90o7BMJFooi8OF0nv+Ghb5kBXypheVQXn5twlMgXrjMJ+f8v0+hko8KI+0ziFGO7NklWG5ikiDZDEmPdQNPYMrw3dU7Fjgka8btqDW0YhwZvkr00BpKC2zDIR38Ifi7VbuLq79mAgVyy44xbBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871552; 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=HVLDjT4fU1zPU/nL/+pXZz3AlOxWu0cbWVrJuViFf8w=; b=aK8ddJGOKdaT8lA4Za6rrlOBRhbdfjesrFdy/PBMLn2WUWsx6e0rstXLlN+SxiWXua6rNKDQKGUJW2WrIBPF7BuA49GEI4KkLEIFiJvhxZCNUzUBOeLUm0kq1Ah2qcUsHEMnnjjyZ62U+Y8a70wFFYskCL1f4M4JZDGEJdl37xc= 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 1663871552736160.9599006106008; Thu, 22 Sep 2022 11:32:32 -0700 (PDT) Received: from localhost ([::1]:44856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQzs-00008v-Od for importer@patchew.org; Thu, 22 Sep 2022 14:32:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Df-J0 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:40482) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB9-0005S9-QH for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:03 -0400 Received: by mail-wr1-x434.google.com with SMTP id x18so10415941wrm.7 for ; Thu, 22 Sep 2022 09:35:59 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=HVLDjT4fU1zPU/nL/+pXZz3AlOxWu0cbWVrJuViFf8w=; b=mT1icSoH9npd9mB/Lk4fzf68OXGKXKmlPueey7qtiS5WQ78MmrO5olF5+05uk5z8DH 8ZS2p4pCXssQAOHaM32y45kLZ1vAgX1l3ro1gd3dEdBTfnzhX+QxhslOr/92yX9/zO7Z AuYvIZNrYhJs2Xa3tS/WxnzdbRarYqumuK75hFZO5h+vBTBie77t22FSU9GGIjoaWqzw L9BoVavWbZDR5+GwLzEGKc2BF3BOunH1aJHnaOSoxbqtZsSd/1mPXw5wb4O5HqNOIQ8Q oqcNaobfFyWKjy5SKa7k6SRR4DVGyFUjdTLsrtv+xnrNBpm5nP/GxDNJXLd2aDJlgC1Z bLbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=HVLDjT4fU1zPU/nL/+pXZz3AlOxWu0cbWVrJuViFf8w=; b=o0ZRPIrvJ3tlPmCC+Mqgw49FkjHsOOSle+tG3mRG6L7x8NXTh6lNeSHAwoM/K2sB4e S6dJqFt2aK9yzIJnT6hgycsJ124ht3IzD6m1trUer6hCPNWN7g/htrxu71OOMpSOhAsE JtH0VlyvoA/TWSWHd6CjOFsCigZ41JGtNMmkAnqbJjqlfzEhVWzKVVKcWw7HJBDs+DFn hzxYtopPoJ2QM+uV2vzLkFPnKZfIR4ZDXt4gtl4+9yTjR88TtTtaaIUph620cvr4FciS yLvX0+WX9ziEewzPBuw6MtnUzgMiPbaiUh+2KPxQbVk9h2Vqb6zIgaUQxtuekivxOtgH 1s3Q== X-Gm-Message-State: ACrzQf340BSll2K71/UGbQLlwf08xeBew93Y+xB4lwdmE8MTCeWVeu/Z eL5v5UWr8os2W1HzhjHtaiNgdjh5dN/dHA== X-Google-Smtp-Source: AMsMyM48P/uJl7fnOvREGWfEg0PRQJMUxCtC8V5bbVNJD42Rw3X2t1Fmyd3qzPZp7guhiIDT3txJ0A== X-Received: by 2002:a5d:6088:0:b0:228:e0c5:da5f with SMTP id w8-20020a5d6088000000b00228e0c5da5fmr2549947wrt.221.1663864557290; Thu, 22 Sep 2022 09:35:57 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 29/39] hw/i386/multiboot: Avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:26 +0100 Message-Id: <20220922163536.1096175-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::434; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871553226100001 From: Philippe Mathieu-Daud=C3=A9 Use autofree heap allocation instead of variable-length array on the stack. Replace the snprintf() call by g_strdup_printf(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-9-peter.maydell@linaro.org --- hw/i386/multiboot.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index 0a10089f14b..963e29362e4 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -163,6 +163,7 @@ int load_multiboot(X86MachineState *x86ms, uint8_t *mb_bootinfo_data; uint32_t cmdline_len; GList *mods =3D NULL; + g_autofree char *kcmdline =3D NULL; =20 /* Ok, let's see if it is a multiboot image. The header is 12x32bit long, so the latest entry may be 8192 - 48. = */ @@ -362,9 +363,7 @@ int load_multiboot(X86MachineState *x86ms, } =20 /* Commandline support */ - char kcmdline[strlen(kernel_filename) + strlen(kernel_cmdline) + 2]; - snprintf(kcmdline, sizeof(kcmdline), "%s %s", - kernel_filename, kernel_cmdline); + kcmdline =3D g_strdup_printf("%s %s", kernel_filename, kernel_cmdline); stl_p(bootinfo + MBI_CMDLINE, mb_add_cmdline(&mbs, kcmdline)); =20 stl_p(bootinfo + MBI_BOOTLOADER, mb_add_bootloader(&mbs, bootloader_na= me)); --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663872342; cv=none; d=zohomail.com; s=zohoarc; b=jcGMBRukrPTy3J3okc0LDOeAta9Np/hIj+2zTD3wrqxUEU/B6/5l/mD1BOWsevC4yqrI19FgWW8ktgNWgSzduETPFpRAj/jJ+QIchUPTMInrCbcPeO7lRi0dNW0gocfbXbiS4Sd2Ww5N/JWYReZHSyXPL91+j3p4x1KDDDx72Zw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663872342; 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=UoIEVd6qFvT+Ln9sMhn/rS//C5+/7lw2UA59aXrFoHY=; b=iRzaiU0yV0OpszFpZuGuSYWE8qe4/rdl8sSan/lGR8S6tBz/brPspJMhSq1kn+ScDqQLCO8MFLj8fEUwUVI3iRI95SfFGzNnBaQ7UYbhYGnE916CSelKZEDhxLmE4LC3ef1vS/HAgBiBvQwnXya5D7C0tULGrL+K5Lz0BEY7lSc= 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 1663872342625310.95737710010997; Thu, 22 Sep 2022 11:45:42 -0700 (PDT) Received: from localhost ([::1]:57364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRCf-0000Mf-Ig for importer@patchew.org; Thu, 22 Sep 2022 14:45:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Dg-JV for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:44805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB9-0005SG-Ht for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:02 -0400 Received: by mail-wr1-x434.google.com with SMTP id c11so16386207wrp.11 for ; Thu, 22 Sep 2022 09:35:59 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=UoIEVd6qFvT+Ln9sMhn/rS//C5+/7lw2UA59aXrFoHY=; b=iBqZAQdapWw+yOXckE21PCWw0K6EQmPoWx5Y8IMKOQNWu60pzzI3nPOmpo6JXyTcGR mYlYPal3za3wH2a/slU3/yyScMhH0sTHSz8aU7lxk21ZKauYAxhiu2y5lg4RXsjW+A0T z08VpzH3SMJKQrZkbnNNZlQOWSAIprxw0UiCFTOtRV0A1aP6myvDXKFqdyVQ5Bqx3jNG gWP6FQjEKfS1+eOVjOm3bUWEx0+ziOUP3B0lS4nBjWf1l572aRPVQkWGTbdoVEEFlGEE b8WnLdVSGJ1r8ztNbmolUUF9VtMgx33tG2LX/ZzFY6JDSnfk80dE0ZWShh11+2HwV9xN e/ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=UoIEVd6qFvT+Ln9sMhn/rS//C5+/7lw2UA59aXrFoHY=; b=3BNzLrQSIxj26WbCRV1ubPSj5fHsFyBWS8xhV+Kegrhq0R5Jo0f5ICHmzbOOLBkqmO 6o8iv5ONJvopVkgs3oiTKxDHt4gqmlw2zAQik3/Vqin9I/TQmE1zOZ1KFPscLtkEuEZJ 02t3ksM20EqD6D8AgFHO7HkCucU2OSTWnebE+sVQEGkKZYvMe8FB8VYzAVfUlvBALX/d lCjVFdLb4y9OV+QhjdV7vkD2cIn4IHDpMo4uoxJWyiOhbIois13CxQcq+hipv66+FhFy u/unU9vewqB/WoeYRbRler7/oMnUFy9Ivc5joEfKG1unO/a7BBKrtBjl8JE6TTMYZt4m IY9g== X-Gm-Message-State: ACrzQf2ouyEBnyMumNbyb7oAGYIpXRVeddIQbuYfqknDQ4Q/BkCSguPm EF8Gfm73j8RO+0LusI1s4qta84UPo+HgAQ== X-Google-Smtp-Source: AMsMyM5E/jHh7623L0fsi52aRCWz5hUkCLOzaxpQWrfW6HAp+kGBA0JWjV4dUW46MZJqSstge/4iAw== X-Received: by 2002:a5d:528a:0:b0:225:4a8e:221e with SMTP id c10-20020a5d528a000000b002254a8e221emr2550970wrv.145.1663864557845; Thu, 22 Sep 2022 09:35:57 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/39] hw/usb/hcd-ohci: Use definition to avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:27 +0100 Message-Id: <20220922163536.1096175-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::434; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663872343922100001 From: Philippe Mathieu-Daud=C3=A9 The compiler isn't clever enough to figure 'width' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-10-peter.maydell@linaro.org --- hw/usb/hcd-ohci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 895b29fb865..5585fd32ccf 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -805,13 +805,14 @@ static int ohci_service_iso_td(OHCIState *ohci, struc= t ohci_ed *ed) return 1; } =20 +#define HEX_CHAR_PER_LINE 16 + static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len) { bool print16; bool printall; - const int width =3D 16; int i; - char tmp[3 * width + 1]; + char tmp[3 * HEX_CHAR_PER_LINE + 1]; char *p =3D tmp; =20 print16 =3D !!trace_event_get_state_backends(TRACE_USB_OHCI_TD_PKT_SHO= RT); @@ -822,7 +823,7 @@ static void ohci_td_pkt(const char *msg, const uint8_t = *buf, size_t len) } =20 for (i =3D 0; ; i++) { - if (i && (!(i % width) || (i =3D=3D len))) { + if (i && (!(i % HEX_CHAR_PER_LINE) || (i =3D=3D len))) { if (!printall) { trace_usb_ohci_td_pkt_short(msg, tmp); break; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663871839; cv=none; d=zohomail.com; s=zohoarc; b=Xz5Hke7TuDKlQJGdp42PdRWAfzU0aL/Z2ezlZB0GJaLh2mHodnnepR5m9deqfuomvQXBVpJYhMncP9vP0MiPWfgJMWEuGWXUITq/arDvwYUz/ROttJ1En6rRulDSfDZQSW8M97xLNjSXI/clc2+TMfDGTpc2Cy4AJPmWWHqO3yY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663871839; 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=l8BTHv6Rvs1T1FBsTL+iOTvROMJj6hLiW9QKgE0n3iY=; b=Sq54PIl/p+hAktU5/mdDrh0gNKxzc8+V5PlxlDF+WKMuSBdW3S7BLVccZKs0Ffm5Efjy/6SXi2am81MfPhDSztDORpVZxTge9Gn/FPEj2iFqjwFOQR4i3137x5+6i4wkHkNErF81mW8XRQaC0kFNYM5GGW77IrC6IJFfEtEM8Lw= 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 1663871839548424.35400498590786; Thu, 22 Sep 2022 11:37:19 -0700 (PDT) Received: from localhost ([::1]:58196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obR4W-0005IJ-UX for importer@patchew.org; Thu, 22 Sep 2022 14:37:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBI-0002E1-FK for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBA-0005SY-5K for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:07 -0400 Received: by mail-wr1-x433.google.com with SMTP id t14so16403378wrx.8 for ; Thu, 22 Sep 2022 09:35:59 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=l8BTHv6Rvs1T1FBsTL+iOTvROMJj6hLiW9QKgE0n3iY=; b=Xtay/0AzdvwMSS0PNMAgFX0sIiAtRArBM3KyVj+y55enF4CzRDUDCcwQIrdUMcgxgj 4766Wr65fSPA/crGFm7tQVNijhQeiuu3LITrbyDach33GL+S3VOAZ3Lz0h8WYmw6CpOQ JlaXuLGnlRFnH5TWuugESW3Pm7SbpzG2ddl4as9adpau0+zmet58f8WzgyWjz3A4CgKJ R7xVAhzunfc0zx0bYzjoPjxgEi//tAjuL8Jcwi/jgKHHtR91HgbkDA5If0+49SOIAAwv EOYHQe2XWB8N0f/AhvitHsoCmSPxXzkKCRykiHaa05M1naGt3xmavNmZPJpfLb0ex79e Um8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=l8BTHv6Rvs1T1FBsTL+iOTvROMJj6hLiW9QKgE0n3iY=; b=D+inlN+M1IeCLhu6VHPNbpMRfn7xx8zRrnnoLbP4pJ6f7n2rZUT3aBlMFYeb1J1pxt iK0YHCLWZ66t6nfuRSUEE++YtCgWvgy4CGxZH54j6tBICcKOPU2ubli3w0vb0w75oiNj ElZyCUN9lOR2PiSHOuETo0xBr5rXtnJP+EsssDSILNYPKjbEr38a6TEEXmPmM0SdsOBo 2Hf3VV9rCcWdSL3A8dxnmO+8MTHJ7DollDe8F6DuvdCB6TuveWjZ3b9kN1L8w3ZiDuCM 4X0WPCPMTwVFzN8+S0U1V2hubJl6koa/FkSgjZdlczaTLhznTdNws1C/jj3Cg2e98On6 PhSw== X-Gm-Message-State: ACrzQf0guIW0WRVlmcXO2Luzhs/QVilz4/IiXR6uGnaiwaQdKXlYDW4d ETM3lgGoDbGBSgvf5acpOFI3KXJdMOp4Kw== X-Google-Smtp-Source: AMsMyM51FUn4CIi1D4Jtc0Jl4myTPR5jRlxJqJluIibY7GsCpqs/DWxCHixZ06oe0diB5wKMNBpimg== X-Received: by 2002:a5d:6c63:0:b0:22a:4247:1e7c with SMTP id r3-20020a5d6c63000000b0022a42471e7cmr2657868wrz.625.1663864558413; Thu, 22 Sep 2022 09:35:58 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/39] ui/curses: Avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:28 +0100 Message-Id: <20220922163536.1096175-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663871841308100001 From: Philippe Mathieu-Daud=C3=A9 Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-11-peter.maydell@linaro.org --- ui/curses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/curses.c b/ui/curses.c index 861d63244c7..de962faa7cd 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -69,7 +69,7 @@ static void curses_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { console_ch_t *line; - cchar_t curses_line[width]; + g_autofree cchar_t *curses_line =3D g_new(cchar_t, width); wchar_t wch[CCHARW_MAX]; attr_t attrs; short colors; --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663872874; cv=none; d=zohomail.com; s=zohoarc; b=cpp0lzNz15xWPScgMJs5gi0k+V98Zyrja21Oh+9MyzZ8GsLzr5qaLZNzywXhPl4S11DOc7MW6xDdSfne8aZkYOf9b4LaTCTXyxsp4Pw5IkVpUxACpXddxfZ8QgQd/YKnerFi6gY49YjRW4w5CjrfB3VjAPloY7nYWAzX7kQX1C8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663872874; 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=bhukZinHP19tc2MABOlYOy3TPhufYb3LdwBHDFcAuKE=; b=dcbmn44h59QG/UItB2GPdm1i/1a6qIT/U/mSoDXb4svAcO3uVcdGlvq/zvMGwZd4QAA+IL6V5IqVKyIDkOcEbBKLY5z2h4VjOOW83WBhYjvYy/yFqHI8ka5R1tXGtcHGf0FYiO6oCN9f3ApkUMM9yz4UYaMGNeZf8M0wTWrgZlI= 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 1663872874232367.91181998824106; Thu, 22 Sep 2022 11:54:34 -0700 (PDT) Received: from localhost ([::1]:34542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRLF-00023i-3K for importer@patchew.org; Thu, 22 Sep 2022 14:54:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002De-Iu for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB9-0005Qb-O7 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:02 -0400 Received: by mail-wr1-x432.google.com with SMTP id n15so9519025wrq.5 for ; Thu, 22 Sep 2022 09:35:59 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=bhukZinHP19tc2MABOlYOy3TPhufYb3LdwBHDFcAuKE=; b=CS47AR3KgcJoOEJE6MR308REqH9N0PmQ0EFuZ20HS0YuCl0OEP88H2Xh7wVro4rlXa 5Rd8swQfM4ZpfvOHR7apLQbLfG5DUJfIxAI8v72hdKRYRGKlypbDLhrYUFiWGasovsj1 rIDxvKk6Kk4JgNgVOqArftEoMtfukPjtj2DqkvydxUmFbI4byXZOCOT/xBdHf0xpAdkN y0/75mx76U/N3ekLVDxInvUztsmilQ7exsNmqjEIWt8Qo/rKOYzwP2RSzIevPjfrwVsn giEGIHQr+cVLauD8mua4iwGvVsRYU8yS4E0gtMwJGRG6yIoLBQkLUdAyX6V6LKnwV98v HYKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=bhukZinHP19tc2MABOlYOy3TPhufYb3LdwBHDFcAuKE=; b=hPwicJkM4nSlCNohOHQN098vvyvaFSMii+i2Vx/rwdEesSoXMT1dc0vbNJCeWWkG/B e+q7Ql/frZGkTxeDKIP1WuAOPPx6KCiS3qANvRzGOUg05dGo0ssol7LH4AwWpgVnqYpB Co7zpkry0EGzN4qKkTi0FThfyAjD9bJmyknu1eBIYugrU0rlJ5PQsdul3eswmC+BB13i FtN+3rjvR7oPfnS6l/7N5sbmyI4dSpkRWf5O7tf0r+FlkgOuvq6amkEBsrGM/xIck985 5Mx+OIiM2VU3E7ODVLYWML5FIA/MaGZmwsHziHqkWwV63zi9tqD8ruoYmd2nSPgvNv0p vNqQ== X-Gm-Message-State: ACrzQf2BriZi6Se0kaXj7k2rIemj9Pw3pTS01ujPnf6K/PlKo+MLnFUO 71HSTKENBhz9B5aXVR/hBHEF06hRrQXE9g== X-Google-Smtp-Source: AMsMyM4t6CVVQ9M73LVUtP53wLRRPIF876HuPnhrwQsgeYa4QNmRTHriuO2jYGlcdox9T135JHA/XA== X-Received: by 2002:a05:6000:1241:b0:226:d999:a2df with SMTP id j1-20020a056000124100b00226d999a2dfmr2585527wrx.19.1663864558936; Thu, 22 Sep 2022 09:35:58 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 32/39] tests/unit/test-vmstate: Avoid dynamic stack allocation Date: Thu, 22 Sep 2022 17:35:29 +0100 Message-Id: <20220922163536.1096175-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663872875866100001 From: Philippe Mathieu-Daud=C3=A9 Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-id: 20220819153931.3147384-12-peter.maydell@linaro.org --- tests/unit/test-vmstate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c index 72077b57800..541bb4f63e3 100644 --- a/tests/unit/test-vmstate.c +++ b/tests/unit/test-vmstate.c @@ -87,17 +87,16 @@ static void save_buffer(const uint8_t *buf, size_t buf_= size) static void compare_vmstate(const uint8_t *wire, size_t size) { QEMUFile *f =3D open_test_file(false); - uint8_t result[size]; + g_autofree uint8_t *result =3D g_malloc(size); =20 /* read back as binary */ =20 - g_assert_cmpint(qemu_get_buffer(f, result, sizeof(result)), =3D=3D, - sizeof(result)); + g_assert_cmpint(qemu_get_buffer(f, result, size), =3D=3D, size); g_assert(!qemu_file_get_error(f)); =20 /* Compare that what is on the file is the same that what we expected to be there */ - SUCCESS(memcmp(result, wire, sizeof(result))); + SUCCESS(memcmp(result, wire, size)); =20 /* Must reach EOF */ qemu_get_byte(f); --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663867539; cv=none; d=zohomail.com; s=zohoarc; b=nU3lhnwL/npCaFjuOyxl+JhGVvG610/REFTAwqltJoyFLP5DC2l/kVS/Mfdr6H98/bc3KVUwwijRIkAOw2utEwXIM9wumkPz/iQhS6ggsLAz+ulYm11SRKIv3iF76nRYHBWYqBCs7lln3l0gYw/s8LvhqRva1V2M3Sm63HAotYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663867539; 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=fRuzNdVxdAJZ2ReB6Zxl4KaSdRZlenZ74jhT7D/lFHc=; b=bJJwmsgd0R7Vxy+jTMsuG8W+08uLtoj71EbEMrvnjIF06BEX/V4/jjWa1w5uqnxp/vPRwH75w+eYUvmj3JIy10mGIrs2JrWNvqQtHIYdNObEXbWWD/j3K8qotY/DF0QL9Zd3GSUKNJes5PsYlBqIXuGBovVR749XZkx+EjAVXGk= 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 166386753935229.700641077865384; Thu, 22 Sep 2022 10:25:39 -0700 (PDT) Received: from localhost ([::1]:59682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPxB-0007rE-Et for importer@patchew.org; Thu, 22 Sep 2022 13:25:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBK-0002G3-H3 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:14 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:35328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBB-0005T1-Uk for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:09 -0400 Received: by mail-wr1-x436.google.com with SMTP id r7so16472060wrm.2 for ; Thu, 22 Sep 2022 09:36:00 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=fRuzNdVxdAJZ2ReB6Zxl4KaSdRZlenZ74jhT7D/lFHc=; b=t11A2SKE4HFIm1qec5RSAY7xAvyKl9il+QXZQeH0OB5d1Q24Yc9oKOSF/VSmf1eFUC aggiPhRILWbjpzGkuAjSrdI8x6icF7smKCPT32UuRiXwp8P4/nK5aKfubA4zlmqzaBMq 07UjKev09+KC+vE0Sa/gXmxH3KHU+22rEOH+QUXePDt64aIoAZPSFTHBoE22WbR09Q85 u/cdsGiMYlN4IPGUnhlGukHnaTkQXWL/49z8jwZ658phrCgkWSWont1x9DUbn8xCXxiF WBDGimWbAA4V0ZAts5fn16TjRogIttAvDY70Ps/jIPThhPwg1ruOGwqxZSWM/Vs3hPx3 v3UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=fRuzNdVxdAJZ2ReB6Zxl4KaSdRZlenZ74jhT7D/lFHc=; b=DOBp29yoAw5s7cYhT3ZymP0XlTpCECYeFDDuyLvUxdx9FL4KVX8zmRM9L7rLRwFNX/ X6yeVMYlrz1GWZB38vIHc97OeUl+D3pgbGmWrzk7yVR+fM7jOJhJEjclBXBEJNP5ILOg wQl17FNe7ooNSjnyrMz4vvj5ulcMoQBQTaRtMHZGKGxZXT1dQHhy6d5wT6EBuaPUeGK3 Kjh//SnuwWflz/A1WPCRZYDlj4BFw2r9h81WVMOz9hmlIK1i7U3SwQS8i/s8nQ8s4HOF dc7qSmHk3vHOrSd71wuVzGBxqIBtjxJrYz0yDP5eCUQ+imyr/k+Hdc3yCB9DHLg4yzym HqxQ== X-Gm-Message-State: ACrzQf2KmsY7Pbe+Ciy5+F8cv7qB8Qb79vBbyn4liMOgJswCEAfoFeYN m73dxJUhnb8g7kJdecvzA/rsgfJfck+qkA== X-Google-Smtp-Source: AMsMyM5BjBZFyt99rInzS6GZQZG8bcunMndMCt7titQ811FkwpTkp3AfBrwRMUm5Y7AKBJXGprznPA== X-Received: by 2002:a05:6000:1d84:b0:224:f447:b1a7 with SMTP id bk4-20020a0560001d8400b00224f447b1a7mr2544801wrb.688.1663864559477; Thu, 22 Sep 2022 09:35:59 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/39] configure: Remove unused python_version variable Date: Thu, 22 Sep 2022 17:35:30 +0100 Message-Id: <20220922163536.1096175-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::436; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663867541625100001 Shellcheck correctly reports that we set python_version and never use it. This is a leftover from commit f9332757898a7: we used to use python_version purely to as part of the summary information printed at the end of a configure run, and that commit changed to printing the information from meson (which looks up the python version itself). Remove the unused variable. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-2-peter.maydell@linaro.org --- configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure b/configure index 0bbf9d28af7..b5ace4cb49e 100755 --- a/configure +++ b/configure @@ -1112,9 +1112,6 @@ if ! $python -c 'import sys; sys.exit(sys.version_inf= o < (3,6))'; then "Use --python=3D/path/to/python to specify a supported Python." fi =20 -# Preserve python version since some functionality is dependent on it -python_version=3D$($python -c 'import sys; print("%d.%d.%d" % (sys.version= _info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) - # Suppress writing compiled files python=3D"$python -B" =20 --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663867044; cv=none; d=zohomail.com; s=zohoarc; b=AvmifM97tmPjB4dgMMxTV/coVO8NcjR6MSmlzZZTlbklIeV+1O3xZrPfsURYQqwn4EfTDBigrPFGuiM3K7UKQJu9OXkfyXs4uPLWkIgPh4rBODCreGTH2C9439WB7BkOefhXSWRgxCSUKHQRz1okxXB50zuhsA1j5dFWriGSazQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663867044; 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=V+573S55AipTOAMAMMsIfcmoZJ0maiQeMsyNXIQuG+w=; b=oChZKC7fFCvtCPyzPWpRcaUyeIX7gFmP52p2sq/ukGvtJVxbsKwdU7q+Hzk6IcLXP58i9HO7w9aj7n4GuvbcyFPUPGhzsyOEXC81rOn88d8rI0km8+k45PdGF2BfIn1ADENvvwKoges9zWsYGFAfmqSSj1VNU4yxDm7W85H7Qvc= 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 1663867044713358.1739234435282; Thu, 22 Sep 2022 10:17:24 -0700 (PDT) Received: from localhost ([::1]:42946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPpD-0003bm-20 for importer@patchew.org; Thu, 22 Sep 2022 13:17:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBL-0002GI-FE for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:14 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:42609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBB-0005TD-Uo for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:08 -0400 Received: by mail-wr1-x42d.google.com with SMTP id n12so16405411wrx.9 for ; Thu, 22 Sep 2022 09:36:01 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=V+573S55AipTOAMAMMsIfcmoZJ0maiQeMsyNXIQuG+w=; b=WWj59uYvN2dNie+l5waxl37IkA4r6yBWqErmSCb0KRzV56Lg7geYoGpHWIbwGTErGo zWG5okIaZsTVkjT6OHTZK9WTt+y0zxksyTyhD2nxp1ZviuaLfrf+pxjQUg0A2Hr/fVKK /J0QNPIsroPkf0TVfsZmdnITDbratA1mXzB9T99/kCFjynzF+31AfyONxqgb2aJfhpDV hD5f8EmqOMwoP1R3nmvpuCn2V697i5DUOkktg0SRbO/aZR0D/pq7JgpGLZXiKEHYlL8Q AkIZmnJemQgdfhBYcbezDvtO/9wRGmA1CSw+vr8lTUZwGUCANY7j5mZl4KATkGw2xIuJ 9KEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=V+573S55AipTOAMAMMsIfcmoZJ0maiQeMsyNXIQuG+w=; b=SDsmTzvskULx5jgU6gqEEtkUwjciFfjmTn5dO46LwMyzv7Rrd07oUE8jXYQVg0HLuG i5kFEYfoz9DibTbx7KNGAPzy3M6vUheCL7rhtSYtYmXd23he51/EzE6LByYBWzsJIqua lMyIjIg6cZxKSUEB29jJFwxSzvl7kTXEkndBLEEKnptLnO7fP40B8NP3FQvHFWO1BTqA Ao3j0+pUC6JdYvPjNZ+ZMvEm8WYMtlGpCAW1C+cclaQZ2Wiex1log9na1hHABmtpfxnS iDD9llnAGFntffZ00M4QN1dOtpb+n9MO+Hf/YeKyY1FVx4mRoNUTlfsKtJbBt+ooakVT boOw== X-Gm-Message-State: ACrzQf2VTTo1VCCZDPpzHiieynS1MkbKWLE3AX7Oow+pcfEavlgbxIxc KfNzChhHTJbj4Di/KyOXC98ZC0qLhb2/8Q== X-Google-Smtp-Source: AMsMyM5MspWAmHVGSa7qlgVHBSIwYMMapGfiS8cxb68TVYVdG4G/68Z+c3BadTV7MxmcmVuUtMREZg== X-Received: by 2002:a5d:47c5:0:b0:22a:6c7a:10f3 with SMTP id o5-20020a5d47c5000000b0022a6c7a10f3mr2514204wrc.523.1663864560068; Thu, 22 Sep 2022 09:36:00 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/39] configure: Remove unused meson_args variable Date: Thu, 22 Sep 2022 17:35:31 +0100 Message-Id: <20220922163536.1096175-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663867045709100001 The meson_args variable was added in commit 3b4da13293482134b, but was not used in that commit and isn't used today. Delete the unnecessary assignment. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-3-peter.maydell@linaro.org --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index b5ace4cb49e..e42d43d6a50 100755 --- a/configure +++ b/configure @@ -311,7 +311,6 @@ pie=3D"" coroutine=3D"" plugins=3D"$default_feature" meson=3D"" -meson_args=3D"" ninja=3D"" bindir=3D"bin" skip_meson=3Dno --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663870446; cv=none; d=zohomail.com; s=zohoarc; b=a30KvLoWMYiR0rJ0NibMUIb9cN7dYVj3e/vQfZSootcm7JT8CL3EjFLD2SuXl+DtKgwQz87iE9m2TaSfiuOBO1lBxLUFE16CTyHH6SpibQtalVAJbmfaVMT6T0+SN01b4Y9ts7ZMG+DTx1U53yiSdxCtMaSCMgI2K0C41kEcccM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663870446; 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=QdnrSN8AocizR5yIDpAyLK6s+nPqJhACaI+pjubOY7c=; b=hTMClnbQQc5RaeMKKKM6mHLOizX6VjSQd6va4KDY+4I+GcAKLKrQG2Hyc741YsJOgRMHHAI+xmrdL+g8WGUB+mUP6kb915Hwh6Z8mkyiWl+pwABrsuUJA28ADxuZ/zO7WRtT4fCJmQt4pQ8y01aADb74urrsbjZXJpUDmehtLwk= 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 1663870446919263.54197784102723; Thu, 22 Sep 2022 11:14:06 -0700 (PDT) Received: from localhost ([::1]:38842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQi5-0007Sd-O9 for importer@patchew.org; Thu, 22 Sep 2022 14:14:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBK-0002Fy-P9 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:14 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBB-0005Pe-VQ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:08 -0400 Received: by mail-wr1-x436.google.com with SMTP id n10so16378625wrw.12 for ; Thu, 22 Sep 2022 09:36:01 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.36.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=QdnrSN8AocizR5yIDpAyLK6s+nPqJhACaI+pjubOY7c=; b=c3QrRVDIqa8eYsv3rHPNSqV1uhhHJQiINozolajwfaHbEjB5F3zn5wSPjT3JmpjANl K43lfQGPRPZYRsg8z8mkdXIX+ASv+acvhz/+i4dl/1M9X4hLtZic6Fj1vSrA9MRnCP5f OITvVhPZC/7YKQHoiMCHTLBcUjfd0Zh79rAxM0/CYrWhEop0v0bWjtBPW3KYjYfocONZ mAITQq+ThdUBoOu/lgQXRrVWM3xBUEQxoNl8FKr8R9Cxre4sIQcW1l5yPu865NrXSZXW tiOCKM/7LgMSYMnlS0zllo1P5SMeI+sY6PSj4/XA68nXNNW7RubBKvpgMl8hAXh0LSdq s1FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=QdnrSN8AocizR5yIDpAyLK6s+nPqJhACaI+pjubOY7c=; b=s2RQQOYZUDM0tOdPMxuA27c01gU6VwzEkgLX+aGYLk3YZ/0qQX0G6wtbRePSE2Zqu3 l3LA9pQlJ2whGAaTgSCTDSBzrUyJF9BYboL7ocB4a1c2hZ5MUF9VNhpPQDEvLs65upYH uGuwWD/XmyjTdXe70v4cXtzpMvpBLlYxMOAJD3xiJvWQ7LWXxrY7QBKKq+eSY1oG1jp8 ool35N/xabZjfQvk9TsBYsyjfxYoQHbX967CIHvI8HAFgEbusiC0nY7m2SA8BYjTZWvJ 4wMPSnej4e7BuwuSAlKbc20t1zu0VT161kfconLUft6unPhWDVjZla6unq+WPoPmCcDk pmrw== X-Gm-Message-State: ACrzQf2Mz+8F1ZEG2/EvRM+Vy8krhWEjm0b1jd52nKVOe40Rjyh43t5d bekGYDn56DoFHe810f+trDYVSEyBLB5xwg== X-Google-Smtp-Source: AMsMyM6Bl6M6YDrnpvNYf7Yn9uJ+cKs4VhZNBFJAP1x91cY3Zk0GiYE/e8+1/Iwd7ezgr/zvoN5y0Q== X-Received: by 2002:a5d:5b19:0:b0:22b:237c:3de8 with SMTP id bx25-20020a5d5b19000000b0022b237c3de8mr2542750wrb.285.1663864560781; Thu, 22 Sep 2022 09:36:00 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 35/39] configure: Add missing quoting for some easy cases Date: Thu, 22 Sep 2022 17:35:32 +0100 Message-Id: <20220922163536.1096175-36-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::436; envelope-from=peter.maydell@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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663870448475100001 This commit adds quotes in some places which: * are spotted by shellcheck * are obviously incorrect * are easy to fix just by adding the quotes It doesn't attempt fix all of the places shellcheck finds errors, or even all the ones which are easy to fix. It's just a random sampling which is hopefully easy to review and which cuts down the size of the problem for next time somebody wants to try to look at shellcheck errors. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-4-peter.maydell@linaro.org --- configure | 64 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/configure b/configure index e42d43d6a50..86cc6259181 100755 --- a/configure +++ b/configure @@ -57,7 +57,7 @@ GNUmakefile: ; =20 EOF cd build - exec $source_path/configure "$@" + exec "$source_path/configure" "$@" fi =20 # Temporary directory used for files created while @@ -691,7 +691,7 @@ meson_option_build_array() { printf ']\n' } =20 -. $source_path/scripts/meson-buildoptions.sh +. "$source_path/scripts/meson-buildoptions.sh" =20 meson_options=3D meson_option_add() { @@ -711,7 +711,7 @@ for opt do case "$opt" in --help|-h) show_help=3Dyes ;; - --version|-V) exec cat $source_path/VERSION + --version|-V) exec cat "$source_path/VERSION" ;; --prefix=3D*) prefix=3D"$optarg" ;; @@ -985,7 +985,7 @@ default_target_list=3D"" mak_wilds=3D"" =20 if [ "$linux_user" !=3D no ]; then - if [ "$targetos" =3D linux ] && [ -d $source_path/linux-user/include/h= ost/$cpu ]; then + if [ "$targetos" =3D linux ] && [ -d "$source_path/linux-user/include/= host/$cpu" ]; then linux_user=3Dyes elif [ "$linux_user" =3D yes ]; then error_exit "linux-user not supported on this architecture" @@ -995,7 +995,7 @@ if [ "$bsd_user" !=3D no ]; then if [ "$bsd_user" =3D "" ]; then test $targetos =3D freebsd && bsd_user=3Dyes fi - if [ "$bsd_user" =3D yes ] && ! [ -d $source_path/bsd-user/$targetos ]= ; then + if [ "$bsd_user" =3D yes ] && ! [ -d "$source_path/bsd-user/$targetos"= ]; then error_exit "bsd-user not supported on this host OS" fi fi @@ -1117,7 +1117,7 @@ python=3D"$python -B" if test -z "$meson"; then if test "$explicit_python" =3D no && has meson && version_ge "$(meson = --version)" 0.59.3; then meson=3Dmeson - elif test $git_submodules_action !=3D 'ignore' ; then + elif test "$git_submodules_action" !=3D 'ignore' ; then meson=3Dgit elif test -e "${source_path}/meson/meson.py" ; then meson=3Dinternal @@ -1834,7 +1834,7 @@ esac container=3D"no" if test $use_containers =3D "yes"; then if has "docker" || has "podman"; then - container=3D$($python $source_path/tests/docker/docker.py probe) + container=3D$($python "$source_path"/tests/docker/docker.py probe) fi fi =20 @@ -2284,7 +2284,7 @@ if test "$QEMU_GA_DISTRO" =3D ""; then QEMU_GA_DISTRO=3DLinux fi if test "$QEMU_GA_VERSION" =3D ""; then - QEMU_GA_VERSION=3D$(cat $source_path/VERSION) + QEMU_GA_VERSION=3D$(cat "$source_path"/VERSION) fi =20 =20 @@ -2533,7 +2533,7 @@ fi for target in $target_list; do target_dir=3D"$target" target_name=3D$(echo $target | cut -d '-' -f 1)$EXESUF - mkdir -p $target_dir + mkdir -p "$target_dir" case $target in *-user) symlink "../qemu-$target_name" "$target_dir/qemu-$target_n= ame" ;; *) symlink "../qemu-system-$target_name" "$target_dir/qemu-system-= $target_name" ;; @@ -2568,14 +2568,14 @@ for target in $target_list; do config_target_mak=3Dtests/tcg/config-$target.mak =20 echo "# Automatically generated by configure - do not modify" > $config_= target_mak - echo "TARGET_NAME=3D$arch" >> $config_target_mak + echo "TARGET_NAME=3D$arch" >> "$config_target_mak" case $target in xtensa*-linux-user) # the toolchain is not complete with headers, only build softmmu tes= ts continue ;; *-softmmu) - test -f $source_path/tests/tcg/$arch/Makefile.softmmu-target || cont= inue + test -f "$source_path/tests/tcg/$arch/Makefile.softmmu-target" || co= ntinue qemu=3D"qemu-system-$arch" ;; *-linux-user|*-bsd-user) @@ -2590,73 +2590,73 @@ for target in $target_list; do # compilers is a requirememt for adding a new test that needs a # compiler feature. =20 - echo "BUILD_STATIC=3D$build_static" >> $config_target_mak - write_target_makefile >> $config_target_mak + echo "BUILD_STATIC=3D$build_static" >> "$config_target_mak" + write_target_makefile >> "$config_target_mak" case $target in aarch64-*) if do_compiler "$target_cc" $target_cflags \ -march=3Darmv8.1-a+sve -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_SVE=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_SVE=3Dy" >> "$config_target_mak" fi if do_compiler "$target_cc" $target_cflags \ -march=3Darmv8.1-a+sve2 -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_SVE2=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_SVE2=3Dy" >> "$config_target_mak" fi if do_compiler "$target_cc" $target_cflags \ -march=3Darmv8.3-a -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> "$config_target_mak" fi if do_compiler "$target_cc" $target_cflags \ -mbranch-protection=3Dstandard -o $TMPE $TMPC= ; then - echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> "$config_target_mak" fi if do_compiler "$target_cc" $target_cflags \ -march=3Darmv8.5-a+memtag -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> "$config_target_mak" fi ;; ppc*) if do_compiler "$target_cc" $target_cflags \ -mpower8-vector -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_target_= mak + echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> "$config_target= _mak" fi if do_compiler "$target_cc" $target_cflags \ -mpower10 -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_POWER10=3Dy" >> "$config_target_mak" fi ;; i386-linux-user) if do_compiler "$target_cc" $target_cflags \ -Werror -fno-pie -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> "$config_target_ma= k" fi ;; esac elif test -n "$container_image"; then echo "build-tcg-tests-$target: docker-image-$container_image" >> $ma= kefile - echo "BUILD_STATIC=3Dy" >> $config_target_mak - write_container_target_makefile >> $config_target_mak + echo "BUILD_STATIC=3Dy" >> "$config_target_mak" + write_container_target_makefile >> "$config_target_mak" case $target in aarch64-*) - echo "CROSS_CC_HAS_SVE=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_SVE2=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_SVE=3Dy" >> "$config_target_mak" + echo "CROSS_CC_HAS_SVE2=3Dy" >> "$config_target_mak" + echo "CROSS_CC_HAS_ARMV8_3=3Dy" >> "$config_target_mak" + echo "CROSS_CC_HAS_ARMV8_BTI=3Dy" >> "$config_target_mak" + echo "CROSS_CC_HAS_ARMV8_MTE=3Dy" >> "$config_target_mak" ;; ppc*) - echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_target_mak - echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> "$config_target_mak" + echo "CROSS_CC_HAS_POWER10=3Dy" >> "$config_target_mak" ;; i386-linux-user) - echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> $config_target_mak + echo "CROSS_CC_HAS_I386_NOPIE=3Dy" >> "$config_target_mak" ;; esac got_cross_cc=3Dyes fi if test $got_cross_cc =3D yes; then mkdir -p tests/tcg/$target - echo "QEMU=3D$PWD/$qemu" >> $config_target_mak + echo "QEMU=3D$PWD/$qemu" >> "$config_target_mak" echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile tcg_tests_targets=3D"$tcg_tests_targets $target" fi --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663873497; cv=none; d=zohomail.com; s=zohoarc; b=eFHrONj8qk1OxClE+DZjU/Uuxi0wlom7OXy8nIw1LHh+5HnUMFEOuGGPLKB6eMl6wkCHU8TqDoN5996wkEuB251pt8X8D0jNKPvJ+MEIVtEaruW/cmPpSKIMNZMVNzybLDOkPxcQXKBlmK22dWCs3n8FauFvDdL319SYCyE0uPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663873497; 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=RoU2tXSDAF3jVU6D2jreLTh5a4JsfPrQiPOOPrFAmFI=; b=M+K9qZqIb6SkPy7ZpJ3M/Wedi430iSpWzMaAYBe82KYsnGDcc+7PPzmTPwA4txnNEss2/6SbejVkFjRB8hyttO2qixjfu5k0iiTrxR51O5xuMcw4bUER17Xdkc57djHRT05Hj+tG8Xt+vk9tx/NtG+M4bhWuJb10GRGsNmY0i1o= 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 166387349747753.85916694169339; Thu, 22 Sep 2022 12:04:57 -0700 (PDT) Received: from localhost ([::1]:57072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRVI-0006nt-DG for importer@patchew.org; Thu, 22 Sep 2022 15:04:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBQ-0002Kt-5Z for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:16 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBE-0005TS-LP for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:15 -0400 Received: by mail-wr1-x42a.google.com with SMTP id s14so14443944wro.0 for ; Thu, 22 Sep 2022 09:36:02 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.36.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=RoU2tXSDAF3jVU6D2jreLTh5a4JsfPrQiPOOPrFAmFI=; b=pPoLztbEDqwmQGPOmR9lkJlsz26Ye7G07N/zLl9RQTULcgCKelXaWhMV7uYB2DbbvG 0/whkJGEgL+GggAfM5/XKbK+L8VSjEkr5pUNphrzoEITgN/yQgci6xm87p6Rl+Q9Q8Ly yHWnHwgPN0biNCh6SsvOLYqJUr9BE/YNDkHxx+3jECgySFiZxiA0YwJJD8UFmzddOS5C dIScTEpvxPrAqrf/ekfk3ifYqWjUaFgG7lFWXl2qvzEHI3ngyzLINE2lHZslGdJUn+o/ O0I3J/RORsb/A5+/Xiw96HSKnejYLabQIbKFE8HGyQggV52GMroWfeKfwjrhvV3Vn58p 8jhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=RoU2tXSDAF3jVU6D2jreLTh5a4JsfPrQiPOOPrFAmFI=; b=lwQkr3gxHzQO3xrYIhAM+jZ1/oAsP4Hd+nFtoDjJ/EuS8vDjicrzv+G/EQBDkO4nNz YjkVaUVopJfb2OS4WRQqGKHb9ogEyBoMXxZ+zgqnav+UGPgFtl3GY1RGFWRCgFlzhgL3 CVigBQPAa3ZSymtjyQaJFQEsjYOh5YESzQEtAyyzhlh5pdmiU1KYOcgnAPD1J7ShfMOx xkXt8gAU8UfwcaBt1LIsQaEysRcBahfEk6tv6nHmFeDTHyK36Z1SI/hHI1Rzg3pB/5IT ZKc8UhdyroisWBDp+ahCie4NdDfC6gWP0CVeLdqiTSErf4MuqsIPyTNw3NQHd+OKK/mZ vq4w== X-Gm-Message-State: ACrzQf1uwXABFFxK0O1EZmlub9mcfxk0Zx2QhZN4yCBVvP5M1h4xrd8g Gi6VAusaLh04h0hSini2JUNVcQd7mRQE2Q== X-Google-Smtp-Source: AMsMyM72N9BxMj9Miw8NHkl9L7eRByV38zfE8e1XEDoVELR6YB1xBNegV4ZdqugkqQSWdOmE0H6B4g== X-Received: by 2002:a5d:6a07:0:b0:228:dba4:2138 with SMTP id m7-20020a5d6a07000000b00228dba42138mr2581211wru.346.1663864561374; Thu, 22 Sep 2022 09:36:01 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/39] configure: Add './' on front of glob of */config-devices.mak.d Date: Thu, 22 Sep 2022 17:35:33 +0100 Message-Id: <20220922163536.1096175-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663873499367100001 Shellcheck warns that in rm -f */config-devices.mak.d the glob might expand to something with a '-' in it, which would then be misinterpreted as an option to rm. Fix this by adding './'. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-5-peter.maydell@linaro.org --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 86cc6259181..482497e9743 100755 --- a/configure +++ b/configure @@ -1093,7 +1093,7 @@ exit 0 fi =20 # Remove old dependency files to make sure that they get properly regenera= ted -rm -f */config-devices.mak.d +rm -f ./*/config-devices.mak.d =20 if test -z "$python" then --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663867336; cv=none; d=zohomail.com; s=zohoarc; b=JPZGDYqr+IbpXGeMjDxDB4DjY1x4xs3f6Jy4FPnfluwlA5F0bMHn4o62Am2ZXIhf2SBTwhARYZnGXai2dM4HBUMn0DnUxpm64eTb+lY5bKyKEBVDEea7i0HNWfRaNmcead/mJ3/1dK1p2i4vnj79s/N7/5NwUZU9pVsqI1cMwzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663867336; 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=TG32nrt188N9s066qYdYkNxMuVya1mUQYmfslcHcgmc=; b=KR+4nC2Ql1ZVXHClvVWzRiB5oDCz8wtn30kbOFaN7habi6GRghcShFUubxMfmN37dvjej4r4ADxtVVgj4SiHqizwYXVe4WR+cqqoPDGA6SQzX0c5emASF+RPKTIB90zjlsGrsextgPbH5Qtv6g78xChBkBRPO6QRROjqDoAUIJI= 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 1663867336876929.6962041641347; Thu, 22 Sep 2022 10:22:16 -0700 (PDT) Received: from localhost ([::1]:55206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPtu-0001cP-QA for importer@patchew.org; Thu, 22 Sep 2022 13:22:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBK-0002GA-Ff for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:14 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:45998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBG-0005Tj-Bl for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:09 -0400 Received: by mail-wr1-x42c.google.com with SMTP id n10so16378685wrw.12 for ; Thu, 22 Sep 2022 09:36:02 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=TG32nrt188N9s066qYdYkNxMuVya1mUQYmfslcHcgmc=; b=QmtySLhlRbGNGvpxUadMsLHRBIidix0PPha4fE4FoxK4T4RIbL4Y5lU0ALh4wjegcs JuZFkW1MG8BHnWZzP4OtGOmDUx9Ed+2/GvqlHdFrgw0fiATaFSOEYoYgPA0XOPq82UGd 530WNCNqH/6slyue/ZdGzi/d+xXTt6t9ypfbBDZjLGIZS4jVGYIee+JiRqVlNxXMtrfP 2sboC/85Nnj5IrXpDbig7h8M/PbanZhNhlgHwqutE/DEFNM4fRX6wwDCJcyIdTSpi0bM 8fBVgHrFKFwliWSH9Ic2BlFEseqosWS3pH7SA74iCZX+jf+ijhDsMe8EanHFxL88IqoR oylw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=TG32nrt188N9s066qYdYkNxMuVya1mUQYmfslcHcgmc=; b=W4G0/7o5pWLbJg++UtAt1zzOUUx03EaDaueAONdEpVKJKBNiwrXD+j++GYl4HSeViR kulyIWozI/61EC3iWgTaupwFDawjWw7zQREb0fg6fYaka1IR2nhi57HIm0EPUVLCuIeT SBCuehPPj++4OCKXkfZugpfYtoD5B1yTz2v78xELq6I37EmPd2zwT5QM5tt3PSqOdvbq xG6XTxoMF4gLCQNX5BjTQnEqMDq5OGtnrx8Kg+zIuTNvercNhiSVqQWEUx+fA6wszQXD Sx7vp80Hln2taXZX4YrtGJ+LIPtRIICmEqjrkN+Y8ODYkDHoDIANWsdVoZU//6znJSof FKcQ== X-Gm-Message-State: ACrzQf3fyNXQvjQ596xk+GPH7FjPcp3RJwLIoa4XCPT2m9JixEpT/l2v mtW57wjHYXjW6FVrGUIr8jCfcI/Bt/xzSQ== X-Google-Smtp-Source: AMsMyM4um5cZCbNrvxxShuhFx4q0JN7gtPZtSkWhcqIx36Z/AnMmkJGhqcza6XQ4yKieJaC39eR9Tg== X-Received: by 2002:a5d:6050:0:b0:228:6128:b0fb with SMTP id j16-20020a5d6050000000b002286128b0fbmr2536181wrt.424.1663864561897; Thu, 22 Sep 2022 09:36:01 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/39] configure: Remove use of backtick `...` syntax Date: Thu, 22 Sep 2022 17:35:34 +0100 Message-Id: <20220922163536.1096175-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663867338820100001 There's only one place in configure where we use `...` to execute a command and capture the result. Switch to $() to match the rest of the script. This silences a shellcheck warning. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-6-peter.maydell@linaro.org --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 482497e9743..8b48e72a135 100755 --- a/configure +++ b/configure @@ -2311,7 +2311,7 @@ LINKS=3D"$LINKS python" LINKS=3D"$LINKS contrib/plugins/Makefile " for f in $LINKS ; do if [ -e "$source_path/$f" ]; then - mkdir -p `dirname ./$f` + mkdir -p "$(dirname ./"$f")" symlink "$source_path/$f" "$f" fi done --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663866701; cv=none; d=zohomail.com; s=zohoarc; b=Z6k8jFcI1mqwTourUMVY8Wfxz+4+kOm23l+r6TJHXcTRGIoz/6mEZ00OjAX9d2BaB3H7QnU/NXLgnh6RoqeWk8kEmjDTS4b4qxFCur3Hl4W+d8J+W/UeZFBnsp5GUtmhN5oImdmuvP3X7JqOMdJqdtklZZ6mlb2vMC9M0HYgAdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663866701; 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=v7AVH/6LvpLE+QUztT5pZ1JpIwSOJX2Mt8zbxlW+u0s=; b=cfTQOVwz6OpBPE6h1qVwzXpqPa36C1duitN93oAfQimZ7CJdYFajuRIyxIAJqWdJ3zM0ZXMIpdRpJ5j+wZnwSJlWnhTz7wm1uyrV7fFr1vQ+7N0cDegWvAHjo7GWntTBrfaURRcDIGblYrtUzOTrt7i2gokzkqYfeMKK/VF+aJE= 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 1663866701351245.86449785326147; Thu, 22 Sep 2022 10:11:41 -0700 (PDT) Received: from localhost ([::1]:45858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPjf-0005s1-7h for importer@patchew.org; Thu, 22 Sep 2022 13:11:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBL-0002GV-GW for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:14 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBG-0005Ts-BT for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: by mail-wr1-x42b.google.com with SMTP id t14so16403670wrx.8 for ; Thu, 22 Sep 2022 09:36:03 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=v7AVH/6LvpLE+QUztT5pZ1JpIwSOJX2Mt8zbxlW+u0s=; b=gTtY5bTuGITw2KV0sOJZpPmvhPOjvn4P2k0QtZ0h1sSPpk7Xj/HHpdeW0GsbLy5xxQ /U2XDF4WnxxXedV+rMNG0ZGyRQGmOfWPk0GXAgCq/shU0q9NRjal9U9p6FR2L9s3TjaH NMFYH9YaZxs3ZsxLUxUzWzkHX5UZymQRLybuPEv3SOKHVqMDR9ADbTiep+K/TExPODeP gyInnU70L8EPPfbvI/kuLfEqYvUexPlJ6Eqj8U1rrD4Wa7ORe4w3mo1CNNXx0168HFI0 N+APpKcqm8dmBajsdT3HFuOONfLAgTSnDuwPaSMCirD4r3gqmXQAwNca/iNLCzqRXX0p h1Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=v7AVH/6LvpLE+QUztT5pZ1JpIwSOJX2Mt8zbxlW+u0s=; b=t8xYTdRi3XzjkqRLGpXNrDtzqCTEPapr7lSFRF/cTwhDySOEi76maqtktxhIRBohT5 zrk0w+jRZMJlc76W7Pvdvz02PBO29BIolLO7wWN56G0waqXMW7a/DnEyU90kEe/15i+h rfbjwyKfYT60hakthP5Y9qfHlNhOgDmhNMOfYvAt59WbYrXadYLDa9KSCi2yxumC/rO7 yL1Xt9dhfTcc6xHV2QrfYqpAGP1/UEQWeMh4o7tzHQiu4iJDD7EJPjehTRo7yvlzAsyE fIpQR2TIinQUdbQjySE0+QM37MfW4RA18XhxjIhKPOoxzRxPlZoW338wbqfhO7HgqAAz pBYQ== X-Gm-Message-State: ACrzQf32i0aEZLvPET3zzrhrDhqnlplOz0w/V7F80vWDGuUMTTsIqAkG acKxBqILbYmxfGDbfmHb0vDx+7NlwFrmuQ== X-Google-Smtp-Source: AMsMyM5SJc0eET9z4kqJjCPZTmKKJIpnFUz+W3b1OqoEyBIalJyrHt+5TN+rarVUkfD6aoDg2/iJ8g== X-Received: by 2002:a5d:598c:0:b0:22b:100f:c2d2 with SMTP id n12-20020a5d598c000000b0022b100fc2d2mr2524782wri.263.1663864562492; Thu, 22 Sep 2022 09:36:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 38/39] configure: Check mkdir result directly, not via $? Date: Thu, 22 Sep 2022 17:35:35 +0100 Message-Id: <20220922163536.1096175-39-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663866701834100001 Shellcheck warns that we have one place where we run a command and then check if it failed using $?; this is better written to simply check the command in the 'if' statement directly. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-7-peter.maydell@linaro.org --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index 8b48e72a135..b39561b2ed7 100755 --- a/configure +++ b/configure @@ -67,8 +67,7 @@ fi # it when configure exits.) TMPDIR1=3D"config-temp" rm -rf "${TMPDIR1}" -mkdir -p "${TMPDIR1}" -if [ $? -ne 0 ]; then +if ! mkdir -p "${TMPDIR1}"; then echo "ERROR: failed to create temporary directory" exit 1 fi --=20 2.25.1 From nobody Sat Apr 20 14:03:47 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=1663872230; cv=none; d=zohomail.com; s=zohoarc; b=doZntstNLH+pKcvTjPIZDBc1ibviPEWP007WsmgGdWsPEO4AIUvZjskEfzlcgblZKvZ1Pun8cBhRh04X6xiFCgub9yjmb0Y6u5GS58hqFyo0Say2VQi5jcPgWkW8HeBfmadBf5zdH/nItG8X52ZEDBxybgg9En4FRmTgmbyyh50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663872230; 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=L95wwHp5RV6cXArMSmbL8Hcv0LZd0gpd8eOHxANOlTY=; b=iMdNYOnA0SYu6K8QZz2bk2jYv4oNQLviLeWQ4UGDMlBJFiblJ7Ycbhuep0insX1wFSeeZuWFrCQuGCNXOnuzRecLcXzzQeLgy3oi6U8gPC0bjNmldvr/8p5TmD3JTgU1YhRITjZIzzDM172lVrVmughFM9OHnx568IC0lINKHDI= 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 1663872230465781.6860301701915; Thu, 22 Sep 2022 11:43:50 -0700 (PDT) Received: from localhost ([::1]:40190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRAq-0006S3-IV for importer@patchew.org; Thu, 22 Sep 2022 14:43:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBK-0002GB-Pf for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:14 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:46001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPBG-0005Tz-Ar for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:09 -0400 Received: by mail-wr1-x42f.google.com with SMTP id n10so16378754wrw.12 for ; Thu, 22 Sep 2022 09:36:04 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=L95wwHp5RV6cXArMSmbL8Hcv0LZd0gpd8eOHxANOlTY=; b=T4WuxWu4T+efzCv8zFpGd9SXJYRNyS4n/SHP63xgXMNVFMseumXdX9Nf5DLrYgaUO2 YNAhg3/hx4CyD4jfWNXyP3VrtvPfMMrytVVrLb/oIxaiY5D16Zt3IbLCFUDS8/JAgFoU 2gHdQtcEBffmN/SJ+ZkSXZhHRagOhIFSnFsuFCD1q/rJi44V/E7uW0Un89i/eJFfZ0Kq NZGb1palhVXFA0a1kTn443iFzp/OK1Soq4srk58bLMxFjrM4FdToG83N6unAkZficdrR 3UwmW4Zxd1zKnKMuaOR5uh1F1EJMSejbeRXYZ+SLBisVsbD6W4xwuQICrrOA4N7fXOw3 yrFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=L95wwHp5RV6cXArMSmbL8Hcv0LZd0gpd8eOHxANOlTY=; b=zD9kH0dEdLyDKlssp1IjY1HlTj504Ye8kVlQbA4ZUz2zPXO53qgAvTBTPvclYXptAX XlBxR8nO+UYmwHZAT/RivySZLLP3o9MwWG6x/N77YgWZKiOX+qdovrZbSCfNS/LXkfp0 VrfQj0uQsu4z4+PXSC5TCb4KiVd4TMgIZbJNx7sLiS8UcWHJRyphU0AuN4gsiirLUJ8R YiDSONbURExizCcIV/TbaMp+OTkwYJ9J5rZliFpmxNBUsbLpEgwDG6zN2sIsj2rKG+ep dgFNJJYy0hbvX58niHAlVmO2BpwZDfvLJaUREQgSe1OVxpaXIWIlkujcnpZLKXKJEJUm ZnBw== X-Gm-Message-State: ACrzQf2BTaR9F279PpU/UyRVsZwWby01gZrlrzZkUSHcg1Kg1H6yAV9K Og+KAwGPc8I5SQ5Xe7eN2HPXXINLk8jK1g== X-Google-Smtp-Source: AMsMyM51kCNrvJnki77/fN9l29E7SC+ux30KrKSEIGsoniec5WL7nGuzrZp0QBuqYt9mq3LlQKnc7g== X-Received: by 2002:adf:a50e:0:b0:22a:ede1:57e with SMTP id i14-20020adfa50e000000b0022aede1057emr2542517wrb.63.1663864563111; Thu, 22 Sep 2022 09:36:03 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 39/39] configure: Avoid use of 'local' as it is non-POSIX Date: Thu, 22 Sep 2022 17:35:36 +0100 Message-Id: <20220922163536.1096175-40-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1663872230885100001 We use the non-POSIX 'local' keyword in just two places in configure; rewrite to avoid it. In do_compiler(), just drop the 'local' keyword. The variable 'compiler' is only used elsewhere in the do_compiler_werror() function, which already uses the variable as a normal non-local one. In probe_target_compiler(), $try and $t are both local; make them normal variables and use a more obviously distinct variable name for $t. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20220825150703.4074125-8-peter.maydell@linaro.org --- configure | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure b/configure index b39561b2ed7..cc4ecd6008b 100755 --- a/configure +++ b/configure @@ -110,7 +110,7 @@ error_exit() { do_compiler() { # Run the compiler, capturing its output to the log. First argument # is compiler binary to execute. - local compiler=3D"$1" + compiler=3D"$1" shift if test -n "$BASH_VERSION"; then eval ' echo >>config.log " @@ -2065,7 +2065,6 @@ probe_target_compiler() { : ${container_cross_strip:=3D${container_cross_prefix}strip} done =20 - local t try try=3Dcross case "$target_arch:$cpu" in aarch64_be:aarch64 | \ @@ -2078,8 +2077,8 @@ probe_target_compiler() { try=3D'native cross' ;; esac eval "target_cflags=3D\${cross_cc_cflags_$target_arch}" - for t in $try; do - case $t in + for thistry in $try; do + case $thistry in native) target_cc=3D$cc target_ccas=3D$ccas --=20 2.25.1