From patchwork Wed Feb 21 08:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774494 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp145231wrw; Wed, 21 Feb 2024 00:21:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUkGvMIW4+MN76YpQhkQp1dV4851WOaGYFNzsnRu9T5cyU4vbjDLR+wOvHU1OHbZT5eDdH3rv7ut4aKDBj6CmGL X-Google-Smtp-Source: AGHT+IHIrZFC5my9Jxw3pRYZpWJh21dUEXP0AZQ7AzSNWpkrX3usPOgM8661pNwVqxK3ZarsDrdT X-Received: by 2002:a0c:aa5c:0:b0:68f:a78f:bf1d with SMTP id e28-20020a0caa5c000000b0068fa78fbf1dmr634986qvb.39.1708503698385; Wed, 21 Feb 2024 00:21:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708503698; cv=none; d=google.com; s=arc-20160816; b=ED2KvrEQHlfBlQSBYwLUHtVnGn2k+/NOpsD+7gY9/ZvG3t5Dtxb+z+vRzaUQG6ZB2G TUMLL+i27cK6gaMts5LWsLCGnLX/+xAaGJ7/yPS3uGq3QcpRP7ihX4GnZWug631DgRc/ Xrs1gDJIzMbf4aKQp1gP7WKFipn0lLDtGXH8Bn+w5mYNs8/Kh4X+yF5LzxJ1I6Vwg24g Maz8EUbIjBMkHS0AlLBdKYUAWnZprFlDzYFNHjKZzurK/OFYZzvuX/XnaIP7PG3FX2+6 kOyfXxWD6WTMjR5jK4NyfjW7NXWZz01olLxpYs/0rZGXlAidDE9Igw9jxhXt9+mtKy07 ypqw== 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=W4r0RhRi6766sVoCuUGM0aM/W/jKaxM9F5PFTVDARx8=; fh=UBdS1C7FLmKCPlHt7AdVMWBqXU1mfm8RYRk8RNS2ZdY=; b=pnxSY1j/wrFUctj5khWNeOz0ZSV+/5giGUT9Fy8QaHNAHbKKWld6d8N50qKL/Sw8mG RTG96c6XAyqm8JjEGnYDfCjhER7pItcx45+n6j0msDlDgc05czsSgKLpsCVDOODdFrMh KZkS1WqbRH9JB+13/RWNOiRx4+lVla8oPWsWebF28BZ8BY1UKnBtXsaQ6ekVod2GfeaP Jwx/rZ0R9sSuTm69aNRxIxOnI3zTFiBe2/w6s5CwNAACPk/LE8mh8Oak5GyCQhpOEdcg E5vrI+FjQpW8qCve6a3l546/UPZyid3Y36Si3E9L8PxTpUql/A1SF4wy5lv8mRAQbTrg pBgg==; dara=google.com 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 jr5-20020a0562142a8500b00683699d4df8si10338995qvb.139.2024.02.21.00.21.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 00:21:38 -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 1rchr5-0001Ek-Hh; Wed, 21 Feb 2024 03:21:27 -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 1rchqw-00015U-6P; Wed, 21 Feb 2024 03:21: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 1rchqu-0002Au-I2; Wed, 21 Feb 2024 03:21:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 657C04F3C6; Wed, 21 Feb 2024 11:21:20 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 2ED37860A5; Wed, 21 Feb 2024 11:20:59 +0300 (MSK) Received: (nullmailer pid 2142010 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Bohdan Kostiv , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Richard Henderson , Michael Tokarev Subject: [Stable-8.2.2 08/60] system/vl.c: Fix handling of '-serial none -serial something' Date: Wed, 21 Feb 2024 11:19:56 +0300 Message-Id: <20240221082058.2141850-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 Currently if the user passes multiple -serial options on the command line, we mostly treat those as applying to the different serial devices in order, so that for example -serial stdio -serial file:filename will connect the first serial port to stdio and the second to the named file. The exception to this is the '-serial none' serial device type. This means "don't allocate this serial device", but a bug means that following -serial options are not correctly handled, so that -serial none -serial stdio has the unexpected effect that stdio is connected to the first serial port, not the second. This is a very long-standing bug that dates back at least as far as commit 998bbd74b9d81 from 2009. Make the 'none' serial type move forward in the indexing of serial devices like all the other serial types, so that any subsequent -serial options are correctly handled. Note that if your commandline mistakenly had a '-serial none' that was being overridden by a following '-serial something' option, you should delete the unnecessary '-serial none'. This will give you the same behaviour as before, on QEMU versions both with and without this bug fix. Cc: qemu-stable@nongnu.org Reported-by: Bohdan Kostiv Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrangé Reviewed-by: Richard Henderson Message-id: 20240122163607.459769-2-peter.maydell@linaro.org Fixes: 998bbd74b9d81 ("default devices: core code & serial lines") Signed-off-by: Peter Maydell (cherry picked from commit d2019a9d0c34a4fdcb5b5df550d73040dc0637d9) Signed-off-by: Michael Tokarev diff --git a/system/vl.c b/system/vl.c index 6b87bfa32c..938b7b5acc 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1440,18 +1440,22 @@ static void qemu_create_default_devices(void) static int serial_parse(const char *devname) { int index = num_serial_hds; - char label[32]; - if (strcmp(devname, "none") == 0) - return 0; - snprintf(label, sizeof(label), "serial%d", index); serial_hds = g_renew(Chardev *, serial_hds, index + 1); - serial_hds[index] = qemu_chr_new_mux_mon(label, devname, NULL); - if (!serial_hds[index]) { - error_report("could not connect serial device" - " to character backend '%s'", devname); - return -1; + if (strcmp(devname, "none") == 0) { + /* Don't allocate a serial device for this index */ + serial_hds[index] = NULL; + } else { + char label[32]; + snprintf(label, sizeof(label), "serial%d", index); + + serial_hds[index] = qemu_chr_new_mux_mon(label, devname, NULL); + if (!serial_hds[index]) { + error_report("could not connect serial device" + " to character backend '%s'", devname); + return -1; + } } num_serial_hds++; return 0; From patchwork Wed Feb 21 08:19:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774496 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp145361wrw; Wed, 21 Feb 2024 00:22:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWk4sBQiLmwQMFzXurgXOLg/XIfG9FcLrFgTKrOVFwZzH9f3mOzrh0boWih+tCCaimelyhKAWxdxB+lPKbyhWDy X-Google-Smtp-Source: AGHT+IH0NYChXz1Ic548keVACbu5MXaZZIRi1JkXB90UE91jlwCFXoThBkCUahJ/5ennejCg8cPy X-Received: by 2002:a05:622a:38e:b0:42d:fbd5:c2de with SMTP id j14-20020a05622a038e00b0042dfbd5c2demr12242206qtx.64.1708503727246; Wed, 21 Feb 2024 00:22:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708503727; cv=none; d=google.com; s=arc-20160816; b=NRdkhGnqUf/h8lCrbAaAfiG5LsYoWcVf9Y2Wzhpvy0ibW6fqWQhNm8HWDoNp+frXvm ZWtcIENY371fNSXD4EvbX0NEjWPE9yl0riMANBpuP+Az5cAKRCoDM1mttdqNQAZxgkR1 DCGyIEIpTXt7Z0sA7httXGl3ZVwLb8qeAbIkBZz2zunMIZ0ryhan5u2v127RdSeQkucP RZ9DVO8dVABaHAQpAS3LWO81qn1TuoYnRX8rMc30tl5h+qMiF1zoZS1RdpOWWEFGYS1q Ntoks6lLlXn077RUiN1tdu0YQpDrm9oNQRDJ2zucO6FHKN+zs25ykrRtg9VYDnmYqMeW 0BPQ== 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=lNprxZWKb8oYjQEDVuFQzkIpPurc0egJsGl+I9kMc2k=; fh=QCiO3s1cvaqADEyfPI2NiS1m5l7Cs6ciWF636GXs0Bw=; b=qLplDK+YIHuCT+4319h3Lk0J584/6qUMMunOXBmrzVQOOUvD9NppJhfydU/DJ+WSPx N9UWO9OKDDepg6UHomolHg6lN4bowG0tVAIL7u1uK6JY9KEjpowRGLaAbYJPSgg+mAA6 dh99dVESemKss5S1of7DlRebFzJWRhbrxPkIdEcfJdfb7H2JOjIJbYXDq7PDJ8QJ4rwY 24tAUWdVY6wg449Qo3UrTDOvU/6liGvKZURct8smE9yP+stciA7HalaPAYP34uGSccf/ xg5wKVwf/Z/ZPon5jMiUmT93qtpFQVbM23xU+qYXA7Gt0SWtIxLsChpWnvoGVSFBKWVB EpUg==; dara=google.com 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 v12-20020a05622a188c00b0042e1212ec3bsi7138263qtc.0.2024.02.21.00.22.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 00:22:07 -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 1rchr4-0001A3-BJ; Wed, 21 Feb 2024 03:21:26 -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 1rchqw-00015T-5Y; Wed, 21 Feb 2024 03:21: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 1rchqu-0002Aw-IN; Wed, 21 Feb 2024 03:21:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 761CC4F3C7; Wed, 21 Feb 2024 11:21:20 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 40F51860A6; Wed, 21 Feb 2024 11:20:59 +0300 (MSK) Received: (nullmailer pid 2142013 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-8.2.2 09/60] qemu-options.hx: Improve -serial option documentation Date: Wed, 21 Feb 2024 11:19:57 +0300 Message-Id: <20240221082058.2141850-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: Peter Maydell The -serial option documentation is a bit brief about '-serial none' and '-serial null'. In particular it's not very clear about the difference between them, and it doesn't mention that it's up to the machine model whether '-serial none' means "don't create the serial port" or "don't wire the serial port up to anything". Expand on these points. Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240122163607.459769-3-peter.maydell@linaro.org (cherry picked from commit 747bfaf3a9d2f3cd51674763dc1f7575100cd200) Signed-off-by: Michael Tokarev diff --git a/qemu-options.hx b/qemu-options.hx index 42fd09e4de..b6b4ad9e67 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4118,7 +4118,8 @@ SRST This option can be used several times to simulate up to 4 serial ports. - Use ``-serial none`` to disable all serial ports. + You can use ``-serial none`` to suppress the creation of default + serial devices. Available character devices are: @@ -4140,10 +4141,17 @@ SRST [Linux only] Pseudo TTY (a new PTY is automatically allocated) ``none`` - No device is allocated. + No device is allocated. Note that for machine types which + emulate systems where a serial device is always present in + real hardware, this may be equivalent to the ``null`` option, + in that the serial device is still present but all output + is discarded. For boards where the number of serial ports is + truly variable, this suppresses the creation of the device. ``null`` - void device + A guest will see the UART or serial device as present in the + machine, but all output is discarded, and there is no input. + Conceptually equivalent to redirecting the output to ``/dev/null``. ``chardev:id`` Use a named character device defined with the ``-chardev`` From patchwork Wed Feb 21 08:19:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774495 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp145303wrw; Wed, 21 Feb 2024 00:21:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVLbSC4NxAI8qf22j/s5NgwSXWa8+g+UT8wkGWBo4TJT5HYu2fSx1xcNsLTuImaai7b/k1tu+PQh0EfbWbwOmzG X-Google-Smtp-Source: AGHT+IGP/z4a6OS1L9HXqCnhQDZhJFVNuYf8Mr7F3DfDaGTeSwcTp7ViZOmRnyGBNnBEqXN5OZFB X-Received: by 2002:a0c:f2d0:0:b0:68f:555c:e331 with SMTP id c16-20020a0cf2d0000000b0068f555ce331mr9602216qvm.28.1708503715623; Wed, 21 Feb 2024 00:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708503715; cv=none; d=google.com; s=arc-20160816; b=coKDbmTKvB86rWpcvS/4rLpLilec6/Qhgr6+FUd1kZogF8XOdxByXNcLsVv4thjapj PpjY1fZahaSljFPC/3h5+R85/lOrD6mSQykOSlLF5mGQRdRAb1Jb7YNNx+iuSfBl00xu scM3s067BRE52DoNxsnycvTfnXQ8NN6/rlriWRi1Zr3SbD3F7a2BZ3FPzI2ocS5ZLEyi h0UBShUEY+P89wOpW5M0W0eV0MrXCbkfka85I6QWiIaOGI5QaLCq+nncD7MHyOouR2MK JWpJAaJSjzbzEvZDhkqiOLaPozm7ympMXJuheHnYExGrTQAGF71fw++Op7hEJczlygiE hToA== 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=kCQLqbpS3N8LvGiIMnyMwnx+tmnKw3/yxd3KumEv61M=; fh=xJ1URYKcMN3TM0/XAv5v+aCN+5tIbzAdcfBx5UNgoLw=; b=W4htNhTv3BUyyITXKgWSPnS562movTo+7TL0sAr3z9ecA8pdGB0FativBoMwDx+7k/ QMjTTj0IcRU6d9I4PPn9qSXI9zZGIEDFkvlQdMn4JZ86iBm+RY5PvRoYSPzcImSmkhit PziMZy8jEqeMYxD3cvo8ZCCsU3zPv45eWbyb8+umDO0NJSZgt8pwfWNBU0IqQ9CTd8N2 EqNNkloyLMi37XPOINZenqg4ncEEWTQCBxkSJz3EaRlSwLD29auq4HQYXIfXDmhOQyu3 lx94V6rJB7efE5+BD/S8gKlDpLJAHED6DAqnpiVaEz3LLDF1n5fAHNNZqHUjJ2GlWpGr 8GNg==; dara=google.com 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 10-20020a05621420ca00b0068cd864e437si10472207qve.325.2024.02.21.00.21.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 00:21: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 1rchrO-0001ZN-He; Wed, 21 Feb 2024 03:21:46 -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 1rchrJ-0001To-As; Wed, 21 Feb 2024 03:21:41 -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 1rchrH-0002BN-K0; Wed, 21 Feb 2024 03:21:41 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 864B74F3C8; Wed, 21 Feb 2024 11:21:20 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 51C58860A7; Wed, 21 Feb 2024 11:20:59 +0300 (MSK) Received: (nullmailer pid 2142016 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev Subject: [Stable-8.2.2 10/60] target/arm: Reinstate "vfp" property on AArch32 CPUs Date: Wed, 21 Feb 2024 11:19:58 +0300 Message-Id: <20240221082058.2141850-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: Peter Maydell In commit 4315f7c614743 we restructured the logic for creating the VFP related properties to avoid testing the aa32_simd_r32 feature on AArch64 CPUs. However in the process we accidentally stopped exposing the "vfp" QOM property on AArch32 TCG CPUs. This mostly hasn't had any ill effects because not many people want to disable VFP, but it wasn't intentional. Reinstate the property. Cc: qemu-stable@nongnu.org Fixes: 4315f7c614743 ("target/arm: Restructure has_vfp_d32 test") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2098 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20240126193432.2210558-1-peter.maydell@linaro.org (cherry picked from commit 185e3fdf8d106cb2f7d234d5e6453939c66db2a9) Signed-off-by: Michael Tokarev diff --git a/target/arm/cpu.c b/target/arm/cpu.c index efb22a87f9..5d9bca5b8d 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1615,6 +1615,10 @@ void arm_cpu_post_init(Object *obj) } } else if (cpu_isar_feature(aa32_vfp, cpu)) { cpu->has_vfp = true; + if (tcg_enabled() || qtest_enabled()) { + qdev_property_add_static(DEVICE(obj), + &arm_cpu_has_vfp_property); + } if (cpu_isar_feature(aa32_simd_r32, cpu)) { cpu->has_vfp_d32 = true; /* From patchwork Wed Feb 21 08:20:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774498 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp145679wrw; Wed, 21 Feb 2024 00:23:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUyE9Ft2DCprlXtztCM7AqVA8/HHo3vktu1ZCqlolxZ0SARgSdY3kXNJc9aIOIeT9IbD5L9hZwRTrVXwT6oTSHV X-Google-Smtp-Source: AGHT+IG170aRKLRGo6Wxp31jbcfwPrwW9OwspUssph2mRuhxX4I7cdMh9dv6k6NCJGIAbDVWYv1V X-Received: by 2002:a05:620a:1673:b0:787:251a:4017 with SMTP id d19-20020a05620a167300b00787251a4017mr19433469qko.64.1708503797661; Wed, 21 Feb 2024 00:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708503797; cv=none; d=google.com; s=arc-20160816; b=JFRskUcSQiKvJK/Utv7AuSrA2Hjg+MF1jA+rLo62SCBWRISTXnEyghPFH1LaUqsTa6 IBHnr6g1e9+R7Vyg3y5UAq6fTMGiYsGyf88Vvcro3LgtNKJ5iYsj7WV/dyeA7bs4H7a4 Wc41YP0YG1WnfndoJOHlXgjT2C0xSntCNvFtwn5xxqJ2j1qXNGMXxewbx6sx22aYxDf5 8yv+UNcyhl4ZgOn/j/x2xEKjQbJKfhJa9V36j2MwdaaqvM4elDGlsaR4RmyCcRg6xJQ3 oUCqP2cg7E/6K0QQHr1bnBJV5CZQpnGvKlaIpC/B8uNt9oR+BRg5YaIYcnYaWM7vzBaA +vNA== 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=ItyTnqHiu/Q8a9GY4IgnGd5x76a0/hh7RoYT1kwY8w0=; fh=Ai/7iYl8PqklBRG+OcSfTczWOCBx0/sAgKz4aM3nNvc=; b=l+sNOa4W1M9hbFBu9nUp1E/PNdW8V4AGk3aS8EN2O4Helr1ikEgqmIlFEUKkkq7Pn+ 96sU8X/U2INCExaY2OTTpUN+BOcxmQIDyKr+4zdrqD6KicKrazBPFMrWDWKmBzvT6eb3 fiU5r4/JpHemU/eeFxHHgAlBD/w6ZIGMc+nr8xLK+viWNqJLOGj7mt4dqeIV8Uq/6XEi /equ+xCgbUKAci3ukAccVhsbnjPs7QbQ/cxovxI/OvvIWxOqI1g3UU5XteGmGz8sUn10 B2jkSFU/3gigN/4tUmT89lrKZqp8D9PaP3kEk1A768gTzJkVSwJi6D+l06smdsrg5ALK Wq3Q==; dara=google.com 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 b16-20020a05620a0cd000b00785d42ba348si9745286qkj.155.2024.02.21.00.23.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 00:23:17 -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 1rchrU-0001i9-2f; Wed, 21 Feb 2024 03:21:53 -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 1rchrM-0001ZL-G2; Wed, 21 Feb 2024 03:21:45 -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 1rchrK-0002Bj-JM; Wed, 21 Feb 2024 03:21:44 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A7FC34F3CA; Wed, 21 Feb 2024 11:21:20 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 74664860A9; Wed, 21 Feb 2024 11:20:59 +0300 (MSK) Received: (nullmailer pid 2142022 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Song Gao , Michael Tokarev Subject: [Stable-8.2.2 12/60] tcg/loongarch64: Set vector registers call clobbered Date: Wed, 21 Feb 2024 11:20:00 +0300 Message-Id: <20240221082058.2141850-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: Richard Henderson Because there are more call clobbered registers than call saved registers, we begin with all registers as call clobbered and then reset those that are saved. This was missed when we introduced the LSX support. Cc: qemu-stable@nongnu.org Fixes: 16288ded944 ("tcg/loongarch64: Lower basic tcg vec ops to LSX") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2136 Signed-off-by: Richard Henderson Reviewed-by: Song Gao Message-Id: <20240201233414.500588-1-richard.henderson@linaro.org> (cherry picked from commit 45bf0e7aa648369cf8ab2333bd20144806fc1be3) Signed-off-by: Michael Tokarev diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index bab0a173a3..dcf0205458 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -2327,7 +2327,7 @@ static void tcg_target_init(TCGContext *s) tcg_target_available_regs[TCG_TYPE_I32] = ALL_GENERAL_REGS; tcg_target_available_regs[TCG_TYPE_I64] = ALL_GENERAL_REGS; - tcg_target_call_clobber_regs = ALL_GENERAL_REGS; + tcg_target_call_clobber_regs = ALL_GENERAL_REGS | ALL_VECTOR_REGS; tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S0); tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S1); tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S2); From patchwork Wed Feb 21 08:20:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774497 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp145419wrw; Wed, 21 Feb 2024 00:22:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUmAgDaJUB3zQx4B/BPKd0nmxYtCzdiArLQ8eUuqtz/MzTpGwrYZj4djePCxTTp7kSTzayRlvzfZrfZVYVgagrO X-Google-Smtp-Source: AGHT+IHEVLG4o4qI9F2JVNSOEuXMDWQM2CkYD+M44Thu/go29bkoPxS/j0/gFpnFhzzJMa6ahf7N X-Received: by 2002:a05:620a:a14:b0:783:68a2:db8b with SMTP id i20-20020a05620a0a1400b0078368a2db8bmr18207757qka.65.1708503738463; Wed, 21 Feb 2024 00:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708503738; cv=none; d=google.com; s=arc-20160816; b=e6pscKqsQg5AQHZMZRFfK6+Ky5/imlSN41f3XoPZpQlGcuDlFH0aQ1vjj+7AP8P+2E 3O5E5Nz3EECAn0oqrl8o/a2KcbtVNJ+eoRtd8N5fHFfnP6Aebyd3p9vGrsPdVyndhMxK q/1IGpgBWtPpc7muHUQFUUPAln6XzrlfXWbey9Lb/Kar450Zzz204leGI+ccfDiyFB/+ lvznTG7S3pAxjcxI/fvOi+z0oIRwuHObNIlOuPQHDzOBzNTXvJ1gtXdfj9S58FAG5VSg xVMzrqFOB6YwN022Xix4fHHNS6xe8IvqPy1wASLCunLw2DaIEU+Qxwqc9Oz5ndzaPenC zpFg== 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=xhVI2j16G5mRdtkS7+DiEyZ+6Vf6OF5toH1O9+QqUJA=; fh=fA8wXgZkOijV3QzeJqIqYxlGqKQb9nNVVJRQwjQ6hao=; b=Rhrj99FqKgxia1Tq+wUH/6hYnGUzYp+W71fNCmpgBGtYozZbjM9nfAvEtYd1+GAdky 3nDyKeuUhMa6Xi6S3agRiSXaydmyisjkx5rtyf0YDYUhj1SbhyvjFLErhC9pC0Y0GwCe xTAxkK0MIWqPV+tE0KxDYFTLm6CNNpzkdHXEscfHByC6QpTv6fIFMVP/17T/ozesXagp hP5yNnndDY854LvoxIh1njk/K+8Rvqf5UKpCiINZOdcu5mWmvoQXbN75t2QiKEKGADuW lwzABP9f5uqAIHfNhoZLWt/j8omInSY8rIe/tUFsoAYzcRc/Q5Gwy/F32gSt1AbzTnyX IrfQ==; dara=google.com 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 ay44-20020a05620a17ac00b0078776ed9eadsi3699410qkb.502.2024.02.21.00.22.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 00:22:18 -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 1rchrW-0001kp-25; Wed, 21 Feb 2024 03:21: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 1rchrO-0001Zx-0y; Wed, 21 Feb 2024 03:21:46 -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 1rchrL-0002CO-Nb; Wed, 21 Feb 2024 03:21:45 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B7F8A4F3CB; Wed, 21 Feb 2024 11:21:20 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 83886860AA; Wed, 21 Feb 2024 11:20:59 +0300 (MSK) Received: (nullmailer pid 2142025 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -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.2.2 13/60] linux-user/aarch64: Add padding before __kernel_rt_sigreturn Date: Wed, 21 Feb 2024 11:20:01 +0300 Message-Id: <20240221082058.2141850-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: Richard Henderson Without this padding, an unwind through the signal handler will pick up the unwind info for the preceding syscall. This fixes gcc's 30_threads/thread/native_handle/cancel.cc. Cc: qemu-stable@nongnu.org Fixes: ee95fae075c6 ("linux-user/aarch64: Add vdso") Resolves: https://linaro.atlassian.net/browse/GNU-974 Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Message-Id: <20240202034427.504686-1-richard.henderson@linaro.org> (cherry picked from commit 6400be014f80e4c2c246eb8be709ea3a96428233) Signed-off-by: Michael Tokarev diff --git a/linux-user/aarch64/vdso-be.so b/linux-user/aarch64/vdso-be.so index 6084f3d1a7..808206ade8 100755 Binary files a/linux-user/aarch64/vdso-be.so and b/linux-user/aarch64/vdso-be.so differ diff --git a/linux-user/aarch64/vdso-le.so b/linux-user/aarch64/vdso-le.so index 947d534ec1..941aaf2993 100755 Binary files a/linux-user/aarch64/vdso-le.so and b/linux-user/aarch64/vdso-le.so differ diff --git a/linux-user/aarch64/vdso.S b/linux-user/aarch64/vdso.S index 34d3a9ebd2..a0ac1487b0 100644 --- a/linux-user/aarch64/vdso.S +++ b/linux-user/aarch64/vdso.S @@ -63,7 +63,11 @@ vdso_syscall __kernel_clock_getres, __NR_clock_getres * For now, elide the unwind info for __kernel_rt_sigreturn and rely on * the libgcc fallback routine as we have always done. This requires * that the code sequence used be exact. + * + * Add a nop as a spacer to ensure that unwind does not pick up the + * unwind info from the preceding syscall. */ + nop __kernel_rt_sigreturn: /* No BTI C insn here -- we arrive via RET. */ mov x8, #__NR_rt_sigreturn From patchwork Wed Feb 21 08:20:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774500 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp302618wrw; Wed, 21 Feb 2024 07:16:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXEk6ZYiYvvAZgfydb+QFJm7kxh3DfCrzUPVrFAAMfMT2HCMlWjpUaqoSUniOUcUWqpKjGLhAqhxgTTovEJU0U1 X-Google-Smtp-Source: AGHT+IEUjrt+NUiSUfCt4WK7S3PbHI+GHZIhVjIW3UIBbK8y4DpUQ9b72Qc3Sdpw94d67S6uS6P3 X-Received: by 2002:a05:620a:e8f:b0:787:3e20:3ca5 with SMTP id w15-20020a05620a0e8f00b007873e203ca5mr16675216qkm.1.1708528585451; Wed, 21 Feb 2024 07:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708528585; cv=none; d=google.com; s=arc-20160816; b=Ei/ECxu/kHnfzzMZOH7D8HXms83r41ZZZOLt85xscIisJ7wH6Yy/VLRs4npuWM1cEY KG4lhJqXAiZITOevOqlAYv6FcV4n1UzZkj/IsvzDwlKRSGJQnyxJas/skD1jumd+pJnC uO2vRcOFbdvRuKYesi7Y9CND9DmhGosGqRvCmQAlKH9atetSSuYl9/FLgP/Ap6JC/nHO Z2d74b3Py7vXl8hhfkV0MnJKxWCN34Lq1JesiD/fv+yGmkrLHdf8KKsOUS33qH+VbIyg Krap4DLrCIMdj5OhgmAC2UiuMLZw8Bv+UVX7irgldeP2F57WRV4OqMPSnuK8hO5frGvl vsig== 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=rcMz4keCWyVd8pCsbRFfl7//1cRTECRaqmoLcjXZeQs=; fh=K4abbxCgZAPvqzOXA+PZ7RIZh+KufMVJze7rXLOwES0=; b=m26f2QxPWXukUvWg/9MRVYEDnj5gDbO/Hq1P07skQFb2bkdg47u69e5txVhW0ysfF+ dIKBIeDf4UNMnD6IqxkNRNcokSVxFPntOr0jIk9zZ25rHBly2ISC+Q62POtH7Ewj2ARy hPNlF4jnL5AFFdbCN/7/fDPC1HhaUpBdmxanjZVKpKnbpCLwJ3k8uYqufiKMuXpVSXRW CC75jtvpqcC0qQB9PNeygK/pGNVAxIdwrVu20zqQBaYYepjcGq14Fcrw2j8eoCBw1A1d rCQeaepCpteZ/q/uzNgd0W7YPmsNOf8rLD3LhFwiaRrmwAYUt67T4oQ6Sq8VBj4rZnor A9Pw==; dara=google.com 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 y8-20020ae9f408000000b0078773b7760fsi4500643qkl.751.2024.02.21.07.16.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:16:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcoJF-0000kJ-H6; Wed, 21 Feb 2024 10:14:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rchsl-0005dy-8j; Wed, 21 Feb 2024 03:23:11 -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 1rchsj-0002RS-Hl; Wed, 21 Feb 2024 03:23:11 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A9ECF4F3D9; Wed, 21 Feb 2024 11:21:21 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 763AE860B8; Wed, 21 Feb 2024 11:21:00 +0300 (MSK) Received: (nullmailer pid 2142069 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-8.2.2 27/60] tcg: Increase width of temp_subindex Date: Wed, 21 Feb 2024 11:20:15 +0300 Message-Id: <20240221082058.2141850-27-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 We need values 0-3 for TCG_TYPE_I128 on 32-bit hosts. Cc: qemu-stable@nongnu.org Fixes: 43eef72f4109 ("tcg: Add temp allocation for TCGv_i128") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2159 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Tested-by: Michael Tokarev (cherry picked from commit c0e688153f299d5d493989c80bcc84c9cf36d6a6) Signed-off-by: Michael Tokarev diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index daf2a5bf9e..451f3fec41 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -412,7 +412,7 @@ typedef struct TCGTemp { unsigned int mem_coherent:1; unsigned int mem_allocated:1; unsigned int temp_allocated:1; - unsigned int temp_subindex:1; + unsigned int temp_subindex:2; int64_t val; struct TCGTemp *mem_base; From patchwork Wed Feb 21 08:20:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774499 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp302086wrw; Wed, 21 Feb 2024 07:15:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWhH0xUzG9EGgNTxPuLJZHZme6M7209OOUwOKekJ3rk/XKHxIXwboNy9XCQ+Tds/Jbu0vHzKgyh0PpO9ZM9q5Gu X-Google-Smtp-Source: AGHT+IFeU0i88wTsrcOYZ7w1yTDOcUHPQSblefPR+ZHJ7MvJeU+vtPh4TC3xo7vVrkpRBVFKYD0Y X-Received: by 2002:a05:6808:de3:b0:3c0:3733:c250 with SMTP id g35-20020a0568080de300b003c03733c250mr15345448oic.20.1708528531347; Wed, 21 Feb 2024 07:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708528531; cv=none; d=google.com; s=arc-20160816; b=K2aFc951XTmzHdTdHH/h4rB33rpYFmvvT06h5zeSSsvOl9/k+Ki1fu4jfUWz4UEMT7 WqCWEaZccDfutUfxKfsHnplL7Mb3g5ST2x8dFABTUqURdp53eEyaNEbJRUUG35xb73FX rKli8xupT4N33QHVC42sd+uU/aNjT7Qx53V6vymMrpK3ddZM1oF1uMBcifnEuIQ8dOFD s13t8wno7jOOMkN3NaQU301v7RbTT77yWxzOIks5JH9UaRSO56V0si/IDmabGDRoFBql j7vkGT3vYWtujLL4++7b7m+wcvjpEo2PnHS/xbjWBolH0UWWnbmdz7RQ2AeFhq/9l5mV 0RHQ== 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=6rjxqdxGxm78rbZB0upq20MGQOQwMRykEMyVoodVm6I=; fh=bMaafE1clBtiBaCrlbrbcY1DSEPhhFUklUk4XoVHiPU=; b=GnL+i/EwYk/EyTgIeToMt6YrIHWHba/beVzFq3fBAGJs1TPjVkyLnyNoTldPrawK5c UD49kFMZYmcVA3zQt09sZr3CgB0Cz8zm2PcNWrN17LO1yJHMyLV2Uy3YIog1npb41gAL Nz2pzNrguOqnuhbu9ZOr8cg/gFp4/Y2DPO4YCVaJhaIdH5gOdmecCjJWQ/WRXd83lX9U uXcn+9U75f8QEcUc6O4yUQbWFof0Xw3nf8GbIjwL0A8rS3eyCUZmn2jwEhkymiJTqbl8 T+a6hRWqnedGW1ncsFsutMc9tInwUN7LqlKJH9295MeMVarEfoqYQGNvvk/GqlDdZZHY abzw==; dara=google.com 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 gu14-20020a056214260e00b0068f57292ab9si9170141qvb.123.2024.02.21.07.15.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:15:31 -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 1rcoJB-0000gZ-R8; Wed, 21 Feb 2024 10:14:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rchsm-0005eU-BS; Wed, 21 Feb 2024 03:23:12 -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 1rchsk-0002Rx-CI; Wed, 21 Feb 2024 03:23:12 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B79F54F3DA; Wed, 21 Feb 2024 11:21:21 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 85884860B9; Wed, 21 Feb 2024 11:21:00 +0300 (MSK) Received: (nullmailer pid 2142072 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Michael Tokarev Subject: [Stable-8.2.2 28/60] tcg/arm: Fix goto_tb for large translation blocks Date: Wed, 21 Feb 2024 11:20:16 +0300 Message-Id: <20240221082058.2141850-28-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 Correct arithmetic for separating high and low on a large negative number. Cc: qemu-stable@nongnu.org Fixes: 79ffece4447 ("tcg/arm: Implement direct branch for goto_tb") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1714 Signed-off-by: Richard Henderson Reviewed-by: Michael Tokarev (cherry picked from commit e41f1825b43796c3508ef309ed0b150ef89acc44) Signed-off-by: Michael Tokarev diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index a9aa8aa91c..c9a47b7ea1 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1736,9 +1736,9 @@ static void tcg_out_goto_tb(TCGContext *s, int which) * shifted immediate from pc. */ int h = -i_disp; - int l = h & 0xfff; + int l = -(h & 0xfff); - h = encode_imm_nofail(h - l); + h = encode_imm_nofail(h + l); tcg_out_dat_imm(s, COND_AL, ARITH_SUB, TCG_REG_R0, TCG_REG_PC, h); tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, l); } From patchwork Wed Feb 21 08:20:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774502 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp308466wrw; Wed, 21 Feb 2024 07:28:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXfsFfyO5ne9MIToU5OT2proVaUNiX7pO5F1IzQ8WJAhTc2YQnH5qzfOy9/p/B/HEFzXg8sY1D7ICyvPNTtKOCF X-Google-Smtp-Source: AGHT+IFhaYl0DVXgKc+ZxL1ZE8nQnfmJZfmfLFMPt8JbEtxU+kAZdeKma62jf/9kltRN4PT29a3l X-Received: by 2002:a05:620a:559a:b0:785:d776:2202 with SMTP id vq26-20020a05620a559a00b00785d7762202mr20543191qkn.77.1708529289739; Wed, 21 Feb 2024 07:28:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708529289; cv=none; d=google.com; s=arc-20160816; b=b/+sh3X/fph3uOyfLcaDwxXwbiyOhS8r2QOLlpZkPajvyYi7ri0kPAcEZXTWbzbNjr 55em8rX6m7o+Imd6zyD5E3AmPh2pccV+rPRYnaBQT8ihdSaYEC8HctziqTnPG++qlNGr Uyfz3N4sxK1sej+CRoWV7600Z6ML55xpyPencyG+L69dRfCmlwe020y8VaZRGIKdqJe6 +TabymHwcd4RJPlVnNRPnjR5hRbxBxGV6BkZLbA7hZTLM3wIOFLoo3YmR1UuDsCRMBpe luen5gyJW01E+on8rXuKbhZI5kW1zMqF3uE7vUh/c03qS+2sFOw51duP5ELUlhwaKXbA 1G0w== 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=GAZG1miXgWSwbptKmsQvMkHxdo8O9bWPg+qBolHy+V0=; fh=Mfp+ztHun75jr+I+HJ3gu9b5WkI1iGjp+6yuuqdwzx0=; b=ySEHPnSFONNJX8eXYflAuYBd26hgy7D4jydV17We1uyzH1Ohca2xhMJDqU/58z7OHE mgMCtBBiwPIxeQHuhaBvLYxP6rPfEnRToTTl/O9AcSAr33u8JBonhmaN7+G+vOrSTgM8 Y+1m1dleW9rNyjQvQHVdvnQfhzVp19pcmeiZSPtHLc8CGS7p/8cmYaIoTJU8zEftx27A Ft4qpxCYLYw8RO+w4BZi3k0N1t4aO48X8geDU+PqLqgvlpRzkqpaYTw6JMuiNJDqPPgD DOxZK2QUrAFI3Af2TZxTQSdDaKGtXNWGl+3rakBhZEQIkda05wYPqNCPBTmzspcZV+dz tGeQ==; dara=google.com 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 vu28-20020a05620a561c00b0078738465c99si10801475qkn.495.2024.02.21.07.28.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:28:09 -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 1rcoJE-0000ji-A2; Wed, 21 Feb 2024 10:14:56 -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 1rchu5-0000w1-2o; Wed, 21 Feb 2024 03:24:33 -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 1rchu3-0002fb-5Z; Wed, 21 Feb 2024 03:24:32 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9ED754F3E6; Wed, 21 Feb 2024 11:21:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 69C8C860C5; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142109 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Gustavo Romero , Peter Maydell , Michael Tokarev Subject: [Stable-8.2.2 40/60] linux-user/aarch64: Choose SYNC as the preferred MTE mode Date: Wed, 21 Feb 2024 11:20:28 +0300 Message-Id: <20240221082058.2141850-40-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 API does not generate an error for setting ASYNC | SYNC; that merely constrains the selection vs the per-cpu default. For qemu linux-user, choose SYNC as the default. Cc: qemu-stable@nongnu.org Reported-by: Gustavo Romero Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 681dfc0d552963d4d598350d26097a692900b408) Signed-off-by: Michael Tokarev diff --git a/linux-user/aarch64/target_prctl.h b/linux-user/aarch64/target_prctl.h index 5067e7d731..aa8e203c15 100644 --- a/linux-user/aarch64/target_prctl.h +++ b/linux-user/aarch64/target_prctl.h @@ -173,21 +173,26 @@ static abi_long do_prctl_set_tagged_addr_ctrl(CPUArchState *env, abi_long arg2) env->tagged_addr_enable = arg2 & PR_TAGGED_ADDR_ENABLE; if (cpu_isar_feature(aa64_mte, cpu)) { - switch (arg2 & PR_MTE_TCF_MASK) { - case PR_MTE_TCF_NONE: - case PR_MTE_TCF_SYNC: - case PR_MTE_TCF_ASYNC: - break; - default: - return -EINVAL; - } - /* * Write PR_MTE_TCF to SCTLR_EL1[TCF0]. - * Note that the syscall values are consistent with hw. + * + * The kernel has a per-cpu configuration for the sysadmin, + * /sys/devices/system/cpu/cpu/mte_tcf_preferred, + * which qemu does not implement. + * + * Because there is no performance difference between the modes, and + * because SYNC is most useful for debugging MTE errors, choose SYNC + * as the preferred mode. With this preference, and the way the API + * uses only two bits, there is no way for the program to select + * ASYMM mode. */ - env->cp15.sctlr_el[1] = - deposit64(env->cp15.sctlr_el[1], 38, 2, arg2 >> PR_MTE_TCF_SHIFT); + unsigned tcf = 0; + if (arg2 & PR_MTE_TCF_SYNC) { + tcf = 1; + } else if (arg2 & PR_MTE_TCF_ASYNC) { + tcf = 2; + } + env->cp15.sctlr_el[1] = deposit64(env->cp15.sctlr_el[1], 38, 2, tcf); /* * Write PR_MTE_TAG to GCR_EL1[Exclude]. From patchwork Wed Feb 21 08:20:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774506 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp317701wrw; Wed, 21 Feb 2024 07:47:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU46pkfItSQqgCD5swH0tENpjk7oI2pb7Z1YFP3GKOzg16AfCaIaeq5qhanOL9iaqrgUoed3OBeKRCiqtJyCbe+ X-Google-Smtp-Source: AGHT+IFGWgOgzjwkzJ5j3dkB5fIyggSeBvno+UdgjHE1jJ+725Q1Wwd3c61HmUNo9jrzWNM55Gjv X-Received: by 2002:a05:6830:10d3:b0:6e4:3e21:1e2d with SMTP id z19-20020a05683010d300b006e43e211e2dmr15184034oto.8.1708530463547; Wed, 21 Feb 2024 07:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708530463; cv=none; d=google.com; s=arc-20160816; b=xIJHs3X24r3xl23mgg6QFJeQsGhrQOAyQJXrOMhkLp/+LTXMxhYUlZ2CXaggr9s7i2 n2b2yET+NzB4V84bU+WzfTuRwUUadq7jeKP5Y2EReMrK+gl0KRYagjuaUtniZSz8JYv9 OMNk36WM8NQTtqYXPX6SBkgbzqTKepwI0vvUIvjfIfdQbxRvAv3IOMmNOWn5P3ZMCcXt GfR2HvPcvqy66A2hqGpovBEimHMRVXXWDA42KLco+PIywVpdmFjgjIqOpcnMhQNV5zq3 VEQSfVRrSckkDSFx2wyR+GtW5iGXltt289jTGLcGY6WyApTYf3wNPBdawGsW781Sc8wG Q+SQ== 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=Bh2lSzLJoz/LHEhgZUa87mR/68/1gHPiDQmjpK6qiV4=; fh=Mfp+ztHun75jr+I+HJ3gu9b5WkI1iGjp+6yuuqdwzx0=; b=u5FZ6g72N5ZIeutHPF6K5+mWoc3xuleojmlhvnkCIIDAR3Q6vGAgxxjMTcwAP3aL45 vKCKwJsOYshyvK6xK1PE34lUlp2ZtHH4Ud0sZuLT7g3TgERZfRJMIC4OpeEtXjBtjXoc r3syG6iSXCjI+T9C6dcsc86Vq7aoj78JkDVi9dCjyitST2+mwEGaHf8RdmUfqZ8MxULU djZ8FotJcQP8YiOXS1g3d1GzP4mIvc9PfYyt/t0RDjuNYe2ns/fdD/8lAu4JT3SkMyM8 21unx063OoH+U8Psp1Q++tRp5RVZEQLBa+KgwA3V6aLXQbHyjC4ITJIjitij/fxSTqKm ++dA==; dara=google.com 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 p1-20020ac84601000000b0042c5c7dd314si3098516qtn.272.2024.02.21.07.47.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:47:43 -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 1rcoa5-0005cW-Qy; Wed, 21 Feb 2024 10:32:22 -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 1rcoOq-0003nk-RI; Wed, 21 Feb 2024 10:20:44 -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 1rchu3-0002fk-Qr; Wed, 21 Feb 2024 03:24:33 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id AFBF74F3E7; Wed, 21 Feb 2024 11:21:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 7A626860C6; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142112 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Gustavo Romero , Peter Maydell , Michael Tokarev Subject: [Stable-8.2.2 41/60] target/arm: Fix nregs computation in do_{ld, st}_zpa Date: Wed, 21 Feb 2024 11:20:29 +0300 Message-Id: <20240221082058.2141850-41-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 field is encoded as [0-3], which is convenient for indexing our array of function pointers, but the true value is [1-4]. Adjust before calling do_mem_zpa. Add an assert, and move the comment re passing ZT to the helper back next to the relevant code. Cc: qemu-stable@nongnu.org Fixes: 206adacfb8d ("target/arm: Add mte helpers for sve scalar + int loads") Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-3-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 64c6e7444dff64b42d11b836b9aec9acfbe8ecc2) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 296e7d1ce2..7108938251 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -4445,11 +4445,7 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, TCGv_ptr t_pg; int desc = 0; - /* - * For e.g. LD4, there are not enough arguments to pass all 4 - * registers as pointers, so encode the regno into the data field. - * For consistency, do this even for LD1. - */ + assert(mte_n >= 1 && mte_n <= 4); if (s->mte_active[0]) { int msz = dtype_msz(dtype); @@ -4463,6 +4459,11 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, addr = clean_data_tbi(s, addr); } + /* + * For e.g. LD4, there are not enough arguments to pass all 4 + * registers as pointers, so encode the regno into the data field. + * For consistency, do this even for LD1. + */ desc = simd_desc(vsz, vsz, zt | desc); t_pg = tcg_temp_new_ptr(); @@ -4600,7 +4601,7 @@ static void do_ld_zpa(DisasContext *s, int zt, int pg, * accessible via the instruction encoding. */ assert(fn != NULL); - do_mem_zpa(s, zt, pg, addr, dtype, nreg, false, fn); + do_mem_zpa(s, zt, pg, addr, dtype, nreg + 1, false, fn); } static bool trans_LD_zprr(DisasContext *s, arg_rprr_load *a) @@ -5168,14 +5169,13 @@ static void do_st_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, if (nreg == 0) { /* ST1 */ fn = fn_single[s->mte_active[0]][be][msz][esz]; - nreg = 1; } else { /* ST2, ST3, ST4 -- msz == esz, enforced by encoding */ assert(msz == esz); fn = fn_multiple[s->mte_active[0]][be][nreg - 1][msz]; } assert(fn != NULL); - do_mem_zpa(s, zt, pg, addr, msz_dtype(s, msz), nreg, true, fn); + do_mem_zpa(s, zt, pg, addr, msz_dtype(s, msz), nreg + 1, true, fn); } static bool trans_ST_zprr(DisasContext *s, arg_rprr_store *a) From patchwork Wed Feb 21 08:20:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774505 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp316119wrw; Wed, 21 Feb 2024 07:43:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcHfWwcXa2TdqEMIqcafdd7LlhrSNA+ccUNi9leXvorg3o+BRt3KbdIYilZ8LmYPaFkP/uy0b5B/HIDe2iSDjV X-Google-Smtp-Source: AGHT+IEyS2LvIJAQhnaSzrdGcjQpupAlCW77ZKDgx4Q2wPR7871o29Havn+Prt4Je8Lpx20MwwQi X-Received: by 2002:a05:622a:513:b0:42c:6005:19a6 with SMTP id l19-20020a05622a051300b0042c600519a6mr19735916qtx.54.1708530236885; Wed, 21 Feb 2024 07:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708530236; cv=none; d=google.com; s=arc-20160816; b=KS+oHk+BAE2lBJOtiCjBWkYcTWa2ISjOqDZlB6AiGY51DOgug2KL+45xV8ukunAcfP O8wVgFId8clXqaZTHMq8D2vALL4KnLq9KUGy0BwXR7U+KevA1IlIStPx6iNyiwFFv/QO K6CcqYbv9MxQzObgW2hZACXC+HaCFScbFGu6que/yIPKHYrtif4/0kztSFCVtlJ3Z1Y5 jJlLjXvMcT1iHJdhWkzwDzPnrbg2WJTSEIM+uyXsle0uXn+lOMZfp4TnSzBTNbdO9Rxx 26KgoU55L680IzKqKV5wSLxcs52uGUxzFAejSF3h8Axko1S+EG47yK6rzJwY1HPNgTiC +nfA== 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=x64wPEWmu8HhEkkOO0BiVfIq6/epYwljLq7uBWLVzCQ=; fh=OKuLB2HSwWuh27MwgB2c3Bd7RFVGc3aSQ8373fc2R0A=; b=bA2Hhm0eU011JcigiybKrLbN6LmYI4zK+CdEcTPAukUxtdo/6c2nFW52d+GCwDhP/x TjzG8SNx/ewaYDW0Mky3yQHE/Kww7DaFN3HdyDk9z4MDs3CaJ+gAtzO9f3gKXmFnscOI jNXhjLP/BDOc2HWfeUM0MLulWh2hTL7Uetoy5gxz4SIvdxjSdoVmprC2V8I/PiLa7iSj fBEKWWX6ULRZnOCpD8usiRd22PpvOD3taUa/ZVwHczhra9z6vfzBFT0ufKpBlR+B6gjG 5HDEtgWs/C/Ng1i6elnQFI4zCoeZiPm/OWsNFir4Uohtxgbdu2Rl21Azfz2cuy2A3AoQ O6Zg==; dara=google.com 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 h2-20020ac87142000000b0042deb612e75si10564007qtp.420.2024.02.21.07.43.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:43:56 -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 1rcoZk-0003hx-9G; Wed, 21 Feb 2024 10:32:00 -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 1rcoOS-0002DX-Kq; Wed, 21 Feb 2024 10:20:20 -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 1rchuQ-0002g6-Cq; Wed, 21 Feb 2024 03:24:55 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C00764F3E8; Wed, 21 Feb 2024 11:21:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 8B2BB860C7; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142115 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Peter Maydell , Gustavo Romero , Michael Tokarev Subject: [Stable-8.2.2 42/60] target/arm: Adjust and validate mtedesc sizem1 Date: Wed, 21 Feb 2024 11:20:30 +0300 Message-Id: <20240221082058.2141850-42-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 When we added SVE_MTEDESC_SHIFT, we effectively limited the maximum size of MTEDESC. Adjust SIZEM1 to consume the remaining bits (32 - 10 - 5 - 12 == 5). Assert that the data to be stored fits within the field (expecting 8 * 4 - 1 == 31, exact fit). Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit b12a7671b6099a26ce5d5ab09701f151e21c112c) Signed-off-by: Michael Tokarev diff --git a/target/arm/internals.h b/target/arm/internals.h index 143d57c0fe..8342f4651f 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1273,7 +1273,7 @@ FIELD(MTEDESC, TBI, 4, 2) FIELD(MTEDESC, TCMA, 6, 2) FIELD(MTEDESC, WRITE, 8, 1) FIELD(MTEDESC, ALIGN, 9, 3) -FIELD(MTEDESC, SIZEM1, 12, SIMD_DATA_BITS - 12) /* size - 1 */ +FIELD(MTEDESC, SIZEM1, 12, SIMD_DATA_BITS - SVE_MTEDESC_SHIFT - 12) /* size - 1 */ bool mte_probe(CPUARMState *env, uint32_t desc, uint64_t ptr); uint64_t mte_check(CPUARMState *env, uint32_t desc, uint64_t ptr, uintptr_t ra); diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 7108938251..a88e523cba 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -4443,17 +4443,18 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, { unsigned vsz = vec_full_reg_size(s); TCGv_ptr t_pg; + uint32_t sizem1; int desc = 0; assert(mte_n >= 1 && mte_n <= 4); + sizem1 = (mte_n << dtype_msz(dtype)) - 1; + assert(sizem1 <= R_MTEDESC_SIZEM1_MASK >> R_MTEDESC_SIZEM1_SHIFT); if (s->mte_active[0]) { - int msz = dtype_msz(dtype); - desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s)); desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid); desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma); desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write); - desc = FIELD_DP32(desc, MTEDESC, SIZEM1, (mte_n << msz) - 1); + desc = FIELD_DP32(desc, MTEDESC, SIZEM1, sizem1); desc <<= SVE_MTEDESC_SHIFT; } else { addr = clean_data_tbi(s, addr); From patchwork Wed Feb 21 08:20:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774507 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp317990wrw; Wed, 21 Feb 2024 07:48:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUuFBMboDOY7B38+UsiKqDKeJAbZwICKdkJytksC5YufebTHtDt9G5pA88K1s/CVjEU0t2kjp9nuJEfjm/oocfv X-Google-Smtp-Source: AGHT+IHbXRx7NkS/JpjTlWw+s8zX6ElaM7u2dgvdmPjr1MJ5EXCQGu+P77tvqawRBt7B7c4xvbNa X-Received: by 2002:ac8:5c0a:0:b0:42e:8be:b74a with SMTP id i10-20020ac85c0a000000b0042e08beb74amr13224922qti.49.1708530498944; Wed, 21 Feb 2024 07:48:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708530498; cv=none; d=google.com; s=arc-20160816; b=mas1CkANZJ7tSshvYCxO0goHNQoaVpybp96guTRWdABfKkrqER1qRmQZvg2vwhPqJW ZGJWEMGYaYZwaS4Wa6qh71lpotEe7cChPLeiYiCLuzrMAXlicIgxAcu9TVhhOtVYarZU YhFe3Ilvh4ak7cXe/IZ5ziBCXPZWcLcy4Td8tQJ84il/Cb4m1fNFQVI9WaT79YG+rN4a Qp5EgtdXQxF6TIl+e2Q7viZT4dXInbHgfsXpdJXnyLJWheAmMRPJsDWx4G1zY2Ea4Q4t 8Ky4LAr/QU65rQjg4q5cxqXXTRxkiSqpUYdqAVw/MIooAioKwsIo/GGD5Tuv+vOp/X+H nzrg== 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=llP8tvbuouQSIiZ6EUhNEvZmxW6a8QVDqsjWw492zMM=; fh=OKuLB2HSwWuh27MwgB2c3Bd7RFVGc3aSQ8373fc2R0A=; b=Atr6owkcMbTVSogxRsHJZH7e2Oh+lvFZNO2AvBnhMz2nDBkTy5NUyDg+oG7lS01/UE iaVZSTSTKioouwd7xVtWJzHARv6q2R47rg4OTAb5Qwribn/wXtL2lydCHdCkI4nto048 lJelaciRtSSC2WmBgyfCtrw0x9FZq9EomSE7HBfiY9xxk429F68HjQfgCVe2+IpSEkdV b9zdZsW7Gm2eJIbgDwE/z2gzmgH+UEnkqPxN+Lf3/CdW/aKvT3YaITCH4Wf3kW1/gooQ wYeJjftj/Jz/4btdapOE1+q1RaAgI8Enb+t25rcaGFnAVhwAmHE3TaXDvkl4R/KN1NWI 6L/w==; dara=google.com 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 i6-20020ac84886000000b0042c2a4d5053si10127829qtq.385.2024.02.21.07.48.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:48:18 -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 1rcoZp-0004QT-7s; Wed, 21 Feb 2024 10:32:05 -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 1rcoOV-0002YR-9s; Wed, 21 Feb 2024 10:20:23 -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 1rchuQ-0002gG-Vc; Wed, 21 Feb 2024 03:24:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D1CA24F3E9; Wed, 21 Feb 2024 11:21:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 9B42E860C8; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142118 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Peter Maydell , Gustavo Romero , Michael Tokarev Subject: [Stable-8.2.2 43/60] target/arm: Split out make_svemte_desc Date: Wed, 21 Feb 2024 11:20:31 +0300 Message-Id: <20240221082058.2141850-43-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 Share code that creates mtedesc and embeds within simd_desc. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 96fcc9982b4aad7aced7fbff046048bbccc6cb0c) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/translate-a64.h b/target/arm/tcg/translate-a64.h index 96ba39b37e..7b811b8ac5 100644 --- a/target/arm/tcg/translate-a64.h +++ b/target/arm/tcg/translate-a64.h @@ -28,6 +28,8 @@ bool logic_imm_decode_wmask(uint64_t *result, unsigned int immn, bool sve_access_check(DisasContext *s); bool sme_enabled_check(DisasContext *s); bool sme_enabled_check_with_svcr(DisasContext *s, unsigned); +uint32_t make_svemte_desc(DisasContext *s, unsigned vsz, uint32_t nregs, + uint32_t msz, bool is_write, uint32_t data); /* This function corresponds to CheckStreamingSVEEnabled. */ static inline bool sme_sm_enabled_check(DisasContext *s) diff --git a/target/arm/tcg/translate-sme.c b/target/arm/tcg/translate-sme.c index 8f0dfc884e..46c7fce8b4 100644 --- a/target/arm/tcg/translate-sme.c +++ b/target/arm/tcg/translate-sme.c @@ -206,7 +206,7 @@ static bool trans_LDST1(DisasContext *s, arg_LDST1 *a) TCGv_ptr t_za, t_pg; TCGv_i64 addr; - int svl, desc = 0; + uint32_t desc; bool be = s->be_data == MO_BE; bool mte = s->mte_active[0]; @@ -224,18 +224,11 @@ static bool trans_LDST1(DisasContext *s, arg_LDST1 *a) tcg_gen_shli_i64(addr, cpu_reg(s, a->rm), a->esz); tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); - if (mte) { - desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s)); - desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid); - desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma); - desc = FIELD_DP32(desc, MTEDESC, WRITE, a->st); - desc = FIELD_DP32(desc, MTEDESC, SIZEM1, (1 << a->esz) - 1); - desc <<= SVE_MTEDESC_SHIFT; - } else { + if (!mte) { addr = clean_data_tbi(s, addr); } - svl = streaming_vec_reg_size(s); - desc = simd_desc(svl, svl, desc); + + desc = make_svemte_desc(s, streaming_vec_reg_size(s), 1, a->esz, a->st, 0); fns[a->esz][be][a->v][mte][a->st](tcg_env, t_za, t_pg, addr, tcg_constant_i32(desc)); diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index a88e523cba..508f7b6bbd 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -4437,18 +4437,18 @@ static const uint8_t dtype_esz[16] = { 3, 2, 1, 3 }; -static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, - int dtype, uint32_t mte_n, bool is_write, - gen_helper_gvec_mem *fn) +uint32_t make_svemte_desc(DisasContext *s, unsigned vsz, uint32_t nregs, + uint32_t msz, bool is_write, uint32_t data) { - unsigned vsz = vec_full_reg_size(s); - TCGv_ptr t_pg; uint32_t sizem1; - int desc = 0; + uint32_t desc = 0; - assert(mte_n >= 1 && mte_n <= 4); - sizem1 = (mte_n << dtype_msz(dtype)) - 1; + /* Assert all of the data fits, with or without MTE enabled. */ + assert(nregs >= 1 && nregs <= 4); + sizem1 = (nregs << msz) - 1; assert(sizem1 <= R_MTEDESC_SIZEM1_MASK >> R_MTEDESC_SIZEM1_SHIFT); + assert(data < 1u << SVE_MTEDESC_SHIFT); + if (s->mte_active[0]) { desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s)); desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid); @@ -4456,7 +4456,18 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write); desc = FIELD_DP32(desc, MTEDESC, SIZEM1, sizem1); desc <<= SVE_MTEDESC_SHIFT; - } else { + } + return simd_desc(vsz, vsz, desc | data); +} + +static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, + int dtype, uint32_t nregs, bool is_write, + gen_helper_gvec_mem *fn) +{ + TCGv_ptr t_pg; + uint32_t desc; + + if (!s->mte_active[0]) { addr = clean_data_tbi(s, addr); } @@ -4465,7 +4476,8 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, * registers as pointers, so encode the regno into the data field. * For consistency, do this even for LD1. */ - desc = simd_desc(vsz, vsz, zt | desc); + desc = make_svemte_desc(s, vec_full_reg_size(s), nregs, + dtype_msz(dtype), is_write, zt); t_pg = tcg_temp_new_ptr(); tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg)); @@ -5224,25 +5236,16 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm, int scale, TCGv_i64 scalar, int msz, bool is_write, gen_helper_gvec_mem_scatter *fn) { - unsigned vsz = vec_full_reg_size(s); TCGv_ptr t_zm = tcg_temp_new_ptr(); TCGv_ptr t_pg = tcg_temp_new_ptr(); TCGv_ptr t_zt = tcg_temp_new_ptr(); - int desc = 0; - - if (s->mte_active[0]) { - desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s)); - desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid); - desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma); - desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write); - desc = FIELD_DP32(desc, MTEDESC, SIZEM1, (1 << msz) - 1); - desc <<= SVE_MTEDESC_SHIFT; - } - desc = simd_desc(vsz, vsz, desc | scale); + uint32_t desc; tcg_gen_addi_ptr(t_pg, tcg_env, pred_full_reg_offset(s, pg)); tcg_gen_addi_ptr(t_zm, tcg_env, vec_full_reg_offset(s, zm)); tcg_gen_addi_ptr(t_zt, tcg_env, vec_full_reg_offset(s, zt)); + + desc = make_svemte_desc(s, vec_full_reg_size(s), 1, msz, is_write, scale); fn(tcg_env, t_zt, t_pg, t_zm, scalar, tcg_constant_i32(desc)); } From patchwork Wed Feb 21 08:20:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774504 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp314016wrw; Wed, 21 Feb 2024 07:39:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUut6FRu3ima8MYxg8H9yWNI0XlGbs3L3/hNYBvDNUZJ/WGoSV+mVFxFguaKPQRvd1nYRYODLzGbODgICfUQAFL X-Google-Smtp-Source: AGHT+IFXgVTGZYt+nHF6jOy8khCIJRImwdpWVslSnAi/cL4RJZX1qY55ETk1QLqpXRVArZQHV9nK X-Received: by 2002:ad4:5aa7:0:b0:68f:52a9:3b24 with SMTP id u7-20020ad45aa7000000b0068f52a93b24mr12315471qvg.29.1708529944816; Wed, 21 Feb 2024 07:39:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708529944; cv=none; d=google.com; s=arc-20160816; b=Yms7GeJAQ8EDczLGgCesxF/eFC2JAbimIvVuVYvn1+c2v6d43l+glzgaOXVw3RkFaw RpkU7PGWk4BehpaB1MHlP1WzxyoRuWT9wBfRfpBFtM2LA/bpAop0vf+XcHhNl2XVxhoE IBVn5XkQ4kvX/tjV3LJ1MWjVd1RT4j8HQN3bqqpHz11LUuJF3m4Q8c9LJwDbJMXfsD88 eN7oezTPIO/UFjeXk/vBUQPVTmxCRGFsH5YtWsqnQoAvb8x/QXmZ8aJKladpNOzq6v7v CPgKSEAUUI8BMtcwlDSeCUMYd1vj4VEqkhSsufaaOESLk74maCNz7ATMYEkmbVBAVSe3 zHoA== 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=yv0BD+Ug+EgvrOiu9lwsUUkCZCpTGD6AU2cNOfdrNSU=; fh=OKuLB2HSwWuh27MwgB2c3Bd7RFVGc3aSQ8373fc2R0A=; b=ZKcnbiv6zB1CqsL3q+0YApj6PCRu96U3eZfYzaa+t0WJBA309SZ8NmHHbAdkTndGdG 7CWBFcOwd7p//70+HUhAJbPmBWMZU1Coi0MhAzQ4W3OjgkAXeednBhWtnS2dIuuaX1qJ wu3iOj6YW7NNcMPjaj6RKSRfSkZHSc0w2BqmVwwPMw6WNO2T9I+4iirtSnyqL7UfBhXk FPZYapKH8RNFzgR8Tz05wnvXajkPxLDUZAOm+osykoghpXt+U1ryXETg1B1WhUi04MDW dg5TPOk6xdgGSZdkjYPspkzbB9ZwA+k8T9bv5qgpyCBfy41RR8wuPnhOW+e3Qr/H46rM OzNA==; dara=google.com 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 r5-20020ad45765000000b0068f4b1bb583si10054881qvx.455.2024.02.21.07.39.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:39:04 -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 1rcoco-00075y-OQ; Wed, 21 Feb 2024 10:35:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcoXd-0004O8-R5; Wed, 21 Feb 2024 10:29:50 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rchuT-0002om-CM; Wed, 21 Feb 2024 03:24:59 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E22944F3EA; Wed, 21 Feb 2024 11:21:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id AD105860C9; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142121 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Peter Maydell , Gustavo Romero , Michael Tokarev Subject: [Stable-8.2.2 44/60] target/arm: Handle mte in do_ldrq, do_ldro Date: Wed, 21 Feb 2024 11:20:32 +0300 Message-Id: <20240221082058.2141850-44-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 These functions "use the standard load helpers", but fail to clean_data_tbi or populate mtedesc. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 623507ccfcfebb0f10229ae5de3f85a27fb615a7) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 508f7b6bbd..ada05aa530 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -4861,8 +4861,13 @@ static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype) unsigned vsz = vec_full_reg_size(s); TCGv_ptr t_pg; int poff; + uint32_t desc; /* Load the first quadword using the normal predicated load helpers. */ + if (!s->mte_active[0]) { + addr = clean_data_tbi(s, addr); + } + poff = pred_full_reg_offset(s, pg); if (vsz > 16) { /* @@ -4886,7 +4891,8 @@ static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype) gen_helper_gvec_mem *fn = ldr_fns[s->mte_active[0]][s->be_data == MO_BE][dtype][0]; - fn(tcg_env, t_pg, addr, tcg_constant_i32(simd_desc(16, 16, zt))); + desc = make_svemte_desc(s, 16, 1, dtype_msz(dtype), false, zt); + fn(tcg_env, t_pg, addr, tcg_constant_i32(desc)); /* Replicate that first quadword. */ if (vsz > 16) { @@ -4929,6 +4935,7 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype) unsigned vsz_r32; TCGv_ptr t_pg; int poff, doff; + uint32_t desc; if (vsz < 32) { /* @@ -4941,6 +4948,9 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype) } /* Load the first octaword using the normal predicated load helpers. */ + if (!s->mte_active[0]) { + addr = clean_data_tbi(s, addr); + } poff = pred_full_reg_offset(s, pg); if (vsz > 32) { @@ -4965,7 +4975,8 @@ static void do_ldro(DisasContext *s, int zt, int pg, TCGv_i64 addr, int dtype) gen_helper_gvec_mem *fn = ldr_fns[s->mte_active[0]][s->be_data == MO_BE][dtype][0]; - fn(tcg_env, t_pg, addr, tcg_constant_i32(simd_desc(32, 32, zt))); + desc = make_svemte_desc(s, 32, 1, dtype_msz(dtype), false, zt); + fn(tcg_env, t_pg, addr, tcg_constant_i32(desc)); /* * Replicate that first octaword. From patchwork Wed Feb 21 08:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774503 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp308500wrw; Wed, 21 Feb 2024 07:28:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpyQEHiFv46+zToxW98PXo5eiRqehe/s1938WPyKDbCeSelokgIeKtOFDWR380RGVEqOU9nXCMAjfLGaVsNKxU X-Google-Smtp-Source: AGHT+IGrgos4pRAv63GtoIgKhIANNqK7Tdes/GuB86scYZhXCEZOz8Q0DgDD7wcBa8nGeFizvipb X-Received: by 2002:a05:6102:2743:b0:470:575a:f4bd with SMTP id p3-20020a056102274300b00470575af4bdmr7883161vsu.28.1708529293114; Wed, 21 Feb 2024 07:28:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708529293; cv=none; d=google.com; s=arc-20160816; b=DT/o+cycFuMr96NXb+FfwmanBH6KTEW154vvCSqvzKV4mk++t8mbD1S+6u4gaiwvQl OgMCk7Oq4rKOWFAH4v5IZriZ3ifK/xlrBOgR12BNbID/sKXHxbL+bcK+cy2TV7upzTq/ ZOtWRaaEmegQI0DBufvHODQrKtamm/KVPk++eDew5l0f0zFiFeqDTPQIJeQUNyRBKSj+ s59GG61zzh7Atn024UaYd6qStSWDn5lDXmTXAKxI4AMvYKl05ZyIXmdUX/bpP1+/S24N nsko7UyfoL8BDUubNA3jjpjTsId0bBZkzfy4J2bUF5A9rAUfYBzAQKX6ZGG59BZH/m7/ Cgcw== 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=WKydpFTvArTiVl2cNeq7FpXsD2PKC0mLKPv+OOAGlRI=; fh=OKuLB2HSwWuh27MwgB2c3Bd7RFVGc3aSQ8373fc2R0A=; b=rW3LVcTaUg4m7i5PhC/5WdBFqgg04vhypykoRqT0RIPC0i2V58fAeKBnhxZSgTpfz1 JUt/LWypV6vJZFCM6QU/vk2TjAl7EifmTR7R0eP9KyggPoz6tvRBIuqGFhFolpkD7MPY jhMkaj52tpG8ywBDOrUW14tEB5+jxgmQDhCTF/v42GqKca+FJxNv6okZjDm6IYGtGNhJ dDEeLuX66zWTb7mKDo26sSPsMLJJsH5IH6fgco2dGJ7kFRQlI5lFfD3uUFJRG6fifcw5 BE7XpMJfG/whoNR06ZP1lr9uVcEQsQ+5bONf+a6+0p5QeH/51A2Uq+K+7y5NvZwGyUze oPTQ==; dara=google.com 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 n9-20020a05622a040900b0042c50a318b8si11942008qtx.122.2024.02.21.07.28.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:28:13 -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 1rcoP3-0004iY-AL; Wed, 21 Feb 2024 10:20:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcoLX-00010D-1q; Wed, 21 Feb 2024 10:17: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 1rchuV-0002pC-2R; Wed, 21 Feb 2024 03:25:00 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F31754F3EB; Wed, 21 Feb 2024 11:21:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id BDD20860CA; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142125 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Peter Maydell , Gustavo Romero , Michael Tokarev Subject: [Stable-8.2.2 45/60] target/arm: Fix SVE/SME gross MTE suppression checks Date: Wed, 21 Feb 2024 11:20:33 +0300 Message-Id: <20240221082058.2141850-45-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 TBI and TCMA bits are located within mtedesc, not desc. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-7-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 855f94eca80c85a99f459e36684ea2f98f6a3243) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/sme_helper.c b/target/arm/tcg/sme_helper.c index 1ee2690ceb..904bfdac43 100644 --- a/target/arm/tcg/sme_helper.c +++ b/target/arm/tcg/sme_helper.c @@ -573,8 +573,8 @@ void sme_ld1_mte(CPUARMState *env, void *za, uint64_t *vg, desc = extract32(desc, 0, SIMD_DATA_SHIFT + SVE_MTEDESC_SHIFT); /* Perform gross MTE suppression early. */ - if (!tbi_check(desc, bit55) || - tcma_check(desc, bit55, allocation_tag_from_addr(addr))) { + if (!tbi_check(mtedesc, bit55) || + tcma_check(mtedesc, bit55, allocation_tag_from_addr(addr))) { mtedesc = 0; } @@ -750,8 +750,8 @@ void sme_st1_mte(CPUARMState *env, void *za, uint64_t *vg, target_ulong addr, desc = extract32(desc, 0, SIMD_DATA_SHIFT + SVE_MTEDESC_SHIFT); /* Perform gross MTE suppression early. */ - if (!tbi_check(desc, bit55) || - tcma_check(desc, bit55, allocation_tag_from_addr(addr))) { + if (!tbi_check(mtedesc, bit55) || + tcma_check(mtedesc, bit55, allocation_tag_from_addr(addr))) { mtedesc = 0; } diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index f006d152cc..5699dfe667 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -5800,8 +5800,8 @@ void sve_ldN_r_mte(CPUARMState *env, uint64_t *vg, target_ulong addr, desc = extract32(desc, 0, SIMD_DATA_SHIFT + SVE_MTEDESC_SHIFT); /* Perform gross MTE suppression early. */ - if (!tbi_check(desc, bit55) || - tcma_check(desc, bit55, allocation_tag_from_addr(addr))) { + if (!tbi_check(mtedesc, bit55) || + tcma_check(mtedesc, bit55, allocation_tag_from_addr(addr))) { mtedesc = 0; } @@ -6156,8 +6156,8 @@ void sve_ldnfff1_r_mte(CPUARMState *env, void *vg, target_ulong addr, desc = extract32(desc, 0, SIMD_DATA_SHIFT + SVE_MTEDESC_SHIFT); /* Perform gross MTE suppression early. */ - if (!tbi_check(desc, bit55) || - tcma_check(desc, bit55, allocation_tag_from_addr(addr))) { + if (!tbi_check(mtedesc, bit55) || + tcma_check(mtedesc, bit55, allocation_tag_from_addr(addr))) { mtedesc = 0; } @@ -6410,8 +6410,8 @@ void sve_stN_r_mte(CPUARMState *env, uint64_t *vg, target_ulong addr, desc = extract32(desc, 0, SIMD_DATA_SHIFT + SVE_MTEDESC_SHIFT); /* Perform gross MTE suppression early. */ - if (!tbi_check(desc, bit55) || - tcma_check(desc, bit55, allocation_tag_from_addr(addr))) { + if (!tbi_check(mtedesc, bit55) || + tcma_check(mtedesc, bit55, allocation_tag_from_addr(addr))) { mtedesc = 0; } From patchwork Wed Feb 21 08:20:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774508 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp321379wrw; Wed, 21 Feb 2024 07:56:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVXtPLswNvzAmPO85pYG35PJlPlGR/ZmoeEHxVjEusLdjBh7qjqNkDmxRpXYGKWF+cXt9WVH6DuwfqH25SA+NEa X-Google-Smtp-Source: AGHT+IHDWLXHm94xDaX7FJyEXEwnKkh6o+XZHPQgORniBX/vjcSU3CESjg6dL6bQv75bRYplxoXg X-Received: by 2002:a0c:e089:0:b0:68f:2a2b:c6e5 with SMTP id l9-20020a0ce089000000b0068f2a2bc6e5mr24603835qvk.31.1708530977879; Wed, 21 Feb 2024 07:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708530977; cv=none; d=google.com; s=arc-20160816; b=wGc6j9RZmZgN+SaYLafWiC8J5AaXobux4OCrRPXu47rq/LoOnyoViA3ua76e3WL7IR DZQYcQwrV52dsHjGq3yeDHWMqkXJGaKPvXlkgRKs5U/yUdZ4t+xFJTnnMzux9wZhMsaf /riqwq/iIsSP7pE+7iN1J+cdc1J5u3A+PEbDeSzcRclbuiMKhLVyARyll+OblJxqL/Xx pbPM2nbcZKWSnvQbw4UcpUowItnxuOAlzSpAj2hFysndIdXq54BkzYG2lc5DHe7H3sg8 Ty8w3ugWhMK/aiTYKmppjuTexnKQZrG0Hd2yVM5RwXqtKOyl6OfW8LHke1Ewc2FYjjIK 6gcw== 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=Rw3OCefk0AMcpgo0RS1LH2CnmFU2DuPt8vMIyh4nmOI=; fh=taStO74W/EZXcDvsT3Zoyq1h58w93JzpEc66fmdrq4s=; b=RzRvhqi2cdzeOIxUfkgMunVQe/9aw31XAg9iOfQyyMohJuXMpgSObxu2wbudQPjwGq n8HPoItg/UgdRmqCcu1GBxnf+9M7fe6PGGHHHcjbZYkSn4r9bze3/ATb3JtXJ0Bia/zN nLZi4s1TdhvhEA89YR9RYJuFwv+uwAL3yM2Ypc0h0E1L0OuGV+P2SNn3TBOlYqFE6CyI GC3MqazAu8vLOAbx7/hWDAE7epeicKd7qSYDBpSJ6BPo8HEZEWuKkyBI/GRUSPjossKx PL5v2PtUpFRWbDyK/ld/2PvTcf7Rw2SbYXVGHLYRsHlFx4bD8tko2uxVlwYYgBeygtmf r1qA==; dara=google.com 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 jr5-20020a0562142a8500b00683699d4df8si11026704qvb.139.2024.02.21.07.56.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:56:17 -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 1rcoZm-00045J-M6; Wed, 21 Feb 2024 10:32:02 -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 1rcoP0-0004ab-Cp; Wed, 21 Feb 2024 10:20:54 -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 1rchus-0002pk-N6; Wed, 21 Feb 2024 03:25:24 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 102D74F3EC; Wed, 21 Feb 2024 11:21:23 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id CF1B7860CB; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142128 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Michael Tokarev Subject: [Stable-8.2.2 46/60] target/arm: Don't get MDCR_EL2 in pmu_counter_enabled() before checking ARM_FEATURE_PMU Date: Wed, 21 Feb 2024 11:20:34 +0300 Message-Id: <20240221082058.2141850-46-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 It doesn't make sense to read the value of MDCR_EL2 on a non-A-profile CPU, and in fact if you try to do it we will assert: #6 0x00007ffff4b95e96 in __GI___assert_fail (assertion=0x5555565a8c70 "!arm_feature(env, ARM_FEATURE_M)", file=0x5555565a6e5c "../../target/arm/helper.c", line=12600, function=0x5555565a9560 <__PRETTY_FUNCTION__.0> "arm_security_space_below_el3") at ./assert/assert.c:101 #7 0x0000555555ebf412 in arm_security_space_below_el3 (env=0x555557bc8190) at ../../target/arm/helper.c:12600 #8 0x0000555555ea6f89 in arm_is_el2_enabled (env=0x555557bc8190) at ../../target/arm/cpu.h:2595 #9 0x0000555555ea942f in arm_mdcr_el2_eff (env=0x555557bc8190) at ../../target/arm/internals.h:1512 We might call pmu_counter_enabled() on an M-profile CPU (for example from the migration pre/post hooks in machine.c); this should always return false because these CPUs don't set ARM_FEATURE_PMU. Avoid the assertion by not calling arm_mdcr_el2_eff() before we have done the early return for "PMU not present". This fixes an assertion failure if you try to do a loadvm or savevm for an M-profile board. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2155 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20240208153346.970021-1-peter.maydell@linaro.org (cherry picked from commit ac1d88e9e7ca0bed83e91e07ce6d0597f10cc77d) Signed-off-by: Michael Tokarev diff --git a/target/arm/helper.c b/target/arm/helper.c index 6515c5e89c..df1646de3a 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1169,13 +1169,21 @@ static bool pmu_counter_enabled(CPUARMState *env, uint8_t counter) bool enabled, prohibited = false, filtered; bool secure = arm_is_secure(env); int el = arm_current_el(env); - uint64_t mdcr_el2 = arm_mdcr_el2_eff(env); - uint8_t hpmn = mdcr_el2 & MDCR_HPMN; + uint64_t mdcr_el2; + uint8_t hpmn; + /* + * We might be called for M-profile cores where MDCR_EL2 doesn't + * exist and arm_mdcr_el2_eff() will assert, so this early-exit check + * must be before we read that value. + */ if (!arm_feature(env, ARM_FEATURE_PMU)) { return false; } + mdcr_el2 = arm_mdcr_el2_eff(env); + hpmn = mdcr_el2 & MDCR_HPMN; + if (!arm_feature(env, ARM_FEATURE_EL2) || (counter < hpmn || counter == 31)) { e = env->cp15.c9_pmcr & PMCRE; From patchwork Wed Feb 21 08:20:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 774501 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp304769wrw; Wed, 21 Feb 2024 07:20:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWyuT5Ii+bRy1v0iOf0LS2jI/lLCtjQE1Rficp9FEkZDVODfA19xXT7mDNB5KYv8Tyh1s/bgodAWqS2zirHhnzX X-Google-Smtp-Source: AGHT+IEXxMO2cep6NkqWBlBtDxks7vhWNcNdfSIKjKt4Hhid8rVHmMJvnoKJIQeJ9fMWuqYsWZMO X-Received: by 2002:a05:620a:16cd:b0:787:28c3:b323 with SMTP id a13-20020a05620a16cd00b0078728c3b323mr20472532qkn.62.1708528829459; Wed, 21 Feb 2024 07:20:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708528829; cv=none; d=google.com; s=arc-20160816; b=fntS8o+PKyaaAHcQ5GYIPnIUn37i9sdmILWTrzkQw3gata99HFowW5wJy4osJ5mNuj WLQ24KNpGOIP3x0SQmocf42tCny2B/CaXGmELAd5VB3etL0pSHj/lFCc2aRhaO3Wtq4q cy2y2g8GbKu0ijrMxJnnTirhKYY+UAIZPLRhdg/aSDoLTudL+9dIKjPkRgyPaqKyDukc wylaeMFb8rvMCJUAo+e5SjkxQGuyO2FuMSiot8ouyRFfWLWIRHv3n7l5TcNFk8nnrKma cJXhAUfOirB23y3zrhIqyPhtr7uH+q4kCYeZ6qwrJpVXnBBkhP/jfsbM0QCR921k1o+J eJ4A== 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=VYCQW4lfuQycqhfN2r4o2OTDNs/mszfaJoFNQJnZruM=; fh=He0A/96iGS/hdBTIvTFKPoE7yByjlEm52ubAJxr7bqo=; b=Xq7Zr77ZV2KUTWPBA/QHfKOXLoQ6zu8eLIQemMxSWW7Xx3FKE2NxqKWta3TTWn+UGU Fwo0v5aqnjshA3mcAVMlaiZstBGA9KWCWeXRRR6g17rRQUQ238fxIT+VUqtYx1etU+zL KV1LU1bbp3mK5y3SCJnJj99Ph8ZcyG0w99zlQImjhHYVDSP9+NMVJQ+MbfUrkJ7o+T9Z p3Mn+C51awkE7WBvI4Mp/Stow3XaL/AK+twBSiUHpE4lWlunmotrNUHMRpmbn2iylOb/ xITVXfOYto2ldxgNZmFRQ3TSo1K2Kd6Lp+oOCDynwE/jfopkZUfVaVPtqe++7b7dxfTH YWaw==; dara=google.com 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 p14-20020a05620a22ee00b00787273e4b87si10320118qki.711.2024.02.21.07.20.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 07:20: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 1rcoOQ-0001we-P5; Wed, 21 Feb 2024 10:20:18 -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 1rcoKw-0000wk-BN; Wed, 21 Feb 2024 10:16:43 -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 1rchuv-00031M-Pt; Wed, 21 Feb 2024 03:25:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 322174F3EE; Wed, 21 Feb 2024 11:21:23 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id F1495860CD; Wed, 21 Feb 2024 11:21:01 +0300 (MSK) Received: (nullmailer pid 2142134 invoked by uid 1000); Wed, 21 Feb 2024 08:20:58 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-8.2.2 48/60] .gitlab-ci/windows.yml: Don't install libusb or spice packages on 32-bit Date: Wed, 21 Feb 2024 11:20:36 +0300 Message-Id: <20240221082058.2141850-48-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 When msys2 updated their libusb packages to libusb 1.0.27, they dropped support for building them for mingw32, leaving only mingw64 packages. This broke our CI job, as the 'pacman' package install now fails with: error: target not found: mingw-w64-i686-libusb error: target not found: mingw-w64-i686-usbredir (both these binary packages are from the libusb source package). Similarly, spice is now 64-bit only: error: target not found: mingw-w64-i686-spice Fix this by dropping these packages from the list we install for our msys2-32bit build. We do this with a simple mechanism for the msys2-64bit and msys2-32bit jobs to specify a list of extra packages to install on top of the common ones we install for both jobs. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2160 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Message-id: 20240215155009.2422335-1-peter.maydell@linaro.org (cherry picked from commit 8e31b744fdf2c5d933681e4128acee72a83af4b8) Signed-off-by: Michael Tokarev diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index f7645f72b7..5c1e385dc8 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -88,7 +88,6 @@ $MINGW_TARGET-libpng $MINGW_TARGET-libssh $MINGW_TARGET-libtasn1 - $MINGW_TARGET-libusb $MINGW_TARGET-lzo2 $MINGW_TARGET-nettle $MINGW_TARGET-ninja @@ -98,9 +97,8 @@ $MINGW_TARGET-SDL2 $MINGW_TARGET-SDL2_image $MINGW_TARGET-snappy - $MINGW_TARGET-spice - $MINGW_TARGET-usbredir - $MINGW_TARGET-zstd " + $MINGW_TARGET-zstd + $EXTRA_PACKAGES " - Write-Output "Running build at $(Get-Date -Format u)" - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink @@ -123,6 +121,8 @@ msys2-64bit: variables: MINGW_TARGET: mingw-w64-x86_64 MSYSTEM: MINGW64 + # msys2 only ship these packages for 64-bit, not 32-bit + EXTRA_PACKAGES: $MINGW_TARGET-libusb $MINGW_TARGET-usbredir $MINGW_TARGET-spice # do not remove "--without-default-devices"! # commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices" # changed to compile QEMU with the --without-default-devices switch @@ -137,5 +137,6 @@ msys2-32bit: variables: MINGW_TARGET: mingw-w64-i686 MSYSTEM: MINGW32 + EXTRA_PACKAGES: CONFIGURE_ARGS: --target-list=ppc64-softmmu -Ddebug=false -Doptimization=0 TEST_ARGS: --no-suite qtest