[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC NO-MERGE 02/12] target/ppc: Add execute permission c
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [RFC NO-MERGE 02/12] target/ppc: Add execute permission checking to access authority check |
Date: |
Mon, 20 Feb 2017 11:30:46 +1100 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Fri, Feb 17, 2017 at 04:08:02PM +1100, Suraj Jitindar Singh wrote:
> 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 <address@hidden>
Acked-by: David Gibson <address@hidden>
> ---
> 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 08079db..de507b9 100644
> --- a/target/ppc/mmu-hash64.c
> +++ b/target/ppc/mmu-hash64.c
> @@ -356,28 +356,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;
> }
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-ppc] [RFC NO-MERGE 00/12] target/ppc: Implement POWER9 pseries tcg radix, Suraj Jitindar Singh, 2017/02/17
- [Qemu-ppc] [RFC NO-MERGE 01/12] target/ppc: Add Instruction Authority Mask Register Check, Suraj Jitindar Singh, 2017/02/17
- [Qemu-ppc] [RFC NO-MERGE 02/12] target/ppc: Add execute permission checking to access authority check, Suraj Jitindar Singh, 2017/02/17
- Re: [Qemu-ppc] [RFC NO-MERGE 02/12] target/ppc: Add execute permission checking to access authority check,
David Gibson <=
- [Qemu-ppc] [RFC NO-MERGE 03/12] target/ppc: Move no-execute and guarded page checking into new function, Suraj Jitindar Singh, 2017/02/17
- [Qemu-ppc] [RFC NO-MERGE 04/12] target/ppc: Rework hash mmu page fault code and add defines for clarity, Suraj Jitindar Singh, 2017/02/17
- [Qemu-ppc] [RFC NO-MERGE 05/12] target/ppc: Add ibm, processor-radix-AP-encodings to cpu device tree node, Suraj Jitindar Singh, 2017/02/17
- [Qemu-ppc] [RFC NO-MERGE 06/12] target/ppc: Add new H-CALL shells for in memory table translation, Suraj Jitindar Singh, 2017/02/17