[RFC PATCH 1/2] powerpc/mm: Update prot_none implementation using _PAGE_READ

Paul Mackerras paulus at ozlabs.org
Wed Mar 2 12:39:20 AEDT 2016


Another thing:

On Fri, Feb 26, 2016 at 08:50:49AM +0530, Aneesh Kumar K.V wrote:
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -173,9 +173,11 @@ unsigned long htab_convert_pte_flags(unsigned long pteflags)
>  	 * and there is no kernel RO (_PAGE_KERNEL_RO).
>  	 * User area is mapped with PP=0x2 for read/write
>  	 * or PP=0x3 for read-only (including writeable but clean pages).
> +	 * We also map user prot none as with PP=00.
>  	 */
>  	if (pteflags & _PAGE_USER) {
> -		rflags |= 0x2;
> +		if ((pteflags & _PAGE_READ) || (pteflags & _PAGE_RW))
> +			rflags |= 0x2;

You need to check _PAGE_EXEC too here.  I would do:

		if (pteflags & (_PAGE_READ | _PAGE_RW | _PAGE_EXEC))
			rflags |= 0x2;

Paul.


More information about the Linuxppc-dev mailing list