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); }