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: 18401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3977125B8B for ; Wed, 17 Jul 2013 13:26:35 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 2sf2827606qea.1 for ; Wed, 17 Jul 2013 06:26:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=4F6Y22hwJinnHF0lzG2yJGrt9mqbFzrKkamMoMXVtto=; b=JMEcTdbQReJERWD8nTQtdrJouX9I9cV4b9XskYpi7pom9jHGMjazjoYyaqOErNjESp uSwcqP3Q/jaqbt3+IM5i1QOE7RInI9Fd+YOtm9EiLspvztrAjIbIRA2U+dANrZi6HuSX L2OG+cgEAmNw7s2NREwS7wglFQu9xoK8Vn2iluGcC1ysMzXETk0+6rQ19+1tKbYcdL6o Xw+vg9aRuRfPS8v54qqzuCmGWT3BzqwoDKXBD96F+BBQBD3Y+sCMFgn9zq7VxNVBBP/Y lJCSGSkdFckbYx3grbTp8Ra9m/b/i9x+njLeTKUzv6jplqEUC8Rzh9DtqBW8Evpk9x8C hLxw== X-Received: by 10.236.92.7 with SMTP id i7mr3780287yhf.52.1374067594816; Wed, 17 Jul 2013 06:26:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.195 with SMTP id ec3ls844929qeb.13.gmail; Wed, 17 Jul 2013 06:26:34 -0700 (PDT) X-Received: by 10.52.231.130 with SMTP id tg2mr1674393vdc.84.1374067594669; Wed, 17 Jul 2013 06:26:34 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id u10si1366762vcj.128.2013.07.17.06.26.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Jul 2013 06:26:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id p12so1337106vbe.40 for ; Wed, 17 Jul 2013 06:26:34 -0700 (PDT) X-Received: by 10.220.198.133 with SMTP id eo5mr2095360vcb.24.1374067594529; Wed, 17 Jul 2013 06:26:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp172296vcv; Wed, 17 Jul 2013 06:26:34 -0700 (PDT) X-Received: by 10.180.21.170 with SMTP id w10mr4756323wie.9.1374067593593; Wed, 17 Jul 2013 06:26:33 -0700 (PDT) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by mx.google.com with ESMTPS id ce4si2664228wib.17.2013.07.17.06.26.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Jul 2013 06:26:33 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.177 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=74.125.82.177; Received: by mail-we0-f177.google.com with SMTP id m19so1713823wev.8 for ; Wed, 17 Jul 2013 06:26:33 -0700 (PDT) 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 Cc: christoffer.dall@linaro.org, catalin.marinas@arm.com, will.deacon@arm.com, patches@linaro.org, Steve Capper 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: ALoCoQmxiCoefnc8WtYpbHxU/r3oeI8E9MDqz2iAhI5pwdaRy33kyB+9wA0Q+Ic2zapvXqPdGIv5 X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);