From patchwork Wed Dec 13 13:00:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753514 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp179877wrr; Wed, 13 Dec 2023 05:02:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqY53ZuMGNN+gbQtsyVKP2kw4OcCYPFpMzXjLGH7Z7hO9J1zofjtawRy9SWg2lJbV4r8py X-Received: by 2002:a05:6102:4429:b0:462:e85b:b812 with SMTP id df41-20020a056102442900b00462e85bb812mr5854818vsb.24.1702472520901; Wed, 13 Dec 2023 05:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472520; cv=none; d=google.com; s=arc-20160816; b=LMHJ5JkndJ5psn5XDm/RZwHwU7Gp17f+AwqGxIkEqnCjgKapAgdu28+ZLphv19HRJS AkKdTvEIGbMReDdEfKEqy20SuhZGgScGIo/Ap0DIufakoU0bxnuR3yTTe0I7jcwixmK8 Aayaxa7PcSJxTT6KDnZBuxvBlT6CLo4qdGO3/yhF2EGFXygazXiN4nRQHV02HUc7FmWn zDhYa0FBFCNEbmQalT0ivzlamVnV29GDwmUEbWKp6+dUFJPle4L5TjjqB3A1toLnSQYr CROEv29H5dITPyIBhTrXAtjMqLBeE02RMsRkEj1MsEuX5x7whtman1ioF1zn27l+jwR/ B/QA== 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=K8gPhr1FD/cvkQM6331HoX0spR7yBwstoXyhogezqFk=; fh=TbI2pklXwlJGmj6m7lZZgI+jTnI/L5qcZuxsjME8SeI=; b=VzOgAwVQx2Jl2G+R5cXUfdN+OWpvrT7Bxog18shcBahaEOdiVwitKlYiV6ED2m3KG6 +9o3Ok7JU2DuQDWl4sIzex6YsENAs0Nxbb9/8Y8EUt+3FBa1d6He4YvAP1G0gZX7ooWJ hxE5rOXTxsz8hVOBpnaIRTgBavBGNDLqlJQk2PcimM9glB0mb87FCgdPYF0IXpapjCX1 fKJBD/FBGHbiCGkd/jbOVbhlfMnR64zVOu4A0NWlHn5u8Ojb7hMdh0KDEeq8Tp7lqfMr WeVvdOmUacimOCmZj07oKh3HSzqA02jiFRszWryuIWLXziZ7ZzHC2a5IH+Lq0AZMkwmC jmMw== 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 jm26-20020a056102199a00b0046495f8f98csi64460vsb.235.2023.12.13.05.02.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:02:00 -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 1rDOrW-00083H-Qt; Wed, 13 Dec 2023 08:01:19 -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 1rDOrF-00082D-6I; Wed, 13 Dec 2023 08:01:01 -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 1rDOrC-0006so-UZ; Wed, 13 Dec 2023 08:01:00 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B83F53B434; Wed, 13 Dec 2023 16:01:00 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 5B99B3C8C5; Wed, 13 Dec 2023 16:00:41 +0300 (MSK) Received: (nullmailer pid 1024696 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 01/24] target/arm: Fix SME FMOPA (16-bit), BFMOPA Date: Wed, 13 Dec 2023 16:00:10 +0300 Message-Id: <20231213130041.1024630-1-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/sme_helper.c b/target/arm/sme_helper.c index 73dd838330..8856773635 100644 --- a/target/arm/sme_helper.c +++ b/target/arm/sme_helper.c @@ -1070,10 +1070,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; @@ -1106,10 +1105,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 Wed Dec 13 13:00:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753518 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp181619wrr; Wed, 13 Dec 2023 05:04:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmMvdOVsQSiusT1qQ5jDd2Waje4OCjSJ+9ncZT2jqSRSTB+bSH92tITvVgPrH2GYCzM1hH X-Received: by 2002:a9d:4d83:0:b0:6d9:e48c:f08a with SMTP id u3-20020a9d4d83000000b006d9e48cf08amr7828144otk.11.1702472672838; Wed, 13 Dec 2023 05:04:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472672; cv=none; d=google.com; s=arc-20160816; b=tmK74hI1SJYyX8b+YIHT1jwT0ebQr5nXgKsOcWhtX87dxZjEgmv6X8d/rg0tA+hWDr GAzVXWl+xyFUXnOHOnHhLRbXjHK3Y72uG7DrijU6XWNvYDfsUC6FES7S7813UuNmn5c8 hpB/peY55Bmkd018k8GkATGDujlNSMA+MbnDLbYJ+Ux96XtroSKamGWAwjTt674WZCm1 zIIvbDaVtnhBP7g9qvyhBXz8IBLgFV7NkOv7IhkYftZV42DsfEPw8bw6Mv21Jm+g4mJ1 IyKTKEDtT4ihDpnLx/k8I9LARfgdjiz27GB+rwuc0C9KQFtA10Cb003tXs2dHfw+6PVi qaUA== 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=KSapHoclk05OMTp0e/WRCGLPZFnJDfbbyExzt0bPku8=; fh=bMaafE1clBtiBaCrlbrbcY1DSEPhhFUklUk4XoVHiPU=; b=Jd8lu+vWN+TfuAAVBCj1idwGGuaJAceMQDiTOPau0HQAgPIbILx3SJUv1+0TgNjIrF ydVoDJjc36JgwQHHBGE6VhuQP7Bstc9ybTTcWQyRTsh6QvI0f12GFUis6KjZB+c6jTe5 CoEaS+qTNBOxVWuj3w3L51VVKz0k/oHtRe5crUXgrkiw2SxpIqCo+cSzdMBEFYPAEfAI AsDfmrFhxGmRq+GyaV9ByyUw7696MdzZjruGMFK3Zp9Qqhsx30WmOyaa1OEpacZSftIG vKxcktbraGfkEUlGrNfzeVoZIJHxZAY6WX+69dPNu4pOeCIH3HLBkDtDPXsehrhKycWy eWiQ== 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 n13-20020a0561020a8d00b004649590ba65si1809422vsg.771.2023.12.13.05.04.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:04:32 -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 1rDOrr-0008DX-DP; Wed, 13 Dec 2023 08:01:39 -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 1rDOrP-00083v-4O; Wed, 13 Dec 2023 08:01: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 1rDOrM-0006y6-Rr; Wed, 13 Dec 2023 08:01:10 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0D9783B438; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id A88F73C8C9; Wed, 13 Dec 2023 16:00:41 +0300 (MSK) Received: (nullmailer pid 1024708 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Michael Tokarev Subject: [Stable-7.2.8 05/24] linux-user: Fix loaddr computation for some elf files Date: Wed, 13 Dec 2023 16:00:14 +0300 Message-Id: <20231213130041.1024630-5-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 c2c095d383..87895847ec 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3001,7 +3001,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 Wed Dec 13 13:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753517 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp180923wrr; Wed, 13 Dec 2023 05:03:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEu9uxYYQYlmon/Wu5n7aLqCqEQaYZQB/AJxAQEz/aJJ8vsuIXXpnmc/VgUdarHzOzrewJU X-Received: by 2002:a05:6102:152a:b0:464:77f2:560 with SMTP id f42-20020a056102152a00b0046477f20560mr6867832vsv.50.1702472614709; Wed, 13 Dec 2023 05:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472614; cv=none; d=google.com; s=arc-20160816; b=0xueAQPdC6C4TGdaesQQQ2plHVgYH9iWtCZowW1cRWrfeFabMqtAzCjVidzC30X+xv CpmjfuJNmbaZIF1/NmqYlm/UxUBRZ8/eBCCf5YHB8o3jcBSvbEk3kkCilGTsnRo4Fp7z p7pJ/suKDwsQDETDjvKOxU/SngsWEycyHTsdCzq2yr8hWWAJRCvDnnVBXGcdVVXI8fJG 4sDnQHVL/mCO+YFHctSlYsB86jysZfmmKbnY111GQIF2IGmGc3Tb+trOgE1oZJZJ7eFq tXxn8YLnErL9bcoQhLPtx+ALCZJCGec0CH364MXxesPlRPu9kBfZUWkklkLsOCcxxOtd gmZA== 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=nl4/hS4VO/xDdkkV5qlHSP/CSafLdl6mm7fanExUM00=; fh=vzu4N/2bQ935L8afgPSM9lExt7+xxv+LGh8guf0KM30=; b=JUF/4e6ubr+WOQLPH+LU0nkztKd3LZZw9A3sTLO3h260uqOuQlFcR3UTH7v00E6o5v mburBerDeo6lkiTpADPJfKHUHx9SQwF0AEzYSTnWafFqAug0U5oqinklvZHxJsDB2Fyz q+Fdr2XcVldj+Iu72J2UYlzje5zRrDT5cVhWMf/+/JEdHwI9p3aVgJSdpJXL78YIc1sN QVNo6fx3pIUqTeYC15laXv5eDxJgVtC07kM/xcW8P4hW240dms7jeCB6ezgBR2kz7c2b qGqwxrruVejBVa0cp1/qUaIiSBxi91SSt2ZIbZk+vic51/D6GiVcTzBt5remaV+zVY1L 3m5w== 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 n19-20020a67f113000000b0046567d19c46si2230729vsk.500.2023.12.13.05.03.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:03:34 -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 1rDOrv-0008FE-A8; Wed, 13 Dec 2023 08:01: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 1rDOrT-00084i-Hj; Wed, 13 Dec 2023 08:01:18 -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 1rDOrQ-0006yu-RC; Wed, 13 Dec 2023 08:01:15 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3199E3B43A; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id CAF893C8CB; Wed, 13 Dec 2023 16:00:41 +0300 (MSK) Received: (nullmailer pid 1024714 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 07/24] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility Date: Wed, 13 Dec 2023 16:00:16 +0300 Message-Id: <20231213130041.1024630-7-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 8cad156aa0..98c26ecf18 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -990,7 +990,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 ded7f039c1..5f88ff300b 100644 --- a/tests/avocado/version.py +++ b/tests/avocado/version.py @@ -21,4 +21,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 Wed Dec 13 13:00:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753515 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp180309wrr; Wed, 13 Dec 2023 05:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmyMIPzJegnY7XYuqtQjtbfek6gOSA3X5rI8wCMPqKZcwmdCsh0YpIWUm4dfZypRfuXSlS X-Received: by 2002:a1f:6e85:0:b0:4b2:c554:d2be with SMTP id j127-20020a1f6e85000000b004b2c554d2bemr4722669vkc.32.1702472555987; Wed, 13 Dec 2023 05:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472555; cv=none; d=google.com; s=arc-20160816; b=D69yxRAPEm0Ta8Dzc1Orl0gglI0gisUytZPjwlPr5Hv9v0cUVcbPkbJD6KzWhHvBN1 UOu2EZy5xjWx51iRq8k/NYuj27vSXtaRZvDxS7K8HE/95c8vi01D8e3T8dn5Zg2K5aWj mhReHvti2F+n8PAM87YoTcw0wuj9Xp/nrNm2us2pi+xOkwV027YyYZzs5mt81ulbNN9y BNlxYii8noAiU95oYHZPyF3k8EqBgbhVks+ONRE7qPkzcqyh76FTkaMtBkF9OElWM+Ut yVkaYFdnOYlAVWyOQQe8Oi8oL84RgW/numrqEvBd5mXM/Z0fLnOItGFiMSloohRJ3GBM wsXA== 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=8yDx4xbuGu/4ocDLsuLjxLn84LhpahMIdffo6TGyMmY=; fh=xJ1URYKcMN3TM0/XAv5v+aCN+5tIbzAdcfBx5UNgoLw=; b=WaLmYtAHfRG4C6qJ1HdZVQDENBjAqDTECA1Cx30/NA/K4/nxs4kah23pLDgAxZEqoW RFpeEjB7Fm7RcArpu+bThDAvVzXqqAXJhb+kmhp6B/AhO0bQpHHG/DUryduKOISFrXX0 bj8WhqZwl/uvmtarxoic5WVy2uMzNbjSGrk+ERRKUIGXYODnGJtV2glquujocAFYrJrJ 5vTQk+GkDpXlF/w7XaNmQ+Zz9LO8J7+SDaSzAtCkUvut2q83g7eQtGJHGADT+aFSz5O9 /btvy1sgYdK1fMgl/H1w0Bnn37J2YFhEMRwS+DerycxFYoxmNwp3UBubtHpz2SZwZygY UfcQ== 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 z64-20020a1fc943000000b004b3280bc7e1si2286532vkf.209.2023.12.13.05.02.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:02:35 -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 1rDOs6-0008KA-KY; Wed, 13 Dec 2023 08:01:55 -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 1rDOrY-00086H-G0; Wed, 13 Dec 2023 08:01:22 -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 1rDOrV-0006zZ-Cs; Wed, 13 Dec 2023 08:01:20 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 424EC3B43B; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id DBD0A3C8CC; Wed, 13 Dec 2023 16:00:41 +0300 (MSK) Received: (nullmailer pid 1024717 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev Subject: [Stable-7.2.8 08/24] target/arm: Set IL bit for pauth, SVE access, BTI trap syndromes Date: Wed, 13 Dec 2023 16:00:17 +0300 Message-Id: <20231213130041.1024630-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: 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 73df5e3793..15334a3d15 100644 --- a/target/arm/syndrome.h +++ b/target/arm/syndrome.h @@ -212,7 +212,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; } static inline uint32_t syn_smetrap(SMEExceptionType etype, bool is_16bit) @@ -223,12 +223,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 Wed Dec 13 13:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753516 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp180791wrr; Wed, 13 Dec 2023 05:03:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGIf+6pokc7TzYEP17Z4/IEOeKZXk+xBH8U8Bn587iwmAqglZ7vLRITD3KHC1OBm2q5xF/ X-Received: by 2002:a05:6102:942:b0:464:77f2:55e with SMTP id a2-20020a056102094200b0046477f2055emr5240070vsi.48.1702472604128; Wed, 13 Dec 2023 05:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472604; cv=none; d=google.com; s=arc-20160816; b=tvWnSlnCQvl5vHllJ1+YSc9BaG6oO4/+lmxmkC9hj1TwcCQSs46g5d3thCORvFvyqk nWDnsntJNTN3DGwaBD21lks0aQFp6SaRt/8F9iG0ZvKIV31+51TJ/M/rPKBz1i6W+Iqg 7c1i/iNXl4Vp13VrMxQZPzNpfuE93Zn3oO9GJrgdFwSAfQmhRxDsxtWdBzaUFrV8Zpzq mdUPDsY2y69UlL8h+6Qe4x9odUtBLodnfHbY3cJuVcxrbx8ZHYyeWlwjMuJQXNY3Efw/ 7irjjHadg6KR51/RgwvrcPWBicbkfxG3ZF7yxPt9pnf873CoSqREWHrqJ5og7UHuAeb4 cpIQ== 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=lJWAMthOA6eztsEC1KHFx/RlzP4/8utwBirF3+80DaN20XKd8CeZVqoeriCUicB/B8 T2zdVAETuVh3wSZPUWz6MLyl/uVskyDQGj53j07NTO1m7rt2TPKZyeFfN2R/k5rnsy6O V5ZZ2++VvyZclgsq2HFdw+9J1RMpNnQH5Xh4M5FbBkvNjaZFQVVC5YP/HjZaUCLACp3F 358+XdmM1dz/nprt1HKACyukTQyv0Z5qb0Wi5mWkJeP31KnL6Dsh3f9poiXrIhG1jnLe EgMO2NDPEWl97V3Nez842zZx+QK4103eHT/9ROoSSDmBFNr3t37v59uYz04268YdRA7k 59zg== 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 l27-20020a056102051b00b00465fbc32655si1989740vsa.33.2023.12.13.05.03.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:03: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 1rDOs1-0008IU-JJ; Wed, 13 Dec 2023 08:01:50 -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 1rDOrY-000865-Al; Wed, 13 Dec 2023 08:01:22 -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 1rDOrV-0006zd-Cm; Wed, 13 Dec 2023 08:01:19 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 54C683B43C; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id EC9683C8CD; Wed, 13 Dec 2023 16:00:41 +0300 (MSK) Received: (nullmailer pid 1024720 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 09/24] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize() Date: Wed, 13 Dec 2023 16:00:18 +0300 Message-Id: <20231213130041.1024630-9-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 Wed Dec 13 13:00:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753521 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp182285wrr; Wed, 13 Dec 2023 05:05:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxeDSy5VLqKjCswV0BmNxnqUaSlkF0Go+xQkgf6pCbYfP8JiBbYCZf1NZ5WzsgEE3x+t2K X-Received: by 2002:a05:6214:9c6:b0:67a:a721:e118 with SMTP id dp6-20020a05621409c600b0067aa721e118mr8081444qvb.69.1702472746228; Wed, 13 Dec 2023 05:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472746; cv=none; d=google.com; s=arc-20160816; b=TUP/2mtOqBvQ3jDY5ehKkOrXmmSWEOC9SGrUFDSy1wXCzRtVc3wyYwCLGkQiPOZIxc 6QYC9631+VWOLBc7Y9CcL/N83QGJwqudQUGG/134NhiZhuGVzE9uU1W3vF7/PNPJARyu QZ+DUKphi/KiewiO+WqmnimH7rlEuGRLz83syH5OqFOC28ng8IJZsHH597FcWRKQsesW IrBfSKCFRdUA/feK9X+5pYycbbVuUf6ZSn4WxygBWkJsli71n6UkoQNCRxU9XzMVR0Fe nkU2D2Pom4hdsSd5H28S5syViA0w6tPU3Az5yGY7uYgCLoPKkQ9BZ/DEgMnKollVIw7V e42A== 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=PCSZirTv5yRPBZI2VHyXMksIdAVIFvtFnn21W4lmPpyNMj2eclUGSehYa1jdpyIYS3 gzNZddkYfWb3YBWNa4akGVZMrSOeXbIUOWfmvD+SqUnRZ8xmO7KFIQDDy9CT/gNmcBti KXeBb2yvS6ONLyH1hABT3TDIR+Fn2joeZouf0+yeHtEiHeg+OrxlChjNKKJ1F2xqJEu6 HCzuQvG0wBL6bkgbWAwLWlxpJTxWKG/894L/Rtzk28fLATOiBxArTreRf81NnqpLUZkJ P12cGfKfXD1qQpXwOuuIIlDqXxkR8vmr7oY3RoyXj2c8pK/A/TUReGkwLVBkDm0TUfsx kHEA== 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 x14-20020a0ceb8e000000b0067eb0003116si2392916qvo.162.2023.12.13.05.05.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:05:46 -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 1rDOt0-0000og-HG; Wed, 13 Dec 2023 08:02:58 -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 1rDOrd-00087t-Th; Wed, 13 Dec 2023 08:01:30 -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 1rDOrZ-00070W-Lu; Wed, 13 Dec 2023 08:01:23 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 65B393B43D; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 0B0613C8CE; Wed, 13 Dec 2023 16:00:42 +0300 (MSK) Received: (nullmailer pid 1024724 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 10/24] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize() Date: Wed, 13 Dec 2023 16:00:19 +0300 Message-Id: <20231213130041.1024630-10-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 Wed Dec 13 13:00:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753520 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp182147wrr; Wed, 13 Dec 2023 05:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGo41bxjsyftniVNpXvXeBf0xRtSgta1BJmJhqo6sEulqCBYBJtDYk3lvhkHBsOf+zFQrtx X-Received: by 2002:a05:620a:1201:b0:77f:521e:3d91 with SMTP id u1-20020a05620a120100b0077f521e3d91mr5460523qkj.10.1702472729740; Wed, 13 Dec 2023 05:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472729; cv=none; d=google.com; s=arc-20160816; b=ULpx9T22ZZ0XOzz/bPTU4DqA7FdGBpyH63KBOOIfC6WxGvLWGA2uFLBL9ygi8cvVXI I7xZoU2QBhYvrDbRTPVbiNiIuNrlcAKk2n0Wz0bKqxeya8VDqjyg/Rkgizee7B2HIF8v owCOpEPiq+7c1kAugA2h3E1zfNQ9dY3r91Bu5epURCXMIQ0CZSixY2ALQpOO+nzhjr9w wb+ZifHbqAlQ7dXqbmVY3rXF9ETNQgEvmP0/X3dFtQ+kCtsLcm22JFwXIGozYVNv1Cke 27rrX+Dg4iX6IoFBoBudBEPjUFenyRKgSpGpBEFnoKEPFx4uq114kL7z4E2Sa4HNvn+z c7Ig== 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=BwVc1iQSyUKIp0kMokNOwrjr/w0VEla96D+AwFuRBsw=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=z+CY8gEAKdD02Nw3AyiCL7gduivd0UWYL9sd8h1BDo9UKGmMJMQAoud2mcLxaXfHOv 0Ex0R6Rz9iFTi8oZDEyZJu2ugghIlVu074QqgOAFtj/hlAmhmkOHJ+gKsapwGNI6mBC8 Pzv4+9wJxseGPZY85cehhZQNP48Ivspw1BuW/KWqWWiUjpXE6IBJJj1OhGXE9lwcxKlp EAZejP5p2zx1YJi9OnSVsBuH5UWN3+iWn3owSKajxR64VU1UzUG2mmc3pB3cuzIKD6VH nWPNaFs3H4bvX5y6XzRTSpKoC2lNV7Fgc50+7pj2IisPUlv3KhErlOiK5YLQ8Ay/hK7m AKrg== 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 ew4-20020a0562140aa400b0067ab786a0absi12514230qvb.566.2023.12.13.05.05.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:05: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 1rDOtV-0001Wb-HP; Wed, 13 Dec 2023 08:03:29 -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 1rDOre-00088K-If; Wed, 13 Dec 2023 08:01:30 -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 1rDOra-00070b-Bh; Wed, 13 Dec 2023 08:01:25 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7677D3B43E; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1C0B33C8CF; Wed, 13 Dec 2023 16:00:42 +0300 (MSK) Received: (nullmailer pid 1024727 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 11/24] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize() Date: Wed, 13 Dec 2023 16:00:20 +0300 Message-Id: <20231213130041.1024630-11-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 fdfffaab99..aff5254129 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -217,6 +217,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) { @@ -273,6 +280,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 Wed Dec 13 13:00:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753524 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp183130wrr; Wed, 13 Dec 2023 05:07:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3ydOSUIj6ItIP5Ij+JUl2yJCAw3pDZ0Fe/eb/Pq/JeD96qChUBPFKuvvpDVynEUgVJ4Ot X-Received: by 2002:a0c:d802:0:b0:67a:bf83:7510 with SMTP id h2-20020a0cd802000000b0067abf837510mr9349178qvj.20.1702472831755; Wed, 13 Dec 2023 05:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472831; cv=none; d=google.com; s=arc-20160816; b=uXDBUZoJIBlDjwJGXWM1/063fQzOcc+UaBBDDW/z5Bbnga6zErAPomSs1tLI3O2n1M TgN7XFuFvPnUzaUCfZE1W3ZX0wBBr/PphgdR3NC5mJvY8jX2eTi1nFRjhdqnxZtz1A5m lr3lj3KwUP9JYKKdqxY6ltwMmJGKCaXFzvFJ9uVAfA/ZuGUiai50gvjbjyVaA66D3V6r VFMSOG4krexxzTKaTjy4B3WubF1itQkFpSPeN9RZd1evrzEf/7qj1Uohuj6qSCjpVsf2 2ZnfJFlKZ6r/gMs0s77sLH0iQ9ZNhWR7lBkN2b96P9/U1OBpAlYacGaUQ4o+hJqZ8VXd a3cA== 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=pQ1mjrOCOAXhybtzfE2AdrG2LEbO5sdYEii66JI9289I7p2sFrsb3lQSys9rRmRkEC 1jByIyhRg2Qni1TKep2k8jH6kd1VMrvIi/FwSThB+RliTtVxMcIebF8xkgs+NhrJFiXF vF7sUcrqa5vTinQXYejU2Nakeir48yn7JcsW9Z70Z+Ynay2WfJZupDqrgVx7n087a7rK Lz5JMHLhU4EPYKkJP9202URINH+yp8AIILoc7V7ELeWQkHY14kX/RxUYUFJ8/I9TK59N mOMQhj86Zl8JwebUNv+27O/a9FNOozc4aEP1FWeYwHN/FICOiMf9IxaESl7MOBbBX13F RMQw== 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 pn20-20020a056214131400b0067ed674a853si7291708qvb.312.2023.12.13.05.07.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:07:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; 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 1rDOsl-0000QH-04; Wed, 13 Dec 2023 08:02:35 -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 1rDOrh-00088d-4E; Wed, 13 Dec 2023 08:01:30 -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 1rDOrf-00071K-BZ; Wed, 13 Dec 2023 08:01:28 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 875473B43F; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 2CB6A3C8D0; Wed, 13 Dec 2023 16:00:42 +0300 (MSK) Received: (nullmailer pid 1024730 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 12/24] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array Date: Wed, 13 Dec 2023 16:00:21 +0300 Message-Id: <20231213130041.1024630-12-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 Wed Dec 13 13:00:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753523 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp182862wrr; Wed, 13 Dec 2023 05:06:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtgNcLS2F6IsFwKOsrE0D9qRdsKzpQt/Z0ioMoP2SAR8UZQWOuMMTOcg0KYA3dZlquP7U4 X-Received: by 2002:a05:622a:100f:b0:425:4043:18ce with SMTP id d15-20020a05622a100f00b00425404318cemr10272462qte.129.1702472805044; Wed, 13 Dec 2023 05:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472805; cv=none; d=google.com; s=arc-20160816; b=TNchj7i2cTK+pxgYFB1xeBJ4ZR1D57hM9SLOYrsoZhdJq/Q2uzAQsjVFm/Fdlfiw9R 1rLtb9FuDaZ8wf1nydaXYyOjGqXeSXFJiK4yiX0p3oqcx6Fkxcr298HK2zAHvm+1SxUP KtjDU7i3a/JPWviX2ShGsy8GHCtf6p8oErvOBYiRrLvts9aN4pB8yuUifmf/6xnPSflO BnHPEKnIUGKypHVB9s30ttR1TRiDNcUvyw8j5oIoZqUKqqXri6pZGT1O4DFjrYDIOKkX HbWhUV6YzLqEhuUEnjFzPxPuTjpYCS15Pp7eqOYHcJIRvt2wvLU4KNAXz5KiETKKbgSI nUVA== 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=5oSHHGZEw4PLKCQJS6InwM2iH7O4/DqA0n/Q0Nb0IR8=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=qpjZ3DC8cUF3jkhgMS0lolM9mbFAjlgLXR6U+6/N7gILCPQddSiKByK4QNR7XmqoyF Of1tohlZYBOkH0dD+4GC6VfpWAfhwMG4wctp02jVx3bSXx0mawJCglrOj1HefnBMdnoG y6GLrimPNmHzQQhl62ZGjkQrDtO28zf+Y87qvs5hLfhPASSsFVkngMKfL/8M+nbsOwpS 3TPtMgGnNdnSnyXFDQnMQHY6SoE1c5ZtJvO+wkK/aiRsQGqMyXsPe5EOGnb2duG3ymKQ JeeyICDlBgV88txxNI2LjcNIB0E8rlUZtKcrXECdUSKm133+sq1VK3IwYun/QkLZ+H3z ludg== 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 s7-20020ac87587000000b00425525e7db8si12174191qtq.461.2023.12.13.05.06.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:06:45 -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 1rDOtP-0001QG-Ce; Wed, 13 Dec 2023 08:03: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 1rDOs1-0008Il-Ok; Wed, 13 Dec 2023 08:01:49 -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 1rDOrz-00071U-Vc; Wed, 13 Dec 2023 08:01:49 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 97F8B3B440; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 3D6DB3C8D1; Wed, 13 Dec 2023 16:00:42 +0300 (MSK) Received: (nullmailer pid 1024733 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 13/24] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field Date: Wed, 13 Dec 2023 16:00:22 +0300 Message-Id: <20231213130041.1024630-13-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 67e771c373..e5e74a7160 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2174,6 +2174,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 938799e8f6..c4676ff4d4 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -241,6 +241,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; From patchwork Wed Dec 13 13:00:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753522 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp182353wrr; Wed, 13 Dec 2023 05:05:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIW0Igmt8L6b0okDfDrEMiOyNxg5PwV5nIZeHDgluWXE4fPvaEQfc8/lxwKTKgRiZVW9zA X-Received: by 2002:ae9:e311:0:b0:77d:c606:2ea2 with SMTP id v17-20020ae9e311000000b0077dc6062ea2mr9421025qkf.45.1702472754045; Wed, 13 Dec 2023 05:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472754; cv=none; d=google.com; s=arc-20160816; b=VIptGUzmGBZ8jCy1qoRoxCIw02ugAPEA5zLxFYbli6pmKk6L8wpC698d+xQMdDOYp3 gNPZTURTqR8bYHQYbU1u610LAwRwHRRP40wy7dx/KGhzwz3qWWS0l+1E9VMX05Ra+SU+ OOcuWYG95orKYzMkYWW/C2f+Rp0O2Cme4w5d4tcS2fVWfdJIIDS0/1pMeLhjyIVtZvSo dlMlmEGABksP7ToQ9vvks4P8jMl8ifOx4yl61EidlNvbKzJ8RFatyYvTmbx4IOfwjdUP hK4lTGp8JFCFgKwEpKXfxYKpBMZFbD8NK85fR906VcmXkXVCqSu7roVJffljBKd2Oe0Q 8A8Q== 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=QfO6UZq38FuBV0mMZy++WNf0yGn+aYWDoGCpDwjRfEc=; fh=GJzGCCXYftWbcJ02hVUf5c8QKNV7/o9dHGXXBrGmTXE=; b=zKTI+gHU6pV24efsNDuq8/aM0/ENcfdctk/AvxJnwEDxKvKOHg30NmGwB/JWl4TEpV 2UIHPDuETAc4MzwRGwcen/tJUunFmDWnKCB2ylCm4CMheLYE7wygWTjS0EwZ5Bm1e85y cD/lhtYTcYy1jSnIaY7qX425o4k/3IjQIRvqXL0IW5q/3xVE+C4FIWyi2xcFXztLBgHB xMt5P4Wpc+v7x5N5eljN1mOjQnmUNPdhRbxzYL6PiAFWtVRJLTrOl9fSz2RSWbxpcpkX 56nPsfZl96aJfU0aHZNvu/piSNtX7j9SxCreS8xf3JNnLiseIZ/irM76rh9eVuKzpuEu Lg9w== 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 d28-20020a05620a137c00b0077dcfd4d7a9si11705595qkl.8.2023.12.13.05.05.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:05:54 -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 1rDOtg-0001kz-PL; Wed, 13 Dec 2023 08:03:34 -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 1rDOsA-0008LD-MN; Wed, 13 Dec 2023 08:01:59 -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 1rDOs8-00076O-Pl; Wed, 13 Dec 2023 08:01:58 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B2C503B445; Wed, 13 Dec 2023 16:01:05 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 564533C8D6; Wed, 13 Dec 2023 16:00:46 +0300 (MSK) Received: (nullmailer pid 1024769 invoked by uid 1000); Wed, 13 Dec 2023 13:00:46 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S . Tsirkin" , Michael Tokarev Subject: [Stable-7.2.8 18/24] hw/acpi/erst: Do not ignore Error* in realize handler Date: Wed, 13 Dec 2023 16:00:27 +0300 Message-Id: <20231213130041.1024630-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é erst_realizefn() passes @errp to functions without checking for failure. If it runs into another failure, it trips error_setv()'s assertion. Use the ERRP_GUARD() macro and check *errp, as suggested in commit ae7c80a7bd ("error: New macro ERRP_GUARD()"). Cc: qemu-stable@nongnu.org Fixes: f7e26ffa59 ("ACPI ERST: support for ACPI ERST feature") Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231120130017.81286-1-philmd@linaro.org> Reviewed-by: Ani Sinha Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 20bc50137f3add52eb4788b420d717de27fed14b) Signed-off-by: Michael Tokarev diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index aefcc03ad6..2e057b1800 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -947,6 +947,7 @@ static const VMStateDescription erst_vmstate = { static void erst_realizefn(PCIDevice *pci_dev, Error **errp) { + ERRP_GUARD(); ERSTDeviceState *s = ACPIERST(pci_dev); trace_acpi_erst_realizefn_in(); @@ -964,9 +965,15 @@ static void erst_realizefn(PCIDevice *pci_dev, Error **errp) /* HostMemoryBackend size will be multiple of PAGE_SIZE */ s->storage_size = object_property_get_int(OBJECT(s->hostmem), "size", errp); + if (*errp) { + return; + } /* Initialize backend storage and record_count */ check_erst_backend_storage(s, errp); + if (*errp) { + return; + } /* BAR 0: Programming registers */ memory_region_init_io(&s->iomem_mr, OBJECT(pci_dev), &erst_reg_ops, s, @@ -977,6 +984,9 @@ static void erst_realizefn(PCIDevice *pci_dev, Error **errp) memory_region_init_ram(&s->exchange_mr, OBJECT(pci_dev), "erst.exchange", le32_to_cpu(s->header->record_size), errp); + if (*errp) { + return; + } pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->exchange_mr); From patchwork Wed Dec 13 13:00:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753519 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp181819wrr; Wed, 13 Dec 2023 05:04:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwiTnjYkMefDya473nqDcmfBuFxQOFB1re/SBU/R9cDWKsR4r/RcQ1freYyx4DNFlxJj2a X-Received: by 2002:a05:6214:1145:b0:67a:a721:8303 with SMTP id b5-20020a056214114500b0067aa7218303mr9374304qvt.93.1702472695289; Wed, 13 Dec 2023 05:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472695; cv=none; d=google.com; s=arc-20160816; b=CstxvKzfzWUJwzSypdK/8QSRYlJeSFRSmDIYyNir8gLuWHOFrBGRDbGWjd9KJekqu0 Tks6TNlgpWWybBp3yovEw7vwgUgFUYTs41Noc2TmN6EsTqUs6eBc+OSyh4IbUmYKJETS PdzI3qQLeBHKucPEbTGhvySJ9F1JW7hY7CVbKXYNtB/AE47ON9H16prXITggTXsZksq/ 4BXMtA4F4+jntav7vkWXj5KtwO8jlCnZDKQuDzGQmVHnIBHZpbfNfwME+OOaS5nFC1Fj OUhzkhJ/NB2Kq1s7/oi6h9GH1rxrKMmL73xEJZd4W4DXov3sO7E2C+Y5jxq4v6jrJk+D brwg== 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=oQS5kruPWNrWN/rjnuBYGOiICTmX0kCqICs8/CP/ztY=; fh=xJ1URYKcMN3TM0/XAv5v+aCN+5tIbzAdcfBx5UNgoLw=; b=RgtofI4yE5k0NUtZJUBybW1yASjkN0bs39GCD7Zbvsp+6qzRu6cm5XJhKB0hqFLRTj vmoJoadoMz7agTL6oGcalg66R4xX/iy38J2vvX0AoX7EsCZUqxmabZTdilYWEG8Ma7wZ hJnXQtsGJHpgxgwA0eO5C3DNfEsd0ZiqLBUphVSW3iEDAKdqRrWcwRLEhC4NjYXb0+/r Z24UnofnKUrUs3QOTAaSq5i1y+h0Y1TZV6w4GuRxdnQwTFvz3G4Sn1LdYH6sJuTdzn1j FKgT/6iFDT+4Szf4qRGV2f+qKVYnN9CDIpmKb5IDk2rWqoB4B+MVm0U1GVb0mJPMdBG1 tU6A== 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 eb7-20020ad44e47000000b0067effdafcb6si491996qvb.119.2023.12.13.05.04.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:04:55 -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 1rDOuS-0004Ab-46; Wed, 13 Dec 2023 08:04: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 1rDOsm-0000cB-L8; Wed, 13 Dec 2023 08:02:37 -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 1rDOsj-0007Cg-IQ; Wed, 13 Dec 2023 08:02:35 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 15DF73B44A; Wed, 13 Dec 2023 16:01:06 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id AEE5A3C8DB; Wed, 13 Dec 2023 16:00:46 +0300 (MSK) Received: (nullmailer pid 1024784 invoked by uid 1000); Wed, 13 Dec 2023 13:00:46 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev Subject: [Stable-7.2.8 23/24] target/arm: Disable SME if SVE is disabled Date: Wed, 13 Dec 2023 16:00:32 +0300 Message-Id: <20231213130041.1024630-23-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 There is no architectural requirement that SME implies SVE, but our implementation currently assumes it. (FEAT_SME_FA64 does imply SVE.) So if you try to run a CPU with eg "-cpu max,sve=off" you quickly run into an assert when the guest tries to write to SMCR_EL1: #6 0x00007ffff4b38e96 in __GI___assert_fail (assertion=0x5555566e69cb "sm", file=0x5555566e5b24 "../../target/arm/helper.c", line=6865, function=0x5555566e82f0 <__PRETTY_FUNCTION__.31> "sve_vqm1_for_el_sm") at ./assert/assert.c:101 #7 0x0000555555ee33aa in sve_vqm1_for_el_sm (env=0x555557d291f0, el=2, sm=false) at ../../target/arm/helper.c:6865 #8 0x0000555555ee3407 in sve_vqm1_for_el (env=0x555557d291f0, el=2) at ../../target/arm/helper.c:6871 #9 0x0000555555ee3724 in smcr_write (env=0x555557d291f0, ri=0x555557da23b0, value=2147483663) at ../../target/arm/helper.c:6995 #10 0x0000555555fd1dba in helper_set_cp_reg64 (env=0x555557d291f0, rip=0x555557da23b0, value=2147483663) at ../../target/arm/tcg/op_helper.c:839 #11 0x00007fff60056781 in code_gen_buffer () Avoid this unsupported and slightly odd combination by disabling SME when SVE is not present. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2005 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20231127173318.674758-1-peter.maydell@linaro.org (cherry picked from commit f7767ca301796334f74b9b642b395a4bd3e3dbac) Signed-off-by: Michael Tokarev diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 38d066c294..6cf7a33591 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1498,6 +1498,16 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) return; } + /* + * FEAT_SME is not architecturally dependent on FEAT_SVE (unless + * FEAT_SME_FA64 is present). However our implementation currently + * assumes it, so if the user asked for sve=off then turn off SME also. + * (KVM doesn't currently support SME at all.) + */ + if (cpu_isar_feature(aa64_sme, cpu) && !cpu_isar_feature(aa64_sve, cpu)) { + object_property_set_bool(OBJECT(cpu), "sme", false, &error_abort); + } + arm_cpu_sme_finalize(cpu, &local_err); if (local_err != NULL) { error_propagate(errp, local_err);