Received: from eggs.gnu.org ([2001:4830:134:3::10]:35807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqH1a-00027V-Cn for qemu-devel@nongnu.org; Tue, 10 Dec 2013 01:42:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqH1R-0004XV-8t for qemu-devel@nongnu.org; Tue, 10 Dec 2013 01:42:30 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:41987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqH1R-0004XI-2s for qemu-devel@nongnu.org; Tue, 10 Dec 2013 01:42:21 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MXK008JMVYG4100@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 10 Dec 2013 06:42:16 +0000 (GMT) From: Sergey Fedorov Date: Tue, 10 Dec 2013 10:41:49 +0400 Message-id: <1386657709-23399-1-git-send-email-s.fedorov@samsung.com> Subject: [Qemu-devel] [PATCH] target-arm: fix TTBCR write masking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, a.basov@samsung.com, Sergey Fedorov Current implementation is not accurate according to ARMv7-AR reference manual. See "B4.1.153 TTBCR, Translation Table Base Control Register, VMSA | TTBCR format when using the Long-descriptor translation table format". When LPAE feature is supported, EAE, bit[31] selects translation descriptor format and, therefore, TTBCR format. Signed-off-by: Sergey Fedorov --- target-arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 3445813..8b1ddce 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1173,7 +1173,7 @@ static int vmsa_ttbcr_raw_write(CPUARMState *env, const ARMCPRegInfo *ri, { int maskshift = extract32(value, 0, 3); - if (arm_feature(env, ARM_FEATURE_LPAE)) { + if (arm_feature(env, ARM_FEATURE_LPAE) && (value & (1 << 31))) { value &= ~((7 << 19) | (3 << 14) | (0xf << 3)); } else { value &= 7; -- 1.7.9.5