From patchwork Mon Apr 18 18:00:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Sorokin X-Patchwork-Id: 8874261 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B7119F39D for ; Mon, 18 Apr 2016 18:00:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A091B2013A for ; Mon, 18 Apr 2016 18:00:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9F5C2012D for ; Mon, 18 Apr 2016 18:00:32 +0000 (UTC) Received: from localhost ([::1]:42897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDTM-0002LE-73 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Apr 2016 14:00:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDTE-0002Hk-Do for qemu-devel@nongnu.org; Mon, 18 Apr 2016 14:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asDTD-0001zh-NN for qemu-devel@nongnu.org; Mon, 18 Apr 2016 14:00:24 -0400 Received: from forward20o.cmail.yandex.net ([37.9.109.219]:53022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDT6-0001tK-Dc; Mon, 18 Apr 2016 14:00:16 -0400 Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [37.140.190.29]) by forward20o.cmail.yandex.net (Yandex) with ESMTP id B7C1D21AA7; Mon, 18 Apr 2016 21:00:13 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id 2597B2323A86; Mon, 18 Apr 2016 21:00:13 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id xZMZYt1l2x-0CxeXEjJ; Mon, 18 Apr 2016 21:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1461002412; bh=QV6uZNSIyOUDALCFSQa+MO1iP+sqhlHK04VspKoBfH8=; h=From:To:Cc:Subject:Date:Message-Id:X-Mailer; b=vcJj6pHU/CDqLsGKW3HyII2WDjDhXiVj3N/pyDmJfDJOGf0fy+6vXtXX/vctB1Yv1 +5EF/fSgioEeJSw/pKSvk6hEOgk/2jRENyymt0IoIlvDLqlh8MLPPUrHw6/Jztycfu ok0spXWy1nkk/wneDUaPTF7vxXXmjkxt+PhSd/3Q= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-ForeignMX: US X-Yandex-Suid-Status: 1 0,1 0,1 0,1 37377968 From: Sergey Sorokin To: qemu-devel@nongnu.org Date: Mon, 18 Apr 2016 21:00:00 +0300 Message-Id: <1461002400-3187-1-git-send-email-afarallax@yandex.ru> X-Mailer: git-send-email 1.9.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 37.9.109.219 Subject: [Qemu-devel] [PATCH] target-arm: Stage 2 permission fault was fixed in AArch32 state 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-arm@nongnu.org, Sergey Sorokin Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As described in AArch32.CheckS2Permission an instruction fetch fails if XN bit is set or there is no read permission for the address. Signed-off-by: Sergey Sorokin --- target-arm/helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 09638b2..59efb90 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -6708,7 +6708,9 @@ static int get_S2prot(CPUARMState *env, int s2ap, int xn) prot |= PAGE_WRITE; } if (!xn) { - prot |= PAGE_EXEC; + if (arm_el_is_aa64(env, 2) || prot & PAGE_READ) { + prot |= PAGE_EXEC; + } } return prot; }