From patchwork Thu Jun 1 17:10:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 100952 Delivered-To: patch@linaro.org Received: by 10.182.202.35 with SMTP id kf3csp858735obc; Thu, 1 Jun 2017 10:14:56 -0700 (PDT) X-Received: by 10.55.144.5 with SMTP id s5mr2976511qkd.39.1496337296266; Thu, 01 Jun 2017 10:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496337296; cv=none; d=google.com; s=arc-20160816; b=ERuzDTn7IPRl26qgWqSLiMGKD1RyLsbNgr7g9r9weZyrvusPpGlCkoCPbStOE2YHFX p3ulOFMftEP46rrki4MVRaAfkQ3oJsxjPdxnlJ8WSxuCAjd78B53wOGLdxGZ9rUUif5N s4HmRzsTtt7ar4shOzr6xsGZ4woXdDbcv9HWfVgj6DpZPnrI3yUBH9eW5I7U1lAHOCyS q4/8OnXfd8gydAHfSquLHlBaWtdyIVWOWkNdP6XbVaLer4pqYVIW4rabB6mgjt6hnSnG KNp3JNKjtLrF+TuFTXUsvTsW1Mwe5llZHPV2NUG39rJ4k1RR5Gd/n/KyrobE81IwbCQc LqBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=nkbJmjhXWH8XyJFuKdzgSJhRLmuWR8K4x9BV5A+R3I8=; b=sTREZ44TN7jZS6Tz+VsGjYUP1hK2FFIXOwEOk5oqC2QDGTt1nDSeCmQhqQBPZjbkji uPYxXgj7RrCz5oob2Vw92mC1lNoDiEM60wDzkvU9hNlD92oBV8U7HI/KGtDIyEq0sa8f EJrnsp62112DcrbeL6WPD0ZMkq2Nev11GclzJE5EFQRnfbeavAKTbNbUC5dgq2kVeQCC bTufvrr2AWaNkfOwc5+QdpPwn11cTbQPZ+YPkqounHpkQpmkL8QCwyfdsPkyanbSRCOR P1GMxi7sWCnQlApy0TU7zSYbIMqSMVXOcH/V7CILt9NW3KgM2BPFwgLrPQLyiHvsZTpQ sLzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e125si20004588qkc.177.2017.06.01.10.14.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Jun 2017 10:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGTgT-0004dQ-EZ for patch@linaro.org; Thu, 01 Jun 2017 13:14:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGTcW-00015j-Px for qemu-devel@nongnu.org; Thu, 01 Jun 2017 13:10:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGTcV-0006AI-Uq for qemu-devel@nongnu.org; Thu, 01 Jun 2017 13:10:48 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGTcV-00068M-Lh for qemu-devel@nongnu.org; Thu, 01 Jun 2017 13:10:47 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dGTcO-0007P9-UQ for qemu-devel@nongnu.org; Thu, 01 Jun 2017 18:10:40 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 18:10:15 +0100 Message-Id: <1496337035-30213-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496337035-30213-1-git-send-email-peter.maydell@linaro.org> References: <1496337035-30213-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 07/27] arm: Use the mmu_idx we're passed in arm_cpu_do_unaligned_access() 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When identifying the DFSR format for an alignment fault, use the mmu index that we are passed, rather than calling cpu_mmu_index() to get the mmu index for the current CPU state. This doesn't actually make any difference since the only cases where the current MMU index differs from the index used for the load are the "unprivileged load/store" instructions, and in that case the mmu index may differ but the translation regime is the same (apart from the "use from Hyp mode" case which is UNPREDICTABLE). However it's the more logical thing to do. Signed-off-by: Peter Maydell Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-id: 1493122030-32191-2-git-send-email-peter.maydell@linaro.org --- target/arm/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index 156b825..de24815 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -208,7 +208,7 @@ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, /* the DFSR for an alignment fault depends on whether we're using * the LPAE long descriptor format, or the short descriptor format */ - if (arm_s1_regime_using_lpae_format(env, cpu_mmu_index(env, false))) { + if (arm_s1_regime_using_lpae_format(env, mmu_idx)) { env->exception.fsr = (1 << 9) | 0x21; } else { env->exception.fsr = 0x1;