From patchwork Sat Dec 20 00:49:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jungseok Lee X-Patchwork-Id: 5521811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2DC94BEEA8 for ; Sat, 20 Dec 2014 00:52:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14D0D20148 for ; Sat, 20 Dec 2014 00:52:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 018D32010C for ; Sat, 20 Dec 2014 00:52:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y28FD-0000E3-Qc; Sat, 20 Dec 2014 00:50:07 +0000 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y28FA-0007rz-7f for linux-arm-kernel@lists.infradead.org; Sat, 20 Dec 2014 00:50:05 +0000 Received: by mail-pd0-f181.google.com with SMTP id v10so2191465pde.12 for ; Fri, 19 Dec 2014 16:49:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; bh=6Cgw1OV1uGz0fL6Ujged4BTqpRm06Gfx8au/4dqfnMQ=; b=rT2avelTcq4y3IK5kXWEIOMrJ8bL9v0lMY5iODn3iM/Q+eb5uB/sXSdv9Vf+O1g6CS /HwjJ2M3tt86lkkbKsndeHYkK8d0xNlKU3X6WyBCxvV/nm5q3ZOVT+yET0m+7N1lqygg ZS4IH/b3ExjGxtvaqe5ZBZVlBiNfMwgfolO7lE/QnWFYo/VuQN+8iK9nLWlHoaPwV3hj i/ahuDNEGEQ/tD/LzV/X1PIoL419SSFLsHty1hsR1lL9oBB8JGZq2zVw37FUxdUbJosX S/Qy6j9myCNQwJuIkK+II0MY4NRfmw03c806ECM4B72wVBMCW4/Y4/E5vBgvDazSssXt Bqxg== X-Received: by 10.68.189.233 with SMTP id gl9mr16587225pbc.20.1419036583088; Fri, 19 Dec 2014 16:49:43 -0800 (PST) Received: from [192.168.123.180] ([182.215.209.43]) by mx.google.com with ESMTPSA id l6sm10701275pdr.39.2014.12.19.16.49.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Dec 2014 16:49:42 -0800 (PST) From: Jungseok Lee Subject: [PATCH] arm64: mm: Add pgd_page to support RCU fast_gup Date: Sat, 20 Dec 2014 09:49:40 +0900 Message-Id: <11B98DF8-2B98-414B-88E5-14C97ADAA60E@gmail.com> To: linux-arm-kernel@lists.infradead.org Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141219_165004_398911_E63C1C4E X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -0.6 (/) Cc: Catalin Marinas , Will Deacon , Steve Capper X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 This patch adds pgd_page definition in order to keep supporting HAVE_GENERIC_RCU_GUP configuration. In addition, it changes pud_page expression to align with pmd_page for readability. An introduction of pgd_page resolves the following build breakage under 4KB + 4Level memory management combo. mm/gup.c: In function 'gup_huge_pgd': mm/gup.c:889:2: error: implicit declaration of function 'pgd_page' [-Werror=implicit-function-declaration] head = pgd_page(orig); ^ mm/gup.c:889:7: warning: assignment makes pointer from integer without a cast head = pgd_page(orig); Cc: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Signed-off-by: Jungseok Lee --- arch/arm64/include/asm/pgtable.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index df22314..a1fe927 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -401,7 +401,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr); } -#define pud_page(pud) pmd_page(pud_pmd(pud)) +#define pud_page(pud) pfn_to_page(__phys_to_pfn(pud_val(pud) & PHYS_MASK)) #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 2 */ @@ -437,6 +437,8 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long addr) return (pud_t *)pgd_page_vaddr(*pgd) + pud_index(addr); } +#define pgd_page(pgd) pfn_to_page(__phys_to_pfn(pgd_val(pgd) & PHYS_MASK)) + #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 3 */ #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd))