From patchwork Wed Jul 17 13:26:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 2828605 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EBF0E9F967 for ; Wed, 17 Jul 2013 13:28:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B34F82015F for ; Wed, 17 Jul 2013 13:28:27 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5318A2012C for ; Wed, 17 Jul 2013 13:28:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzRlM-0003hq-6P; Wed, 17 Jul 2013 13:27:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzRl4-0002oV-VA; Wed, 17 Jul 2013 13:27:06 +0000 Received: from mail-we0-f173.google.com ([74.125.82.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzRks-0002lW-OF for linux-arm-kernel@lists.infradead.org; Wed, 17 Jul 2013 13:26:56 +0000 Received: by mail-we0-f173.google.com with SMTP id x54so1799076wes.32 for ; Wed, 17 Jul 2013 06:26:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=4F6Y22hwJinnHF0lzG2yJGrt9mqbFzrKkamMoMXVtto=; b=PGQlsZj4GAEh7FCxUti2MbYUCZBgoJku3gqDGyVChF+qtEjZKSkK4Nw1npb8bNWSY/ OsHzcCOiWHOLlWAC5tPjb5N4jfkYGyVZyYOztefIr4jLsNE98IdlRyHz8Flcz3BqsEh5 cGuB1LLLheyl8Ozk+jSR3NbShtFTla8R+FStm7905eMAeHPh0/5cvIKWc96bDE7/xq9l vF8IdLUWZL1i4hMAbzfBPyHIKy69M51UYU9/RvvAu66OIYHMQLOnnQc4G/h62n+tRKh7 gfc4Yeg+H3eku0gAYUzjr9cRlSxrxj6jWcsssF3zh+IrCk4JJxgI6/KG9SfI54xQ+kpf PqHw== X-Received: by 10.180.185.74 with SMTP id fa10mr4698211wic.26.1374067593046; Wed, 17 Jul 2013 06:26:33 -0700 (PDT) Received: from localhost.localdomain (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id s19sm35079515wik.11.2013.07.17.06.26.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Jul 2013 06:26:32 -0700 (PDT) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM. Date: Wed, 17 Jul 2013 14:26:13 +0100 Message-Id: <1374067574-32034-2-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1374067574-32034-1-git-send-email-steve.capper@linaro.org> References: <1374067574-32034-1-git-send-email-steve.capper@linaro.org> X-Gm-Message-State: ALoCoQniOq7cTb9AblJRynFhrj8WEYb5PPxaTahN43qu2Be6sF7Wz3PCyz72lC6Bfa+gYasjdBQ7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130717_092654_941774_C1CAB560 X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -2.6 (--) Cc: Steve Capper , catalin.marinas@arm.com, will.deacon@arm.com, christoffer.dall@linaro.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd are now available in mm/hugetlb.c. This patch removes the ARM copies of these functions and activates the general ones by enabling: CONFIG_ARCH_WANT_GENERAL_HUGETLB Signed-off-by: Steve Capper Acked-by: Catalin Marinas --- arch/arm/Kconfig | 3 +++ arch/arm/mm/hugetlbpage.c | 43 ------------------------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ba412e0..d0fd5bf 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1757,6 +1757,9 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE def_bool y depends on ARM_LPAE +config ARCH_WANT_GENERAL_HUGETLB + def_bool y + source "mm/Kconfig" config FORCE_MAX_ZONEORDER diff --git a/arch/arm/mm/hugetlbpage.c b/arch/arm/mm/hugetlbpage.c index 3d1e4a2..66781bf 100644 --- a/arch/arm/mm/hugetlbpage.c +++ b/arch/arm/mm/hugetlbpage.c @@ -36,22 +36,6 @@ * of type casting from pmd_t * to pte_t *. */ -pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) -{ - pgd_t *pgd; - pud_t *pud; - pmd_t *pmd = NULL; - - pgd = pgd_offset(mm, addr); - if (pgd_present(*pgd)) { - pud = pud_offset(pgd, addr); - if (pud_present(*pud)) - pmd = pmd_offset(pud, addr); - } - - return (pte_t *)pmd; -} - struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) { @@ -68,33 +52,6 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) return 0; } -pte_t *huge_pte_alloc(struct mm_struct *mm, - unsigned long addr, unsigned long sz) -{ - pgd_t *pgd; - pud_t *pud; - pte_t *pte = NULL; - - pgd = pgd_offset(mm, addr); - pud = pud_alloc(mm, pgd, addr); - if (pud) - pte = (pte_t *)pmd_alloc(mm, pud, addr); - - return pte; -} - -struct page * -follow_huge_pmd(struct mm_struct *mm, unsigned long address, - pmd_t *pmd, int write) -{ - struct page *page; - - page = pte_page(*(pte_t *)pmd); - if (page) - page += ((address & ~PMD_MASK) >> PAGE_SHIFT); - return page; -} - int pmd_huge(pmd_t pmd) { return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);