diff options
author | Suraj Jitindar Singh <sjitindarsingh@gmail.com> | 2017-03-01 18:12:53 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-03-03 11:30:59 +1100 |
commit | 347a5c73bafd1b5872c9d3192a4d08f8aa1d5f5a (patch) | |
tree | 28b1ed28dc68431e3d53e89046d7e3d3eb43130f /target | |
parent | a6152b52bc50c5cf1cd118a74b483dd3f0748ebd (diff) |
target/ppc: Add execute permission checking to access authority check
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 <sjitindarsingh@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target')
-rw-r--r-- | target/ppc/mmu-hash64.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index ee94f13481..99f936ddbe 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 = PAGE_READ | PAGE_WRITE; + prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; break; case 0x3: case 0x6: - prot = PAGE_READ; + prot = PAGE_READ | PAGE_EXEC; break; } } else { switch (pp) { case 0x0: case 0x6: - prot = 0; break; case 0x1: case 0x3: - prot = PAGE_READ; + prot = PAGE_READ | PAGE_EXEC; break; case 0x2: - prot = PAGE_READ | PAGE_WRITE; + prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; break; } } |