From patchwork Mon Apr 1 20:58:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161584 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1006046jan; Mon, 1 Apr 2019 15:23:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEAwyrH6TiWluir4gChfdhMABXw0l5ikuPySOSsQpF6sMQIXsMfIxM/sgmLq9EP/KpJXm6 X-Received: by 2002:a81:2511:: with SMTP id l17mr57265205ywl.288.1554157412480; Mon, 01 Apr 2019 15:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554157412; cv=none; d=google.com; s=arc-20160816; b=a6BOK1eavN1PuTNzinQZ/EsU62bRo5lqfdAzyDQDLm/ojbq4sBpWleZFZqC1a7L6fJ I2wwdfvkKiGFT/snqy1GGLvQGCPBh2WE2oMt4uF6Le83x2kEGVpucKGci7jImsvR4whm eJwZygIsnLfMZOvhczeVCb2sislVSMm9avIHqP5iqJlrTRM23NNZ7v/7bQRtlYO73Pck +7YTqVUs4A/4/7oZt7P2xgHzn5JTJby5ucJEWra5AT7PzRBoFYTucdIp+e6dX/xaj/BK 9ZsSEt4zH0nPmd5P8g0a8zXGlOFvjJhdAKem2+GiGOgbJ/xX+YOsVVIsVRMOPlYBhvYk JSZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=P5YF/Wkxqnbbthg1tUZOVyFGoLM8JUCOtgydo0rwFWs=; b=iTUMAraRd8Dob625P/u8t66e7FTO72aHPT1JlyOE9FJpKI5FhGBcW6YkdT29D6GHeA XJD4lIri2SdnjRfGMY9ORCp299PleINyJtQoGtmXf14gigRXAGVxi9pmir1mxXh5na45 gz6S074nW2gWTJ2uNwGD9DMAZe6sHNkIrROPQpsRRDZB6B7Z0vFacd6K5nzqQgxpmkCj kTt0XVfUQYvO/NFqadETx38bAmAyBQrlOKuGMDEx/khEHaiQ6vBTjvtpZOMF0bM9i84l nueZP6KL8Q+zSr20pxnlyIA4+w8/Y3nZ8egIz/9hZ99+K7QCiu034MWd1yOss9LBSMBR +Ssg== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i131si3126893ybi.286.2019.04.01.15.23.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:59478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB5L1-00047l-T9 for patch@linaro.org; Mon, 01 Apr 2019 18:23:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB479-0003jP-7r for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB477-00050G-BC for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:07 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42250 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB477-0004n9-0J for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:05 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4eGa053806 for ; Mon, 1 Apr 2019 17:04:47 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rkrjx57rg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:04:44 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:57 +0100 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:54 +0100 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1rhm14483562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:53 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC547AE05C; Mon, 1 Apr 2019 21:01:53 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A32D7AE063; Mon, 1 Apr 2019 21:01:53 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:53 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:35 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0068-0000-0000-000003AF1BB3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:55 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0069-0000-0000-0000480295AC Message-Id: <20190401210011.16009-2-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id x31L4eGa053806 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 01/97] target/arm: Fix sign of sve_cmpeq_ppzw/sve_cmpne_ppzw X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The normal vector element is sign-extended before comparing with the wide vector element. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Reviewed-by: Alex Bennée Tested-by: Alex Bennée Tested-by: Laurent Desnogues Message-id: 20180801123111.3595-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit df4e001093988544d09887122ae824f18ba55c68) Signed-off-by: Michael Roth --- target/arm/sve_helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 54795c9194..9bd0694d55 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2436,13 +2436,13 @@ uint32_t HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, uint32_t desc) \ #define DO_CMP_PPZW_S(NAME, TYPE, TYPEW, OP) \ DO_CMP_PPZW(NAME, TYPE, TYPEW, OP, H1_4, 0x1111111111111111ull) -DO_CMP_PPZW_B(sve_cmpeq_ppzw_b, uint8_t, uint64_t, ==) -DO_CMP_PPZW_H(sve_cmpeq_ppzw_h, uint16_t, uint64_t, ==) -DO_CMP_PPZW_S(sve_cmpeq_ppzw_s, uint32_t, uint64_t, ==) +DO_CMP_PPZW_B(sve_cmpeq_ppzw_b, int8_t, uint64_t, ==) +DO_CMP_PPZW_H(sve_cmpeq_ppzw_h, int16_t, uint64_t, ==) +DO_CMP_PPZW_S(sve_cmpeq_ppzw_s, int32_t, uint64_t, ==) -DO_CMP_PPZW_B(sve_cmpne_ppzw_b, uint8_t, uint64_t, !=) -DO_CMP_PPZW_H(sve_cmpne_ppzw_h, uint16_t, uint64_t, !=) -DO_CMP_PPZW_S(sve_cmpne_ppzw_s, uint32_t, uint64_t, !=) +DO_CMP_PPZW_B(sve_cmpne_ppzw_b, int8_t, uint64_t, !=) +DO_CMP_PPZW_H(sve_cmpne_ppzw_h, int16_t, uint64_t, !=) +DO_CMP_PPZW_S(sve_cmpne_ppzw_s, int32_t, uint64_t, !=) DO_CMP_PPZW_B(sve_cmpgt_ppzw_b, int8_t, int64_t, >) DO_CMP_PPZW_H(sve_cmpgt_ppzw_h, int16_t, int64_t, >) From patchwork Mon Apr 1 20:58:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161582 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1000059jan; Mon, 1 Apr 2019 15:16:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/cxtK+SHYr+A5//tZMOD6GzFNl9yj41KTu6JiqSpaWIaAixid99oisSL/1sWDpw6XhRtA X-Received: by 2002:a0d:d50b:: with SMTP id x11mr55683533ywd.120.1554157002399; Mon, 01 Apr 2019 15:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554157002; cv=none; d=google.com; s=arc-20160816; b=vFnCT5OoczlZfdP+ZWG4PMNOpI7ysMdgIMR2dsESZ0nd3m/hSkEjz83MY2verrNGmn zBWDTMQERE89KwJHgwjkjGsOaW+5wSUbhmDcYiFjTXGEjgAgUSTooN3Jyr7Em3XHN/+q gw6cBWd5ZM8enqgr8f9ZK6fNmjZLrFT8naW/x8FDVU5xyiL4Qw+jkTAJYunr8It1O0v4 flys1ATBjO5xpKvPwQnzR7ic5FHg42/0V3Iii/XKq+IZBaBhmW4Qey1zHNXOodV9WD3V KWwZ1a0xm3yZwnzO9XJzgfgMCJjhNDXRc/1FwUuJXP6z60SFtTo6oq5nEX/mLXGqx1pI XvHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=LqxZ3bf6LcbL9M2WcnaydvDLyPHTxTgISRvMmjtWuno=; b=C/CihkCDulwF416Q1Ywh5BAKu5wSu3hhmPQFQ+ouiX0+ryOF/9dP8mnhlX5P13JV4S AwqAEIUHO6kGyRIDBjIB/iYqXGkrsChur3TXJlu6TlgWzcBm4CwqNjv2QjDbcUfgAgTl 3Mhs1t/r/DFY7vKD1aR86Vri12P0Isuvj8IRqcfcs28+rqCySCqTnpPCoy3xOR8Z/4vS /R0OsFF+nf0bRlD+fqRYw+NuyhGATTMV8mVC5YRG0ib1Thu14UHgsWvrs9/EtS8DvqWB ytbYsKgTHN8RgCCMI4NH3LTRytF8aJaEKg/Mncb3A9VWz/smccmgifo+BsOdr6tRWQ4P 3a3Q== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p20si3672025yba.235.2019.04.01.15.16.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:16:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:57771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB5EP-0004zV-RB for patch@linaro.org; Mon, 01 Apr 2019 18:16:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB479-0003kI-Ud for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB477-00050p-Iu for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:07 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59862 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB477-0004pt-39 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:05 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4iMi163601 for ; Mon, 1 Apr 2019 17:04:53 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rksx78ud5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:04:46 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:16 +0100 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:13 +0100 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2CGC22806616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:12 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E2D1AC05F; Mon, 1 Apr 2019 21:02:12 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A905AC068; Mon, 1 Apr 2019 21:02:12 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:12 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:36 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-2213-0000-0000-0000036F1A3B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-2214-0000-0000-00005DDE90EB Message-Id: <20190401210011.16009-3-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id x31L4iMi163601 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 02/97] target/arm: Fix typo in do_sat_addsub_64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Used the wrong temporary in the computation of subtractive overflow. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Alex Bennée Tested-by: Laurent Desnogues Message-id: 20180801123111.3595-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 7a31e0c6c68baffab0867bdd92b8744568b1d3ba) Signed-off-by: Michael Roth --- target/arm/translate-sve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 374051cd20..9dd4c38bab 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -1625,7 +1625,7 @@ static void do_sat_addsub_64(TCGv_i64 reg, TCGv_i64 val, bool u, bool d) /* Detect signed overflow for subtraction. */ tcg_gen_xor_i64(t0, reg, val); tcg_gen_sub_i64(t1, reg, val); - tcg_gen_xor_i64(reg, reg, t0); + tcg_gen_xor_i64(reg, reg, t1); tcg_gen_and_i64(t0, t0, reg); /* Bound the result. */ From patchwork Mon Apr 1 20:58:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161578 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp981298jan; Mon, 1 Apr 2019 14:57:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwokO9i925cX3XnV7AVppGkVmCg0pERrILs1aTilAsy3JNxHyftFK8h6wEkJN+hWBgE2GNO X-Received: by 2002:a25:5905:: with SMTP id n5mr56346764ybb.107.1554155835706; Mon, 01 Apr 2019 14:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554155835; cv=none; d=google.com; s=arc-20160816; b=cSUJAiyreRKKbfgfCMcKByJSaqq5hB1OQmjgXvKX5p2O/YctxOQZrsb3t1Qy1bucsy 08gDa9HNbRcasmIxm583F7RflAVNUy1UadBuyFRstzOs3iPbTBImUA+2j1vlzlaprAKL AHOZt8f/X2lpv47A/GCxkmFOwvlsToPjl/pbZBWai1buK0GjVg6Ua+FA/XpLXAJqToMb rxzJXExeaqX59EXWs+0EigBIqrnkwD+tmBU3sr5ssUyDuy2z2LogX+0OZSqaRoTqlbNG T9PcFouNKzTNFqmAUm0hbwAEa1yU5TXgRDE9wwf69qqp30YxEwRrfKAr7ENBz4CDiibf 2FPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=jkvLBCwYmM5d4WXl9egufOqrYfWQa7CldZobbZkFaKo=; b=UG+OvPbGN1mZDqav6Dxpls6X8+tueoklE2+Igz1lCt1KqbIUnrhnPRm1GHDrvMS9xw 7MxGZaYtp8EmdGQ8UeJf4G8lPzu+UzSn3tcgYm7HVgXz8BwEqFWzA5W8eMtIIQEq6Ply MplJ0JDzedR/aI9i6l+R1zy+wq8uQbMguvp8PkFDyOI4MiaitOSIyGe5miXTmPq64l3N yabj/fWLHNEj4gY5/0URUzIrcU6DC8p00GWIcMj/eJdNEAv6sSnO+CCK5iPPklBjxgv+ bxOVF7qC5qMMEb12GOVlVwADmC9FMDxAHCLa0NmRADV+6NEs+nhr36aQAdXTEYSKxEyi ae+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l9si4217428ybk.276.2019.04.01.14.57.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:52697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4vb-0005su-5P for patch@linaro.org; Mon, 01 Apr 2019 17:57:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB46G-0002tt-5W for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB46E-0004Rj-Qq for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:12 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52778 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB46E-0004JA-HQ for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:10 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L3pmx062123 for ; Mon, 1 Apr 2019 17:03:58 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkskgsy1t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:03:54 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:29 +0100 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:26 +0100 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2P1220447430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:25 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E60F0AE06D; Mon, 1 Apr 2019 21:02:24 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1B41AE060; Mon, 1 Apr 2019 21:02:24 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:24 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:37 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0068-0000-0000-000003AF1BBF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0069-0000-0000-0000480295E9 Message-Id: <20190401210011.16009-4-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x31L3pmx062123 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 03/97] target/arm: Reorganize SVE WHILE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The pseudocode for this operation is an increment + compare loop, so comparing <= the maximum integer produces an all-true predicate. Rather than bound in both the inline code and the helper, pass the helper the number of predicate bits to set instead of the number of predicate elements to set. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Alex Bennée Tested-by: Laurent Desnogues Message-id: 20180801123111.3595-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit bbd0968c458d48e34a08b8694fa3309a9fe1c9e7) Signed-off-by: Michael Roth --- target/arm/sve_helper.c | 5 ---- target/arm/translate-sve.c | 49 +++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 22 deletions(-) -- 2.17.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 9bd0694d55..87594a8adb 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2846,11 +2846,6 @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count, uint32_t pred_desc) return flags; } - /* Scale from predicate element count to bits. */ - count <<= esz; - /* Bound to the bits in the predicate. */ - count = MIN(count, oprsz * 8); - /* Set all of the requested bits. */ for (i = 0; i < count / 64; ++i) { d->p[i] = esz_mask; diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 9dd4c38bab..89efc80ee7 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -3173,19 +3173,19 @@ static bool trans_CTERM(DisasContext *s, arg_CTERM *a, uint32_t insn) static bool trans_WHILE(DisasContext *s, arg_WHILE *a, uint32_t insn) { - if (!sve_access_check(s)) { - return true; - } - - TCGv_i64 op0 = read_cpu_reg(s, a->rn, 1); - TCGv_i64 op1 = read_cpu_reg(s, a->rm, 1); - TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_i64 t1 = tcg_temp_new_i64(); + TCGv_i64 op0, op1, t0, t1, tmax; TCGv_i32 t2, t3; TCGv_ptr ptr; unsigned desc, vsz = vec_full_reg_size(s); TCGCond cond; + if (!sve_access_check(s)) { + return true; + } + + op0 = read_cpu_reg(s, a->rn, 1); + op1 = read_cpu_reg(s, a->rm, 1); + if (!a->sf) { if (a->u) { tcg_gen_ext32u_i64(op0, op0); @@ -3198,32 +3198,47 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a, uint32_t insn) /* For the helper, compress the different conditions into a computation * of how many iterations for which the condition is true. - * - * This is slightly complicated by 0 <= UINT64_MAX, which is nominally - * 2**64 iterations, overflowing to 0. Of course, predicate registers - * aren't that large, so any value >= predicate size is sufficient. */ + t0 = tcg_temp_new_i64(); + t1 = tcg_temp_new_i64(); tcg_gen_sub_i64(t0, op1, op0); - /* t0 = MIN(op1 - op0, vsz). */ - tcg_gen_movi_i64(t1, vsz); - tcg_gen_umin_i64(t0, t0, t1); + tmax = tcg_const_i64(vsz >> a->esz); if (a->eq) { /* Equality means one more iteration. */ tcg_gen_addi_i64(t0, t0, 1); + + /* If op1 is max (un)signed integer (and the only time the addition + * above could overflow), then we produce an all-true predicate by + * setting the count to the vector length. This is because the + * pseudocode is described as an increment + compare loop, and the + * max integer would always compare true. + */ + tcg_gen_movi_i64(t1, (a->sf + ? (a->u ? UINT64_MAX : INT64_MAX) + : (a->u ? UINT32_MAX : INT32_MAX))); + tcg_gen_movcond_i64(TCG_COND_EQ, t0, op1, t1, tmax, t0); } - /* t0 = (condition true ? t0 : 0). */ + /* Bound to the maximum. */ + tcg_gen_umin_i64(t0, t0, tmax); + tcg_temp_free_i64(tmax); + + /* Set the count to zero if the condition is false. */ cond = (a->u ? (a->eq ? TCG_COND_LEU : TCG_COND_LTU) : (a->eq ? TCG_COND_LE : TCG_COND_LT)); tcg_gen_movi_i64(t1, 0); tcg_gen_movcond_i64(cond, t0, op0, op1, t0, t1); + tcg_temp_free_i64(t1); + /* Since we're bounded, pass as a 32-bit type. */ t2 = tcg_temp_new_i32(); tcg_gen_extrl_i64_i32(t2, t0); tcg_temp_free_i64(t0); - tcg_temp_free_i64(t1); + + /* Scale elements to bits. */ + tcg_gen_shli_i32(t2, t2, a->esz); desc = (vsz / 8) - 2; desc = deposit32(desc, SIMD_DATA_SHIFT, 2, a->esz); From patchwork Mon Apr 1 20:58:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161585 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1009010jan; Mon, 1 Apr 2019 15:27:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQgRGkpTRe10spyXBfXUKxeuWnhzTxDFIrFH8hPhmJjyL81NlqMA/9hz2qRxFevOoDYILy X-Received: by 2002:a25:2317:: with SMTP id j23mr7967528ybj.122.1554157628780; Mon, 01 Apr 2019 15:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554157628; cv=none; d=google.com; s=arc-20160816; b=TKwJprOKViQPe0WH1gWq157h1NWD7WvFDwO2I0b1406kJoZYn250y/rVRiyiXN/wlr BsnGWyLuAT3EUfGseW6/PRy7473GqQBZQmMBKW7l6ZDTcZosmsqHbJh8TzpsTcKME00E ezqHaETQgDLQgISL9YaToowzfCq7Co3GPdOwGLTQytaEfykAycIiPnEgZNFJZdCJL4Q+ 4I5iQe67dbSc+jRCQOy55Yvgo+epaquYqLoWuHQYzjiWxkvtqgKynPo0enLYTQ2tESpm PUHlhrEfwD6z5bRvDfSHWUvvSKJ/8lPAuZzErzYHP4pTkt8ZdDlKPqsL2t9qFsyRpQAR 1XnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=HtIP9b95YZlEcNl603EW2oIDuk8jEMWuEjxBgI9O9JA=; b=NH+C0zZ8jjGWJk/Ws/+/mhvX+k59aXOimMYwzqKZR1V8scWVhAlAlOqDpoBb8NaLyJ nEW2dGOSlh1JhmEgBD+Ddbb07+hKKpVfQnEMGK+u41DWq9Yx9y4w+SSB+tNLoFiNKLb8 H05/hjxcPv4sJsS8ux1a2AVw0TMFyA/xaG9t4rS8Kl4icDmHeO8Bn583yy58KAdZIcdB XL9SvM+J0R/orp+xa52A1oe+sEH5kurDpBwR3toIGGOqK+qRMpkVEhXkztE1KK46yroY H9nj9FhRvZlMeZeZ+4IAf2K4uv1gyyb6cjLyO7fGEBKVZ+OL/O7fBUMcG5vgYi0aFFHj Hz8Q== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 12si6702551yww.458.2019.04.01.15.27.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:60566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB5OW-0007pM-6G for patch@linaro.org; Mon, 01 Apr 2019 18:27:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47g-0004Kk-SC for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB47f-0005UB-H2 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB47e-00052v-Jv for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:39 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4wVB140345 for ; Mon, 1 Apr 2019 17:05:06 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rksqasr5q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:05:01 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:40 +0100 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:38 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2bSv54526012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:37 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A52FC605B; Mon, 1 Apr 2019 21:02:37 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01571C6055; Mon, 1 Apr 2019 21:02:37 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:36 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:38 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0012-0000-0000-000017211F23 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0013-0000-0000-000056B7C4BC Message-Id: <20190401210011.16009-5-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x31L4wVB140345 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 04/97] target/arm: Fix typo in helper_sve_movz_d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Alex Bennée Tested-by: Laurent Desnogues Message-id: 20180801123111.3595-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 054e7adf4e64e4acb3b033348ebf7cc871baa34f) Signed-off-by: Michael Roth --- target/arm/sve_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 87594a8adb..c3cbec9cf5 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -1042,7 +1042,7 @@ void HELPER(sve_movz_d)(void *vd, void *vn, void *vg, uint32_t desc) uint64_t *d = vd, *n = vn; uint8_t *pg = vg; for (i = 0; i < opr_sz; i += 1) { - d[i] = n[1] & -(uint64_t)(pg[H1(i)] & 1); + d[i] = n[i] & -(uint64_t)(pg[H1(i)] & 1); } } From patchwork Mon Apr 1 20:58:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161586 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1016209jan; Mon, 1 Apr 2019 15:35:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwetxdb/kkGNfjbh2gwtq/+VdkLEzc1sxhhUg7yj3DBomY2FsmdLIRX8MNIUK2G8EEc4+Ko X-Received: by 2002:a0d:d492:: with SMTP id w140mr44282418ywd.107.1554158112933; Mon, 01 Apr 2019 15:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554158112; cv=none; d=google.com; s=arc-20160816; b=THkwZtRVIRCVPhFUytvYuVZCfKH00nez8zI3foHP1A3K6VztjRwS0++g48Ta+0/GC9 SdTcOlfj9O/QU9XKVMufxV4m8U/TJVLgWopNcBgAsHT25DkbCk1jHDZ9K7lOR1CcPgAp plzTC8z2A/CkWM0xFXmSjyeb1dVg5XHYEm5ELtE0juuUVtSAG6QpwIpQnBHlaAhANZNk KFOVYgB3mzSQVpKdTzbTMDnZxSuXYX7S1L3HdHm1OqNxEkCrDXO+iNsq36x1ZWyXARdT Za6lvksTs+mXD9KFVvEbWiFgFSpOD8DzQ0mjAs8Ikub8Myxc8V//dTeKcGQVDGQpe3cL Xf8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=rK297Sz0uGPUnFUeNgzeRZwgVQYWWId4cdwEZwbO0+o=; b=qv+Gw/f3bmGw+ol2MQZ06xYbMeTAvAfLlV5HXsZbsrRiw5MpfuGOHG59x4DehOL464 ricEUK9xvfuAhz9t8mSGG6rbYzzz68bEptY3YRbYJPltRrHjH+2IPvR7g1z9+kloNtXK 7yJ0JOWIdOD/Y990uDFY3hDQC/9Ve9MyxrEixUcmH4GYbVtE6fbmcIeePSPJvXyzwayi d448G8PwXjK1HjH+uRvPptshjfzzG8F3KM+Rgz8RqBnJ3bMkbEUP6AOx3XLZEu+7UdaB /Xia/QmSlWWc6DhQD7rxUVkfAsGa+ej5VJabtNQbgEf4HlFcBEBxxufQYruCBdn1LDv0 ABUw== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l82si6602140ybb.346.2019.04.01.15.35.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:34860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB5WK-00088W-E3 for patch@linaro.org; Mon, 01 Apr 2019 18:35:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47l-0004Nn-Il for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB47j-0005WM-UE for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:45 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB47h-00053u-U0 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:43 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4xsU140449 for ; Mon, 1 Apr 2019 17:05:07 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rksqasr9f-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:05:02 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:50 +0100 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:47 +0100 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2kAx25952486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:46 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D80CAC062; Mon, 1 Apr 2019 21:02:46 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03FF9AC05B; Mon, 1 Apr 2019 21:02:46 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:45 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:39 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0060-0000-0000-000003271877 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0061-0000-0000-000048CD841E Message-Id: <20190401210011.16009-6-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x31L4xsU140449 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 05/97] target/arm: Fix typo in helper_sve_ld1hss_r X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Cc: qemu-stable@nongnu.org (3.0.1) Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Peter Maydell (cherry picked from commit 573ec0fe40b9a412085ac7dfb41975a0fc2b28dd) Signed-off-by: Michael Roth --- target/arm/sve_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index c3cbec9cf5..e03f954a26 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -4045,7 +4045,7 @@ DO_LD1(sve_ld1bdu_r, cpu_ldub_data_ra, uint64_t, uint8_t, ) DO_LD1(sve_ld1bds_r, cpu_ldsb_data_ra, uint64_t, int8_t, ) DO_LD1(sve_ld1hsu_r, cpu_lduw_data_ra, uint32_t, uint16_t, H1_4) -DO_LD1(sve_ld1hss_r, cpu_ldsw_data_ra, uint32_t, int8_t, H1_4) +DO_LD1(sve_ld1hss_r, cpu_ldsw_data_ra, uint32_t, int16_t, H1_4) DO_LD1(sve_ld1hdu_r, cpu_lduw_data_ra, uint64_t, uint16_t, ) DO_LD1(sve_ld1hds_r, cpu_ldsw_data_ra, uint64_t, int16_t, ) From patchwork Mon Apr 1 20:58:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161576 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp976990jan; Mon, 1 Apr 2019 14:51:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaU/vHJ8KQ3yU8NN007uELQfQCes1ACE5IZXKa3kab0KefwOksdPFkuSg45fZWU/o8EiUH X-Received: by 2002:a25:8149:: with SMTP id j9mr55897018ybm.400.1554155465130; Mon, 01 Apr 2019 14:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554155465; cv=none; d=google.com; s=arc-20160816; b=ckpTLRFE9zT0Umevcda9gYwKWkQR5HTXXZbnjbJB8pXOWR5XZyXM3RtK05tdyPRDbp 2lG+3ZNAxJl/KgIOkc0RYtvTBq0iJ4aft05C8kUD/jFpjJmCMm1Ng9blf7+9hQUm45if 3vi2JzQzsJdN1atpIvK41N8ZDatR1wvrmMKGjh9MOO2YJ2nY9z822I6UAW06HfZsPwVG ndRViLXdhDdAey6ny3nDNgj1eZafijYAvGpwkm9+F/ly8zo4WqPkdfTkM4jQEEYHbacQ YK2NP4xhtDxWLgPWgtoRILyISWHDvJz/ntRo8XSIxXtjY3aN91Sn3O/K23jLwRgBzdjh r/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=ixuJThxkm9FHwgWynGwQxvTbSKl/X4PrDYvxr/X8CHY=; b=APrhQ6CXk84tyo4aAvW0Wuk2nLGzWW+5ihO9RtuUm42FxNec//tL0xB0kIPILhpQZK hBbc1cDLwGjXJJR//kUrZLLnWUwJn+axJXRK9+np4s+95yD9Qk+jYuzDCFYahS4E08n5 dIVNSeXZ8Bk6vMa/8gB3mcWd7RQb4hgoYmurLNK2vICvR8zfnb4XwZT4514eDX1tYRD4 EM+qm2pOHEh2Ce1+GHFl+RrHhu7f1GUQqcI2XQ+iIEE6yhsLp5wBxftWga9hdLu5WZGj Hv2axEUPndIuhLHi1UCIz0dQLppw951djBsOt928iSoXW52XNMxV6a2UpbwnDJDp1Cib AfyA== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a15si6850186ybe.135.2019.04.01.14.51.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:50814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4pc-0005Vp-IU for patch@linaro.org; Mon, 01 Apr 2019 17:51:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB45X-0002Gh-Db for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:03:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB45W-00042Z-8A for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:03:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB45V-0003us-EF for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:03:26 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L2AZ3119067 for ; Mon, 1 Apr 2019 17:03:14 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkqt6070k-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:03:12 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:03:02 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:58 +0100 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2vL231195336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:57 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FEA56E054; Mon, 1 Apr 2019 21:02:57 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B95B6E056; Mon, 1 Apr 2019 21:02:57 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:57 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:40 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0004-0000-0000-000014F71F5F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:03:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0005-0000-0000-00008B1BBF6A Message-Id: <20190401210011.16009-7-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=978 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x31L2AZ3119067 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 06/97] target/arm: Fix sign-extension in sve do_ldr/do_str X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The expression (int) imm + (uint32_t) len_align turns into uint32_t and thus with negative imm produces a memory operation at the wrong offset. None of the numbers involved are particularly large, so change everything to use int. Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Peter Maydell (cherry picked from commit 19f2acc915a0f8f443a959844540a6f09133cc96) Signed-off-by: Michael Roth --- target/arm/translate-sve.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 89efc80ee7..9e63b5f8e5 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4372,12 +4372,11 @@ static bool trans_UCVTF_dd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) * The load should begin at the address Rn + IMM. */ -static void do_ldr(DisasContext *s, uint32_t vofs, uint32_t len, - int rn, int imm) +static void do_ldr(DisasContext *s, uint32_t vofs, int len, int rn, int imm) { - uint32_t len_align = QEMU_ALIGN_DOWN(len, 8); - uint32_t len_remain = len % 8; - uint32_t nparts = len / 8 + ctpop8(len_remain); + int len_align = QEMU_ALIGN_DOWN(len, 8); + int len_remain = len % 8; + int nparts = len / 8 + ctpop8(len_remain); int midx = get_mem_index(s); TCGv_i64 addr, t0, t1; @@ -4458,12 +4457,11 @@ static void do_ldr(DisasContext *s, uint32_t vofs, uint32_t len, } /* Similarly for stores. */ -static void do_str(DisasContext *s, uint32_t vofs, uint32_t len, - int rn, int imm) +static void do_str(DisasContext *s, uint32_t vofs, int len, int rn, int imm) { - uint32_t len_align = QEMU_ALIGN_DOWN(len, 8); - uint32_t len_remain = len % 8; - uint32_t nparts = len / 8 + ctpop8(len_remain); + int len_align = QEMU_ALIGN_DOWN(len, 8); + int len_remain = len % 8; + int nparts = len / 8 + ctpop8(len_remain); int midx = get_mem_index(s); TCGv_i64 addr, t0; From patchwork Mon Apr 1 20:58:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161579 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp983211jan; Mon, 1 Apr 2019 15:00:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoZjj1lJZhLU6W6to8Jxvz/+cE2ZdmCGJzOluYNzQHhL05Fky0wNsbKBTWs/4+jq6fQAJL X-Received: by 2002:a81:6045:: with SMTP id u66mr20659553ywb.53.1554156000469; Mon, 01 Apr 2019 15:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554156000; cv=none; d=google.com; s=arc-20160816; b=q4PmA25OSCPArB1OE2UEzoXJdubNJoi/Ow8H4DsTL+YrlsIf2dmyP20TFHuN/kmsz6 OenY9EN5RCZCmKRFJMb4XqBb70OUHxx+IGaBQ5DUTlsdS5dEbOfiNahnlZphY4JcDLpC 9nf7zWG8HMpmaWzelwQFWNQtptv/Fmr6Dx+7KVVvcbVr2WHwIbYzgr3+5c7jJe/9RxhF TGhGVyHSYfe9JEfuPV7RJqANGGB4ZnsGOY+OKtuSN3U0EfdG1ibi6l63dZ44bir8nOoZ sBjHsFTuM+dpxxL3CgW/1sYK8fmVjxTbZ1ILspwS2O04A+ZARny2MsYgkVbYDttfSGmj mB4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=s1J1Tl1SjdP88iHpp739mq3lTqviO1MactBUl7mSJXw=; b=l3GIlsuFyaQNgRsE3hSB6pWrPhCd+CbWpDh4tk5F642y7sXK+aJbBonHky5n5xMURi rMipoXcbZ3KaFiUvY5lcPyOSLaA5dup/xHnRYd1HG0kwDG1RLiR8/Wpu+kfU4KePQBmL 7U1K0avGl2/Ip9M7ermTQypWW9W1j1o+6/lSHJwxad2LbDpnt59A4ULEkY3MUrEuIPul OjAIx3lGuzPLaC00KdtXz0Tb8LILw20UxSTPJ5KSzIkgFpblAMjOo1y6G2Tr5qL8nC5p gb5Zcmd2WGsEO6jHYB5ctd5FaYSA2zqJcJ2Dra3sMTRcDo7tSGhuAAHbmhnnnuwUjPp+ xXWQ== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t128si6549370yba.390.2019.04.01.15.00.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:00:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:53507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4yF-0008F2-VT for patch@linaro.org; Mon, 01 Apr 2019 18:00:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB46J-0002xl-Uf for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB46I-0004US-Mu for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53978 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB46I-0004Li-HP for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:14 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L3tNK062270 for ; Mon, 1 Apr 2019 17:04:02 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkskgsyq4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:03:58 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:03:10 +0100 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:03:08 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L38ux18743406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:03:08 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E89F4B205F; Mon, 1 Apr 2019 21:03:07 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1C10B2067; Mon, 1 Apr 2019 21:03:07 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:03:07 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:41 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0064-0000-0000-000003C5174B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:03:10 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0065-0000-0000-00003CEA8137 Message-Id: <20190401210011.16009-8-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 07/97] target/arm: Fix offset for LD1R instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The immediate should be scaled by the size of the memory reference, not the size of the elements into which it is loaded. Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Tested-by: Laurent Desnogues Reviewed-by: Laurent Desnogues Signed-off-by: Peter Maydell (cherry picked from commit d0e372b0298f897993f831dbff7ad4f1c70f138e) Signed-off-by: Michael Roth --- target/arm/translate-sve.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 9e63b5f8e5..f635822a61 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4819,6 +4819,7 @@ static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) unsigned vsz = vec_full_reg_size(s); unsigned psz = pred_full_reg_size(s); unsigned esz = dtype_esz[a->dtype]; + unsigned msz = dtype_msz(a->dtype); TCGLabel *over = gen_new_label(); TCGv_i64 temp; @@ -4842,7 +4843,7 @@ static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) /* Load the data. */ temp = tcg_temp_new_i64(); - tcg_gen_addi_i64(temp, cpu_reg_sp(s, a->rn), a->imm << esz); + tcg_gen_addi_i64(temp, cpu_reg_sp(s, a->rn), a->imm << msz); tcg_gen_qemu_ld_i64(temp, temp, get_mem_index(s), s->be_data | dtype_mop[a->dtype]); From patchwork Mon Apr 1 20:58:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161568 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp938990jan; Mon, 1 Apr 2019 14:05:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwID5t6+RgQ0dGhulbDzgZLzHK5RiGYb5bLOwE+mQSGKD/AsDi5Kp35Mi8D9IKZErNisyjG X-Received: by 2002:a81:9110:: with SMTP id i16mr56300052ywg.174.1554152711171; Mon, 01 Apr 2019 14:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152711; cv=none; d=google.com; s=arc-20160816; b=aQPEDEbydZeMFEAkoxNeTzVjbr5GPI0GDdQh7hh374oG2DUupiDQl4psJZvMv2hiKS Hc/h7HSB0PTG7hoFS5fq0aq/lrO1wXddgLhvb0Br7vuy0XbWYIH1kxHTxjXt7qU7ADhq 9HJ1G/huMVSCZ2Hp6tJiSvivtgiTazjvoBj6rigNeM2+9uDRpZw07RFbpsQszaRAq+ma aAVJPt7F6ezRZ2r+EGih+RTRkbEBgqWaanED5eYaZcgxuaamnKZ0BOpE0ZeKzgHzdq13 KEakN28t8NpqyFYrqUNMc7BowYKwNXw79iIxLR6tPB8EZUSQ08gVxQcXQqv5dcLpKgVZ IiMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=mN/cRD+zciXU6XSogWPZ/mEDkx1sGiiSeEwrteIw5sc=; b=RNJrnRp2QNh9OufqUpIOsJziGaRGgYYKGhv86Cau8+Cwe3MTGNODNqvUrhs1Lozl8G higVR6Lj1Dr9hhwxyVKI6g3KtMiTNWnYdgXVQ43evG4ts4vxV9BuCS8vWJ8P7w5fxH/h DmfUFP/f6eloPR0doIUOZqZ/YSuRKtg2WQHM1dbW8rvPTSg6Sq6IqvVCl6fx2eLVr6eN wTD1GgahXbJDHwBiVHxuQ5Sq+/wBY1V79S/raiWIw2YMsbhus3bQdkpI9pDGGHPAMMjN ozD9kqAH0YAcp5NkighAjzxNxIG1dAZwa5MxTPwaezNSQ2RJCNbYCf3WAGdS5NiWJVpn U87w== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b85si5872886yba.155.2019.04.01.14.05.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:38321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47B-0003lF-4d for patch@linaro.org; Mon, 01 Apr 2019 17:05:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43r-0000mc-Ev for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43o-0002xt-H1 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:41 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36700 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43l-0002r8-KP for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:39 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrYUe156165 for ; Mon, 1 Apr 2019 17:01:28 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rksyp8m6y-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:28 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:27 +0100 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:25 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1ODM20447328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:24 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4253B205F; Mon, 1 Apr 2019 21:01:24 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AEFB9B2068; Mon, 1 Apr 2019 21:01:24 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:24 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:42 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0068-0000-0000-000003AF1B91 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0069-0000-0000-000048029547 Message-Id: <20190401210011.16009-9-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 08/97] target/arm: Fix offset scaling for LD_zprr and ST_zprr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The scaling should be solely on the memory operation size; the number of registers being loaded does not come in to the initial computation. Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Tested-by: Laurent Desnogues Reviewed-by: Laurent Desnogues Signed-off-by: Peter Maydell (cherry picked from commit 50ef1cbf31caad21019ae6fa8036ed6f29244ba5) Signed-off-by: Michael Roth --- target/arm/translate-sve.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index f635822a61..d27bc8c946 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4665,8 +4665,7 @@ static bool trans_LD_zprr(DisasContext *s, arg_rprr_load *a, uint32_t insn) } if (sve_access_check(s)) { TCGv_i64 addr = new_tmp_a64(s); - tcg_gen_muli_i64(addr, cpu_reg(s, a->rm), - (a->nreg + 1) << dtype_msz(a->dtype)); + tcg_gen_shli_i64(addr, cpu_reg(s, a->rm), dtype_msz(a->dtype)); tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); do_ld_zpa(s, a->rd, a->pg, addr, a->dtype, a->nreg); } @@ -4899,7 +4898,7 @@ static bool trans_ST_zprr(DisasContext *s, arg_rprr_store *a, uint32_t insn) } if (sve_access_check(s)) { TCGv_i64 addr = new_tmp_a64(s); - tcg_gen_muli_i64(addr, cpu_reg(s, a->rm), (a->nreg + 1) << a->msz); + tcg_gen_shli_i64(addr, cpu_reg(s, a->rm), a->msz); tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); do_st_zpa(s, a->rd, a->pg, addr, a->msz, a->esz, a->nreg); } From patchwork Mon Apr 1 20:58:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161567 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp935962jan; Mon, 1 Apr 2019 14:02:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6jkLa57cr338Ji6v69/jyAS37QTgqPKOehijh1TRMgMDkHb4TqyLI8lqqFCzHABnreEnk X-Received: by 2002:a25:6941:: with SMTP id e62mr52383133ybc.97.1554152536239; Mon, 01 Apr 2019 14:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152536; cv=none; d=google.com; s=arc-20160816; b=zIRisHjvpoZhgGLSHQ1xWtwC9hKjSaE8KTIjC5+gX3K1SNAD4SC4GUrnr/ozH2ikD5 Nt7EBM7TMl8nbigybdg6BmtdmTjuMEF8lt0m+sbNFau9jcHGZqcyEh1BC5fZpvLQE+Dg gcbsMQOIrRe5Z/2Z3KK36OwWUPBsdNtP30Jn+DN77Ls8sjUMXSAcSxfD8cWMYuSjgrO8 t74nsB0AP2F5/S1czNOJlfTWYIfPO65eGiEY2MpqLDoTWqF1OQkBnPfVKWgSsxektxvs zxlYWGkvcu5Uximk42XZNU+2WqDHsTZRHkBYIrbUX0tRmuju6jXBsOMQpnmFp6lJ4Hyu DQhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=stYefH9mFzGkj6RLDrLAi5METpiLVQy08Q/bDyqJuBw=; b=Vjyzs39q0G27MMtR7EUTDtQFAxV0CeEDZrP8oX2EOD6Gu810cGDidtk1jrAQwGTV2l fwjoT3/FYkId1FBVWsVrmYuOwlcTqvv/6HLXnKIaqti7YKov5pG6hHRucoWvzjZ0toDG 8AvrUA5oY42jVoEs2j/qQ+LI3Z3VDYJsGsihSBpU9pok75T/mkSq1+e5AFNjz+iAAqGI 52TOzOgieKx/lfo/uHkTghgpzu2kjEkyZf1Cu7ci7fdeNzEQOj1Uv1ZlzOctvuWERUjC i83B77EU/XTlB6u+vT0hS0WsDHe5MpdTLU6VSGFQO8v81WDpzvb7jgOyb5LQFvuZAOEo i1EA== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 135si6600369ywp.288.2019.04.01.14.02.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:37406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB44N-0000n6-Kc for patch@linaro.org; Mon, 01 Apr 2019 17:02:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43t-0000ml-BQ for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43p-0002zy-HO for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54124 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43l-0002sV-KR for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:39 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrWCB136226 for ; Mon, 1 Apr 2019 17:01:31 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rksx78tce-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:30 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:29 +0100 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:27 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1QgQ20906134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:26 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68DC6C605A; Mon, 1 Apr 2019 21:01:26 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03A40C6063; Mon, 1 Apr 2019 21:01:25 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:25 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:43 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0020-0000-0000-00000ED21EA8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0021-0000-0000-00006548BE8B Message-Id: <20190401210011.16009-10-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id x31KrWCB136226 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 09/97] target/arm: Reformat integer register dump X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson With PC, there are 33 registers. Three per line lines up nicely without overflowing 80 columns. Cc: qemu-stable@nongnu.org (3.0.1) Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Peter Maydell (cherry picked from commit 3cb506a399854c481c2fd2efabecda0654700c47) Signed-off-by: Michael Roth --- target/arm/translate-a64.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 45a6c2a3aa..358f169c75 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -137,14 +137,13 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int el = arm_current_el(env); const char *ns_status; - cpu_fprintf(f, "PC=%016"PRIx64" SP=%016"PRIx64"\n", - env->pc, env->xregs[31]); - for (i = 0; i < 31; i++) { - cpu_fprintf(f, "X%02d=%016"PRIx64, i, env->xregs[i]); - if ((i % 4) == 3) { - cpu_fprintf(f, "\n"); + cpu_fprintf(f, " PC=%016" PRIx64 " ", env->pc); + for (i = 0; i < 32; i++) { + if (i == 31) { + cpu_fprintf(f, " SP=%016" PRIx64 "\n", env->xregs[i]); } else { - cpu_fprintf(f, " "); + cpu_fprintf(f, "X%02d=%016" PRIx64 "%s", i, env->xregs[i], + (i + 2) % 3 ? " " : "\n"); } } From patchwork Mon Apr 1 20:58:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161570 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp939455jan; Mon, 1 Apr 2019 14:05:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQmwNZU3b9flf/UsSbN9sUiYms6LdjsqBIefhOL6/xcjiNjawFKV5Yu9+XVX2JpwLqAzip X-Received: by 2002:a81:5f88:: with SMTP id t130mr44982340ywb.453.1554152743349; Mon, 01 Apr 2019 14:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152743; cv=none; d=google.com; s=arc-20160816; b=SKZXexLPuJcYRaIefk1AD3AHSX5nx5htPRkQEiEiQ+yykhlefVmbHeIoe9DAeu4Y0L sD/yHXjB/Isnpta6U1EiFF6T44I1hc3Rh0EiDv7mrgL6ps9dntMHGicHzN4NRpRuogEN 4T0JnBKZ2MgdgR25tE0REcj5zA/OtKSyGElbLbq8ECmsSfEeJhVD0d5Ew0AehK/uHHuv vqLLiwyZG2FDb090StoIJq+wfpzMDpsPWjpT5DOE3cOIF2jI3giHHppNL5GuOdm8P0pT vzcBvb1bU/F1fSWIMxlkef0wfSt9ibCOOfBp6KY8fwY6kbIwgPfwOh2CjNSMY9XLuJSK DLjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=gzItAooFcpcYeXpsKbczh2DnotIp12OnFdcbR1c5tiU=; b=rgtczJk0aDQFcZOl+3bUOA31LoWQCYpgjAwZUzDQJ3PRM31eGi6G64NToaaJob8zr9 v2QXmEHkrLeZC+Y/Kj6eDy6Vj2bIKtZbHDE/oSOIQjcE5FXvelSUTMkvjfj5aWBZ3kx5 WL5jHdVQ9qeiibKFxmiqPVKERp7tWbnBTpMnsXjW7nkoz5KCNDJ8yWVbKv7nUY+V3oXw gb+xUrb3NcL3jJveQ2Zs/ImOP3yWwKL+FT6eF7E1nVa3qIEUQwGUG0PR0UGgtQ6Kicab J/H0/Km5baco3H+20mLm46p3Kr2BN1bO4h/bNGig8dAcRz4zEDrwYCYoAC0mGssijHAr FgDQ== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a127si6373582ybb.6.2019.04.01.14.05.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:38495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47i-0004MG-Mu for patch@linaro.org; Mon, 01 Apr 2019 17:05:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43v-0000nh-SH for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43u-000328-11 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:47 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38724 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43t-0002xe-JF for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:45 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrYVw156183 for ; Mon, 1 Apr 2019 17:01:40 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rksyp8mgu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:39 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:38 +0100 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:36 +0100 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1ZdQ23396484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:35 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D5E26E056; Mon, 1 Apr 2019 21:01:35 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 041D06E053; Mon, 1 Apr 2019 21:01:34 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:34 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:44 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0012-0000-0000-000017211E9F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0013-0000-0000-000056B7C3D8 Message-Id: <20190401210011.16009-11-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id x31KrYVw156183 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 10/97] target/arm: Dump SVE state if enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Also fold the FPCR/FPSR state onto the same line as PSTATE, and mention but do not dump disabled FPU state. Cc: qemu-stable@nongnu.org (3.0.1) Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Peter Maydell (cherry picked from commit 2bf5f3f91bb4e3faa2a19aec042138a938afbf6a) Signed-off-by: Michael Roth --- target/arm/translate-a64.c | 93 +++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 358f169c75..b29dc49c4f 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -152,8 +152,7 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f, } else { ns_status = ""; } - - cpu_fprintf(f, "\nPSTATE=%08x %c%c%c%c %sEL%d%c\n", + cpu_fprintf(f, "PSTATE=%08x %c%c%c%c %sEL%d%c", psr, psr & PSTATE_N ? 'N' : '-', psr & PSTATE_Z ? 'Z' : '-', @@ -163,17 +162,89 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f, el, psr & PSTATE_SP ? 'h' : 't'); - if (flags & CPU_DUMP_FPU) { - int numvfpregs = 32; - for (i = 0; i < numvfpregs; i++) { + if (!(flags & CPU_DUMP_FPU)) { + cpu_fprintf(f, "\n"); + return; + } + cpu_fprintf(f, " FPCR=%08x FPSR=%08x\n", + vfp_get_fpcr(env), vfp_get_fpsr(env)); + + if (arm_feature(env, ARM_FEATURE_SVE)) { + int j, zcr_len = env->vfp.zcr_el[1] & 0xf; /* fix for system mode */ + + for (i = 0; i <= FFR_PRED_NUM; i++) { + bool eol; + if (i == FFR_PRED_NUM) { + cpu_fprintf(f, "FFR="); + /* It's last, so end the line. */ + eol = true; + } else { + cpu_fprintf(f, "P%02d=", i); + switch (zcr_len) { + case 0: + eol = i % 8 == 7; + break; + case 1: + eol = i % 6 == 5; + break; + case 2: + case 3: + eol = i % 3 == 2; + break; + default: + /* More than one quadword per predicate. */ + eol = true; + break; + } + } + for (j = zcr_len / 4; j >= 0; j--) { + int digits; + if (j * 4 + 4 <= zcr_len + 1) { + digits = 16; + } else { + digits = (zcr_len % 4 + 1) * 4; + } + cpu_fprintf(f, "%0*" PRIx64 "%s", digits, + env->vfp.pregs[i].p[j], + j ? ":" : eol ? "\n" : " "); + } + } + + for (i = 0; i < 32; i++) { + if (zcr_len == 0) { + cpu_fprintf(f, "Z%02d=%016" PRIx64 ":%016" PRIx64 "%s", + i, env->vfp.zregs[i].d[1], + env->vfp.zregs[i].d[0], i & 1 ? "\n" : " "); + } else if (zcr_len == 1) { + cpu_fprintf(f, "Z%02d=%016" PRIx64 ":%016" PRIx64 + ":%016" PRIx64 ":%016" PRIx64 "\n", + i, env->vfp.zregs[i].d[3], env->vfp.zregs[i].d[2], + env->vfp.zregs[i].d[1], env->vfp.zregs[i].d[0]); + } else { + for (j = zcr_len; j >= 0; j--) { + bool odd = (zcr_len - j) % 2 != 0; + if (j == zcr_len) { + cpu_fprintf(f, "Z%02d[%x-%x]=", i, j, j - 1); + } else if (!odd) { + if (j > 0) { + cpu_fprintf(f, " [%x-%x]=", j, j - 1); + } else { + cpu_fprintf(f, " [%x]=", j); + } + } + cpu_fprintf(f, "%016" PRIx64 ":%016" PRIx64 "%s", + env->vfp.zregs[i].d[j * 2 + 1], + env->vfp.zregs[i].d[j * 2], + odd || j == 0 ? "\n" : ":"); + } + } + } + } else { + for (i = 0; i < 32; i++) { uint64_t *q = aa64_vfp_qreg(env, i); - uint64_t vlo = q[0]; - uint64_t vhi = q[1]; - cpu_fprintf(f, "q%02d=%016" PRIx64 ":%016" PRIx64 "%c", - i, vhi, vlo, (i & 1 ? '\n' : ' ')); + cpu_fprintf(f, "Q%02d=%016" PRIx64 ":%016" PRIx64 "%s", + i, q[1], q[0], (i & 1 ? "\n" : " ")); } - cpu_fprintf(f, "FPCR: %08x FPSR: %08x\n", - vfp_get_fpcr(env), vfp_get_fpsr(env)); } } From patchwork Mon Apr 1 20:58:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161573 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp942861jan; Mon, 1 Apr 2019 14:09:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzokmAZ3BJ75tu1V+zB//Qo8c2tqm5z6LUjIz440HH/ldXJBuGD3IiGQH+MNUzV6PzgFzvn X-Received: by 2002:a81:58a:: with SMTP id 132mr1788967ywf.460.1554152965360; Mon, 01 Apr 2019 14:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152965; cv=none; d=google.com; s=arc-20160816; b=Ao7XO/dupnc6IHTdZ6N2ceUUsi80JXvolQKuQBGMLJf9KRCAIsoQ95RGqfE1B2udh1 8qIZ5+2qW90YVCre7TwrrdW7WQAaDgCJNeYVIzzp6Kb8r9KxaOvmtwgdegzT+WD1hYA/ 9uAIEc4xJ+/PUGtB5ikjw2hpB41QootJMYFNeWmxx8DPNCENuEfu4WkG9hjOVW+i5JQA RIYwKTsHqYgbYkhtaKLjqKtMTGk4g75iEst2Fdgi8IlnGYJ/3AolQkzPOxG2GVCrEEB/ wbNVEBtlOJxRcej/FObeeMiEnl/GnvEuWFG7HHeCk0Hgszxmnv+cS2I+4V/e3GcSGtxl pazg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=EGhK6SVZ0icXAuRmfJw45YwFZ2uq1zyhxUVAnOowlLg=; b=utJcE7UeT0a89KaT7D2Y2iKLdvFsr9EUAo3eRLMwzW1HKdgPGs7vLd70JNMhJ2y57X cg+40t5R1GLgmHTGi38HV1e34VDyR5JpaHWX+JpqSSZToopBmn3VsZdoJg3eWzJddxz9 kBGYrUnxl0UzWljCHoLugiJ0M/hiDST2mlKKhNg43HjhsVfVPRzyHiCbC6g2Y+TDiT4M tiTToF03fZZIKh0jSBVga5HWc8R2rHxpEX0nFLrolsZNtg01OOgR/WgsLhnoK47NX8RU V+oKFgAOrTbByc/suRKtGjA/emjZ+yxM5tOpYlSocc1P3TnmT+Egwe72Ed409PosCZC0 ReCA== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t206si6611519yba.2.2019.04.01.14.09.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:39484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4BI-0007Wj-PV for patch@linaro.org; Mon, 01 Apr 2019 17:09:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43x-0000oe-IW for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43u-00032z-7e for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43t-00030h-KN for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:46 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrUhh087134 for ; Mon, 1 Apr 2019 17:01:42 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rksvqgykj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:41 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:40 +0100 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:37 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1a3J23527670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:36 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 083F5B2064; Mon, 1 Apr 2019 21:01:36 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4CA0B2066; Mon, 1 Apr 2019 21:01:35 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:35 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:45 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0064-0000-0000-000003C5171A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0065-0000-0000-00003CEA806B Message-Id: <20190401210011.16009-12-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x31KrUhh087134 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 11/97] target/arm: Add sve-max-vq cpu property to -cpu max X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This allows the default (and maximum) vector length to be set from the command-line. Which is extraordinarily helpful in debugging problems depending on vector length without having to bake knowledge of PR_SET_SVE_VL into every guest binary. Cc: qemu-stable@nongnu.org (3.0.1) Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Peter Maydell (cherry picked from commit adf92eab90e3f5f34c285da6d14d48952b7a8e72) Signed-off-by: Michael Roth --- linux-user/syscall.c | 19 +++++++++++++------ target/arm/cpu.c | 6 +++--- target/arm/cpu.h | 3 +++ target/arm/cpu64.c | 29 +++++++++++++++++++++++++++++ target/arm/helper.c | 7 +++++-- 5 files changed, 53 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index dfc851cc35..5a4af76c03 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10848,15 +10848,22 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_AARCH64 case TARGET_PR_SVE_SET_VL: - /* We cannot support either PR_SVE_SET_VL_ONEXEC - or PR_SVE_VL_INHERIT. Therefore, anything above - ARM_MAX_VQ results in EINVAL. */ + /* + * We cannot support either PR_SVE_SET_VL_ONEXEC or + * PR_SVE_VL_INHERIT. Note the kernel definition + * of sve_vl_valid allows for VQ=512, i.e. VL=8192, + * even though the current architectural maximum is VQ=16. + */ ret = -TARGET_EINVAL; if (arm_feature(cpu_env, ARM_FEATURE_SVE) - && arg2 >= 0 && arg2 <= ARM_MAX_VQ * 16 && !(arg2 & 15)) { + && arg2 >= 0 && arg2 <= 512 * 16 && !(arg2 & 15)) { CPUARMState *env = cpu_env; - int old_vq = (env->vfp.zcr_el[1] & 0xf) + 1; - int vq = MAX(arg2 / 16, 1); + ARMCPU *cpu = arm_env_get_cpu(env); + uint32_t vq, old_vq; + + old_vq = (env->vfp.zcr_el[1] & 0xf) + 1; + vq = MAX(arg2 / 16, 1); + vq = MIN(vq, cpu->sve_max_vq); if (vq < old_vq) { aarch64_sve_narrow_vq(env, vq); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 64a8005a4b..b25898ed4c 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -168,9 +168,9 @@ static void arm_cpu_reset(CPUState *s) env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 16, 2, 3); env->cp15.cptr_el[3] |= CPTR_EZ; /* with maximum vector length */ - env->vfp.zcr_el[1] = ARM_MAX_VQ - 1; - env->vfp.zcr_el[2] = ARM_MAX_VQ - 1; - env->vfp.zcr_el[3] = ARM_MAX_VQ - 1; + env->vfp.zcr_el[1] = cpu->sve_max_vq - 1; + env->vfp.zcr_el[2] = env->vfp.zcr_el[1]; + env->vfp.zcr_el[3] = env->vfp.zcr_el[1]; #else /* Reset into the highest available EL */ if (arm_feature(env, ARM_FEATURE_EL3)) { diff --git a/target/arm/cpu.h b/target/arm/cpu.h index e310ffc29d..9526ed27cb 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -857,6 +857,9 @@ struct ARMCPU { /* Used to synchronize KVM and QEMU in-kernel device levels */ uint8_t device_irq_level; + + /* Used to set the maximum vector length the cpu will support. */ + uint32_t sve_max_vq; }; static inline ARMCPU *arm_env_get_cpu(CPUARMState *env) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index d0581d59d8..800bff780e 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -29,6 +29,7 @@ #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "kvm_arm.h" +#include "qapi/visitor.h" static inline void set_feature(CPUARMState *env, int feature) { @@ -217,6 +218,29 @@ static void aarch64_a53_initfn(Object *obj) define_arm_cp_regs(cpu, cortex_a57_a53_cp_reginfo); } +static void cpu_max_get_sve_vq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + visit_type_uint32(v, name, &cpu->sve_max_vq, errp); +} + +static void cpu_max_set_sve_vq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + Error *err = NULL; + + visit_type_uint32(v, name, &cpu->sve_max_vq, &err); + + if (!err && (cpu->sve_max_vq == 0 || cpu->sve_max_vq > ARM_MAX_VQ)) { + error_setg(&err, "unsupported SVE vector length"); + error_append_hint(&err, "Valid sve-max-vq in range [1-%d]\n", + ARM_MAX_VQ); + } + error_propagate(errp, err); +} + /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); * otherwise, a CPU with as many features enabled as our emulation supports. * The version of '-cpu max' for qemu-system-arm is defined in cpu.c; @@ -253,6 +277,10 @@ static void aarch64_max_initfn(Object *obj) cpu->ctr = 0x80038003; /* 32 byte I and D cacheline size, VIPT icache */ cpu->dcz_blocksize = 7; /* 512 bytes */ #endif + + cpu->sve_max_vq = ARM_MAX_VQ; + object_property_add(obj, "sve-max-vq", "uint32", cpu_max_get_sve_vq, + cpu_max_set_sve_vq, NULL, NULL, &error_fatal); } } @@ -405,6 +433,7 @@ void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq) uint64_t pmask; assert(vq >= 1 && vq <= ARM_MAX_VQ); + assert(vq <= arm_env_get_cpu(env)->sve_max_vq); /* Zap the high bits of the zregs. */ for (i = 0; i < 32; i++) { diff --git a/target/arm/helper.c b/target/arm/helper.c index 66afb08ee0..c24c66d43e 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -12408,9 +12408,12 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, zcr_len = 0; } else { int current_el = arm_current_el(env); + ARMCPU *cpu = arm_env_get_cpu(env); - zcr_len = env->vfp.zcr_el[current_el <= 1 ? 1 : current_el]; - zcr_len &= 0xf; + zcr_len = cpu->sve_max_vq - 1; + if (current_el <= 1) { + zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); + } if (current_el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]); } From patchwork Mon Apr 1 20:58:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161571 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp939602jan; Mon, 1 Apr 2019 14:05:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSXY4+VYRP0HcTtLrO1yRe9l+eIJJe+pyl/yvyu+FOglpW4cjYZo0bSI8Qz7lkNsORsVqH X-Received: by 2002:a25:4405:: with SMTP id r5mr53830913yba.413.1554152751964; Mon, 01 Apr 2019 14:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152751; cv=none; d=google.com; s=arc-20160816; b=mxO/RDOobEFwTH/QESDBs6yhAHoQRoHzj8AwugAgGa0WzG0W7dGy/p6pu/jCVrQz9l X32Y+TWY4BKPvSnt27OW3wpUwxYzPj6JKvlAvWZi5ZQ04dSaxXgpxT1+086hvwXvbZ0J cDf/fbhRkvi9fA4csH/Vq3HEbuIsRf0vwA/9xfH5nIH0UiUpqN8nv8+uUK2llBCYsZqQ xfqK4m8pr2KraBfYYjgYEkvvQECFfCFpd79jy2njDB8ADlRjLVkRkjNzEsqoJCP+H+fg TRuN7XhYo1KBY7fiQ5U9FtAC8IEz6OfRszKOiQwFRiwejc8Ci9hY5OBT73erETOpfzzY zxVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=TdVfPqFse6y4bkid2iD2mTUPrJIi9vk/IPbpVTcHDF4=; b=D+G2meMM/Bx/cCN/3VKSxTKhVz2mGhsF+/uycu7sQfKsJCgko0DES1JnB6EbH5lofN auK70LduwDHDN0qQQC+fiqrgPlyCXVWTHqgrtHatWabJRkUNMwEVAbXQjjCa0foNgb+e 8dY+GTxIUJIXSlFq7vOdRqk7U/DY+8yKa2V2/+bnqqYgsZAvTMEdgn3HfMYhtqyJtTwl BosarSGz19imQULIeQhvoSUwK1xLBDhHvskB6PtpZnR5feMWaF3ziJUad2I+e9BjVsmr DDcixkVg8wjsMLOM2psw7ZtwiEFlogh+Q/GMAwg08jDffX3P2E9s4TZwDLoYK9x84HXb fFVg== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s15si7070531ybc.182.2019.04.01.14.05.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:05:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:38542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47r-0004Ty-F1 for patch@linaro.org; Mon, 01 Apr 2019 17:05:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43w-0000oZ-PQ for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43v-00033f-19 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:48 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43t-00030l-Q8 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:46 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrYJ4050042 for ; Mon, 1 Apr 2019 17:01:42 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkqrc06gj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:41 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:40 +0100 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:38 +0100 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1bpp31522954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:37 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8ABA56A04D; Mon, 1 Apr 2019 21:01:37 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38FEF6A057; Mon, 1 Apr 2019 21:01:37 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:37 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:47 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-8235-0000-0000-00000E781E4C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-8236-0000-0000-000044FDBFF5 Message-Id: <20190401210011.16009-14-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 13/97] target/arm: Adjust FPCR_MASK for FZ16 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson When support for FZ16 was added, we failed to include the bit within FPCR_MASK, which means that it could never be set. Continue to zero FZ16 when ARMv8.2-FP16 is not enabled. Fixes: d81ce0ef2c4 Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Laurent Desnogues Message-id: 20180810193129.1556-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 0b62159be33d45d00dfa34a317c6d3da30ffb480) Signed-off-by: Michael Roth --- target/arm/cpu.h | 2 +- target/arm/helper.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 9526ed27cb..0dce472aae 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1263,7 +1263,7 @@ void vfp_set_fpscr(CPUARMState *env, uint32_t val); * we store the underlying state in fpscr and just mask on read/write. */ #define FPSR_MASK 0xf800009f -#define FPCR_MASK 0x07f79f00 +#define FPCR_MASK 0x07ff9f00 #define FPCR_FZ16 (1 << 19) /* ARMv8.2+, FP16 flush-to-zero */ #define FPCR_FZ (1 << 24) /* Flush-to-zero enable bit */ diff --git a/target/arm/helper.c b/target/arm/helper.c index c24c66d43e..c2287c76e5 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11320,6 +11320,11 @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) int i; uint32_t changed; + /* When ARMv8.2-FP16 is not supported, FZ16 is RES0. */ + if (!arm_feature(env, ARM_FEATURE_V8_FP16)) { + val &= ~FPCR_FZ16; + } + changed = env->vfp.xregs[ARM_VFP_FPSCR]; env->vfp.xregs[ARM_VFP_FPSCR] = (val & 0xffc8ffff); env->vfp.vec_len = (val >> 16) & 7; From patchwork Mon Apr 1 20:58:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161569 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp939432jan; Mon, 1 Apr 2019 14:05:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpb7tqmZSrcBBRc0Uhhqdfz4zdY74VXKjByDh4K7ES0mPz5Pocboz3saYoxGPmwMv1RCKW X-Received: by 2002:a25:9387:: with SMTP id a7mr55360403ybm.380.1554152742317; Mon, 01 Apr 2019 14:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152742; cv=none; d=google.com; s=arc-20160816; b=EIz6R+9YKwWmIhrnfgX3yUnAjFXfcRypdconBuI8wTivDpo8eo2Cfz0/EJI0bSrZFH h1cVLV6LDUsUezWAAOWd1pSYt6pnaqx8JXvV9/SIMLXOXCMjZc43SI5SA8GpUFcvSnvj kVFm+6HznytDAjcDJ/ahmQ6zHg35lKL0k44g05LyEk8AyG7sP92WSaaRME4QJ9UuwusR 2rQQu0BH2R82QouyN3OwbxDGf0fD75xjnhNdaFwNnNllNkinYfSUfM4zMVdxjN+9zv+Z mLFKZqK39jcp8EM0axxz1LqyZBXccZFg3BOq0wszvMYgw14aUX9bbZNE2Zpjouv8HHgU 76jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=WQKUMd7P2A8nZcVLuZL6vScGwWcpKPUbH08ZQDc1Ick=; b=youR9+v/MwZM2i49jz3wUBNInMD6u1kzIFGsXKJ3TX7yQCN00Ce02rGaeYDVTij10m DxIEOuc9OvG7rOud5arq4+7CZ5gwgwHTLH4B0gMhDBrL9YMJ2ZC52uN40MTT9+X12jCO gifp5NAwQL2PrH6UdL4H6MHDVQsq4rWWcj7NGGR0ILKGMP4Hwx1xawUQ+81f2MVneyJn XZrXl7pKPq08ZpGWxBU4RX1Uic3FI1PGB9dfoKhQV7tKlRWCUbyx2HO9GbSeAFaQDN2e +kGahdePiFOTbQFHMxeiAMds/g8dPxlmOhVxkGkGRld2yCqCVllfJ6weKlM98PNhVa7F WALg== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 205si6586273ywg.369.2019.04.01.14.05.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:38370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47h-0003wq-Og for patch@linaro.org; Mon, 01 Apr 2019 17:05:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43v-0000o2-WA for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43u-00032l-5v for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58174) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43t-00031H-GZ for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:45 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrVht035181 for ; Mon, 1 Apr 2019 17:01:43 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rksw4ryj4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:43 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:42 +0100 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:40 +0100 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1dT154198284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:39 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67BA4136055; Mon, 1 Apr 2019 21:01:39 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31162136053; Mon, 1 Apr 2019 21:01:39 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:39 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:48 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0012-0000-0000-000017211EAB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0013-0000-0000-000056B7C3ED Message-Id: <20190401210011.16009-15-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 14/97] target/arm: Ignore float_flag_input_denormal from fp_status_f16 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson When FZ is set, input_denormal exceptions are recognized, but this does not happen with FZ16. The softfloat code has no way to distinguish these bits and will raise such exceptions into fp_status_f16.flags, so ignore them when computing the accumulated flags. Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Laurent Desnogues Message-id: 20180810193129.1556-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 19062c169e5bcdda3d60df9161228e107bf0f96e) Signed-off-by: Michael Roth --- target/arm/helper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index c2287c76e5..991b077e8f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11283,9 +11283,13 @@ uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env) fpscr = (env->vfp.xregs[ARM_VFP_FPSCR] & 0xffc8ffff) | (env->vfp.vec_len << 16) | (env->vfp.vec_stride << 20); + i = get_float_exception_flags(&env->vfp.fp_status); i |= get_float_exception_flags(&env->vfp.standard_fp_status); - i |= get_float_exception_flags(&env->vfp.fp_status_f16); + /* FZ16 does not generate an input denormal exception. */ + i |= (get_float_exception_flags(&env->vfp.fp_status_f16) + & ~float_flag_input_denormal); + fpscr |= vfp_exceptbits_from_host(i); return fpscr; } From patchwork Mon Apr 1 20:58:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161580 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp985945jan; Mon, 1 Apr 2019 15:02:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4ufkjGNTF5lo9r/AozI/NzPM13j3TYvU1L9GzHt7NBe7izwkpzpXTgoOHsgLMCPZ1v66/ X-Received: by 2002:a5b:11:: with SMTP id a17mr57535259ybp.141.1554156150346; Mon, 01 Apr 2019 15:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554156150; cv=none; d=google.com; s=arc-20160816; b=fcuUcljaPzA0LkjHkuZOh4/xcumQa4cIZQ0edXEPuCoId4uhZuldMGSb/DEwyrL8LE XgQsw0B/FKKr0DPaX0sV3gESeju2tZNszFxynOi2PAn+479t3KhbWbfCxa340+8oTWn9 AHKn7JVpImPeEAsliEcQk7ql8ubbkj+FC+2ISf8Ods3vfxIywFtcEnQ8iQNnaGADwH2i KhTgqOOTptE+leHjRly2bs66BoTxjkSO6PFqyeeKEcAFEwxmv7qVS4OwXYm7c01Sv556 ehzm3bo2LSmk29KIR0IDWqF7OS15s/mlkibSe+B6rMfaC+jtVyzlEOsZ+3RIPNj1AlQb cHOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=XaC1A2ZyLdv3WbfiUy3OwYg3gn2CI3OcQmAnaEMJrrY=; b=iWHCSTCsFfoWQKMVYQlwHk/ShDaYMa5p5HWUl6QYZ52w3vdwhgLw9gRat6dM+Aeqmk Psb836Qk/nJu1ZeH4AUAArpVztj3k9bfwAOfZk+pZscQduSHbFzT1sNHIsOLUnd7Gej/ rfp2w++wdekIq3nSTMXYXaB1gH993F9S5JxoWHgJNd3uXJGNngmvzvyP9Mdl48XLe8mI Ava3jHBHPEG5q1EipIfhMQOlMbrNLsRkYYnSvOtYK0ygOCSsMEh2Z9D4gGtS0vMT/i6U 1Ltd1dmvUAO1RjRHKsWYvbqrvLVWby8xocv8wEomiJk3Q7fxpF8pygbe4qcLg5mCqEW0 wSYg== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y184si5214403yba.312.2019.04.01.15.02.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:54163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB50f-0001q4-Q7 for patch@linaro.org; Mon, 01 Apr 2019 18:02:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB47Z-0004Dk-6w for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB47I-0005Fx-QG for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB47F-0004xG-Pz for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:14 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L505h140533 for ; Mon, 1 Apr 2019 17:05:01 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rksqasqe4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:05:00 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:44 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:41 +0100 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1ede27263032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:40 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A1AA7805C; Mon, 1 Apr 2019 21:01:40 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 605F478067; Mon, 1 Apr 2019 21:01:40 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:40 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:49 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0036-0000-0000-00000AA31D98 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0037-0000-0000-00004B3CB11A Message-Id: <20190401210011.16009-16-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 15/97] target/arm: Use fp_status_fp16 for do_fmpa_zpzzz_h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This makes float16_muladd correctly use FZ16 not FZ. Fixes: 6ceabaad110 Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Laurent Desnogues Message-id: 20180810193129.1556-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 52a339b11d1719a6589de40606859939875fda9a) Signed-off-by: Michael Roth --- target/arm/sve_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index e03f954a26..0f98097253 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -3358,7 +3358,7 @@ static void do_fmla_zpzzz_h(CPUARMState *env, void *vg, uint32_t desc, e1 = *(uint16_t *)(vn + H1_2(i)) ^ neg1; e2 = *(uint16_t *)(vm + H1_2(i)); e3 = *(uint16_t *)(va + H1_2(i)) ^ neg3; - r = float16_muladd(e1, e2, e3, 0, &env->vfp.fp_status); + r = float16_muladd(e1, e2, e3, 0, &env->vfp.fp_status_f16); *(uint16_t *)(vd + H1_2(i)) = r; } } while (i & 63); From patchwork Mon Apr 1 20:58:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161572 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp940406jan; Mon, 1 Apr 2019 14:06:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdLFAhKEV6f7oSOFBO6PcES99e16ctTfpNQO1SpVDcY4WBufd6C578oKcXGilL55job83c X-Received: by 2002:a81:6f89:: with SMTP id k131mr44677743ywc.36.1554152802212; Mon, 01 Apr 2019 14:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152802; cv=none; d=google.com; s=arc-20160816; b=sLhUWySVQy/TnFgYDMJMBQSIhrqW4K1Nqd7gUYPoYGPpHmSlOOM0MYpF3PdbJOPNp9 lDpChm5SPqCL6I2hXRGRC9pBJhmQzkA5Y0yytc0geZhFuTsACoW+wq4AmuAmp34rd0Kb FdYAtDeEmVZxJFC7IfxdbZEyD1B3OI83RVE5BgjnIT4+IkKkLZhLeaUkotYw8S1lfybf xRIzMEd6+fS9cp5KsIr4CGN4cRKF09i3OUMouguIeJIN2LLPA7B97R1wwM5MqphIsL85 ZS2L91vs3fZXaPjJ+2dOkBnMFVOcblpf1WjZg7W9w4th51D6F/2rCWtjmCGyQDxGO4j+ SchA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=d5dRsvgz/LtnYblCCfgz6OXr84Vl8w4zko4iEwQg7Lc=; b=k3fvo+MI+C89KlJfMq9SR4W6LRdFEJTCYvW1fHOtTMp2prZ0stL/gBjGvSpgUV93aE PNAooEbafUYzwWSex2C3yMbKADVkc3zN5NtNFC6PZ+fCmlfFhwwiUB89ofUhDi621JZg rGJwb3bCUOHnJ999wMh24njNC22SmfLYB/U+jCz1WFJOpM6bnYdRZH/MW3JPcWi/Q01s fOLomo3NxNjYqinTYpBfyjmNBFCciPLGD6M0SNsCYWtC5JRgXW0+bWyYFeM4GLvOjZND xBmm+XxWt0of21bP76F0fjfFNoNvhceEaLd/F/rYFQRTWt0J/fmH/aCxTYaM4/W2aG/O o6SA== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j186si6700134ywa.432.2019.04.01.14.06.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:38652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB48f-0004sa-KL for patch@linaro.org; Mon, 01 Apr 2019 17:06:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB43z-0000qu-V4 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB43y-00036s-Lg for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB43y-00035n-4S for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:01:50 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31KrcI4128195 for ; Mon, 1 Apr 2019 17:01:48 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkq85hr1p-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:47 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:45 +0100 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:01:42 +0100 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L1f2S20774972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:01:41 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 46198AE068; Mon, 1 Apr 2019 21:01:41 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1DF18AE063; Mon, 1 Apr 2019 21:01:41 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:01:41 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:58:50 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0052-0000-0000-000003A61B20 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:01:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0053-0000-0000-000060599393 Message-Id: <20190401210011.16009-17-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=915 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010135 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 16/97] target/arm: Use FZ not FZ16 for SVE FCVT single-half and double-half X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We were using the wrong flush-to-zero bit for the non-half input. Fixes: 46d33d1e3c9 Cc: qemu-stable@nongnu.org (3.0.1) Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Laurent Desnogues Message-id: 20180810193129.1556-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit e4ab5124a5c2e2291006b24bdc21c3dd8d087ff4) Signed-off-by: Michael Roth --- target/arm/translate-sve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index d27bc8c946..667879564f 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4093,7 +4093,7 @@ static bool do_zpz_ptr(DisasContext *s, int rd, int rn, int pg, static bool trans_FCVT_sh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) { - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvt_sh); + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_sh); } static bool trans_FCVT_hs(DisasContext *s, arg_rpr_esz *a, uint32_t insn) @@ -4103,7 +4103,7 @@ static bool trans_FCVT_hs(DisasContext *s, arg_rpr_esz *a, uint32_t insn) static bool trans_FCVT_dh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) { - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvt_dh); + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_dh); } static bool trans_FCVT_hd(DisasContext *s, arg_rpr_esz *a, uint32_t insn) From patchwork Mon Apr 1 20:59:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161581 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp995999jan; Mon, 1 Apr 2019 15:12:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQaj1wNX+CFjwqWESIWDeEUY04hwV8jDb4Bucm2RsVVV+K+YqbIRAK9xLUfSCzP7H1c1Sa X-Received: by 2002:a5b:603:: with SMTP id d3mr53463098ybq.299.1554156734344; Mon, 01 Apr 2019 15:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554156734; cv=none; d=google.com; s=arc-20160816; b=ENF9xQANSI4nKMKsk1FSVik9GD5JMZS4A2/o2hdTrBl1HSSLYrZE5lFfViyedDYTor 22rY+kaMzzt9p9vmddx3Yojhga1nOS0BBAcSUeRpg4jzek31KjiCxNm1LERKS/wYkGEg mNWK58k3lfXEMsGWrNEYMLUHmzrEH6jDoqMhZEkCXvrRzd9KwR8avCZfzdcmLMNWdPgv hZXRqv7TFF4SoXkSa0sYulBq41eqS+g+6C2G3q4tz6anD43B5D8Y5Lhut+VdZoRXI5ep lvg6cLO15XydBXFrNhAjYwn+O31WLC+nUaDjXcOl/pU0MO0MOX9gwRJpQLaB0T8iZIM7 FCHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=WMhljpzP9AkpWoyINCdRiwe1+ExfdfWG9lo0zMvbLIA=; b=twTr/Gf5jUbdFQY+R1vpVkq3b74wVzljbfAFHDQXKwUY1Hxk829pl6dNqStLtgIWpv L0H/J79Ww+RgJzFyBkGlNTW2b5rk7bnOEv2/kC1DeOxEZHFPnlY5YyQ/8VbnSGE+I5dW MDqhslpaX4Nl6IR4+QXX2rCxuXlZGjgl9GDXewnGrFZbHpQ4kqU3uMrAE8/vN7A4YXRI 5NKt9L8QZvDkzslPofHvfgF3khbbW5HVG9exeX0Jyo+cy6tJ3I2rweSXI+UhoRS7Lbcm kuO46y7iGN4XL01lJI/gq9kkbGy/ugWwhgsIauUCCL9BtbMrB4WFlEiWfwTtJ/4vpGPB FfPw== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e1si1578617yba.139.2019.04.01.15.12.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:56714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB5A5-00019h-R2 for patch@linaro.org; Mon, 01 Apr 2019 18:12:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB471-0003XT-Bu for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB46z-0004sm-KJ for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48636) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB46y-0004nh-7o for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:56 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4ie2114727 for ; Mon, 1 Apr 2019 17:04:48 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rksvqh0am-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:04:46 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:22 +0100 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:20 +0100 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2J5J32899186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:19 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09CE013605E; Mon, 1 Apr 2019 21:02:19 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF0E0136055; Mon, 1 Apr 2019 21:02:18 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:18 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:59:18 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0036-0000-0000-00000AA31DEC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963683; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0037-0000-0000-00004B3CB1BD Message-Id: <20190401210011.16009-45-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=896 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 44/97] target/arm: Fix cpu_get_tb_cpu_state() for non-SVE CPUs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Not only are the sve-related tb_flags fields unused when SVE is disabled, but not all of the cpu registers are initialized properly for computing same. This can corrupt other fields by ORing in -1, which might result in QEMU crashing. This bug was not present in 3.0, but this patch is cc'd to stable because adf92eab90e3f5f34c285 where the bug was introduced was marked for stable. Fixes: adf92eab90e3f5f34c285 Cc: qemu-stable@nongnu.org (3.0.1) Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit e79b445d896deb61909be52b61b87c98a9ed96f7) Signed-off-by: Michael Roth --- target/arm/helper.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index 991b077e8f..7ee614c04f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -12401,36 +12401,39 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, uint32_t flags; if (is_a64(env)) { - int sve_el = sve_exception_el(env); - uint32_t zcr_len; - *pc = env->pc; flags = ARM_TBFLAG_AARCH64_STATE_MASK; /* Get control bits for tagged addresses */ flags |= (arm_regime_tbi0(env, mmu_idx) << ARM_TBFLAG_TBI0_SHIFT); flags |= (arm_regime_tbi1(env, mmu_idx) << ARM_TBFLAG_TBI1_SHIFT); - flags |= sve_el << ARM_TBFLAG_SVEEXC_EL_SHIFT; - /* If SVE is disabled, but FP is enabled, - then the effective len is 0. */ - if (sve_el != 0 && fp_el == 0) { - zcr_len = 0; - } else { - int current_el = arm_current_el(env); - ARMCPU *cpu = arm_env_get_cpu(env); + if (arm_feature(env, ARM_FEATURE_SVE)) { + int sve_el = sve_exception_el(env); + uint32_t zcr_len; - zcr_len = cpu->sve_max_vq - 1; - if (current_el <= 1) { - zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); - } - if (current_el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { - zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]); - } - if (current_el < 3 && arm_feature(env, ARM_FEATURE_EL3)) { - zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); + /* If SVE is disabled, but FP is enabled, + * then the effective len is 0. + */ + if (sve_el != 0 && fp_el == 0) { + zcr_len = 0; + } else { + int current_el = arm_current_el(env); + ARMCPU *cpu = arm_env_get_cpu(env); + + zcr_len = cpu->sve_max_vq - 1; + if (current_el <= 1) { + zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); + } + if (current_el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { + zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]); + } + if (current_el < 3 && arm_feature(env, ARM_FEATURE_EL3)) { + zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); + } } + flags |= sve_el << ARM_TBFLAG_SVEEXC_EL_SHIFT; + flags |= zcr_len << ARM_TBFLAG_ZCR_LEN_SHIFT; } - flags |= zcr_len << ARM_TBFLAG_ZCR_LEN_SHIFT; } else { *pc = env->regs[15]; flags = (env->thumb << ARM_TBFLAG_THUMB_SHIFT) From patchwork Mon Apr 1 20:59:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161575 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp968767jan; Mon, 1 Apr 2019 14:39:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaVm9aFa5mY1vmA8OqqSjyrcPO+vJoN+0crvYwjO/eTTgQFDLeZsUeWNki+yfYV7UZCP8c X-Received: by 2002:a81:2ed2:: with SMTP id u201mr54681252ywu.72.1554154797833; Mon, 01 Apr 2019 14:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554154797; cv=none; d=google.com; s=arc-20160816; b=OKd3pHagVaAmqRK3UVg5Pf8IyCt5JF/44tzP2XZkWuz2le3N2nwIHZvrPLilpXVIpv b9oxIIFFDqNDzSCOGa8g+gVC9vy/GtoX4kfRqp0nexUYmeY2TvW1s+F4s626mMFQKNLU h9LFl1csvS++baCfJGmEmd6uImli1LnmU1GsmRKVX0OFwL7NuzptwaO67E0gxN8Uf0kf E644PJb7Xw1S9FgXMi4f6OLNX3JT4nGH9BvzUFdePXmtCKa0uE7gDfER+WczrWJFYJ6m PHbNPGyKiZ7DbLtFtmSiqCzvKhS52isGlHxud/aaIHwrGy29QDbUvAnAftl82gircuGo 93BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=lloQ1Oqn5Ss+GISnAOl0kSA562JbtmayvmqZuYtCsP8=; b=Hq/Rjrexcop1rdKIYMpMFtvU7Lw7NnP0+Y8iSbtFYhcuDoi7NACDsGugzaLH9yqGDc 7T3WFvjM1GpVrs1V9qsDLfF/zaF2mByU7ZDpNnP1fao/3+9VsZ5Lqsui4sNOXS4aZ0bF n9i5emYGqHmT17Lp9JixKbpxUtMVpMIAjID46Rs5lNvocsTP6YcXg6nSTOKlpvg2fkGG wRu2cVC73FWDr+SHVzzIjiVrPtb7Xkk4IVZarmebq9cMYgcnt0eKqzUxqHoJBkXrKYm9 c7AAExit7pPq3t8JXPJqBSC80xejwWyEikfCpIVE39Y8JIIK/P1vCffpZ13XPJEOQETu GeIA== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 204si6616554ybs.488.2019.04.01.14.39.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:47439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4er-00036z-AX for patch@linaro.org; Mon, 01 Apr 2019 17:39:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB46g-0003Gu-Dc for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB46f-0004i6-3a for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45558 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB46e-0004ZN-Ph for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:04:36 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4KHY054847 for ; Mon, 1 Apr 2019 17:04:24 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rkr97pakc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:04:21 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:28 +0100 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:25 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2OZK65470664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:24 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4030CC605A; Mon, 1 Apr 2019 21:02:24 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15C7BC6055; Mon, 1 Apr 2019 21:02:24 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:23 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:59:23 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-8235-0000-0000-00000E781EBA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-8236-0000-0000-000044FDC0BB Message-Id: <20190401210011.16009-50-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id x31L4KHY054847 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 49/97] virt: Suppress external aborts on virt-2.10 and earlier X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In commit c79c0a314c43b78 we enabled emulation of external aborts when the guest attempts to access a physical address with no mapped device. In commit 4672cbd7bed88dc6 we suppress this for most legacy boards to prevent breakage of previously working guests, but we didn't suppress it in the 'virt' board, with the rationale "we know that guests won't try to prod devices that we don't describe in the device tree or ACPI tables". This is mostly true, but we've had a report of a Linux guest image that this did break. The problem seems to be that the guest is (incorrectly) configured with a DEBUG_UART_PHYS value that tells it there is a uart at 0x10009000 (which is true for vexpress but not for virt), so in early bootup the kernel probes this bogus address. This is a misconfigured guest, so we don't need to worry about it too much, but we can arrange that guests that ran on QEMU v2.10 (before c79c0a314c43b78) will still run on the "virt-2.10" board model, by suppressing external aborts only for that version and earlier. This seems a reasonable compromise: "virt-2.10" is supposed to behave the same way that "virt" did in the 2.10 release, and making it do that provides a usable workaround for guests with bugs like this. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Message-id: 20180925144127.31965-1-peter.maydell@linaro.org Reviewed-by: Philippe Mathieu-Daudé (cherry picked from commit 846690dee8ca6a4143d20b39e894fd1f24627561) Signed-off-by: Michael Roth --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 281ddcdf6e..7f234ff6e8 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1881,6 +1881,8 @@ static void virt_machine_2_10_options(MachineClass *mc) { virt_machine_2_11_options(mc); SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_10); + /* before 2.11 we never faulted accesses to bad addresses */ + mc->ignore_memory_transaction_failures = true; } DEFINE_VIRT_MACHINE(2, 10) From patchwork Mon Apr 1 20:59:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161574 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp953104jan; Mon, 1 Apr 2019 14:20:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiB2ypvEX5PsTWShyibwpxZNlAobyQ452P4fvbPIUTMG8wwffGXHjYAANxs0dIupcJoUz3 X-Received: by 2002:a25:7106:: with SMTP id m6mr16634011ybc.218.1554153649525; Mon, 01 Apr 2019 14:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554153649; cv=none; d=google.com; s=arc-20160816; b=MfUs8w//v9AeRgR3NajErQa8AEfX6lfvnri5298teWQwZJAfKZ56RnxMkMGKm1nL8C wwx27zppQVYVARsvPG2YZJppq20d9z6aObpABISMidggzw+QRMGY5b+lhkRxTA6he6SZ 1z0QalZNIXFLTKJ43ujq7F2bJvlffWcjfNHlnaGeZ1QPU4hEZA7C/GCuKDXNrOPZQ2Lj /ezT4srnQHFtYIurSPOAIHHsMHj1nHe4/l9TCrWKjz/yAhnU0YngXP0O8g8HXtMTImEz axcBkJEGwBT93y4GDjF2CISf4/bilUuHZw/eUsoi2NU69lTF02JGXc9bEvgnT2Ay/QZa yccA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=zx4yJFo/x+73QDgl/8tL4PyW5jT6sw3J1vMd8fcfUQc=; b=G5ap3faMRxD+TU746hzjCJaO4urpsAFp4Bh3DA9zQbU6KBEZ9BSgOQbLAxt8Zj6l6W 7gYx6sZRhZCK53k/r3EdXewH3JVujrsvaSs+fyDMgj5S18q/wFjiOk2wEOD84/fn6N6G 64KR1tN5IW/4QwJupR+wvr30Kba7v8bcpp3MTJVBdc+6aQSsCW31L3HrLrow+WVFMUCn 3y9oib9D2ZdffKkmq95FARL3lZbM7m6Lw9iz2CBr/mwD/WJf4s4ie8FbjQ0+2AwNEZVK +fxqunJt0a79xQeaZPE7aZvLwXK9ViX7GZHXiVNePRpJAgTDhQ03XgUSK6DeNY0BPD8r xcPQ== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u63si7093991yba.102.2019.04.01.14.20.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:20:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:42434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4MK-0002bu-Vl for patch@linaro.org; Mon, 01 Apr 2019 17:20:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB44q-0001bL-Aj for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:02:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB44p-0003c3-B6 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:02:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57336 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB44p-0003VV-3V for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:02:43 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L1pFY095672 for ; Mon, 1 Apr 2019 17:02:32 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkswegxj0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:02:32 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:02:31 +0100 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:28 +0100 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2Rci23396450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:27 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 871ADAC066; Mon, 1 Apr 2019 21:02:27 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64504AC059; Mon, 1 Apr 2019 21:02:27 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:27 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:59:26 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0052-0000-0000-000003A61B41 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:02:29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0053-0000-0000-0000605993FF Message-Id: <20190401210011.16009-53-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 52/97] target/arm: Correct condition for v8M callee stack push X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In v7m_exception_taken() we were incorrectly using a "LR bit EXCRET.ES is 1" check when it should be 0 (compare the pseudocode ExceptionTaken() function). This meant we didn't stack the callee-saved registers when tailchaining from a NonSecure to a Secure exception. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20181002145940.30931-1-peter.maydell@linaro.org (cherry picked from commit 7b73a1ca05b33d42278ce29cea4652e22d408165) Signed-off-by: Michael Roth --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index 7ee614c04f..cae2b2649d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6858,7 +6858,7 @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr, bool dotailchain, * not already saved. */ if (lr & R_V7M_EXCRET_DCRS_MASK && - !(dotailchain && (lr & R_V7M_EXCRET_ES_MASK))) { + !(dotailchain && !(lr & R_V7M_EXCRET_ES_MASK))) { push_failed = v7m_push_callee_stack(cpu, lr, dotailchain, ignore_stackfaults); } From patchwork Mon Apr 1 20:59:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161583 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1002716jan; Mon, 1 Apr 2019 15:19:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLn3S5F6x9Gr3UyDsukmbX1nh++xL8RxhAKUrb4V+4HparOUUr5/y1T4e2xiyczUVEDO5l X-Received: by 2002:a25:57c4:: with SMTP id l187mr54949001ybb.435.1554157182671; Mon, 01 Apr 2019 15:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554157182; cv=none; d=google.com; s=arc-20160816; b=nSU+3TOM2ixI7woAE7sDAn4QEjj0fSC9LFSQmlgE5LlCH0vwolXzZdjr0Glnw6NjI9 map/8IiJCqVryLKiToJF3N+mPKhVII3D44AyBL2m6T4kTIQXH3Vu8TByISiMXuTYQFKm AAmJbBXveNvjB8p/8wLfnpM1XAQS/MXaVUbrWTbIn9nV6x1GK0VC/KuTPFJRDxtT2TX3 0W9flgKMYAzGYRDw75YXK/Z6rt63kPSYmkIGtuoBvKWVfCYZdoKMDdaDfWBa4CYwSJPd g6RcVZg+sycjPTIXLGVbfoQcCnC5/bRRLk7bvKusgTrZ5HqXEdlm8+7FODd76Rac/NdQ qmrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from; bh=5DDWuqsJkV/h9T5L2ArmJTqjRP00itWNlLTWMuaDOEY=; b=VBq1LblKlyRLLrZxctnAdRbJkrNzPxFY5vBX64cgoAg4zLCdr1vDZSxZpl73kdAHGQ g1ZK+2rmxT07Z/go1pSobe3ayd0wJdk7CYAN0rxOqqPDZzAPQ8bc7cX1KY42OeI3kkWB HlBFgtCiajrHLuoZtqRxQAW0pDLZPMCulHvdV602JLvP7/YgrE4PtC3nxP24Tra/20a1 El5ceieonBIDYKnmS6+mKjABm79As+1SO6JUo5VNvJDHKgZnDMu0zUhS/z+ahs8GyFs8 mwO4fouMDs3Ka4gfdCB/0CKO7H5CRJ5B9d8KKi7/BJ6Y7pHLAWDmNjqctQtl7rIYf+BY MJ7Q== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d63si6482621ybf.382.2019.04.01.15.19.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 15:19:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:58560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB5HK-0000HP-3p for patch@linaro.org; Mon, 01 Apr 2019 18:19:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB478-0003ii-II for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB476-0004ym-Ad for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59922 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB476-0004pz-4S for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:05:04 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L4i17163580 for ; Mon, 1 Apr 2019 17:04:53 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rksx78v4w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:04:48 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:03:03 +0100 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:02:59 +0100 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L2wGU52625408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:02:58 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C9059BE04F; Mon, 1 Apr 2019 21:02:58 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FB55BE054; Mon, 1 Apr 2019 21:02:58 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:02:58 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:59:54 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19040121-0016-0000-0000-0000099B1DFB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:03:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0017-0000-0000-000042A9B24F Message-Id: <20190401210011.16009-81-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id x31L4i17163580 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 80/97] linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-stable@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Linux returns success if pwrite64() or pread64() are called with a zero length NULL buffer, but QEMU was returning -TARGET_EFAULT. This is the same bug that we fixed in commit 58cfa6c2e6eb51b23cc9 for the write syscall, and long before that in 38d840e6790c29f59 for the read syscall. Fixes: https://bugs.launchpad.net/qemu/+bug/1810433 Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190108184900.9654-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier (cherry picked from commit 2bd3f8998e1e7dcd9afc29fab252fb9936f9e956) *drop functional dep. on 2852aafd9d Signed-off-by: Michael Roth --- linux-user/syscall.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1477509cf2..0859739e9d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10910,8 +10910,15 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, arg4 = arg5; arg5 = arg6; } - if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0))) - goto efault; + if (arg2 == 0 && arg3 == 0) { + /* Special-case NULL buffer and zero length, which should succeed */ + p = 0; + } else { + p = lock_user(VERIFY_WRITE, arg2, arg3, 0); + if (!p) { + goto efault; + } + } ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5))); unlock_user(p, arg2, ret); break; @@ -10920,8 +10927,15 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, arg4 = arg5; arg5 = arg6; } - if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1))) - goto efault; + if (arg2 == 0 && arg3 == 0) { + /* Special-case NULL buffer and zero length, which should succeed */ + p = 0; + } else { + p = lock_user(VERIFY_READ, arg2, arg3, 1); + if (!p) { + goto efault; + } + } ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5))); unlock_user(p, arg2, 0); break; From patchwork Mon Apr 1 20:59:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 161577 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp978454jan; Mon, 1 Apr 2019 14:53:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGgbvjZVNMB7bZw4mKln31NufFEszC9CkZaKYCQZOlxCsx9WSYn79raBnYS1QJKEqYWyr5 X-Received: by 2002:a25:4642:: with SMTP id t63mr8001567yba.116.1554155586088; Mon, 01 Apr 2019 14:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554155586; cv=none; d=google.com; s=arc-20160816; b=c4cD+KHUjL8fZNmbuSzRkuQEw8LBw01Be64k5hMOBzs1rUQIbzCtsS93Can9WvPfvA C/XAN65aoMUNY4piyeFpSHMQ7wdc2UeLiWI9AZFB+qhayHmlwOI+szpwKTT24bGKgca1 wS0xBW6GyMdZdwGTLLBu6j/w+j6p2W5rQ7lZhCYxTDa369QHCbWU1uPJrRRPu6paOOk4 PZlaDnBAY09g4ye3V1/3D8RQA14PvzL5Uv5SQjyz/WfDFFe5LqLNz6E75lQvb2ApjecU gwELhrQBnPmvE3D6A03eofUPWLfi/3eA/yN8TtFCqN02U1mehUS6TiBza3XpAx0WTmjO W5rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:references :in-reply-to:date:to:from; bh=PsrLHd4ae3QxowIQ+b6LKep5TGllfkjyCNHlbkHcNfs=; b=YtLlg/1HrZfu1SJwVjZnkrEbf8F11akaZC1GaizJtPsIXWl2oeUEpNR8obnlCZuOiV LCzRUlnugK7K6xn2YUgTn34H9jVtPkVW8BwjAsy9OJwrOiy9R5+XKvOJdAnMWf+uaqI7 mc+W0JkN7xM5LhiwZrz9D/7N1ETCMuWXxdrYrqY7InF++sCXXuVUtqUcztkd6lpstHJO yszPAnjoWoOswMjuDGkHYnzPY9aA1MpjhYmoez/8k17p01mGerdD8Qh+IZqGfs5f4Uu/ bEUc0dL9IonTFrfJ7tOl9LFSncDc/qIs3QzK0GrGYGQRPWVS7BMXDKyR/LOwKgRYaXJ+ bNIw== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u33si8066539ywh.191.2019.04.01.14.53.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 14:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([127.0.0.1]:51433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB4rZ-0002CZ-HG for patch@linaro.org; Mon, 01 Apr 2019 17:53:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB45y-0002d9-Mc for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:03:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB45x-0004F8-Cv for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:03:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53686) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB45w-00049c-PL for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:03:53 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31L3QW7027506 for ; Mon, 1 Apr 2019 17:03:41 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkq85hryj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:03:39 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:03:05 +0100 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Apr 2019 22:03:03 +0100 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x31L32Wx21823534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Apr 2019 21:03:02 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1647E28059; Mon, 1 Apr 2019 21:03:02 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EF85728064; Mon, 1 Apr 2019 21:03:01 +0000 (GMT) Received: from localhost (unknown [9.80.94.43]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Apr 2019 21:03:01 +0000 (GMT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 15:59:56 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19040121-0052-0000-0000-000003A61B51 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010857; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000283; SDB=6.01182941; UDB=6.00619269; IPR=6.00963684; MB=3.00026249; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-01 21:03:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040121-0053-0000-0000-000060599456 Message-Id: <20190401210011.16009-83-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904010136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 82/97] exec.c: Don't reallocate IOMMUNotifiers that are in use X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The tcg_register_iommu_notifier() code has a GArray of TCGIOMMUNotifier structs which it has registered by passing memory_region_register_iommu_notifier() a pointer to the embedded IOMMUNotifier field. Unfortunately, if we need to enlarge the array via g_array_set_size() this can cause a realloc(), which invalidates the pointer that memory_region_register_iommu_notifier() put into the MemoryRegion's iommu_notify list. This can result in segfaults. Switch the GArray to holding pointers to the TCGIOMMUNotifier structs, so that we can individually allocate and free them. Cc: qemu-stable@nongnu.org Fixes: 1f871c5e6b0f30644a60a ("exec.c: Handle IOMMUs in address_space_translate_for_iotlb()") Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20190128174241.5860-1-peter.maydell@linaro.org (cherry picked from commit 5601be3b01d73e21c09331599e2ce62df016ff94) Signed-off-by: Michael Roth --- exec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/exec.c b/exec.c index 4f5df07b6a..9bafcb155a 100644 --- a/exec.c +++ b/exec.c @@ -690,7 +690,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu, int i; for (i = 0; i < cpu->iommu_notifiers->len; i++) { - notifier = &g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier, i); + notifier = g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i); if (notifier->mr == mr && notifier->iommu_idx == iommu_idx) { break; } @@ -698,7 +698,8 @@ static void tcg_register_iommu_notifier(CPUState *cpu, if (i == cpu->iommu_notifiers->len) { /* Not found, add a new entry at the end of the array */ cpu->iommu_notifiers = g_array_set_size(cpu->iommu_notifiers, i + 1); - notifier = &g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier, i); + notifier = g_new0(TCGIOMMUNotifier, 1); + g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i) = notifier; notifier->mr = mr; notifier->iommu_idx = iommu_idx; @@ -730,8 +731,9 @@ static void tcg_iommu_free_notifier_list(CPUState *cpu) TCGIOMMUNotifier *notifier; for (i = 0; i < cpu->iommu_notifiers->len; i++) { - notifier = &g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier, i); + notifier = g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i); memory_region_unregister_iommu_notifier(notifier->mr, ¬ifier->n); + g_free(notifier); } g_array_free(cpu->iommu_notifiers, true); } @@ -1000,7 +1002,7 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) vmstate_register(NULL, cpu->cpu_index, cc->vmsd, cpu); } - cpu->iommu_notifiers = g_array_new(false, true, sizeof(TCGIOMMUNotifier)); + cpu->iommu_notifiers = g_array_new(false, true, sizeof(TCGIOMMUNotifier *)); #endif }