Ritesh Harjani (IBM) <[email protected]> writes:

> So, I think what we need here is:
>
> diff --git a/tools/testing/selftests/powerpc/mm/exec_prot.c 
> b/tools/testing/selftests/powerpc/mm/exec_prot.c
> index db75b2225de1..51ac2f9c14a6 100644
> --- a/tools/testing/selftests/powerpc/mm/exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/exec_prot.c
> @@ -167,13 +167,17 @@ static int test(void)
>          * Read an instruction word from the address when the page
>          * is execute only. This should generate an access fault.
>          */
> -       fault_code = -1;
> -       remaining_faults = 1;
> -       printf("Testing read on --x, should fault...");
> -       FAIL_IF(mprotect(insns, pgsize, PROT_EXEC) != 0);
> -       i = *fault_addr;
> -       FAIL_IF(remaining_faults != 0 || !is_fault_expected(fault_code));
> -       printf("ok!\n");
> +       if (pkeys_supported) {
One quick correction - I think this should be
            if (!hash_mmu || pkeys_supported)

> +               fault_code = -1;
> +               remaining_faults = 1;
> +               printf("Testing read on --x, should fault...");
> +               FAIL_IF(mprotect(insns, pgsize, PROT_EXEC) != 0);
> +               i = *fault_addr;
> +               FAIL_IF(remaining_faults != 0 || 
> !is_fault_expected(fault_code));
> +               printf("ok!\n");
> +       } else {
> +               printf("Testing read on --x, skipped on Hash MMU without 
> pkeys\n");
> +       }
>
>

-ritesh

Reply via email to