Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5647221imm; Wed, 12 Sep 2018 09:01:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIJ1DuPgKLTB2wjd4rD5ai8QapekKm8UFUDXTfcdfuHavv1AFv2DEv2hfZMSwzOkQbn7Lv X-Received: by 2002:a63:141c:: with SMTP id u28-v6mr3095511pgl.247.1536768111705; Wed, 12 Sep 2018 09:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536768111; cv=none; d=google.com; s=arc-20160816; b=UNCGr+keZkvHIiWbdOhkyZkwqVuzyF26HvjR1Jn5harrfgfo8eQzx7Zdpb7vQ5mGUM YnyCfVXCOGP0cimhJ8Ie0VZrV3RmT381W2N3293Vw4nO2JXk3E49Pi2rD15C+2q6H6c6 N0soAi+5ddpWuarphbTk123YFLk7JSJd4lNgriyunW9kh1A48RSbeGSZxIZVZZLPknkr MwKW1oQQwEdZz6GxHkz2ZIpsRpKslP/8ZlUw/R1U9PT4iYxt7nf11gk3zSlyeyAFWp6u 4rZBmv8SVenLyuH6T1RT0WNbBbodMqGBzQ281Qfzm0QgqjS171rNqDyF5Asxciims6LH sS8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=AVzLrly8Tz4umf0/XBeqhj0a2MYHlFdldu/rfZJQdXg=; b=rp7ahZCnZc1kJyEdppsyxNDS8DKELdzMusD543JoWh0EQiEihwh3o0pXN5ebZfO9ez Ri99QNOS54pp80Ul042Yk5KskIYx5g00OrIEN5l6e+EPWPx38VkJ+42TgQH2FEqsg/66 DrFCfQ7MJEZgQx3wII2wis2AXODAPkFmQJZjML6CjqgD0rDX9roz5qi2DZn4lW8scUXd 45KlJR1+haQJhVyLmVO1Eawi7nRav08TPBJTf9cJs/UY8hiX6aGyar5qDQbiKlbxqfrO Hzat+jtjPOHR9HszZ/DvOASyg/PNem7sffEeZ0xNqROMxAbvK7uvj2D+USyM4vpbvXB7 zbGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13-v6si1440073pfd.319.2018.09.12.09.01.25; Wed, 12 Sep 2018 09:01:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728235AbeILVDn (ORCPT + 99 others); Wed, 12 Sep 2018 17:03:43 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:3341 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbeILVDn (ORCPT ); Wed, 12 Sep 2018 17:03:43 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 429RK35gQhz9ttRp; Wed, 12 Sep 2018 17:58:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 9yFLhju64-tc; Wed, 12 Sep 2018 17:58:31 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 429RK35991z9ttBm; Wed, 12 Sep 2018 17:58:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 07BEE8B874; Wed, 12 Sep 2018 17:58:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id iF3petY_lBR2; Wed, 12 Sep 2018 17:58:31 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9FAA08B86F; Wed, 12 Sep 2018 17:58:30 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 2C52271913; Wed, 12 Sep 2018 15:58:30 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 08/24] powerpc/mm: don't use _PAGE_EXEC in book3s/32 To: Bartlomiej Zolnierkiewicz , Benjamin Herrenschmidt , Dominik Brodowski , Geoff Levand , Jens Axboe , Kumar Gala , Li Yang , Michael Ellerman , Nicholas Piggin , Paul Mackerras , Scott Wood , aneesh.kumar@linux.vnet.ibm.com Cc: linux-arm-kernel@lists.infradead.org, linux-block@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org Date: Wed, 12 Sep 2018 15:58:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org book3s/32 doesn't define _PAGE_EXEC, so no need to use it. All other platforms define _PAGE_EXEC so no need to check it is not NUL when not book3s/32. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/mm/pgtable.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h index 7a9f0ed599ff..3127cc529aa1 100644 --- a/arch/powerpc/include/asm/book3s/32/pgtable.h +++ b/arch/powerpc/include/asm/book3s/32/pgtable.h @@ -234,7 +234,7 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma, int psize) { unsigned long set = pte_val(entry) & - (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC); + (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW); unsigned long clr = ~pte_val(entry) & _PAGE_RO; pte_update(ptep, clr, set); diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index d71c7777669c..4f788f3762a9 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -73,7 +73,7 @@ static struct page *maybe_pte_to_page(pte_t pte) return page; } -#if defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0 +#ifdef CONFIG_PPC_BOOK3S /* Server-style MMU handles coherency when hashing if HW exec permission * is supposed per page (currently 64-bit only). If not, then, we always @@ -106,7 +106,7 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma, return pte; } -#else /* defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0 */ +#else /* CONFIG_PPC_BOOK3S */ /* Embedded type MMU with HW exec support. This is a bit more complicated * as we don't have two bits to spare for _PAGE_EXEC and _PAGE_HWEXEC so @@ -179,7 +179,7 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma, return __pte(pte_val(pte) | _PAGE_EXEC); } -#endif /* !(defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0) */ +#endif /* CONFIG_PPC_BOOK3S */ /* * set_pte stores a linux PTE into the linux page table. -- 2.13.3