Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4899292imm; Tue, 9 Oct 2018 06:56:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV63nFY+Ghh3vNbJIwr0Uv8iFXzwnx0XDM3NDpZ8BEChqtyAnsJyJkhsGZWOHPxA74KA3d6Fi X-Received: by 2002:a62:3185:: with SMTP id x127-v6mr31046696pfx.88.1539093384279; Tue, 09 Oct 2018 06:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539093384; cv=none; d=google.com; s=arc-20160816; b=tdqFO/B9Xf84M+mSpB3kFlEMqLXQPdrLFIGtF7UYcoo8D9FBi3KSirxz7HiiNHQ7nh 4xLOhG4VdSxqLUyvNiuII6XHanzCS+nzyjvMoO/wSsuYV33VIyDkcdXOONxPqYDWQ3Hm VkJhEyYK0AI/EvRkcm99XhsiCNyyY2BT809D4896cPPE8vOKy/6XW5mlATYiDYLQbomh LYyM2A0HXu21R31R9je1W7ZAk2aVPO8RrB0QDze8rnRYuAJyM5cNQMnvY7rE7Ieg7R0r swl1MOzGe/0oEV+zjDV7sRVJVdMZPSMc/lfxsz4/B1vN2e7OdndQSZ/cys8BLTsO18vp 9iBg== 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=lKR5TereVepOX/bnQJ2nRSSes22xzgtz4am0noTHls0=; b=rqTD8t6HeadY75hVsP3V7tM9P0hQk5M5Lgo16rbBe80vsa+hVClmpbjetKf1Hl/cu0 MMQk3JG84axAvvY2+loiJyBGm0hmANKOSHPezyL83dQOoekT0IiaJOMOo/zI9OdgyGgS DfwVeys0/A5QaDqunNC4i0KQa+L8f9REjePI3ebqRAp9AvpN2z9jqSodWv/5L07aNPeo ZcbDFgHpn6q3FsD0vsnwPNhczkOijCI203/oVf+N/3qKq7lVLyIDsBSrUN8hEcfScNzD Dd3AkaVh/YvoqBhEY/rDgTs8+K36s/R+b5aBA+nNEXiSdtzmqq+FKB8Che40p6N8cgZT tabg== 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 h9-v6si22074118pfh.240.2018.10.09.06.56.09; Tue, 09 Oct 2018 06:56:24 -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 S1727303AbeJIVIz (ORCPT + 99 others); Tue, 9 Oct 2018 17:08:55 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:40653 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbeJIVIy (ORCPT ); Tue, 9 Oct 2018 17:08:54 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42TzD96CKJz9ttg6; Tue, 9 Oct 2018 15:51:37 +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 kYo3-EZQmeEA; Tue, 9 Oct 2018 15:51:37 +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 42TzD95hvWz9ttg4; Tue, 9 Oct 2018 15:51:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 73B0E8B80B; Tue, 9 Oct 2018 15:51:49 +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 otY8Y9AvFkEC; Tue, 9 Oct 2018 15:51:49 +0200 (CEST) Received: from pc13168vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 35FE58B80A; Tue, 9 Oct 2018 15:51:49 +0200 (CEST) Received: by pc13168vm.idsi0.si.c-s.fr (Postfix, from userid 0) id F371D6F444; Tue, 9 Oct 2018 13:51:47 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 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: Tue, 9 Oct 2018 13:51:47 +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 aee04b209b51..f97d9c3760e3 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