From nobody Wed Nov 27 02:33:10 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=1701703614; cv=none; d=zohomail.com; s=zohoarc; b=T1ojUuWqCtq67g8BPH9PkvVVEs6t8lqS9qERP3ZPzaq5uQTQZzW9qeOAFUmkA3sK4Ml1M1f1fKhPUZ73uX4pdt7pHobwxdqNAXOhOr9O2BZc9KjaBDbxjS/xRnXyR3eeGTK/739Gu+6Kzww0f5rEgrLw4wa7cUaoi6jIZXYJbis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701703614; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JZhXIwTdxRXKPCMPSGzqdtq6zXuxgS6BLrIc53hBnkQ=; b=WnWM1a1TuL+m/EyV/fZwrEwnctFtj9OsJQmKwWbOgQNUUmBx+UylBBANsEVsynExZcTX598QyDtwbIg78qwXBc+tEUaES5PbEo13d8Pr4CHDLzTUm6RUZDH7DoitwytFLXY24FrCmYoknWRC18M6+NPchaZtHnDCdP7vUclCR2c= 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 1701703614430552.0632054253566; Mon, 4 Dec 2023 07:26:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAApn-000420-Kc; Mon, 04 Dec 2023 10:26:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAApl-00040I-F3 for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:09 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAApj-0005Ro-3w for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:09 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40b399a6529so35192475e9.1 for ; Mon, 04 Dec 2023 07:26:05 -0800 (PST) Received: from m1x-phil.lan ([176.176.140.35]) by smtp.gmail.com with ESMTPSA id iv11-20020a05600c548b00b0040b4cb14d40sm19082346wmb.19.2023.12.04.07.26.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Dec 2023 07:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701703563; x=1702308363; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JZhXIwTdxRXKPCMPSGzqdtq6zXuxgS6BLrIc53hBnkQ=; b=Ik+y3p73xNQfV08P+AWscF27YgM2soO9QqwULde5RKAUM5V6O4fJOaBu+f6F4Fkxdk OJcInbvEUHhxAxlOL/phLcTzgS3yhLdv59DvZuvdIiBGihh/1WkclPpwz7Zio9NozoU5 U53xJShD/AWx5lHWe0R+y50Ljv1LtQL7kimtihmyTJ2ujhzLVQVP8A35O5E+0V3H4kZG oKTFi6w6aJeMvMtFIxvx18siorRt4JoWGKzozBcZ/+X+z5o2os/N+ePhoHnKPOH0TxFf qf+hm97krD4csOQMPCcop1p4wjMu68g/lu+AWsXon7DVy5mupHa19c1a965PPTkdu3Ip cKuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701703563; x=1702308363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JZhXIwTdxRXKPCMPSGzqdtq6zXuxgS6BLrIc53hBnkQ=; b=U/sulzseVenqivcSwkHe7MEthbeyIepVZm28l8dfHUo6EZ0lr2eFDr1kG2iC3O8sEL E/JGBFDoOweBNEKqrru60UnQqpqu104kSb4hhsVDNZXZjo9smVIk1/TDccEwopUx97bx 4rqjmeAmk9PZm8BMzWJD8UpgpomWLUzoWakRHxlKGczh8iAPT1MRLFBZCy5SBRsQJe2t y0hNwexGS0IGFmxIgC8hi1Xj9fNXm+IT76KCaSN3jgrsG2IuNUO4XoeC1zE84Rzqoj11 bjq+1roIa0+W0Ju624WT/Rmn3dnL1NM0yUiUvX+z2WxgLd/hy5ANH/XlSzv7SvN2LjGf iKsg== X-Gm-Message-State: AOJu0Yywax/hL7IsBWSaPmfTyFhsTj7Tmk0CMjmIoJa5wwBUgUuYUcv2 IrVJoL0F1fKoflgTJKQe0v4Gl1py+Gmn8Fg+JVg= X-Google-Smtp-Source: AGHT+IF7S4hN8Ty5stC/jwuTrFR39QKReM8akbhMSJT2uVxez0h9m7F5yWhXmozxOaiazE800TIZvA== X-Received: by 2002:a1c:7712:0:b0:40b:5e56:7b58 with SMTP id t18-20020a1c7712000000b0040b5e567b58mr1265580wmi.161.1701703562831; Mon, 04 Dec 2023 07:26:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Patrick Venture , qemu-stable@nongnu.org, Chris Rauer , Peter Foley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Hildenbrand , Paolo Bonzini , Peter Xu Subject: [PULL 1/4] system/memory: use ldn_he_p/stn_he_p Date: Mon, 4 Dec 2023 16:25:21 +0100 Message-ID: <20231204152524.37803-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231204152524.37803-1-philmd@linaro.org> References: <20231204152524.37803-1-philmd@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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701703616677100005 From: Patrick Venture Using direct pointer dereferencing can allow for unaligned accesses, which was seen during execution with sanitizers enabled. Cc: qemu-stable@nongnu.org Reviewed-by: Chris Rauer Reviewed-by: Peter Foley Signed-off-by: Patrick Venture Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Hildenbrand Message-ID: <20231116163633.276671-1-venture@google.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/memory.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/system/memory.c b/system/memory.c index 4d9cb0a7ff..798b6c0a17 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1339,22 +1339,7 @@ static uint64_t memory_region_ram_device_read(void *= opaque, hwaddr addr, unsigned size) { MemoryRegion *mr =3D opaque; - uint64_t data =3D (uint64_t)~0; - - switch (size) { - case 1: - data =3D *(uint8_t *)(mr->ram_block->host + addr); - break; - case 2: - data =3D *(uint16_t *)(mr->ram_block->host + addr); - break; - case 4: - data =3D *(uint32_t *)(mr->ram_block->host + addr); - break; - case 8: - data =3D *(uint64_t *)(mr->ram_block->host + addr); - break; - } + uint64_t data =3D ldn_he_p(mr->ram_block->host + addr, size); =20 trace_memory_region_ram_device_read(get_cpu_index(), mr, addr, data, s= ize); =20 @@ -1368,20 +1353,7 @@ static void memory_region_ram_device_write(void *opa= que, hwaddr addr, =20 trace_memory_region_ram_device_write(get_cpu_index(), mr, addr, data, = size); =20 - switch (size) { - case 1: - *(uint8_t *)(mr->ram_block->host + addr) =3D (uint8_t)data; - break; - case 2: - *(uint16_t *)(mr->ram_block->host + addr) =3D (uint16_t)data; - break; - case 4: - *(uint32_t *)(mr->ram_block->host + addr) =3D (uint32_t)data; - break; - case 8: - *(uint64_t *)(mr->ram_block->host + addr) =3D data; - break; - } + stn_he_p(mr->ram_block->host + addr, size, data); } =20 static const MemoryRegionOps ram_device_mem_ops =3D { --=20 2.41.0 From nobody Wed Nov 27 02:33:10 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=1701703614; cv=none; d=zohomail.com; s=zohoarc; b=jaAu1EHJmQ9FWL4l6Cl4+f5mRor+lrqBLlJwr+VcEAqUwvAh/5Ey9+QNh8boYTQyIAvPrcE0n0REuKUdRE5PUVsLzae2HTLauD+DpfWcv/wZ2xF9KOiZneql+03e8NYArYtCWqEw/UFWLgIdX9C75pgZCAgCE3YSMeDKeKwFwbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701703614; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hwIlmu7y+8erPdoR/Kkd+7013w7hW587KwHOvMnbXVw=; b=Up2oIei55Jf6cmiwjDQ3vBUgr4reX4tQdpXR6cYWwW7MJsbFJv2nqdlDz8xJL/8JvOIBfuZgbjl54iopsyj1ofsObAvKWt7k3ORvwblWnFb4TuMP6n8tr0sdaWNDlyzcc4txqkB2N2lOzxHFqZlsX5NQ9f2XL/D7ErKiOHHrA9s= 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 1701703614238822.6461659584634; Mon, 4 Dec 2023 07:26:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAApx-000450-Hs; Mon, 04 Dec 2023 10:26:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAApp-00042I-0A for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:13 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAApm-0005T5-6T for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:12 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40c0a074e71so12517235e9.1 for ; Mon, 04 Dec 2023 07:26:09 -0800 (PST) Received: from m1x-phil.lan ([176.176.140.35]) by smtp.gmail.com with ESMTPSA id r21-20020a05600c35d500b0040b3e79bad3sm15354298wmq.40.2023.12.04.07.26.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Dec 2023 07:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701703568; x=1702308368; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hwIlmu7y+8erPdoR/Kkd+7013w7hW587KwHOvMnbXVw=; b=MB/sBipiwkb23i9jGyz/FuzYzwo/tL9DvMx8tI32jrTb1hZbXDKQBKGT49F+B84bRw TNndYFi6jP1HjOHggS/8eEvinRohZZ8pWwjBjhrNT48HwqYl3rwuK0VliMh5+Sk+npK+ R+W+nbbdF4QDFcXPPIuSLnYM407qA2HPrlGW7amMpwdTNOCuLbZGNZIyG8ijvHzTh4KE IygEVVjkHodQVjwZJF0YFoBsfsysLk8dq10Sn+0Uqmf2r7bl/41pit2mk/6IqJsIdy/o 6zSTWiJRdsNx9Bg2wcBzhqFDTKPzu7ZlKJxK4E4LwmSlnrA8QeICKXDRYC/vkmvsHZs/ bsbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701703568; x=1702308368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hwIlmu7y+8erPdoR/Kkd+7013w7hW587KwHOvMnbXVw=; b=xA/PlvLAnkJj7kkZe/FlHtaUnkwyLLQWJcpnU9Xz9ylXITUOcEq6Ju1jgrXHKpFXQe 8O0o1MAX2pczghB/eicpoT0oPfOdb7j+G3ySqG7LaZuxjZI7LOvFBPFLbmsvbe5hIu8x 1fjKDaNAI0U9G6XtjOBgn8CIGnEedPBYRK28PHJ/I1dQAaNx6aiYPr4jqh4izxJRt7HU 3mhBQzZclLnl1A2aSUofxEnFmhbbW3LEr8CJPycYwF1HKL8SgX5rEqld30POkcIj6QQ7 IDKZZbou6Roots4J8YMQY5kE++58Umr5vm6mJQDUwYyo3dKmjMXMnr2dlx5deE+x4ptm 7xQg== X-Gm-Message-State: AOJu0Yz3eI+tcOkfStu5D2HQwqrAO/uIdzdr830Eh8EEm3EUOhq9J2TZ 3Koz9/uJBRoai5vZXrUOYC4PwEhlpZjlLHPAYQM= X-Google-Smtp-Source: AGHT+IEO8jGWysVtJ00t3Be9HD2MxetjOg8h35eCcRxj0jBNyQExo3+7A8UzZGuCwcPrVVepITwy/A== X-Received: by 2002:a05:600c:354f:b0:40b:3645:4671 with SMTP id i15-20020a05600c354f00b0040b36454671mr3949699wmq.10.1701703568398; Mon, 04 Dec 2023 07:26:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Daniel Henrique Barboza , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alistair Francis , Palmer Dabbelt , Bin Meng , Weiwei Li , Liu Zhiwei Subject: [PULL 2/4] target/riscv/kvm: fix shadowing in kvm_riscv_(get|put)_regs_csr Date: Mon, 4 Dec 2023 16:25:22 +0100 Message-ID: <20231204152524.37803-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231204152524.37803-1-philmd@linaro.org> References: <20231204152524.37803-1-philmd@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=philmd@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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701703614953100003 From: Daniel Henrique Barboza KVM_RISCV_GET_CSR() and KVM_RISCV_SET_CSR() use an 'int ret' variable that is used to do an early 'return' if ret > 0. Both are being called in functions that are also declaring a 'ret' integer, initialized with '0', and this integer is used as return of the function. The result is that the compiler is less than pleased and is pointing shadowing errors: ../target/riscv/kvm/kvm-cpu.c: In function 'kvm_riscv_get_regs_csr': ../target/riscv/kvm/kvm-cpu.c:90:13: error: declaration of 'ret' shadows a = previous local [-Werror=3Dshadow=3Dcompatible-local] 90 | int ret =3D kvm_get_one_reg(cs, RISCV_CSR_REG(env, csr), &r= eg); \ | ^~~ ../target/riscv/kvm/kvm-cpu.c:539:5: note: in expansion of macro 'KVM_RISCV= _GET_CSR' 539 | KVM_RISCV_GET_CSR(cs, env, sstatus, env->mstatus); | ^~~~~~~~~~~~~~~~~ ../target/riscv/kvm/kvm-cpu.c:536:9: note: shadowed declaration is here 536 | int ret =3D 0; | ^~~ ../target/riscv/kvm/kvm-cpu.c: In function 'kvm_riscv_put_regs_csr': ../target/riscv/kvm/kvm-cpu.c:98:13: error: declaration of 'ret' shadows a = previous local [-Werror=3Dshadow=3Dcompatible-local] 98 | int ret =3D kvm_set_one_reg(cs, RISCV_CSR_REG(env, csr), &r= eg); \ | ^~~ ../target/riscv/kvm/kvm-cpu.c:556:5: note: in expansion of macro 'KVM_RISCV= _SET_CSR' 556 | KVM_RISCV_SET_CSR(cs, env, sstatus, env->mstatus); | ^~~~~~~~~~~~~~~~~ ../target/riscv/kvm/kvm-cpu.c:553:9: note: shadowed declaration is here 553 | int ret =3D 0; | ^~~ The macros are doing early returns for non-zero returns and the local 'ret' variable for both functions is used just to do 'return 0', so remove them from kvm_riscv_get_regs_csr() and kvm_riscv_put_regs_csr() and do a straight 'return 0' in the end. For good measure let's also rename the 'ret' variables in KVM_RISCV_GET_CSR() and KVM_RISCV_SET_CSR() to '_ret' to make them more resilient to these kind of errors. Fixes: 937f0b4512 ("target/riscv: Implement kvm_arch_get_registers") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-ID: <20231123101338.1040134-1-dbarboza@ventanamicro.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/kvm/kvm-cpu.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 78fa1fa162..45b6cf1cfa 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -87,17 +87,17 @@ static uint64_t kvm_riscv_reg_id(CPURISCVState *env, ui= nt64_t type, =20 #define KVM_RISCV_GET_CSR(cs, env, csr, reg) \ do { \ - int ret =3D kvm_get_one_reg(cs, RISCV_CSR_REG(env, csr), ®); \ - if (ret) { \ - return ret; \ + int _ret =3D kvm_get_one_reg(cs, RISCV_CSR_REG(env, csr), ®); \ + if (_ret) { \ + return _ret; \ } \ } while (0) =20 #define KVM_RISCV_SET_CSR(cs, env, csr, reg) \ do { \ - int ret =3D kvm_set_one_reg(cs, RISCV_CSR_REG(env, csr), ®); \ - if (ret) { \ - return ret; \ + int _ret =3D kvm_set_one_reg(cs, RISCV_CSR_REG(env, csr), ®); \ + if (_ret) { \ + return _ret; \ } \ } while (0) =20 @@ -533,7 +533,6 @@ static int kvm_riscv_put_regs_core(CPUState *cs) =20 static int kvm_riscv_get_regs_csr(CPUState *cs) { - int ret =3D 0; CPURISCVState *env =3D &RISCV_CPU(cs)->env; =20 KVM_RISCV_GET_CSR(cs, env, sstatus, env->mstatus); @@ -545,12 +544,12 @@ static int kvm_riscv_get_regs_csr(CPUState *cs) KVM_RISCV_GET_CSR(cs, env, stval, env->stval); KVM_RISCV_GET_CSR(cs, env, sip, env->mip); KVM_RISCV_GET_CSR(cs, env, satp, env->satp); - return ret; + + return 0; } =20 static int kvm_riscv_put_regs_csr(CPUState *cs) { - int ret =3D 0; CPURISCVState *env =3D &RISCV_CPU(cs)->env; =20 KVM_RISCV_SET_CSR(cs, env, sstatus, env->mstatus); @@ -563,7 +562,7 @@ static int kvm_riscv_put_regs_csr(CPUState *cs) KVM_RISCV_SET_CSR(cs, env, sip, env->mip); KVM_RISCV_SET_CSR(cs, env, satp, env->satp); =20 - return ret; + return 0; } =20 static int kvm_riscv_get_regs_fp(CPUState *cs) --=20 2.41.0 From nobody Wed Nov 27 02:33:10 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=1701703647; cv=none; d=zohomail.com; s=zohoarc; b=Go8l1J0iZqy97ApjvgkP/9S4TeulToBESa9PD/5ay1zuo5EEZPuKUB3I9tHholEgJ9apOl3Oh6PRtHl4d0Z4ccNNV49yo+RS36/pSlE9v1O58jRsQagyWQ8FLr1arHE7vPl5SpCRcRp4ryIDwRGhYLHP/k6qwAnVhjAcAM7y3G8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701703647; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+FOPF54Ts8pAoe2u+mRITxVWTs2rKpGlxkYcxd5nZGU=; b=W6ebkaBvRfxvqXcca8ffbzjPdP8CEl0aZakS+BfQNMBvP5d9HZrFn92YVBqCunNSA7Is4bh92Z4gP/Rw2XAdRQjIkgE85jUgTluqBGPQ0mjbm6QeDDZQza92iGr1iGpvmwuHRCxc6diuMrvscRuEG/7ZrcMhbQrpmpD9JK48rA0= 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 1701703647459442.51355994393225; Mon, 4 Dec 2023 07:27:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAApz-0004Bu-JL; Mon, 04 Dec 2023 10:26:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAApt-00044g-JV for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:19 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAApr-0005Ua-Nm for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:17 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40859dee28cso45795295e9.0 for ; Mon, 04 Dec 2023 07:26:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.140.35]) by smtp.gmail.com with ESMTPSA id j19-20020a5d6e53000000b00333423ffcd6sm4629412wrz.51.2023.12.04.07.26.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Dec 2023 07:26:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701703574; x=1702308374; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+FOPF54Ts8pAoe2u+mRITxVWTs2rKpGlxkYcxd5nZGU=; b=unhO0vPOPsQV3moEqnMZVbwn65CO8XyEKgM1NzWHs7HilesFr6SPvFpUvCdDufLrNT /eaaiUedKax2jnR5Hk2IyZXTBQqXLGvtbIA85mM+ELvKVI0bFeurBZTHXkodpvDWQ1/S LCMSVM2Rh2gQNY4YY9UxnSeWggU1KTFWdKYuv23raIZ/ZT6W5udpQzfASrtakXvoma1v YrBJp+Bs6QcOZ6dG3Zf0Yc+rw+rlwJAZWd89CJXlF9buTBaZ6rm8EALCH5Z9aDzFwUHZ VvOdG9quBLkb3UglbFFBy2xaAaeHyySxhnxTy3mo50lOpEN8iMwZR420Ni+uwa60LdzN 0XNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701703574; x=1702308374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+FOPF54Ts8pAoe2u+mRITxVWTs2rKpGlxkYcxd5nZGU=; b=bNSNpL5xQQ83QwE0Ms39GmvU9MdIPebcHPzkypyPkY0qcnXIwJItJMSch/Zghnizmq 7AkdMBvf2LWpgxraisUaQri5hJHQm0IdNoYg+8hpL6DSwGXVOfVoNz7gfuQS/oYLgyju CrGQiA84N2NBbgrxOWSojUlb3ZY8yRNwvKCzGnGXHYR7NHoKXQA6SNlvH/i5fGZjv081 p9MGVKcIMCb/ASjvfbqZjjNYpEOtE/jDEwMv5cQ5KC71QQKq88/U47OxNGYZn3PFSZvc 9cfVgdNhJYLtbJUz49GrKqUAolENkrE4x3D/SaC7qrzA9/rbRtz/HB+tbS88q3+Isy/+ 8hig== X-Gm-Message-State: AOJu0YzeZPxzjcSIUC9rbKUFne1xYB2LJQ3SQehEZ5HBvaBAYXcohBap lTqdRbgLUrEB9mCWZz+paOe6l29HQFZLbD1lQn8= X-Google-Smtp-Source: AGHT+IHX+CPEIaEpuFbgoGNu1DuFkQK9sEDxOVnHsarn5RwVqTxFiaafONykOxKvWdzchz6EXCOIcg== X-Received: by 2002:a5d:60cf:0:b0:333:3c99:7d28 with SMTP id x15-20020a5d60cf000000b003333c997d28mr2476076wrt.75.1701703574003; Mon, 04 Dec 2023 07:26:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Aurelien Jarno , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 3/4] tests/avocado: Update yamon-bin-02.22.zip URL Date: Mon, 4 Dec 2023 16:25:23 +0100 Message-ID: <20231204152524.37803-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231204152524.37803-1-philmd@linaro.org> References: <20231204152524.37803-1-philmd@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=philmd@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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701703649281100005 http://www.imgtec.com/tools/mips-tools/downloads/ redirects to https://mips.com/downloads/yamon-version-02-22/ then points to an invalid path to a s3 bucket. Use the correct path. The site will eventually be fixed. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <20231201205630.10837-1-philmd@linaro.org> --- tests/avocado/machine_mips_malta.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mi= ps_malta.py index 99bee49e9a..8cf84bd805 100644 --- a/tests/avocado/machine_mips_malta.py +++ b/tests/avocado/machine_mips_malta.py @@ -128,8 +128,9 @@ def test_mips_malta_i6400_framebuffer_logo_8cores(self): class MaltaMachine(QemuSystemTest): =20 def do_test_yamon(self): - rom_url =3D ('http://www.imgtec.com/tools/mips-tools/downloads/' - 'yamon/yamon-bin-02.22.zip') + rom_url =3D ('https://s3-eu-west-1.amazonaws.com/' + 'downloads-mips/mips-downloads/' + 'YAMON/yamon-bin-02.22.zip') rom_hash =3D '8da7ecddbc5312704b8b324341ee238189bde480' zip_path =3D self.fetch_asset(rom_url, asset_hash=3Drom_hash) =20 --=20 2.41.0 From nobody Wed Nov 27 02:33:10 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=1701703645; cv=none; d=zohomail.com; s=zohoarc; b=mN8dwvoIApvdvAzyQWKv5E06sqhVIP6gw+gktB3GI9jUIj0gWAcv2xMAKTzYRoLzdxWAohX5Vv/0jALSUQ2ZFyUKUibXC0SS+M8ZWUTVY0lQJLRB8ZMKKScpUNMtdqbICKd25HIXdqBCF1ofqgMPz/qxwfaS+MIWGM0ssxq02Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701703645; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Mc/WowXZKK7/TX1A9Zcf22gua9+ILUXdw0tlS4dSjm8=; b=MuSJXUb3X9YgHnRjRA3tkOKTukuoiws7AlHrsnZpzUs7obNqPC9ie18F89Rq5qeZcvcqyoEBENFsoxdlceYTni+12jTvZngWyUjHg/z9VjMw9ATBopVEojk5EBiIne3/geAKK1Rh2mhXJn6M06lHPCtUnQ6J4sFEEQc14c/JLQk= 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 1701703645271535.3356317407736; Mon, 4 Dec 2023 07:27:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAAq1-0004Fc-GW; Mon, 04 Dec 2023 10:26:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAApz-0004BG-Bn for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:23 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAApx-0005Ys-7y for qemu-devel@nongnu.org; Mon, 04 Dec 2023 10:26:22 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40c08af319cso17433395e9.2 for ; Mon, 04 Dec 2023 07:26:20 -0800 (PST) Received: from m1x-phil.lan ([176.176.140.35]) by smtp.gmail.com with ESMTPSA id u8-20020a05600c19c800b004030e8ff964sm19132875wmq.34.2023.12.04.07.26.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Dec 2023 07:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701703579; x=1702308379; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mc/WowXZKK7/TX1A9Zcf22gua9+ILUXdw0tlS4dSjm8=; b=kP4bBJfgiDaAns7ZPWOng4eKwj8M84b99wi/LaEiEeEJVtzEKorQjCfymII3ePmTi7 MtRt4p4pXRTBQjPYgCdZDT1qGso44cu1OEh5d4pKTcteNPZmZRIOPGqw9JiY+5JqDxe7 QcNuPq/+XUgdonY6ZJ9j4r/oqAvxSv40utKrxow0SNI9jtj/PVioIDVi6/EHy3jmgmIW WpKA0ZJWgI69tp2L00IiGdOpAnDpPuD3a/tjn/lAYgtgc5kAENzTvzji6/1egNlji+dV yOn6qh1wJbp6nm88T739gGqfkwzJpwcXGLNBmSh/5GCZTf5BrRmJgC3mNb4Z4A+W+nAd 9Plw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701703579; x=1702308379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mc/WowXZKK7/TX1A9Zcf22gua9+ILUXdw0tlS4dSjm8=; b=X9y3W6XgzYnEvwbbBOKLFtwwt8RFoITWAB3DwS+GO6tPHX7hYTdP2tK7KvOOBD+koa 5go4fn3oH3wEp/fgyMhA6n0lPVoRMOo7IyryigE+POPXpDUnsq2pTK1fB3NRnTI55sE1 3LTHYJdArf2NkZiwVqo+gRuaMKownRIMlY3vAHSIrRIA3EDw7uDkBGXn808Puo8440Tv wf9E58WT6MQ/9OthVAi184mHx5pKdpto082SJU0gURdsC9lZkeKvN7dz8pZCFjIshGFl ZOMwPOIR4IQNyxoqLlIGumKsL6fJ8WsvRTLZkamzu5X+1DlICc5ULJIpSncOpLMvI2VZ R68g== X-Gm-Message-State: AOJu0YxwsziONdfRRApExQpXhJwDRSBNBNUqJjBjZIr/6j2u15l2Qu11 oaKkvnkMgGxklumImS/n6QdnwajZIN8/wCXE/YQ= X-Google-Smtp-Source: AGHT+IFpuJ/WehPrdQud0bKSl0qgqUC8/QkLfkP52uZ5GhtgYHvijdiFJ29T8B/gD7HdUH/8GHXR3Q== X-Received: by 2002:a05:600c:b45:b0:40b:5e21:ec27 with SMTP id k5-20020a05600c0b4500b0040b5e21ec27mr2617623wmr.89.1701703579710; Mon, 04 Dec 2023 07:26:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pavel Dovgalyuk , Paolo Bonzini , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal , Jiaxun Yang Subject: [PULL 4/4] tests/avocado: mark ReplayKernelNormal.test_mips64el_malta as flaky Date: Mon, 4 Dec 2023 16:25:24 +0100 Message-ID: <20231204152524.37803-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231204152524.37803-1-philmd@linaro.org> References: <20231204152524.37803-1-philmd@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=philmd@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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701703647180100001 From: Alex Benn=C3=A9e I missed this when going through the recent failure logs. I can run the test 30 times without failure locally but it seems to hang pretty reliably on GitLab's CI infra-structure. Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231201201027.2689404-1-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/avocado/replay_kernel.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py index af086eab08..c37afa662c 100644 --- a/tests/avocado/replay_kernel.py +++ b/tests/avocado/replay_kernel.py @@ -119,6 +119,8 @@ def test_mips_malta(self): =20 self.run_rr(kernel_path, kernel_command_line, console_pattern, shi= ft=3D5) =20 + # See https://gitlab.com/qemu-project/qemu/-/issues/2013 + @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on G= itLab') def test_mips64el_malta(self): """ This test requires the ar tool to extract "data.tar.gz" from @@ -134,6 +136,7 @@ def test_mips64el_malta(self): =20 :avocado: tags=3Darch:mips64el :avocado: tags=3Dmachine:malta + :avocado: tags=3Dflaky """ deb_url =3D ('http://snapshot.debian.org/archive/debian/' '20130217T032700Z/pool/main/l/linux-2.6/' --=20 2.41.0