[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/7] target/ppc: Extend ppc_radix64_check_prot() with a 'part
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH 6/7] target/ppc: Extend ppc_radix64_check_prot() with a 'partition_scoped' bool |
Date: |
Tue, 31 Mar 2020 10:22:03 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 3/30/20 7:01 PM, Greg Kurz wrote:
> On Mon, 30 Mar 2020 11:49:45 +0200
> Cédric Le Goater <address@hidden> wrote:
>
>> This prepares ground for partition-scoped Radix translation.
>>
>> Signed-off-by: Suraj Jitindar Singh <address@hidden>
>> Signed-off-by: Cédric Le Goater <address@hidden>
>> ---
>> target/ppc/mmu-radix64.c | 11 ++++++-----
>> 1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
>> index 136498111f60..3ae29ed90d49 100644
>> --- a/target/ppc/mmu-radix64.c
>> +++ b/target/ppc/mmu-radix64.c
>> @@ -105,7 +105,8 @@ static void ppc_radix64_raise_si(PowerPCCPU *cpu, int
>> rwx, vaddr eaddr,
>>
>>
>> static bool ppc_radix64_check_prot(PowerPCCPU *cpu, int rwx, uint64_t pte,
>> - int *fault_cause, int *prot)
>> + int *fault_cause, int *prot,
>> + bool partition_scoped)
>> {
>> CPUPPCState *env = &cpu->env;
>> const int need_prot[] = { PAGE_READ, PAGE_WRITE, PAGE_EXEC };
>> @@ -121,11 +122,11 @@ static bool ppc_radix64_check_prot(PowerPCCPU *cpu,
>> int rwx, uint64_t pte,
>> }
>>
>> /* Determine permissions allowed by Encoded Access Authority */
>> - if ((pte & R_PTE_EAA_PRIV) && msr_pr) { /* Insufficient Privilege */
>> + if (!partition_scoped && (pte & R_PTE_EAA_PRIV) && msr_pr) {
>> *prot = 0;
>> - } else if (msr_pr || (pte & R_PTE_EAA_PRIV)) {
>> + } else if (msr_pr || (pte & R_PTE_EAA_PRIV) || partition_scoped) {
>> *prot = ppc_radix64_get_prot_eaa(pte);
>> - } else { /* !msr_pr && !(pte & R_PTE_EAA_PRIV) */
>> + } else { /* !msr_pr && !(pte & R_PTE_EAA_PRIV) && !partition_scoped */
>> *prot = ppc_radix64_get_prot_eaa(pte);
>> *prot &= ppc_radix64_get_prot_amr(cpu); /* Least combined
>> permissions */
>> }
>> @@ -266,7 +267,7 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU
>> *cpu, int rwx,
>> g_raddr, g_page_size, &fault_cause,
>> &pte_addr);
>>
>> if (!(pte & R_PTE_VALID) ||
>> - ppc_radix64_check_prot(cpu, rwx, pte, &fault_cause, g_prot)) {
>> + ppc_radix64_check_prot(cpu, rwx, pte, &fault_cause, g_prot, 0)) {
>
> Maybe pass false since ppc_radix64_check_prot() expects a bool ?
Sure,
> Apart from that,
>
> Reviewed-by: Greg Kurz <address@hidden>
Thanks,
C.
- Re: [PATCH 4/7] target/ppc: Introduce ppc_radix64_xlate() for Radix tree translation, (continued)
[PATCH 5/7] target/ppc: Rework ppc_radix64_walk_tree() for partition-scoped translation, Cédric Le Goater, 2020/03/30
[PATCH 6/7] target/ppc: Extend ppc_radix64_check_prot() with a 'partition_scoped' bool, Cédric Le Goater, 2020/03/30
[PATCH 7/7] target/ppc: Add support for Radix partition-scoped translation, Cédric Le Goater, 2020/03/30