From patchwork Wed Mar 6 03:44:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 225280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 312692C037A for ; Wed, 6 Mar 2013 14:57:20 +1100 (EST) Received: from localhost ([::1]:56479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UD5Ti-0006K5-Do for incoming@patchwork.ozlabs.org; Tue, 05 Mar 2013 22:57:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UD5IG-0004EN-9e for qemu-devel@nongnu.org; Tue, 05 Mar 2013 22:46:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UD5Hi-0007v7-Qg for qemu-devel@nongnu.org; Tue, 05 Mar 2013 22:45:28 -0500 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:45189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UD5Hi-0007o9-Cz; Tue, 05 Mar 2013 22:44:54 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id CA3A22C03A3; Wed, 6 Mar 2013 14:44:43 +1100 (EST) From: David Gibson To: agraf@suse.de Date: Wed, 6 Mar 2013 14:44:25 +1100 Message-Id: <1362541473-4365-38-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362541473-4365-1-git-send-email-david@gibson.dropbear.id.au> References: <1362541473-4365-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2402:b800:7003:1:1::1 Cc: David Gibson , qemu-ppc@nongnu.org, afaerber@suse.de, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 37/45] mmu-hash32: Remove nx from context structure 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 Previous cleanups have meant the nx field of the mmu_ctx_hash32 structure is now only used within ppc_hash32_translate(), and so it can be replaced by a local variable. Signed-off-by: David Gibson --- target-ppc/mmu-hash32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target-ppc/mmu-hash32.c b/target-ppc/mmu-hash32.c index ae606fd..2b88b9f 100644 --- a/target-ppc/mmu-hash32.c +++ b/target-ppc/mmu-hash32.c @@ -45,7 +45,6 @@ struct mmu_ctx_hash32 { hwaddr raddr; /* Real address */ int prot; /* Protection bits */ int key; /* Access key */ - int nx; /* Non-execute area */ }; static int ppc_hash32_pp_check(int key, int pp, int nx) @@ -383,6 +382,7 @@ static int ppc_hash32_translate(CPUPPCState *env, struct mmu_ctx_hash32 *ctx, { int ret; target_ulong sr; + bool nx; hwaddr pte_offset; ppc_hash_pte32_t pte; @@ -414,8 +414,8 @@ static int ppc_hash32_translate(CPUPPCState *env, struct mmu_ctx_hash32 *ctx, } /* 5. Check for segment level no-execute violation */ - ctx->nx = !!(sr & SR32_NX); - if ((rwx == 2) && ctx->nx) { + nx = !!(sr & SR32_NX); + if ((rwx == 2) && nx) { return -3; } @@ -434,7 +434,7 @@ static int ppc_hash32_translate(CPUPPCState *env, struct mmu_ctx_hash32 *ctx, pp = pte.pte1 & HPTE32_R_PP; /* Compute access rights */ - access = ppc_hash32_pp_check(ctx->key, pp, ctx->nx); + access = ppc_hash32_pp_check(ctx->key, pp, nx); /* Keep the matching PTE informations */ ctx->raddr = pte.pte1; ctx->prot = access;