From patchwork Fri Jan 2 17:33:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 425020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7C78A1400B7 for ; Sat, 3 Jan 2015 04:34:08 +1100 (AEDT) Received: from localhost ([::1]:52129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y766w-00078H-G3 for incoming@patchwork.ozlabs.org; Fri, 02 Jan 2015 12:34:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y766g-0006Rr-Ra for qemu-devel@nongnu.org; Fri, 02 Jan 2015 12:33:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y766d-000302-Ll for qemu-devel@nongnu.org; Fri, 02 Jan 2015 12:33:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y766d-0002zo-EM for qemu-devel@nongnu.org; Fri, 02 Jan 2015 12:33:47 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t02HXkWr012544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 2 Jan 2015 12:33:46 -0500 Received: from hawk.usersys.redhat.com ([10.34.1.145]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t02HXiQB016310; Fri, 2 Jan 2015 12:33:45 -0500 From: Andrew Jones To: qemu-devel@nongnu.org Date: Fri, 2 Jan 2015 18:33:41 +0100 Message-Id: <1420220021-16886-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] tcg-aarch64: handle additional PXN case X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org D4.5.1 "Memory access control:Access permissions for instruction execution" states "... In addition: * For the EL1&0 translation regime, if the value of the AP[2:1] bits is 0b01, permitting write access from EL0, then the PXN bit is treated as if it has the value 1, regardless of its actual value. ..." Signed-off-by: Andrew Jones --- target-arm/helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index 3ef0f1f38eda5..962758888194a 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4960,6 +4960,8 @@ static int get_phys_addr_lpae(CPUARMState *env, target_ulong address, *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; if ((arm_feature(env, ARM_FEATURE_V8) && is_user && (attrs & (1 << 12))) || (!arm_feature(env, ARM_FEATURE_V8) && (attrs & (1 << 12))) || + (arm_feature(env, ARM_FEATURE_V8) && !is_user && + ((attrs & (3 << 4)) == (1 << 4) /* AP[2:1] == 0b01 */)) || (!is_user && (attrs & (1 << 11)))) { /* XN/UXN or PXN. Since we only implement EL0/EL1 we unconditionally * treat XN/UXN as UXN for v8.