From patchwork Wed Dec 8 11:15:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juha.Riihimaki@nokia.com X-Patchwork-Id: 74679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2153AB6F11 for ; Wed, 8 Dec 2010 22:34:32 +1100 (EST) Received: from localhost ([127.0.0.1]:56681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQII1-0004fC-7Y for incoming@patchwork.ozlabs.org; Wed, 08 Dec 2010 06:34:29 -0500 Received: from [140.186.70.92] (port=59133 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQHzX-0002Tc-B0 for qemu-devel@nongnu.org; Wed, 08 Dec 2010 06:15:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQHzV-0003Cd-58 for qemu-devel@nongnu.org; Wed, 08 Dec 2010 06:15:23 -0500 Received: from smtp.nokia.com ([147.243.1.47]:53983 helo=mgw-sa01.nokia.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQHzU-0003Bc-Pz for qemu-devel@nongnu.org; Wed, 08 Dec 2010 06:15:21 -0500 Received: from esdhcp04048.research.nokia.com (esdhcp04048.research.nokia.com [172.21.40.48]) by mgw-sa01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id oB8BFHUP009165 for ; Wed, 8 Dec 2010 13:15:17 +0200 From: =?UTF-8?q?Juha=20Riihim=C3=A4ki?= To: qemu-devel@nongnu.org Date: Wed, 8 Dec 2010 13:15:16 +0200 Message-Id: <4579f94557edfad96fce7feec9ee0d7911ee33fa.1291703787.git.juha.riihimaki@nokia.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Nokia-AV: Clean X-MIME-Autoconverted: from 8bit to quoted-printable by mgw-sa01.nokia.com id oB8BFHUP009165 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) Subject: [Qemu-devel] [PATCH 1/3] target-arm: fix vmsav6 access control X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Override access control checks (including execute) for mmu translation table descriptors assigned to manager domains. Signed-off-by: Juha Riihimäki --- target-arm/helper.c | 34 +++++++++++++++++++--------------- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 996d40d..5bcfcf7 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1078,22 +1078,26 @@ static int get_phys_addr_v6(CPUState *env, uint32_t address, int access_type, } code = 15; } - if (xn && access_type == 2) - goto do_fault; + if (domain == 3) { + *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; + } else { + if (xn && access_type == 2) + goto do_fault; - /* The simplified model uses AP[0] as an access control bit. */ - if ((env->cp15.c1_sys & (1 << 29)) && (ap & 1) == 0) { - /* Access flag fault. */ - code = (code == 15) ? 6 : 3; - goto do_fault; - } - *prot = check_ap(env, ap, domain, access_type, is_user); - if (!*prot) { - /* Access permission fault. */ - goto do_fault; - } - if (!xn) { - *prot |= PAGE_EXEC; + /* The simplified model uses AP[0] as an access control bit. */ + if ((env->cp15.c1_sys & (1 << 29)) && (ap & 1) == 0) { + /* Access flag fault. */ + code = (code == 15) ? 6 : 3; + goto do_fault; + } + *prot = check_ap(env, ap, domain, access_type, is_user); + if (!*prot) { + /* Access permission fault. */ + goto do_fault; + } + if (!xn) { + *prot |= PAGE_EXEC; + } } *phys_ptr = phys_addr; return 0;