From nobody Mon Feb 9 22:19:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488512159994364.0594152819443; Thu, 2 Mar 2017 19:35:59 -0800 (PST) Received: from localhost ([::1]:55897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cje0b-0007St-SA for importer@patchew.org; Thu, 02 Mar 2017 22:35:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjdqY-00087W-Tx for qemu-devel@nongnu.org; Thu, 02 Mar 2017 22:25:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjdqX-0001Od-AH for qemu-devel@nongnu.org; Thu, 02 Mar 2017 22:25:34 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:52231) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjdqW-0001M1-Rx; Thu, 02 Mar 2017 22:25:33 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vZF1X55xkz9s8N; Fri, 3 Mar 2017 14:25:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1488511520; bh=WsT6LYEuEpHvRb3bjAnz4eplJQRZfxFiMdDbzm4+J74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjeFGH79pDd1veYeEOWL7u5toAFOlojduURpgS7BlFinQjG6vuT70XgG1T7H96a2A bJAlxbLoLJR5PZfmdZhebvP/A5SKyMEC2aQ9815C9N+B7MwUr5+SEMOjJpOobf0CYC vA640ObxB7S4zMx3D8ot5nGFVV1wql4uBqwe2U9Y= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 3 Mar 2017 14:25:02 +1100 Message-Id: <20170303032507.16142-13-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170303032507.16142-1-david@gibson.dropbear.id.au> References: <20170303032507.16142-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 12/17] target/ppc: Add execute permission checking to access authority check 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: lvivier@redhat.com, thuth@redhat.com, mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, sjitindarsingh@gmail.com, sam.bobroff@au1.ibm.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Suraj Jitindar Singh Basic storage protection defines various access authority permissions based on a slb storage key and pte pp value pair. This access authority defines read, write and execute permissions however currently we only use this to control read and write permissions and ignore the execute control. Fix the code to allow execute permissions based on the key-pp value pair. Execute is allowed under the same conditions which enable reads. (i.e. read permission -> execute permission) Signed-off-by: Suraj Jitindar Singh Acked-by: David Gibson Signed-off-by: David Gibson --- target/ppc/mmu-hash64.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index ee94f13..99f936d 100644 --- a/target/ppc/mmu-hash64.c +++ b/target/ppc/mmu-hash64.c @@ -308,28 +308,27 @@ static int ppc_hash64_pte_prot(PowerPCCPU *cpu, case 0x0: case 0x1: case 0x2: - prot =3D PAGE_READ | PAGE_WRITE; + prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; break; =20 case 0x3: case 0x6: - prot =3D PAGE_READ; + prot =3D PAGE_READ | PAGE_EXEC; break; } } else { switch (pp) { case 0x0: case 0x6: - prot =3D 0; break; =20 case 0x1: case 0x3: - prot =3D PAGE_READ; + prot =3D PAGE_READ | PAGE_EXEC; break; =20 case 0x2: - prot =3D PAGE_READ | PAGE_WRITE; + prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; break; } } --=20 2.9.3