Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp501003ybl; Thu, 15 Aug 2019 22:44:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkBhMNyNXs4sa8hKdxeSLb+gf7vIHmJGGkCOLa2Rsqsgqkd4uR0ld5bDTFBcd1GSLhLuuy X-Received: by 2002:a17:902:124:: with SMTP id 33mr7779726plb.145.1565934272794; Thu, 15 Aug 2019 22:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565934272; cv=none; d=google.com; s=arc-20160816; b=tZ2GR3PVMVvyQ9pvhP5bzJUqDPSiKICYSIvh+NzYagVmVm0g+ROBZWWUbwnDN40ORa ++ImZftbtW+pRAbQ2wolbP850k3Fd+GBHIwBLUpMqGdFD5sAA5fzbgtQsq4n6F+/4D/z pCXnp7EQoYum851MJ6dk3ANsHKirR8UJK5nohYIqrDsVHP+JrL19W+v3oXAzLT1teC+Y Do96H87qAeAnlzOzeWjHt6X+QHQlQuaz5pp/QSE4nkD4FG1+I6ZXJeTV6WpXiSC4GhYv 6KEFLa0V20RRoR5uPrHqqiqWGlQxT2wmuT9JnsVG8TIb0jyv68v00h/Z4OJI229T7P7v DLSA== 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:message-id :dkim-signature; bh=WYMNLBFh6ch1zZnLludHa1zT7jT6U/Npzey3DZ406rk=; b=bGEhZQrq+K+grXR/tVMaPvBam173yQHgn0FYCjiSQWuU+ehZsriysNz1e+jli5ojDc MJ1q6z9sFcWZJu/scc73tTwHlx91YI4FMNCP9qJd4w5cZaOuNCKwShlTEyRVUkgmKxbr DD23O4KycQ5eSXEjOyzRKYdFdL+jjCwgfYTqIZip7WonWbrjRXUXC/sCGjgNs4+SAz4V sL74QHPWLn8Ldlbk4g+9h6/vR4L2EabgafspesqeSLJJtKluIE2Mxo8bXCFv7Wrwd/Af 3JFE5MnNiPuAIc97xdKf1zIwsTVnT3hVP1R+Zi8h/wkhl4mrSv6psszRb6jY9W62ZVwM u0Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=C5lhLwpl; 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 35si3404653plb.24.2019.08.15.22.44.16; Thu, 15 Aug 2019 22:44:32 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=C5lhLwpl; 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 S1726582AbfHPFln (ORCPT + 99 others); Fri, 16 Aug 2019 01:41:43 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:3321 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfHPFlm (ORCPT ); Fri, 16 Aug 2019 01:41:42 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 468sdH60FGz9txsx; Fri, 16 Aug 2019 07:41:39 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=C5lhLwpl; dkim-adsp=pass; dkim-atps=neutral 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 gExlPo0f7j56; Fri, 16 Aug 2019 07:41:39 +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 468sdH4rX9z9tygC; Fri, 16 Aug 2019 07:41:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1565934099; bh=WYMNLBFh6ch1zZnLludHa1zT7jT6U/Npzey3DZ406rk=; h=From:Subject:To:Cc:Date:From; b=C5lhLwpleju2b8lyT+L27+zEbj+avXjLCfBBxMxmRpMFKuXZydNZzww35RD4suPNt A3/llx9A6wn0EMy3RhP3sdb9eKB/W2Q/xysEX1PKITP1ElUoNpO6MifhOzZWQPEIZG TPpC6D5Gi7SHldu/E7cq2Dc8inzkXkGoxTk0Qhqw= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9D6898B776; Fri, 16 Aug 2019 07:41:40 +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 YQUxJCzoC-E9; Fri, 16 Aug 2019 07:41:40 +0200 (CEST) Received: from pc17473vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.101]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7AB1C8B754; Fri, 16 Aug 2019 07:41:40 +0200 (CEST) Received: by pc17473vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 49DDE6B6CC; Fri, 16 Aug 2019 05:41:40 +0000 (UTC) Message-Id: <668aba4db6b9af6d8a151174e11a4289f1a6bbcd.1565933217.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH 1/5] powerpc/mm: define empty update_mmu_cache() as static inline To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 16 Aug 2019 05:41:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only BOOK3S and FSL_BOOK3E have a usefull update_mmu_cache(). For the others, just define it static inline. In the meantime, simplify the FSL_BOOK3E related ifdef as book3e_hugetlb_preload() only exists when CONFIG_PPC_FSL_BOOK3E is selected. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/pgtable.h | 11 +++++++++++ arch/powerpc/include/asm/nohash/pgtable.h | 13 +++++++++++++ arch/powerpc/include/asm/pgtable.h | 12 ------------ arch/powerpc/mm/mem.c | 11 +++++++---- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/pgtable.h b/arch/powerpc/include/asm/book3s/pgtable.h index 6436b65ac7bc..0e1263455d73 100644 --- a/arch/powerpc/include/asm/book3s/pgtable.h +++ b/arch/powerpc/include/asm/book3s/pgtable.h @@ -26,5 +26,16 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t vma_prot); #define __HAVE_PHYS_MEM_ACCESS_PROT +/* + * This gets called at the end of handling a page fault, when + * the kernel has put a new PTE into the page table for the process. + * We use it to ensure coherency between the i-cache and d-cache + * for the page which has just been mapped in. + * On machines which use an MMU hash table, we use this to put a + * corresponding HPTE into the hash table ahead of time, instead of + * waiting for the inevitable extra hash-table miss exception. + */ +void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); + #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/powerpc/include/asm/nohash/pgtable.h b/arch/powerpc/include/asm/nohash/pgtable.h index 1ca1c1864b32..7fed9dc0f147 100644 --- a/arch/powerpc/include/asm/nohash/pgtable.h +++ b/arch/powerpc/include/asm/nohash/pgtable.h @@ -293,5 +293,18 @@ static inline int pgd_huge(pgd_t pgd) #define is_hugepd(hpd) (hugepd_ok(hpd)) #endif +/* + * This gets called at the end of handling a page fault, when + * the kernel has put a new PTE into the page table for the process. + * We use it to ensure coherency between the i-cache and d-cache + * for the page which has just been mapped in. + */ +#if defined(CONFIG_PPC_FSL_BOOK3E) && defined(CONFIG_HUGETLB_PAGE) +void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); +#else +static inline +void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) {} +#endif + #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index c58ba7963688..c70916a7865a 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -77,18 +77,6 @@ extern void paging_init(void); #include - -/* - * This gets called at the end of handling a page fault, when - * the kernel has put a new PTE into the page table for the process. - * We use it to ensure coherency between the i-cache and d-cache - * for the page which has just been mapped in. - * On machines which use an MMU hash table, we use this to put a - * corresponding HPTE into the hash table ahead of time, instead of - * waiting for the inevitable extra hash-table miss exception. - */ -extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); - #ifndef CONFIG_TRANSPARENT_HUGEPAGE #define pmd_large(pmd) 0 #endif diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 9191a66b3bc5..582ad728ac9d 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -414,10 +414,10 @@ EXPORT_SYMBOL(flush_icache_user_range); * * This must always be called with the pte lock held. */ +#ifdef CONFIG_PPC_BOOK3S void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) { -#ifdef CONFIG_PPC_BOOK3S /* * We don't need to worry about _PAGE_PRESENT here because we are * called with either mm->page_table_lock held or ptl lock held @@ -455,13 +455,16 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, } hash_preload(vma->vm_mm, address, is_exec, trap); +} #endif /* CONFIG_PPC_BOOK3S */ -#if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ - && defined(CONFIG_HUGETLB_PAGE) +#if defined(CONFIG_PPC_FSL_BOOK3E) && defined(CONFIG_HUGETLB_PAGE) +void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, + pte_t *ptep) +{ if (is_vm_hugetlb_page(vma)) book3e_hugetlb_preload(vma, address, *ptep); -#endif } +#endif /* * System memory should not be in /proc/iomem but various tools expect it -- 2.13.3