From patchwork Sat Sep 9 10:27:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 721085 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200779wrp; Sat, 9 Sep 2023 03:30:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIMZIluXY+GzvslyvThClLRsM5+Sc+KVzfFdvex9mVT+CFyTslTntDeGcCrxp3MHI/n2zR X-Received: by 2002:a05:620a:b5a:b0:76d:b2d9:ae4b with SMTP id x26-20020a05620a0b5a00b0076db2d9ae4bmr5050997qkg.13.1694255441585; Sat, 09 Sep 2023 03:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255441; cv=none; d=google.com; s=arc-20160816; b=z6vabqjw1bumJyZoCPU9aKEz1x0HQphwtHFUBADc3DHmUO/Mm52l5jnIFuPfamc7Sl aVh8wNAHfkegu02ljKzLmLfZ5m5LW717rY09/3+9cu8jUa2Mfy/jrzIrNPG6GO8GT5Id SoS8i8ASqMiEyqi7nUFlT/Oy4bIUOpwHiCz7/2YJPN/DXRUcG+9wgZek5bbXfGum4F+e IGikCucyR9SqXCdXLndHT7phyCfgu1PMPKSRn3Zcerwk9kLmrv0o1dV1pJL9hunis7TA kVDfmDWAWWuBcHkUV+bJ62NNd3ARZy52Ax8Hmm7R882p9eTRps/Qosrebu1iu5LQZ4sN pj2w== 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=IATqqqODT0sHsvp31DTxx3fQ9qytytuXXLWv8sA8TaI=; fh=TbI2pklXwlJGmj6m7lZZgI+jTnI/L5qcZuxsjME8SeI=; b=ozD5vTqlerLgKvBhDVpB6j3Q/jLAgyhkVNt6JGq+mePawtZj3hSsyDEjHc/oaAnOFN 2clNw0z6axz97ESsLaT198ND8rxjG+NqpjZO8mjrOh2FR927skvQl72MD6YHzKnI8FFp vdZpZ1/yD+GjbfrqZrm7vcsm4VuUdlQ82iNPSrUMYwF9SzM8xhWic50jCLvN02MjX74J RUXosjDtLA6Y6Ajtt5BvZHwoR+dZ1D5IuG4XQJru8ualHBrsJ9aCbx8qUhV4Ttb1yJXK 7FT7GAob3Juv5HlyemMrHfFWUOqp7yLVPnoh8qEWaPqTKJM3EroANB3mm82LOB4UA+p/ ZFTA== 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 qg11-20020a05620a664b00b00765ae950bb1si2067261qkn.499.2023.09.09.03.30.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:30:41 -0700 (PDT) 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 1qevCG-0006zX-2I; Sat, 09 Sep 2023 06:28:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCE-0006yO-JR; Sat, 09 Sep 2023 06:28:10 -0400 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 1qevCC-0004SN-5f; Sat, 09 Sep 2023 06:28:10 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id AFD112049B; Sat, 9 Sep 2023 13:28: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 AFC2626CF9; Sat, 9 Sep 2023 13:27:57 +0300 (MSK) Received: (nullmailer pid 346646 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -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.1 08/34] target/arm: Fix SME ST1Q Date: Sat, 9 Sep 2023 13:27:01 +0300 Message-Id: <20230909102747.346522-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 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 A typo, noted in the bug report, resulting in an incorrect write offset. Cc: qemu-stable@nongnu.org Fixes: 7390e0e9ab8 ("target/arm: Implement SME LD1, ST1") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1833 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20230818214255.146905-1-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 4b3520fd93cd49cc56dfcab45d90735cc2e35af7) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/sme_helper.c b/target/arm/tcg/sme_helper.c index 1e67fcac30..296826ffe6 100644 --- a/target/arm/tcg/sme_helper.c +++ b/target/arm/tcg/sme_helper.c @@ -379,7 +379,7 @@ static inline void HNAME##_host(void *za, intptr_t off, void *host) \ { \ uint64_t *ptr = za + off; \ HOST(host, ptr[BE]); \ - HOST(host + 1, ptr[!BE]); \ + HOST(host + 8, ptr[!BE]); \ } \ static inline void VNAME##_v_host(void *za, intptr_t off, void *host) \ { \ From patchwork Sat Sep 9 10:27:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 721086 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp201703wrp; Sat, 9 Sep 2023 03:33:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2iSgcD4zZQxExMLB1LC70D7sNUH+9wOaHdaU79N2uQS00bQgQ8axgxVo3wIJyvAuXRxW8 X-Received: by 2002:a0c:8c43:0:b0:636:39ed:4dce with SMTP id o3-20020a0c8c43000000b0063639ed4dcemr4382460qvb.20.1694255626723; Sat, 09 Sep 2023 03:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255626; cv=none; d=google.com; s=arc-20160816; b=1KvtRJ3jR+pzUypxvIYhwVQX2YkjaZo0wYJAQxk3aOgru5lzqHsLCsgbdsfmheMlYA e53yjdJxQzvvcvL6xnIZ+YTujBnP6jT5Lc3NvO33xciBMWOD5xkbpHQVOPYMlLdkuGil 3MQXEnKr0RmjBSg8SOt/oIo0mR3CYXhnbMKtvGMsrOSel+fRuNWLj0bMkEeUnJedr+uP 6XtrfWqFZe4dvuHAA5gauRp/ASjPkm+6aL7g2BpOcz7PA+EeYxJbIi4F3IwYgueDIbe0 XDcl+NqLbZ8Qdx7mH8U7JqwYSW2PArRG0CFH6rMIEtglP9IL2yF5IArH7Zk9b2ae1LSw XIRA== 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=j5gl96AuTRLrjyO8732q85WK+1oxCJLJpMouFFWN9xA=; fh=TbI2pklXwlJGmj6m7lZZgI+jTnI/L5qcZuxsjME8SeI=; b=eaQrn2jyAJuhniJhPlPtV5jky+w0ec+ESCs9uFnQpBZv06C18e2yPsgY5tU1FFUvoM PgG/yFosY5UG94LXmmDdKZQa+NUymSMT3JMwbOI6F7t1Da4d6KO4jFGCJTkxt9A9hy5V Pzj0m4RCysVmMY4KLl9WrqmKIh8rVxtfuxo0OUdWTFqrzvavUnUfwBta5C+DGfq5Zdap qBnwUoMDSTtPF2ky4rerFHwlmO9cNim+A4ASCBrIhz119e49g/CyhMJU4V5rOac5XgC9 7r8UHkHyQx+IInhYmtYWfxopeUJjA0koX1Dlg1eqVbKMJZrM400iovyCRXIXLlIquOFS iBcw== 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 b4-20020a0ccd04000000b00651679eff67si2322504qvm.438.2023.09.09.03.33.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:33:46 -0700 (PDT) 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 1qevCK-000742-LY; Sat, 09 Sep 2023 06:28:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCI-00072H-Pc; Sat, 09 Sep 2023 06:28:14 -0400 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 1qevCG-0004T8-0Y; Sat, 09 Sep 2023 06:28:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DEC4C2049C; Sat, 9 Sep 2023 13:28: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 DE45726CFA; Sat, 9 Sep 2023 13:27:57 +0300 (MSK) Received: (nullmailer pid 346649 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -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.1 09/34] target/arm: Fix 64-bit SSRA Date: Sat, 9 Sep 2023 13:27:02 +0300 Message-Id: <20230909102747.346522-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 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 Typo applied byte-wise shift instead of double-word shift. Cc: qemu-stable@nongnu.org Fixes: 631e565450c ("target/arm: Create gen_gvec_[us]sra") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1737 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20230821022025.397682-1-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit cd1e4db73646006039f25879af3bff55b2295ff3) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index b71ac2d0d5..39541ecdf0 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -3053,7 +3053,7 @@ void gen_gvec_ssra(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs, .vece = MO_32 }, { .fni8 = gen_ssra64_i64, .fniv = gen_ssra_vec, - .fno = gen_helper_gvec_ssra_b, + .fno = gen_helper_gvec_ssra_d, .prefer_i64 = TCG_TARGET_REG_BITS == 64, .opt_opc = vecop_list, .load_dest = true, From patchwork Sat Sep 9 10:27:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 721083 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200628wrp; Sat, 9 Sep 2023 03:30:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErSloyNZ7UgL2b1ZARsXgtKRhKHnbVs+pph4CtHSbyadVoIUZqUOMYOabDUbDJcQVyj8jn X-Received: by 2002:ac8:7e8b:0:b0:412:1773:8d57 with SMTP id w11-20020ac87e8b000000b0041217738d57mr6204195qtj.58.1694255417392; Sat, 09 Sep 2023 03:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255417; cv=none; d=google.com; s=arc-20160816; b=s7tH3b9F3ibVkLYM1dRmVU7HkH5r2ZPN5HkBrAbaVXNqo5C2Wi4wqWddInl4NDsRrj Y0MMtXKKnGJqmeBH1AJqfYjePTzYsgLb7T+ZZjsgNqYVkfOpqVnqMlPrNZmh5AGNxzzh PhJ3IZQIr7YyJTO6WHtX2KWGaAJ7NdJpunZBgusuGXOXRlbvW9dVgBdR099u3CefkhCn /dLtFXb4DnperWqTP2tF80VzPaJ1h9aKoNYUZVucJgjkwHbDYN7l9WqmcApE6hKOdkRq J0psRxGKodEub3un3staNBh6ysMjOEUQRHtLy99Gr22VYXgaFKggmz5PItdZq+EL6kl1 OrOQ== 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=nwhJvISK0rQpnSHULbC00cEJOnuu/FFfzLkf2B/eWno=; fh=PgLyHC34FdwZ58BDtT1Uv+WTjjblmGAp7eLz3NtGEyo=; b=be1D9Ng9czc9n3ICfx3pMBqsiNb342nBmDeZ1JJWVRcJ204VeyjaPnHivxFNfTcdiS VNqqrMkgoedUJC9LU7YcqbPuB/BMSlDk4lqGf25T+beye/y9EbwmAVa120gt4YIRPCkB tyqsvqwFEO6SmI1EUPiDG+PX5tY018fXLILceVRMmwMMbe6JSvFu/J06zx6BkVIuJDOJ vWJDJ8MIn0AuGiKK64Jj+2KcxoNGUPV7iF+oz7NYlbneCvlkDyqAjWY+y9A44FEpQHZF 0mYSpK/OVbYGv3kvyfDslJ4ZY6kr6d5cRgwfU7COo4iSDWQfFKDi4TG+hSiMsyXDElSu kaJQ== 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 fi20-20020a0562141a5400b00649f944ef60si693104qvb.418.2023.09.09.03.30.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:30:17 -0700 (PDT) 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 1qevCJ-00072u-Qo; Sat, 09 Sep 2023 06:28:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCI-00072D-Lx; Sat, 09 Sep 2023 06:28:14 -0400 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 1qevCG-0004TD-4Y; Sat, 09 Sep 2023 06:28:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 196612049D; Sat, 9 Sep 2023 13:28: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 1835426CFB; Sat, 9 Sep 2023 13:27:58 +0300 (MSK) Received: (nullmailer pid 346652 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P_=2E_Berrang=C3=A9?= , Thomas Huth , Stefan Hajnoczi , Michael Tokarev Subject: [Stable-8.1.1 10/34] docs/about/license: Update LICENSE URL Date: Sat, 9 Sep 2023 13:27:03 +0300 Message-Id: <20230909102747.346522-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 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é In early 2021 (see commit 2ad784339e "docs: update README to use GitLab repo URLs") almost all of the code base was converted to point to GitLab instead of git.qemu.org. During 2023, git.qemu.org switched from a git mirror to a http redirect to GitLab (see [1]). Update the LICENSE URL to match its previous content, displaying the file raw content similarly to gitweb 'blob_plain' format ([2]). [1] https://lore.kernel.org/qemu-devel/CABgObfZu3mFc8tM20K-yXdt7F-7eV-uKZN4sKDarSeu7DYoRbA@mail.gmail.com/ [2] https://git-scm.com/docs/gitweb#Documentation/gitweb.txt-blobplain Reviewed-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Message-ID: <20230822125716.55295-1-philmd@linaro.org> (cherry picked from commit 09a3fffae00b042bed8ad9c351b1a58c505fde37) Signed-off-by: Michael Tokarev diff --git a/docs/about/license.rst b/docs/about/license.rst index cde3d2d25d..303c55d61b 100644 --- a/docs/about/license.rst +++ b/docs/about/license.rst @@ -8,4 +8,4 @@ QEMU is a trademark of Fabrice Bellard. QEMU is released under the `GNU General Public License `__, version 2. Parts of QEMU have specific licenses, see file -`LICENSE `__. +`LICENSE `__. From patchwork Sat Sep 9 10:27: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: 721079 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200319wrp; Sat, 9 Sep 2023 03:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhTQP8HxHz/pMbgN8Gh6ZSMFHBGUIMZ2UhUs8EBMuqcsv0/e7OOC7gP2sjj6/KZLVXQEH1 X-Received: by 2002:a05:620a:2a0b:b0:770:58e2:a105 with SMTP id o11-20020a05620a2a0b00b0077058e2a105mr6087363qkp.31.1694255361186; Sat, 09 Sep 2023 03:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255361; cv=none; d=google.com; s=arc-20160816; b=IdVkFr2Ioef2YmUKGm8d1l5EOj4iVtTOm5TKvrh+ioA8aXf5RmmEm3SP1wYNaS2Dmq XyWSgWZvS4B/jtudhVBgZToTurY7TiC8L1soafbeYAWXH7VV6u/l+9sVlmMAvGPeVHjl kjvqqZX0dBeYifYs6qfcx2Q2GPtZO1nYeAb1DccWRdweFUAOLV4rFJThEfzLcoGxmHYa wieCfKYH0p938bi2YuldoEvTr+WNtHuCj9OoIJpFV8h8c3Ya2mab045oVDmcu304eavL Hf+6dwlO9zhZWrBhrGy7Fqh/J+sbFnxB71jKeruw+X8yWmHIY5uNdlGQupUXa1/tOnu2 aR0A== 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=ypnDFDsJZIWzchMv879oWvP0Tad3AwBP4wXHdfVqt4g=; fh=fA8wXgZkOijV3QzeJqIqYxlGqKQb9nNVVJRQwjQ6hao=; b=tNPjfWX5wS/BisPtd78Iv+6+rYfUMDhRSypHTKmBtHuwwEIG/imH4wI909gAhvqUO5 gvEQPPIPMyoYNQ3L5uCXiDmIq7ILgA7P7AImwXnqJ3D2CJ23Yhx5FJW6F3PahPCJPm7/ EGoJ4/3rsuSAGuguBLPHj3is/ioAVQ9w1570jJM8TdbJGrAclNlOs6ttQKitlse1nt0M Hv95KdxYfRT12fHHPtB23wBlWIcB7imbpKAHjFe5Rf1IPRMIuUSSbVWXsrwS/96SVG4j l0ELAc1aKbIgH0r2qDOeYpPIiL7/LjLGSgTU+uUW4zTph8vmaUrY38pUvcpNxrAmXKnt I/wQ== 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 ot20-20020a05620a819400b0076daa65c8adsi2156292qkn.430.2023.09.09.03.29.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:29:21 -0700 (PDT) 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 1qevCN-00076E-Qy; Sat, 09 Sep 2023 06:28:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCM-00074z-HJ; Sat, 09 Sep 2023 06:28:18 -0400 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 1qevCK-0004Tw-2S; Sat, 09 Sep 2023 06:28:18 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 401682049E; Sat, 9 Sep 2023 13:28: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 4758926CFC; Sat, 9 Sep 2023 13:27:58 +0300 (MSK) Received: (nullmailer pid 346655 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9e?= , Michael Tokarev Subject: [Stable-8.1.1 11/34] softmmu: Assert data in bounds in iotlb_to_section Date: Sat, 9 Sep 2023 13:27:04 +0300 Message-Id: <20230909102747.346522-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 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 Acked-by: Alex Bennée Suggested-by: Alex Bennée Signed-off-by: Richard Henderson (cherry picked from commit 86e4f93d827d3c1efd00cd8a906e38a2c0f2b5bc) Signed-off-by: Michael Tokarev diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 3df73542e1..7597dc1c39 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2413,9 +2413,15 @@ MemoryRegionSection *iotlb_to_section(CPUState *cpu, int asidx = cpu_asidx_from_attrs(cpu, attrs); CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx]; AddressSpaceDispatch *d = qatomic_rcu_read(&cpuas->memory_dispatch); - MemoryRegionSection *sections = d->map.sections; + int section_index = index & ~TARGET_PAGE_MASK; + MemoryRegionSection *ret; + + assert(section_index < d->map.sections_nb); + ret = d->map.sections + section_index; + assert(ret->mr); + assert(ret->mr->ops); - return §ions[index & ~TARGET_PAGE_MASK]; + return ret; } static void io_mem_init(void) From patchwork Sat Sep 9 10:27: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: 721084 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200746wrp; Sat, 9 Sep 2023 03:30:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJjhxWGQxRPfRGYtZq1RYa9a/w8j3iPeK5QDuRliNp4FcklxMz4WSGZu3+ovfC6nk+sP8L X-Received: by 2002:a05:622a:1c2:b0:412:1e51:8fef with SMTP id t2-20020a05622a01c200b004121e518fefmr6911596qtw.30.1694255437139; Sat, 09 Sep 2023 03:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255437; cv=none; d=google.com; s=arc-20160816; b=B5TmV9nKT4NxtWnDy10pAk92Pp5G3/sjZXFKUrVrSICJr/TERQDL4FnVGGBqtmfAJf qOp9ihcK80ZiLymF8o4cpJ5ZbBCal8312QqM3Qz0d55UcUi+Zqq8lqxHiCawCTfpevxO dVswdEgqERhRI4MKRbMlf8kPLHi66fw9rF7yPDs+8TMMmqmAYKOidJMQ847GlFEkbS7a 4kz/JR0LK/qqZkPKPU5Py653Om9P4E7DlYKpPQ/240tnURrBii4HITHmz8p4iCdTM4zX 9qlUQQr2L4Y8yITsq5xXv28IZC9SHgYsTQUY94+7d3/jJ2//auX59YhP+OQ3h4m1HSzp TuTA== 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=0R8jeSBiOzixKARFXBI2sNvpbCleAKe6tLdmNbsL/AE=; fh=fA8wXgZkOijV3QzeJqIqYxlGqKQb9nNVVJRQwjQ6hao=; b=cybjgZlenwYZ072O7SarsCq9EkNFhEkbreCEhWebCY6ULirV4R78hrioAKkOrwu7zW bdDBLCMahcv4/z8Pm34a6i19DuchIsHh5eT36qDATE1o17aulyRHpjlVbTc6vA0tbDc5 SbML+eCz+KUkfRpV7DUShNL8dyUcf9v+CElCZn3RaHupm9MsJZcDT0YNzkaHOavzWQd/ FUYmHAFf1Q3B4CDZ3GShlOyywPxJVuCLEOpbGA9jYvgbnQQ+WPJAG1unSETcWxy2emzv cWSF//+z9F6hu4RpH1yiy+LfWraCKKIuOQmEo9UOgiYcLp89I1is5DfXAVWKqphTw7Ch 1fxg== 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 g6-20020ac87f46000000b00403bf9d2091si2296920qtk.363.2023.09.09.03.30.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:30:37 -0700 (PDT) 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 1qevCj-0007Nl-CP; Sat, 09 Sep 2023 06:28:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCg-0007Mb-US; Sat, 09 Sep 2023 06:28:38 -0400 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 1qevCe-0004U1-5Z; Sat, 09 Sep 2023 06:28:38 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6A8FE2049F; Sat, 9 Sep 2023 13:28: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 6E77E26CFD; Sat, 9 Sep 2023 13:27:58 +0300 (MSK) Received: (nullmailer pid 346658 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9e?= , Michael Tokarev Subject: [Stable-8.1.1 12/34] softmmu: Use async_run_on_cpu in tcg_commit Date: Sat, 9 Sep 2023 13:27:05 +0300 Message-Id: <20230909102747.346522-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 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 After system startup, run the update to memory_dispatch and the tlb_flush on the cpu. This eliminates a race, wherein a running cpu sees the memory_dispatch change but has not yet seen the tlb_flush. Since the update now happens on the cpu, we need not use qatomic_rcu_read to protect the read of memory_dispatch. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1826 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1834 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1846 Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson (cherry picked from commit 0d58c660689f6da1e3feff8a997014003d928b3b) Signed-off-by: Michael Tokarev diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index 9a5fabf625..7e35d7f4b5 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -33,36 +33,6 @@ void cpu_loop_exit_noexc(CPUState *cpu) cpu_loop_exit(cpu); } -#if defined(CONFIG_SOFTMMU) -void cpu_reloading_memory_map(void) -{ - if (qemu_in_vcpu_thread() && current_cpu->running) { - /* The guest can in theory prolong the RCU critical section as long - * as it feels like. The major problem with this is that because it - * can do multiple reconfigurations of the memory map within the - * critical section, we could potentially accumulate an unbounded - * collection of memory data structures awaiting reclamation. - * - * Because the only thing we're currently protecting with RCU is the - * memory data structures, it's sufficient to break the critical section - * in this callback, which we know will get called every time the - * memory map is rearranged. - * - * (If we add anything else in the system that uses RCU to protect - * its data structures, we will need to implement some other mechanism - * to force TCG CPUs to exit the critical section, at which point this - * part of this callback might become unnecessary.) - * - * This pair matches cpu_exec's rcu_read_lock()/rcu_read_unlock(), which - * only protects cpu->as->dispatch. Since we know our caller is about - * to reload it, it's safe to split the critical section. - */ - rcu_read_unlock(); - rcu_read_lock(); - } -} -#endif - void cpu_loop_exit(CPUState *cpu) { /* Undo the setting in cpu_tb_exec. */ diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 87dc9a752c..41788c0bdd 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -133,7 +133,6 @@ static inline void cpu_physical_memory_write(hwaddr addr, { cpu_physical_memory_rw(addr, (void *)buf, len, true); } -void cpu_reloading_memory_map(void); void *cpu_physical_memory_map(hwaddr addr, hwaddr *plen, bool is_write); diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 7597dc1c39..18277ddd67 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -680,8 +680,7 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr orig_addr, IOMMUTLBEntry iotlb; int iommu_idx; hwaddr addr = orig_addr; - AddressSpaceDispatch *d = - qatomic_rcu_read(&cpu->cpu_ases[asidx].memory_dispatch); + AddressSpaceDispatch *d = cpu->cpu_ases[asidx].memory_dispatch; for (;;) { section = address_space_translate_internal(d, addr, &addr, plen, false); @@ -2412,7 +2411,7 @@ MemoryRegionSection *iotlb_to_section(CPUState *cpu, { int asidx = cpu_asidx_from_attrs(cpu, attrs); CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx]; - AddressSpaceDispatch *d = qatomic_rcu_read(&cpuas->memory_dispatch); + AddressSpaceDispatch *d = cpuas->memory_dispatch; int section_index = index & ~TARGET_PAGE_MASK; MemoryRegionSection *ret; @@ -2487,23 +2486,42 @@ static void tcg_log_global_after_sync(MemoryListener *listener) } } +static void tcg_commit_cpu(CPUState *cpu, run_on_cpu_data data) +{ + CPUAddressSpace *cpuas = data.host_ptr; + + cpuas->memory_dispatch = address_space_to_dispatch(cpuas->as); + tlb_flush(cpu); +} + static void tcg_commit(MemoryListener *listener) { CPUAddressSpace *cpuas; - AddressSpaceDispatch *d; + CPUState *cpu; assert(tcg_enabled()); /* since each CPU stores ram addresses in its TLB cache, we must reset the modified entries */ cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener); - cpu_reloading_memory_map(); - /* The CPU and TLB are protected by the iothread lock. - * We reload the dispatch pointer now because cpu_reloading_memory_map() - * may have split the RCU critical section. + cpu = cpuas->cpu; + + /* + * Defer changes to as->memory_dispatch until the cpu is quiescent. + * Otherwise we race between (1) other cpu threads and (2) ongoing + * i/o for the current cpu thread, with data cached by mmu_lookup(). + * + * In addition, queueing the work function will kick the cpu back to + * the main loop, which will end the RCU critical section and reclaim + * the memory data structures. + * + * That said, the listener is also called during realize, before + * all of the tcg machinery for run-on is initialized: thus halt_cond. */ - d = address_space_to_dispatch(cpuas->as); - qatomic_rcu_set(&cpuas->memory_dispatch, d); - tlb_flush(cpuas->cpu); + if (cpu->halt_cond) { + async_run_on_cpu(cpu, tcg_commit_cpu, RUN_ON_CPU_HOST_PTR(cpuas)); + } else { + tcg_commit_cpu(cpu, RUN_ON_CPU_HOST_PTR(cpuas)); + } } static void memory_map_init(void) From patchwork Sat Sep 9 10:27: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: 721080 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200409wrp; Sat, 9 Sep 2023 03:29:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJIKHwpcfKZKZQJJVYjh3gRLL8HEwebPY5Prv7edpArXrh+sOjXz+sz6CGPstkZGuJbsYj X-Received: by 2002:a05:620a:2ac6:b0:76c:b682:f503 with SMTP id bn6-20020a05620a2ac600b0076cb682f503mr4745098qkb.60.1694255377407; Sat, 09 Sep 2023 03:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255377; cv=none; d=google.com; s=arc-20160816; b=gFawOXgCO6ZsoN9EMCZAKojhJOxbAcF9SjBZs1R5tcbdfqm19uqO8KU318XMHSXZKa wn5UCdfyZPdaUy3gKWt45fW3bMWKewlTCS9UWbEfGJNj2EaejeSHgSrqWd95SpdKX3kt lA/wHjXSrW+h34ISvkEznrO8ruDUg77wAenrdql2IWXCq0wZWiWF/5GqGHdlyLTRq6WU yA4HeXZXEwwMGRFNz0FSIOPkIVqFfM0ezZty5Xj724i2o2xZeg+iL9KV5kMsTW2zv0SB QKHj+j485l8s4e3KuBLODZSyz+xGoK6/NYV4A660vuT9JeYW+aU5aX2Nd9T4W9lOar8j reAg== 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=jfo8XNb8dVSi5eCHx8YeIoql8qfLwykXpyHr9mObziU=; fh=NYFo6XPkT4DRoX4o4xQY3FwVA26uVrJ9W3vyWAc1lUw=; b=QNauCswG+e1R/9u5Ob4sCX3B5FJ+dwbv5RBDmQx//17oOeEUSRI1ChEXwS3E+EnWFg iDGsHVsecbnwh9LWtqiko/uRLlhXjNdzhYw5LL/WvDeXd2XvLYv7dsbS0CJ4xyP43Nx4 /wJuoj5VChokHAJng/+MsicB4CYmA08EM1j8E4EacUcJLDu3N9bVFstzM+S6BuP0CPGS /htuPn/3/Lkf+NRx1v5eh/QmS4huBSgC0V7iRqx3PETsB+hNUKNfl4jSFgHbTPVL8cVj gJjvZIFcWsFL7FoCT0YEYRJoVu9u43b5PA1xBd5ThSHgsKQhKNgK9YphWJNwcI/Uwg5I S8yQ== 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 dv12-20020a05620a1b8c00b0076787a8a594si2192693qkb.205.2023.09.09.03.29.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:29:37 -0700 (PDT) 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 1qevCn-0007Qk-6M; Sat, 09 Sep 2023 06:28:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCl-0007OT-1V; Sat, 09 Sep 2023 06:28:43 -0400 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 1qevCi-0004Vb-Or; Sat, 09 Sep 2023 06:28:42 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D8264204A1; Sat, 9 Sep 2023 13:28: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 C80F526CFF; Sat, 9 Sep 2023 13:27:58 +0300 (MSK) Received: (nullmailer pid 346664 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.1 14/34] target/arm: properly document FEAT_CRC32 Date: Sat, 9 Sep 2023 13:27:07 +0300 Message-Id: <20230909102747.346522-14-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 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: Alex Bennée This is a mandatory feature for Armv8.1 architectures but we don't state the feature clearly in our emulation list. Also include FEAT_CRC32 comment in aarch64_max_tcg_initfn for ease of grepping. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-id: 20230824075406.1515566-1-alex.bennee@linaro.org Cc: qemu-stable@nongnu.org Message-Id: <20230222110104.3996971-1-alex.bennee@linaro.org> [PMM: pluralize 'instructions' in docs] Signed-off-by: Peter Maydell (cherry picked from commit 9e771a2fc68d98c5719b877e008d1dca64e6896e) Signed-off-by: Michael Tokarev diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index bdafc68819..d47b78eca9 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -14,6 +14,7 @@ the following architecture extensions: - FEAT_BBM at level 2 (Translation table break-before-make levels) - FEAT_BF16 (AArch64 BFloat16 instructions) - FEAT_BTI (Branch Target Identification) +- FEAT_CRC32 (CRC32 instructions) - FEAT_CSV2 (Cache speculation variant 2) - FEAT_CSV2_1p1 (Cache speculation variant 2, version 1.1) - FEAT_CSV2_1p2 (Cache speculation variant 2, version 1.2) diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 8019f00bc3..1975253dea 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -743,7 +743,7 @@ void aarch64_max_tcg_initfn(Object *obj) t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* FEAT_PMULL */ t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); /* FEAT_SHA1 */ t = FIELD_DP64(t, ID_AA64ISAR0, SHA2, 2); /* FEAT_SHA512 */ - t = FIELD_DP64(t, ID_AA64ISAR0, CRC32, 1); + t = FIELD_DP64(t, ID_AA64ISAR0, CRC32, 1); /* FEAT_CRC32 */ t = FIELD_DP64(t, ID_AA64ISAR0, ATOMIC, 2); /* FEAT_LSE */ t = FIELD_DP64(t, ID_AA64ISAR0, RDM, 1); /* FEAT_RDM */ t = FIELD_DP64(t, ID_AA64ISAR0, SHA3, 1); /* FEAT_SHA3 */ From patchwork Sat Sep 9 10:27: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: 721082 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200460wrp; Sat, 9 Sep 2023 03:29:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiXHk+rmaoA2raH1oJia07U1IwGAKr8a+zgnUdn25zo7iFa72kCd5Jeo3WOS20zruP5oNJ X-Received: by 2002:a05:622a:20a:b0:412:845:3d94 with SMTP id b10-20020a05622a020a00b0041208453d94mr5448147qtx.54.1694255390345; Sat, 09 Sep 2023 03:29:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255390; cv=none; d=google.com; s=arc-20160816; b=oBeQErVSoBqt+IlNcrGV54lfYM3dt1VsG5nBAzwoqAVcPNrGmxvuviXRx2kG2OMwxU kHU3cWdLzLQRhjMfZn1UCeE9blDG+ssm3lqfWjhrS/+axXWVAK0uGsZxzPio5pGhcmI/ KWVxTyrCqI/Lb3esusc7vs8+ZUnAXcXIgVHSMXi6VYaWqEnifuapDTCw8kmJ4bwn0wlJ tPHNsPbTC5KUadL5BU4q+UakoNUzZlKc6Z6Wkof6Okm/7MZcfqBszAxVmELjg2XKo/24 SGKtx9074ysSjoI1cGatxNA30sHRKPU0jaqAJ3ckbtgbyJACgtDofKBiOQQHzKKsqJol G76g== 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=4klhxoPJATNkg3ZAt8qVd27UExA7+M3rW61HSxNJBng=; fh=OZJ3+QZPrqj/nL2n5BczvdwTUg+gWEoo3BmH9JbYpKQ=; b=p9abtHzRs6V+am8cqEQ8hauieBRjS4H5jqXMWM9Vgjvc42lvMA0Ldyx7DkpXZNs0fZ Jxp6MumLlruSdBewOTw5tRw5V5ifsqjjepoLDW7XPrJWL0OhJCfO4tLriVTHrb6Bf2Dk 3E7rm3jSAI58aMY8AhcH4PiID1nGTD0CBm6bDJc/Mw3aiWbdWOAcs4mZ72NN+fvPeGiQ Y3ZEYANUF9Z7Lt60d9tfpi1gyTkYQckECcwxhpxXSO1w5LEd0YOWJohTPLFSiHCSwdJ3 i3cr+YGCSs/IRDXuUekQIeJEEoK9p6fhjGn+k/E86aCpLZDi+kky7L8wbjDfLs0sSBl8 6dgQ== 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 k4-20020ac85fc4000000b0040fd72b982esi2303396qta.780.2023.09.09.03.29.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:29:50 -0700 (PDT) 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 1qevCp-0007Rs-Oz; Sat, 09 Sep 2023 06:28:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevCo-0007RX-RA; Sat, 09 Sep 2023 06:28:46 -0400 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 1qevCm-0004Vs-KJ; Sat, 09 Sep 2023 06:28:46 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 130E2204A2; Sat, 9 Sep 2023 13:28: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 1245926D00; Sat, 9 Sep 2023 13:27:59 +0300 (MSK) Received: (nullmailer pid 346667 invoked by uid 1000); Sat, 09 Sep 2023 10:27:57 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Helge Deller , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-8.1.1 15/34] linux-user: Adjust brk for load_bias Date: Sat, 9 Sep 2023 13:27:08 +0300 Message-Id: <20230909102747.346522-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 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 PIE executables are usually linked at offset 0 and are relocated somewhere during load. The hiaddr needs to be adjusted to keep the brk next to the executable. Cc: qemu-stable@nongnu.org Fixes: 1f356e8c013 ("linux-user: Adjust initial brk when interpreter is close to executable") Tested-by: Helge Deller Reviewed-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit aec338d63bc28f1f13d5e64c561d7f1dd0e4b07e) Signed-off-by: Michael Tokarev diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ac03beb01b..a69e7d7eab 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3204,7 +3204,7 @@ static void load_elf_image(const char *image_name, int image_fd, info->start_data = -1; info->end_data = 0; /* Usual start for brk is after all sections of the main executable. */ - info->brk = TARGET_PAGE_ALIGN(hiaddr); + info->brk = TARGET_PAGE_ALIGN(hiaddr + load_bias); info->elf_flags = ehdr->e_flags; prot_exec = PROT_EXEC; From patchwork Sat Sep 9 10:27:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 721081 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp200436wrp; Sat, 9 Sep 2023 03:29:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtED/MJ4IhKrEL16TIURnJr3OvcEZPVzWOqrxupDJJKk0LCYtls0KeBJFy2pN/NCfNy997 X-Received: by 2002:a05:620a:2a15:b0:767:dc9f:5141 with SMTP id o21-20020a05620a2a1500b00767dc9f5141mr10382763qkp.19.1694255386052; Sat, 09 Sep 2023 03:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694255386; cv=none; d=google.com; s=arc-20160816; b=Nk1j70HlTq0jJHhcxtddKzRiKzyKayHGK1RetPWVynWApBADUxXddH7uhSRZ80m6RQ YPaFApIzYKHddpvPSuXMQyYdXJGEQIGNIlICep+BxbDdCvP9oFlaypvwT1CNPJC6FEcJ pNYSVqWjOTQYI9bc2UP9Js+ior5UTsD+DGVP83ITNziBlz3SZtByHaxJWJxS6iaj3vJ7 VbMSIpTiwAvp0z+ddzFeh79ksFdHmd8dXjSv5+HR3Io1yRB0FNT3dEVEUZA6SNKJdw4b /D523m7jI1ujUAhsEzweo5sxanLnUXa1RnRNg+QV/x4MgPHY48uV29jTraHRQ77PhAqC Uz1A== 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=FzkIDwPaM604ahxijaVXynWd4A6d8wBBRw78zMZQ4RE=; fh=+D0Ov/H+ewjMrdUrA5bt7T5YdpcG3fBRsCPTLxVLxV0=; b=QuGqBDGdag08gByLun6Njg5rLUPwYi4LnOQ5aHhb2nOLDm+uc3NRv4L98iCYOyFTMd 6MNUnyKBNzH/hfeVAVYjTQPJHipH1oycd0zV+4ufIYQpYu5268UEW1yP1HEAfklIrylH XDqaJd3q2ikmbwuTb8q9GrLHylFTkverUVBCTCEkjufJx7WDVFYt9XQoJcytjCfAtFft 1gG1ngFV2ZOJ3341AmXAJwjnnpqqULOxOXdpX1LnmFEOnMrALj+RFSRtAG4P9rxtGvwr dQ/Ys+ROt2V562sPNMkxzdfaUzSuo5JBixbBM2c8Wayo3KMgx0YOFKI38E5vW2b3QNfg XP+g== 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 z31-20020a05620a261f00b00767da14f0cesi2174620qko.13.2023.09.09.03.29.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2023 03:29:46 -0700 (PDT) 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 1qevDJ-000179-V9; Sat, 09 Sep 2023 06:29:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qevDH-00011g-Mf; Sat, 09 Sep 2023 06:29:15 -0400 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 1qevDF-0004Zz-2Z; Sat, 09 Sep 2023 06:29:15 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C62E7204A7; Sat, 9 Sep 2023 13:29:09 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id C13A226D05; Sat, 9 Sep 2023 13:28:18 +0300 (MSK) Received: (nullmailer pid 346699 invoked by uid 1000); Sat, 09 Sep 2023 10:28:17 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Nicholas Piggin , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Michael Tokarev Subject: [Stable-8.1.1 20/34] target/ppc: Flush inputs to zero with NJ in ppc_store_vscr Date: Sat, 9 Sep 2023 13:27:13 +0300 Message-Id: <20230909102747.346522-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 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 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1779 Signed-off-by: Richard Henderson Reviewed-by: Nicholas Piggin Signed-off-by: Cédric Le Goater (cherry picked from commit af03aeb631eeb81a44d2c0ff5b429cd4b5dc2799) Signed-off-by: Michael Tokarev diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c index 424f2e1741..48257f7225 100644 --- a/target/ppc/cpu.c +++ b/target/ppc/cpu.c @@ -59,6 +59,7 @@ void ppc_store_vscr(CPUPPCState *env, uint32_t vscr) env->vscr_sat.u64[0] = vscr & (1u << VSCR_SAT); env->vscr_sat.u64[1] = 0; set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); + set_flush_inputs_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } uint32_t ppc_get_vscr(CPUPPCState *env)