From patchwork Tue Dec 12 12:17:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753047 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1867104wrs; Tue, 12 Dec 2023 04:19:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHX83EJNBF3cTvXxi12ozeLH7fVUubfqFrOMiwG+ZboqfntPuFRGL3w5J4VvjbzKkE1wojF X-Received: by 2002:a05:622a:148f:b0:412:c2a:eaef with SMTP id t15-20020a05622a148f00b004120c2aeaefmr8142287qtx.11.1702383569242; Tue, 12 Dec 2023 04:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383569; cv=none; d=google.com; s=arc-20160816; b=eLY8fhvMLUYpB/0Efcj4H6M9BPJXGqafCuqJCzAyPErohT50lkVFJxpNqiWezCfSJJ G3amevHxp3i568vxwEhN2nEVlg+XNISN+qmq2U7YpibDc2AG9jrykCAxKAt5rAebswzp XcCImOPp1hNEDN8KkJUB4tJcuMfzMbknrwwDDTwMgdMQSeNwzlFSlfoz43KMsYTlOt+g W5Lmoo7Ot0w+Nb/Xr0qSwXdjxakHAwfG+/vrKFAG4WCBwHxlALknF9qDtkjWFNJPMeSJ U42QYZi7EUJ9EEea1YG7LsqbJpW6Glo7e6101++M0pYRHTlYXCLdL7CCe8uIQibdHKb+ aJ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=V27TfXrFeQATSb5czE4qvxs3kxtgF+n+/XDv27oAFsk=; fh=TbI2pklXwlJGmj6m7lZZgI+jTnI/L5qcZuxsjME8SeI=; b=ZRaADggv6KpWMvAjyOKYutCCZ9EMhQS569wqXK/rD1RJYn6YBuRAR+CXoDd13OHZ7D smy1ubhw2cI/lY2nR469q8UIbKLZ+I5CCtCYFoJTfP+mlV0u/c5mkzuLXCGuUSv137UP WS8QivUu9Xx/RscrQJ25eqObGbS1pF1FGu0E53nCYYR2lkIObJG4YwD3CCQhuywu7I/3 WJD1cEMQb0jkofb8CJKLR0+S4JGQay/2+eHa0MVYMKTcOZwwG7W0lloEztovfOdpbOjS uvjBXhKqmvKYJkRCN84lX5TNaNhKFmvJEwFrgxuSPSXGrqQnV4/+jPFfMBJO6mwKjSea bpYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ey10-20020a05622a4c0a00b004237af6e8dfsi11877680qtb.180.2023.12.12.04.19.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:19:29 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1iz-00057z-4J; Tue, 12 Dec 2023 07:18:57 -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 1rD1is-00056F-Gn; Tue, 12 Dec 2023 07:18:50 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1ip-0000De-EN; Tue, 12 Dec 2023 07:18:50 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DB8673AEF5; Tue, 12 Dec 2023 15:18:48 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 9FD6D3B943; Tue, 12 Dec 2023 15:18:31 +0300 (MSK) Received: (nullmailer pid 1003404 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 02/31] target/arm: Fix SME FMOPA (16-bit), BFMOPA Date: Tue, 12 Dec 2023 15:17:50 +0300 Message-Id: <20231212121831.1003318-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Perform the loop increment unconditionally, not nested within the predication. Cc: qemu-stable@nongnu.org Fixes: 3916841ac75 ("target/arm: Implement FMOPA, FMOPS (widening)") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1985 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20231117193135.1180657-1-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 3efd8495735c69b863476e9003e624877382a72d) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/sme_helper.c b/target/arm/tcg/sme_helper.c index 296826ffe6..1ee2690ceb 100644 --- a/target/arm/tcg/sme_helper.c +++ b/target/arm/tcg/sme_helper.c @@ -1037,10 +1037,9 @@ void HELPER(sme_fmopa_h)(void *vza, void *vzn, void *vzm, void *vpn, m = f16mop_adj_pair(m, pcol, 0); *a = f16_dotadd(*a, n, m, &fpst_std, &fpst_odd); - - col += 4; - pcol >>= 4; } + col += 4; + pcol >>= 4; } while (col & 15); } row += 4; @@ -1073,10 +1072,9 @@ void HELPER(sme_bfmopa)(void *vza, void *vzn, void *vzm, void *vpn, m = f16mop_adj_pair(m, pcol, 0); *a = bfdotadd(*a, n, m); - - col += 4; - pcol >>= 4; } + col += 4; + pcol >>= 4; } while (col & 15); } row += 4; From patchwork Tue Dec 12 12:17:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753055 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1869550wrs; Tue, 12 Dec 2023 04:24:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiXCV2cd/2nTV+Di+YlaBkSpyTukcBOJ/AVrP0MDajXwjgEYIwXrcwRerJ2hHicQnGx6Nt X-Received: by 2002:a05:622a:104e:b0:425:918b:f189 with SMTP id f14-20020a05622a104e00b00425918bf189mr8170454qte.105.1702383867448; Tue, 12 Dec 2023 04:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383867; cv=none; d=google.com; s=arc-20160816; b=Bo74QON4Ld/CYmTsUKhfBw444EB2rm+3boWCz1XjUaJ+xp7Q+dDMXeTB0LA83WPMex vfU3c6kOPFzGtcZq4paOWuc0Y58+HsvTzMtfTiSwUzb+HSNPo4ROK3ivdTg7Xojh69SM f99kYxoe8iZZN6FReAz5pQw3NHiKBwtJIvakyZCf8+BRoWK/HBoC0I9kBZNTqyxUdyzG ga1AIHHE9mV4IJvu/A3rRgBHwpKVao2k0eR+ZLz+szASPzh1ZqrX+K+VHL+gtB0S5WGE EU2p2Z0iGHVFli92ULTLOlnWFMcJoRmWN5fw41uG4ODcby83R1o/Ydy+y21XGzd2fJFp nOuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=GOcItsBaxNMMWib6q9WmvrYRC4MrPr1jMClrImyr4Sc=; fh=bMaafE1clBtiBaCrlbrbcY1DSEPhhFUklUk4XoVHiPU=; b=IWr6xyyLNnElBNlngx2dzaPrWSxcFuaR88EocUBACproQbDRrayxaZOiahoftpkpJu yesOWIjZwhwHyfF22jIFr4Nr9/+r7MBnB4xrrdOYCD3YIUx8EEqGJsrgPNhuA5/dBd9L 2lTLlcMGq+pWWh4bIsdf+EVMffALnJzFn8A9dh3J3tZVuUpHFnlz+fbmQyDrc3qkiUp5 I/zpVkAbWjMdutjltdFrJLLZ8kYsvtWlo0xuHNCDi5tHaY4AsaW2bZsjNF4EYwyi9oZ4 H8lVSRZeGrovmZNjRXwGDVmKnMgW20s/i4jY0+2Eo7kLqN90Wrp7eQmFiRroWBlEqyCg HigQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id kf5-20020a05622a2a8500b004236ecc968dsi9912911qtb.67.2023.12.12.04.24.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:24:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1jH-0005Bi-Aq; Tue, 12 Dec 2023 07:19:15 -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 1rD1jF-0005Aw-2j; Tue, 12 Dec 2023 07:19:13 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1jC-0000Ic-HX; Tue, 12 Dec 2023 07:19:11 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 300BB3AEF9; Tue, 12 Dec 2023 15:18:49 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id EB80E3B947; Tue, 12 Dec 2023 15:18:31 +0300 (MSK) Received: (nullmailer pid 1003416 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Michael Tokarev Subject: [Stable-8.1.4 06/31] linux-user: Fix loaddr computation for some elf files Date: Tue, 12 Dec 2023 15:17:54 +0300 Message-Id: <20231212121831.1003318-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson The file offset of the load segment is not relevant to the low address, only the beginning of the virtual address page. Cc: qemu-stable@nongnu.org Fixes: a93934fecd4 ("elf: take phdr offset into account when calculating the program load address") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1952 Signed-off-by: Richard Henderson Reviewed-by: Michael Tokarev (cherry picked from commit 82d70a84c8ee42ef969a9cfddc0f5b30b16165f5) Signed-off-by: Michael Tokarev diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 47170fe5d3..b1462842b6 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3093,7 +3093,7 @@ static void load_elf_image(const char *image_name, int image_fd, for (i = 0; i < ehdr->e_phnum; ++i) { struct elf_phdr *eppnt = phdr + i; if (eppnt->p_type == PT_LOAD) { - abi_ulong a = eppnt->p_vaddr - eppnt->p_offset; + abi_ulong a = eppnt->p_vaddr & TARGET_PAGE_MASK; if (a < loaddr) { loaddr = a; } From patchwork Tue Dec 12 12:17:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753050 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1868025wrs; Tue, 12 Dec 2023 04:21:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6VoSowLYR6/KcI7syTaUqY4Pm7S64P4rDimi/G9CuiU0e+icAEeuaSgXbEI1QVAtli6oQ X-Received: by 2002:ad4:4192:0:b0:67a:a721:9ecd with SMTP id e18-20020ad44192000000b0067aa7219ecdmr6521305qvp.126.1702383674387; Tue, 12 Dec 2023 04:21:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383674; cv=none; d=google.com; s=arc-20160816; b=SWuqtHr3sSObGcpXK0jlf6uNBeWRp9WGW6VkibTvoqrqYjjBSUUhK4vAqUNYEbNHMP z7VBHG844Vt5MBL+u7q7IUF4CgpVY/qKb9fGiUKAshu7ZCgyG6148eqHayoycWMSzmeL b9zbN5K5BSff31NoAlZY4l08evBadB1s26Qk0lI4xOrtbynJa6JObuU8RcwK5UNoS/QK PMMogBmPFanPxuYGJgSdk/EFZECsCnSVN0GQh64A1WOshAkorwVBO/2E83g6IxPma4Nx lub7o/D15ZrpX0o2nbZJlrhT1fjJzHO6DBdJ6FGIJTuqhllBX6u1GdKEKhVwDJ3F2wYw wp8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=3+bzWOgNnueb5anAbc10l7+86QpesrwIeE4Ka8ZrR4g=; fh=vzu4N/2bQ935L8afgPSM9lExt7+xxv+LGh8guf0KM30=; b=f1RNs1eATdWXcDSVBvHd4YNhfgBGOHiqdZ0TPJ5iZg0Sy9RsWvnP/YH4RDY7neb7wF vvD4QhiuqcjGMRGonDZkh1Ud1WQWfJaFpQIyZ/LNtHOAe/c1ZY+QNOjlrPtBF6DCZHlM 56edLr764LPxyk6YPdZ4T/83/np4G43dT90OjxDTxhoRObAtMm/C//Ng7che6zHHNwVB ve3RSCw5bk7bXPmMc3PpKWdHXla7yO6M9dEAfci2UW03MvKD5j4jWvGShxtuVtCtgDsn RXJ6j4O6XtXOgSr8lZQ4rFehnyKnwniQFWprx8MJJYd21JB/IrdqT0IWS1lHQxNiOxI+ yKng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q3-20020ad45743000000b0067a391a13e8si247281qvx.80.2023.12.12.04.21.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:21:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1jP-0005Fr-MR; Tue, 12 Dec 2023 07:19: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 1rD1jN-0005ET-NF; Tue, 12 Dec 2023 07:19:21 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1jM-0000Kl-0b; Tue, 12 Dec 2023 07:19:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5254A3AEFC; Tue, 12 Dec 2023 15:18:49 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1861E3B94A; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003422 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Michael Tokarev Subject: [Stable-8.1.4 08/31] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility Date: Tue, 12 Dec 2023 15:17:56 +0300 Message-Id: <20231212121831.1003318-8-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé assertRegexpMatches() has been removed in Python 3.12 and should be replaced by assertRegex(). See: https://docs.python.org/3.12/whatsnew/3.12.html#id3 Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231114144832.71612-1-philmd@linaro.org> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth (cherry picked from commit f0a663b4ced2bf315936c774c2b6ff398fce8905) Signed-off-by: Michael Tokarev (Mjt: adjust context for before v8.1.0-1582-g684750ab4f "python/qemu: rename command() to cmd()") diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 1c4ee2af32..1502fc01f2 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -1016,7 +1016,7 @@ class. Here's a simple usage example: self.vm.launch() res = self.vm.command('human-monitor-command', command_line='info version') - self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') + self.assertRegex(res, r'^(\d+\.\d+\.\d)') To execute your test, run: diff --git a/tests/avocado/version.py b/tests/avocado/version.py index dd775955eb..1d5f1f2562 100644 --- a/tests/avocado/version.py +++ b/tests/avocado/version.py @@ -22,4 +22,4 @@ def test_qmp_human_info_version(self): self.vm.launch() res = self.vm.command('human-monitor-command', command_line='info version') - self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') + self.assertRegex(res, r'^(\d+\.\d+\.\d)') From patchwork Tue Dec 12 12:18:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753056 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1869662wrs; Tue, 12 Dec 2023 04:24:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWbWE5IvQTBEyy0RtfC4oMFZLVo9tsIL+rXLWIl0roeTJrRnqf35rp05AVmDtI7F9z4FAg X-Received: by 2002:ac8:5a43:0:b0:425:4043:50e9 with SMTP id o3-20020ac85a43000000b00425404350e9mr9229825qta.120.1702383881359; Tue, 12 Dec 2023 04:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383881; cv=none; d=google.com; s=arc-20160816; b=hla9iC+6t5tBL3DdyvRdGfN3X+4c/LckZ2q0kvwdGtn2lc+oQ/rgeX8oV0/owjJTjJ IvhWOOaXwxR0sdjJomrO9WM0NkKzgc5J66hTZr3Gp7oE7ntJc2iezvo03F07J2VFgOgC c2K10ETKnwAwCJKy7asvVAxY8/xf1X3V2VONe/Fp8nSwYjto7/Ve76MeJFpXFycJ42hn omFm1O7PnvNwxH8B9HffTixYaqEy0gZy6jOms4aRHPF+4CQdNH1DzVn2p7UjAxsXQnVk JPOpWQzOMNVJNnoOplPuaibXt8P1YpnLxD7fxU9aqTHp27xf0DpMC5+JZzcPuDDcNKRT Gg0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=/O7FCHFF/caGJZYThJSsCwxdnGiVZBnov163QNjacEY=; fh=xJ1URYKcMN3TM0/XAv5v+aCN+5tIbzAdcfBx5UNgoLw=; b=e/5lnxZSLSyGkAvjo6V7oyWPJEQA/wfqlZT318siwSG2mR970UGXh1RHfhJkxJodn4 C+R5KRoJMdDOKtnztlhQQzgJvK29UVE4anu9NxDOmsa6A+KVmCVrg0zG3L5eg1V5viyL +i9axZD/NvLii4P0Rs9HE57S9Ck2RnzeJqcmEDQYT7fXWYZS6F8vuccqUPD4KUXB4Rrf pG+gCncBaQG/6PB622xjJ0CdNHAYt+7QuklKaxCBy/qHdFghsLkllHPwUaSlZwpvfk6o /ppKDsnEPDWDz+/hlaNLBxKf+/GTiikHDiwb0ULoeajAFQNWCZEn9y/ahhx9suSUX+5/ A3og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l4-20020ac84a84000000b00425826acab8si9898605qtq.469.2023.12.12.04.24.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:24:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1jx-00067i-7D; Tue, 12 Dec 2023 07:19:57 -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 1rD1jv-00065Z-7f; Tue, 12 Dec 2023 07:19:55 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1jt-0000PP-D7; Tue, 12 Dec 2023 07:19:54 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DC26F3AF03; Tue, 12 Dec 2023 15:18:49 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id A1EFF3B951; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003444 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev Subject: [Stable-8.1.4 15/31] target/arm: Set IL bit for pauth, SVE access, BTI trap syndromes Date: Tue, 12 Dec 2023 15:18:03 +0300 Message-Id: <20231212121831.1003318-15-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell The syndrome register value always has an IL field at bit 25, which is 0 for a trap on a 16 bit instruction, and 1 for a trap on a 32 bit instruction (or for exceptions which aren't traps on a known instruction, like PC alignment faults). This means that our syn_*() functions should always either take an is_16bit argument to determine whether to set the IL bit, or else unconditionally set it. We missed setting the IL bit for the syndrome for three kinds of trap: * an SVE access exception * a pointer authentication check failure * a BTI (branch target identification) check failure All of these traps are AArch64 only, and so the instruction causing the trap is always 64 bit. This means we can unconditionally set the IL bit in the syn_*() function. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20231120150121.3458408-1-peter.maydell@linaro.org Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell (cherry picked from commit 11a3c4a286d5dc603582ea0a1fca62c2ec0a1aee) Signed-off-by: Michael Tokarev diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index 62254d0e51..63d0f37a1c 100644 --- a/target/arm/syndrome.h +++ b/target/arm/syndrome.h @@ -214,7 +214,7 @@ static inline uint32_t syn_simd_access_trap(int cv, int cond, bool is_16bit) static inline uint32_t syn_sve_access_trap(void) { - return EC_SVEACCESSTRAP << ARM_EL_EC_SHIFT; + return (EC_SVEACCESSTRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL; } /* @@ -234,12 +234,12 @@ static inline uint32_t syn_smetrap(SMEExceptionType etype, bool is_16bit) static inline uint32_t syn_pactrap(void) { - return EC_PACTRAP << ARM_EL_EC_SHIFT; + return (EC_PACTRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL; } static inline uint32_t syn_btitrap(int btype) { - return (EC_BTITRAP << ARM_EL_EC_SHIFT) | btype; + return (EC_BTITRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL | btype; } static inline uint32_t syn_bxjtrap(int cv, int cond, int rm) From patchwork Tue Dec 12 12:18:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753048 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1867882wrs; Tue, 12 Dec 2023 04:20:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBLd2D5rSt3ftN+D/DsFP560LeQ4h4omcd9zH1FyGjkesOeickkGppMNCx0zdq7eM7edOZ X-Received: by 2002:a05:620a:3888:b0:77f:44e2:dfc0 with SMTP id qp8-20020a05620a388800b0077f44e2dfc0mr6722557qkn.133.1702383657499; Tue, 12 Dec 2023 04:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383657; cv=none; d=google.com; s=arc-20160816; b=qDEY6Pj+OHoOu8LxgMeZOx6kEjnogKSH8LnS5thiHStA5vEsP8R3Zd9m7NPxGyfJlZ lXRINP5OFkrBerrbQXxyEFdaDd0AsX1NGzAfU7artjFv+NrfMJ/I1njqkMs/vCHRUQQl u3wqtpMyeIFvN9CmKDu9gViZdw5hkXXYbuAOl7WVOye3jzuMpNOAo7tBCUxiSLAcAvOV y1LYnNN+La6tcyll7AWj8IVlKXMVo5T+GOI0h8N4mzQ+2PPrYLPSBLzxX0h9JxDFkYcG k1CEwhFg3/bzhdajqm+a4flj7BdMVLxGvDHiNTq0Z+gQYU+TitEyyICY56SPZZrxUrPX oWTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Pktf9/8CpRqVKYEPN4+EksRTaAHTL96KzrFi3S39OIs=; fh=upfN+4mcRAuX+bX9oPqMwq1TP+fTfKlWZBqspF+lG6I=; b=XgL8Wbhw3CuHo3cGMJc2iRqRXNIdAzvYfJouHFcR5MuoGAfcfvw5UrnJwAbklKxi6Y HPqaqDXyAWxqeKIzt6U4vgBcfRD3uExOmH5/6r5cwO77l473h/KEqQb9+SwKj9M8/J7s Z1FVefIECwqMDNrl3FUUwyI3YjEwdThDaOwsTouqcsNKCJSjBVzQZMtyH1fkBLX4usTR G0j8+Bl9AXmjq4IlS/9Lw/r5E/mfmV0+idPcjtV+9vEfMkLq4+Y1HfMFwmJuRccXyOpA qo6GnsoudpsphPkB3iAwwPdIeOxN0jWf+cWKUVEag2fvHa9XODmdyQnk5HbFaFPiE+d3 EK2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u7-20020a05620a0c4700b0077d68c53644si11359778qki.109.2023.12.12.04.20.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:20:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1jz-0006At-LH; Tue, 12 Dec 2023 07:19:59 -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 1rD1jx-00068B-84; Tue, 12 Dec 2023 07:19:57 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1jv-0000U8-3U; Tue, 12 Dec 2023 07:19:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F015D3AF04; Tue, 12 Dec 2023 15:18:49 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id B25F93B952; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003447 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Michael Tokarev Subject: [Stable-8.1.4 16/31] target/arm: Handle overflow in calculation of next timer tick Date: Tue, 12 Dec 2023 15:18:04 +0300 Message-Id: <20231212121831.1003318-16-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell In commit edac4d8a168 back in 2015 when we added support for the virtual timer offset CNTVOFF_EL2, we didn't correctly update the timer-recalculation code that figures out when the timer interrupt is next going to change state. We got it wrong in two ways: * for the 0->1 transition, we didn't notice that gt->cval + offset can overflow a uint64_t * for the 1->0 transition, we didn't notice that the transition might now happen before the count rolls over, if offset > count In the former case, we end up trying to set the next interrupt for a time in the past, which results in QEMU hanging as the timer fires continuously. In the latter case, we would fail to update the interrupt status when we are supposed to. Fix the calculations in both cases. The test case is Alex Bennée's from the bug report, and tests the 0->1 transition overflow case. Fixes: edac4d8a168 ("target-arm: Add CNTVOFF_EL2") Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/60 Signed-off-by: Alex Bennée Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20231120173506.3729884-1-peter.maydell@linaro.org Reviewed-by: Peter Maydell (cherry picked from commit 8d37a1425b9954d7e445615dcad23456515e24c0) Signed-off-by: Michael Tokarev diff --git a/target/arm/helper.c b/target/arm/helper.c index f66b610bdd..01822b9086 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2616,11 +2616,28 @@ static void gt_recalc_timer(ARMCPU *cpu, int timeridx) qemu_set_irq(cpu->gt_timer_outputs[timeridx], irqstate); if (istatus) { - /* Next transition is when count rolls back over to zero */ - nexttick = UINT64_MAX; + /* + * Next transition is when (count - offset) rolls back over to 0. + * If offset > count then this is when count == offset; + * if offset <= count then this is when count == offset + 2^64 + * For the latter case we set nexttick to an "as far in future + * as possible" value and let the code below handle it. + */ + if (offset > count) { + nexttick = offset; + } else { + nexttick = UINT64_MAX; + } } else { - /* Next transition is when we hit cval */ - nexttick = gt->cval + offset; + /* + * Next transition is when (count - offset) == cval, i.e. + * when count == (cval + offset). + * If that would overflow, then again we set up the next interrupt + * for "as far in the future as possible" for the code below. + */ + if (uadd64_overflow(gt->cval, offset, &nexttick)) { + nexttick = UINT64_MAX; + } } /* * Note that the desired next expiry time might be beyond the diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target index b74a2534e3..d71659cc22 100644 --- a/tests/tcg/aarch64/Makefile.softmmu-target +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -45,7 +45,8 @@ TESTS+=memory-sve # Running QEMU_BASE_MACHINE=-M virt -cpu max -display none -QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel +QEMU_BASE_ARGS=-semihosting-config enable=on,target=native,chardev=output +QEMU_OPTS+=$(QEMU_BASE_MACHINE) $(QEMU_BASE_ARGS) -kernel # console test is manual only QEMU_SEMIHOST=-chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline @@ -55,6 +56,10 @@ run-semiconsole: semiconsole run-plugin-semiconsole-with-%: semiconsole $(call skip-test, $<, "MANUAL ONLY") +# vtimer test needs EL2 +QEMU_EL2_MACHINE=-machine virt,virtualization=on,gic-version=2 -cpu cortex-a57 -smp 4 +run-vtimer: QEMU_OPTS=$(QEMU_EL2_MACHINE) $(QEMU_BASE_ARGS) -kernel + # Simple Record/Replay Test .PHONY: memory-record run-memory-record: memory-record memory diff --git a/tests/tcg/aarch64/system/vtimer.c b/tests/tcg/aarch64/system/vtimer.c new file mode 100644 index 0000000000..42f2f7796c --- /dev/null +++ b/tests/tcg/aarch64/system/vtimer.c @@ -0,0 +1,48 @@ +/* + * Simple Virtual Timer Test + * + * Copyright (c) 2020 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include + +/* grabbed from Linux */ +#define __stringify_1(x...) #x +#define __stringify(x...) __stringify_1(x) + +#define read_sysreg(r) ({ \ + uint64_t __val; \ + asm volatile("mrs %0, " __stringify(r) : "=r" (__val)); \ + __val; \ +}) + +#define write_sysreg(r, v) do { \ + uint64_t __val = (uint64_t)(v); \ + asm volatile("msr " __stringify(r) ", %x0" \ + : : "rZ" (__val)); \ +} while (0) + +int main(void) +{ + int i; + + ml_printf("VTimer Test\n"); + + write_sysreg(cntvoff_el2, 1); + write_sysreg(cntv_cval_el0, -1); + write_sysreg(cntv_ctl_el0, 1); + + ml_printf("cntvoff_el2=%lx\n", read_sysreg(cntvoff_el2)); + ml_printf("cntv_cval_el0=%lx\n", read_sysreg(cntv_cval_el0)); + ml_printf("cntv_ctl_el0=%lx\n", read_sysreg(cntv_ctl_el0)); + + /* Now read cval a few times */ + for (i = 0; i < 10; i++) { + ml_printf("%d: cntv_cval_el0=%lx\n", i, read_sysreg(cntv_cval_el0)); + } + + return 0; +} From patchwork Tue Dec 12 12:18:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753049 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1867963wrs; Tue, 12 Dec 2023 04:21:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxEW4XhQUB1jpKWBTye8zd/Mp4GfA/5194a1Nmuxkh2BiL837HCWhFTHH0d1zULx3d5K3k X-Received: by 2002:a37:c444:0:b0:77f:6ec:4b0b with SMTP id h4-20020a37c444000000b0077f06ec4b0bmr7082675qkm.140.1702383666605; Tue, 12 Dec 2023 04:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383666; cv=none; d=google.com; s=arc-20160816; b=JOtydWY+HGtOCKGhI0aTJJnQ8htSf6zx3VjRGsKSgAJeTuzKc7q0yshCOJlH5bCjwe C5K+Ik3Xn6hvINkUAgmbbnsx03+3l7yzL+AUFSZw5CZn0O4WDXhLobhLa3XjNK3E36dr gs0HQMsatGATInAxc8pSqXms+cKzU1GY6pN+0Oc4rZB2pPIx9Yb32m1cDp21+bEPJWB+ stKxTcyEHcczrPE+3sHGvITxF/xmxVVxAl1zZDT3OZX7HUXTp43yZDuf7clzgZeQXhhL QEmmiYj950pnN2VEdVQdxeRSOIVrj1tV4Kom05RNp9B0nuqLXsKMORynfn4IWVswGxb4 EfYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=qGQz/jE/sFM047+EWZMtPX7y9WaU6Lnbw5Cw9Csejk0=; fh=PenDYrn8i21Yvsbn+uxcw5oiVY7iec7IJ9Kf8KemhZE=; b=prkAOaR2ERu+c+c7HxbqQmk4Wy/wbNbvNHZyjHO+AegXD0bMvaxDoDtLIqSIlvceV/ WESIXyOpeaO3rnfkWjkuF5mqeh0vE628BIknnl6IzQlv5fKFq/ENrZV/zSAOVmT3+OQB lJQEe5M34XVB1ZADv9N/NpZd6aHEdFu6bmLd0KZfb63+ihjNLhA1QPwKTwosZIGM+t/3 ObdUNXPP2qXc1RvRil1cn2MVWE8GsqiMFWqcShPF0lX2vwLJbhp1FQsUHeJbpVqTAbog mqE6JEiCCynS4bFDsWfwkAy9KZcfcKx9PMe5P04RpSyleyV2T73f7NFiRB1k2gHFSxPq 70Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bq42-20020a05620a46aa00b0077d98c41377si11043014qkb.442.2023.12.12.04.21.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1k5-0006Xb-Mt; Tue, 12 Dec 2023 07:20:06 -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 1rD1jy-0006A1-Fe; Tue, 12 Dec 2023 07:19:58 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1jw-0000UR-K1; Tue, 12 Dec 2023 07:19:58 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0E2DE3AF05; Tue, 12 Dec 2023 15:18:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id C66293B953; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003450 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Auger , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 17/31] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize() Date: Tue, 12 Dec 2023 15:18:05 +0300 Message-Id: <20231212121831.1003318-17-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 8077b8e549 added: DEFINE_PROP_ARRAY("reserved-regions", VirtIOIOMMUPCI, vdev.nb_reserved_regions, vdev.reserved_regions, qdev_prop_reserved_region, ReservedRegion), but forgot to free the 'vdev.reserved_regions' array. Do it in the instance_finalize() handler. Cc: qemu-stable@nongnu.org Fixes: 8077b8e549 ("virtio-iommu-pci: Add array of Interval properties") # v5.1.0+ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Message-id: 20231121174051.63038-3-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit c9a4aa06dfce0fde1e279e1ea0c1945582ec0d16) Signed-off-by: Michael Tokarev (Mjt: fixup hw/virtio/virtio-iommu-pci.c for before v8.1.0-2552-g41cc70cdf5, "virtio-iommu: Rename reserved_regions into prop_resv_regions" -- so now patch subject matches actual change again) diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 7ef2f9dcdb..eab6e1c793 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -95,10 +95,18 @@ static void virtio_iommu_pci_instance_init(Object *obj) TYPE_VIRTIO_IOMMU); } +static void virtio_iommu_pci_instance_finalize(Object *obj) +{ + VirtIOIOMMUPCI *dev = VIRTIO_IOMMU_PCI(obj); + + g_free(dev->vdev.reserved_regions); +} + static const VirtioPCIDeviceTypeInfo virtio_iommu_pci_info = { .generic_name = TYPE_VIRTIO_IOMMU_PCI, .instance_size = sizeof(VirtIOIOMMUPCI), .instance_init = virtio_iommu_pci_instance_init, + .instance_finalize = virtio_iommu_pci_instance_finalize, .class_init = virtio_iommu_pci_class_init, }; From patchwork Tue Dec 12 12:18:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753053 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1869530wrs; Tue, 12 Dec 2023 04:24:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7kwV1wWdQuzJ0bJHehRT8jGp3X4WdOogyNw5if7TL+5fyCwOuuFPhxfuoENqr+w1lB34s X-Received: by 2002:a05:6808:6507:b0:3ba:ad9:9ed7 with SMTP id fm7-20020a056808650700b003ba0ad99ed7mr3792839oib.109.1702383865895; Tue, 12 Dec 2023 04:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383865; cv=none; d=google.com; s=arc-20160816; b=zGXCDwXyxIC3lKBgUM2o4sbAPl51ESo0JZwVGBiziQRq+ITrh/AIq/UKH2tW84jvdy 8Mpaar71jvpnqBTTZ5XAkunBmRWOWBF8wtu1QiAtwgZsSysAYv48YWXLUsmNJjp+CdTN hL9bhxxSsFQ6ygSBVXFMKXpS2LpLzFNO+gVSSgI1RiQ0u+j1oZyCDE3SCdw7/jbO5QtE AErW20BYg4jaWUZnWp7pPv4BTC/U9W1zJFqI90p4aHkhSpiq/S9TxhKMsA+9rDIBmhT6 ArSReO/i8wX4vt6umQMgK2A01FujVhHoa3NkO5xveZ+1uhSSogqLBeOewq6pKlPeuP5C WzxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=dFRWswkCk1rwH5QyWUG1sIeSPJbYvSHERQCXqz+munE=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=aJ75w3113P6By9X7EcFWwaUcJl1tsDgxMGAy9W1Vq0n07qtZVnUmvqW+ALQztghs1u W5kM0qBmZMHyICrEHpHzjiZqMM4tT5SliAqyv0jaOYuPnm8JcceVQ/MWVBanucB/afFu 1t7zPXKTZ4zBp0gnmwMJaoFD/vGKi6WD5GEB5MJBnW1PQL25W+zDyG/bvvFTsaPeM3Dw IkXg1xujH9rao3NVxMVfxsc9nD6msaw0kU0UGRpNfNED0TuH4JlKrjC2Hr11vT22fOty K+bef61IOa3PyB1hafIwcpJq17Z6d1r94QWswX6YjX4gICn64uPiuEvMvAQOVEcWbZ2Q SpkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v11-20020a05620a440b00b0077f75c6421esi4830008qkp.637.2023.12.12.04.24.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:24:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1ke-0006zM-UO; Tue, 12 Dec 2023 07:20:42 -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 1rD1kK-0006kq-Pl; Tue, 12 Dec 2023 07:20:24 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1kI-0000Uo-LX; Tue, 12 Dec 2023 07:20:20 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1F00B3AF06; Tue, 12 Dec 2023 15:18:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id D96C33B954; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003453 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 18/31] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize() Date: Tue, 12 Dec 2023 15:18:06 +0300 Message-Id: <20231212121831.1003318-18-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 4fb013afcc added: DEFINE_PROP_ARRAY("oscclk", MPS2SCC, num_oscclk, oscclk_reset, qdev_prop_uint32, uint32_t), but forgot to free the 'oscclk_reset' array. Do it in the instance_finalize() handler. Cc: qemu-stable@nongnu.org Fixes: 4fb013afcc ("hw/misc/mps2-scc: Support configurable number of OSCCLK values") # v6.0.0+ Signed-off-by: Philippe Mathieu-Daudé Message-id: 20231121174051.63038-4-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 896dd6ff7b9f2575f1a908a07f26a70b58d8b675) Signed-off-by: Michael Tokarev diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index b3b42a792c..fe5034db14 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -329,6 +329,13 @@ static void mps2_scc_realize(DeviceState *dev, Error **errp) s->oscclk = g_new0(uint32_t, s->num_oscclk); } +static void mps2_scc_finalize(Object *obj) +{ + MPS2SCC *s = MPS2_SCC(obj); + + g_free(s->oscclk_reset); +} + static const VMStateDescription mps2_scc_vmstate = { .name = "mps2-scc", .version_id = 3, @@ -385,6 +392,7 @@ static const TypeInfo mps2_scc_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(MPS2SCC), .instance_init = mps2_scc_init, + .instance_finalize = mps2_scc_finalize, .class_init = mps2_scc_class_init, }; From patchwork Tue Dec 12 12:18:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753051 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1868279wrs; Tue, 12 Dec 2023 04:21:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVTS8pi2+ePX5VuQsP9+NubUyi8bQl7j3KEQOGrEsWloBtn6qyeskxt4voUpnJRq/v3WFy X-Received: by 2002:a9d:638a:0:b0:6d9:da51:b9f1 with SMTP id w10-20020a9d638a000000b006d9da51b9f1mr6082395otk.74.1702383708942; Tue, 12 Dec 2023 04:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383708; cv=none; d=google.com; s=arc-20160816; b=dE1+B58DSKrbbpWI1vCOy3XOMG9n2THgeQOJUfGVMzs2jdEnPKqsMVdqdw6t/o42g4 sfNIQyie9Qfp3Oqs75C9Nu3Xn/fbNfPdmimUxZcuFaIiD5T/3dJF5JOovqfFoFzlp9VY ZTuW1Fvv5WBfpLqQdDLEZr2mw4iR0wojWa88Jd5ld5ArjYGpzsmCmk9zYiihEmEtLLLs XRdI0gtaOb1da6SELJOpMAbwiG1l0LCW8KK0bJU3qgPeaRqoxbeL38rknV+6Kjuauwei QaAtzYToo0+BSuOJPNrseGLBC9j8lPCLAu07X6tWBODTtwTLHtF3wGfvsOi/p/UMkP2R yqOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=QVsVIhkXJ5k2cGp2GaYl4TJPY+fNWnyuUIYWW4EhIwM=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=jWcgw8frcXckhCUudZZEjs5nnwuYW7oj78x7BRWG7Y+ikRO30J04Va4R63fC1C3meo FTaQu/jS1l8yLfQpwMxgLXaqcLgWjB2KDtmuPdt0Vqr0HTBUrEE1k77YL9lVFbaKZT/C Lv5/wCWjIRodlfAXA9tXqsQMzT5j5rIbTcxOMxMmiiCuFlxqIE6oU6vbFt2qIigmiqEe KOr562gCaEFZ8PFhIEOT8cw/prRkbqSdq15KnL9u6PFC402TDIph8oJSnCoXfGIpeidY 7lJ5LiCH0iMOHNsKooUHrL0m8I16jOUfECgREaIhMx4W0AmxTVT0wFNF2sxcvx/Crtto QJAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w8-20020a0cef88000000b0067a261b50fesi10058819qvr.320.2023.12.12.04.21.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1kg-00076C-Q5; Tue, 12 Dec 2023 07:20:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1kN-0006rK-LT; Tue, 12 Dec 2023 07:20:26 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1kJ-0000V9-Rd; Tue, 12 Dec 2023 07:20:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3054A3AF07; Tue, 12 Dec 2023 15:18:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id EAAAF3B955; Tue, 12 Dec 2023 15:18:32 +0300 (MSK) Received: (nullmailer pid 1003456 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 19/31] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize() Date: Tue, 12 Dec 2023 15:18:07 +0300 Message-Id: <20231212121831.1003318-19-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 68fbcc344e added: DEFINE_PROP_ARRAY("read-only", XlnxEFuse, ro_bits_cnt, ro_bits, qdev_prop_uint32, uint32_t), but forgot to free the 'ro_bits' array. Do it in the instance_finalize handler. Cc: qemu-stable@nongnu.org Fixes: 68fbcc344e ("hw/nvram: Introduce Xilinx eFuse QOM") # v6.2.0+ Signed-off-by: Philippe Mathieu-Daudé Message-id: 20231121174051.63038-5-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 49b3e28b7bdfe771150d05c4b5860aa7854a4232) Signed-off-by: Michael Tokarev diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 655c40b8d1..f7b849f7de 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -224,6 +224,13 @@ static void efuse_realize(DeviceState *dev, Error **errp) } } +static void efuse_finalize(Object *obj) +{ + XlnxEFuse *s = XLNX_EFUSE(obj); + + g_free(s->ro_bits); +} + static void efuse_prop_set_drive(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { @@ -280,6 +287,7 @@ static const TypeInfo efuse_info = { .name = TYPE_XLNX_EFUSE, .parent = TYPE_DEVICE, .instance_size = sizeof(XlnxEFuse), + .instance_finalize = efuse_finalize, .class_init = efuse_class_init, }; From patchwork Tue Dec 12 12:18:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753052 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1868565wrs; Tue, 12 Dec 2023 04:22:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IESJq7IJwcBzD8jWDEQkT1AvKaz0qQ+lpY6LgrjoCnyLbE429+QMUJLE5tszD755xLCPGhy X-Received: by 2002:a05:622a:1308:b0:425:8b43:29e9 with SMTP id v8-20020a05622a130800b004258b4329e9mr8603389qtk.33.1702383744931; Tue, 12 Dec 2023 04:22:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383744; cv=none; d=google.com; s=arc-20160816; b=Nu436hZBxLeUSBqq5UWv/dJ9l1qF+PP6e89ob9hGdgu7iYk7CuZKTvs4xViErvR78t LST6mjQ+l1OMVw/vzUnZR/CxMoUMhxC0OWqEukc/hJubjHLPPWh9fMf/lpxRrKt5tfx0 IkkLQs1FVbrHku3rS26EBEXIwfOy6ZJ8UIhuKHIGIvSxlDeu3vdotRXTMA3d84ZNFIxW 9dcbxeyXAX22ykC+ZHav6+mNmOo8Rf2+Du4J/f/34jcH36sXgbyGpQpiaj77F8z90umB 9HfZwrASgEJ3E1ZWuPmcdrkjBswlmriSnTUbx614IIoauDkJDy7iLns2cWE3c8K7JBek jSfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=8Dw1cdwwP/OzDQZ8ldHmvY36ECfWJKMAA4KFmXSINA0=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=a3lDhG1WL9UMxZZySxuZ5vTCAyBpzAqBZ3B1VTv8Y5WSlUxdMlXpTGU6u+R+2R4SMK G331vgrZwWt+A2ekxj7jR50IeTFxXDVd7nclHraKD8L2dsu0DglKfiAI3Ej9fps2gujd xm+pj1ZwCS0U0potOFEZMsw/x8K2+v86kLQ8k93KHTaxdupXrWi4/k9FIPRL6nCm/nHY 8TrDRhffvcxrIMz2YqcMl6g8rNtziR+ymthnHQ0aacHvdf4twBc8mEcKzsq01GLi0Fe/ MPmfYintysVmpK0/rAMtcLsI7DoizB+L8YN6LrWkXEfmiqWRr06DBhqYwmaRK1pAIiLH YQAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fg6-20020a05622a580600b0042581018839si11617970qtb.785.2023.12.12.04.22.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:22:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1kj-0007Hb-Ir; Tue, 12 Dec 2023 07:20:45 -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 1rD1kS-0006tx-6L; Tue, 12 Dec 2023 07:20:32 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1kN-0000km-Pf; Tue, 12 Dec 2023 07:20:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 410213AF08; Tue, 12 Dec 2023 15:18:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 071F63B956; Tue, 12 Dec 2023 15:18:33 +0300 (MSK) Received: (nullmailer pid 1003459 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 20/31] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array Date: Tue, 12 Dec 2023 15:18:08 +0300 Message-Id: <20231212121831.1003318-20-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 9e4aa1fafe added: DEFINE_PROP_ARRAY("pg0-lock", XlnxVersalEFuseCtrl, extra_pg0_lock_n16, extra_pg0_lock_spec, qdev_prop_uint16, uint16_t), but forgot to free the 'extra_pg0_lock_spec' array. Do it in the instance_finalize() handler. Cc: qemu-stable@nongnu.org Fixes: 9e4aa1fafe ("hw/nvram: Xilinx Versal eFuse device") # v6.2.0+ Signed-off-by: Philippe Mathieu-Daudé Message-id: 20231121174051.63038-6-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 4f10c66077e39969940d928077560665e155cac8) Signed-off-by: Michael Tokarev diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse-ctrl.c index b35ba65ab5..2d2dc09526 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -725,6 +725,13 @@ static void efuse_ctrl_init(Object *obj) sysbus_init_irq(sbd, &s->irq_efuse_imr); } +static void efuse_ctrl_finalize(Object *obj) +{ + XlnxVersalEFuseCtrl *s = XLNX_VERSAL_EFUSE_CTRL(obj); + + g_free(s->extra_pg0_lock_spec); +} + static const VMStateDescription vmstate_efuse_ctrl = { .name = TYPE_XLNX_VERSAL_EFUSE_CTRL, .version_id = 1, @@ -762,6 +769,7 @@ static const TypeInfo efuse_ctrl_info = { .instance_size = sizeof(XlnxVersalEFuseCtrl), .class_init = efuse_ctrl_class_init, .instance_init = efuse_ctrl_init, + .instance_finalize = efuse_ctrl_finalize, }; static void efuse_ctrl_register_types(void) From patchwork Tue Dec 12 12:18:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753054 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1869541wrs; Tue, 12 Dec 2023 04:24:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcbzXTh1rn/xZjPvkqFhqie40jjHAuLeJWBomAJHxArD2GQ1xwz4LDnOt9+OzJj5HWc6iL X-Received: by 2002:a05:6808:3a19:b0:3b9:e0f1:809b with SMTP id gr25-20020a0568083a1900b003b9e0f1809bmr10082359oib.49.1702383867077; Tue, 12 Dec 2023 04:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383867; cv=none; d=google.com; s=arc-20160816; b=s0idY4pvlbP1Bd+tXlO1ZXtO/UnVGxFvfBK+7oBxNpX7sJbSo1iczdst8O/6qzpgor b9pVFoj6tEh5WK7zfGYFVLrKSDI3KMSaUMgt/Q1ICteJHfe/Mg7vvmSmkkUCpupN0bnK hsJnVO7WpBlq81z/82wLQqblfHqZgT5Nb1MiJHSaLyDfQYwj/raT4F/yHaVcdMWfFTgI JH4ufYceE3CgonyqpQGPTaRoMh3Cri0wLLkgv3YBjwN4FPpLvT6ERXUCypyC4/SVuwdV QCqfhaRge1abAz260o8aBlp2/FEbEd7Zj6N0eAlfdFzx0cVSgVjEetDpe1pG6FFidgzM zcIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=YzUe1S2S8/20FSjVYGU7XIdDItxJeWpNeL9XX9jTpkc=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=sCAUzpknmAJ2nmhkddG0WdzldC7TYKyP1kIRQrbYG3583ZekzgyhIgP1I34j6oLqsc qho8TF09VJPbz3NFzS4V4cSvmCIyMcG6HmuPw0JtLE7LS62yq8pviLr/wVxPNyq7Pgu/ 6qbTjomRv7roJ7w7KVeNxM5P+Hvzq6cszfRf4DLNZRpFclgrj/KDTd6ajet86EC0k9OG dpdqCda2haEcNf8wp1OKlg5SHqmGdmdYwQit3LN0XXYqKrKOsXUqjyJET5WRUWvowZeO 42Nee2bpyaRC2yv/ZQKKHkTPNRcVfu3ALNglr0MM8XsdqAl++H1dvhE2uU+xM8+6PW7Z oByg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dp12-20020a05620a2b4c00b0077419b27790si11156845qkb.97.2023.12.12.04.24.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:24:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1kr-0007dR-CR; Tue, 12 Dec 2023 07:20:54 -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 1rD1kT-0006u1-W9; Tue, 12 Dec 2023 07:20:32 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1kP-0000mi-PL; Tue, 12 Dec 2023 07:20:29 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5161B3AF09; Tue, 12 Dec 2023 15:18:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 17B373B957; Tue, 12 Dec 2023 15:18:33 +0300 (MSK) Received: (nullmailer pid 1003462 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 21/31] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field Date: Tue, 12 Dec 2023 15:18:09 +0300 Message-Id: <20231212121831.1003318-21-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé The VirtioPCIDeviceTypeInfo structure, added in commit a4ee4c8baa ("virtio: Helper for registering virtio device types") got extended in commit 8ea90ee690 ("virtio: add class_size") with the @class_size field. Do similarly with the @instance_finalize field. Signed-off-by: Philippe Mathieu-Daudé Message-id: 20231121174051.63038-2-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 837053a7f491b445088eac647abe7f462c50f59a) Signed-off-by: Michael Tokarev diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index edbc0daa18..c663fb2570 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2388,6 +2388,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .parent = t->parent ? t->parent : TYPE_VIRTIO_PCI, .instance_size = t->instance_size, .instance_init = t->instance_init, + .instance_finalize = t->instance_finalize, .class_size = t->class_size, .abstract = true, .interfaces = t->interfaces, diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index ab2051b64b..47c83edd28 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -246,6 +246,7 @@ typedef struct VirtioPCIDeviceTypeInfo { size_t instance_size; size_t class_size; void (*instance_init)(Object *obj); + void (*instance_finalize)(Object *obj); void (*class_init)(ObjectClass *klass, void *data); InterfaceInfo *interfaces; } VirtioPCIDeviceTypeInfo;