From patchwork Fri Oct 5 13:49:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10628203 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01A5B112B for ; Fri, 5 Oct 2018 13:55:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E39C1292FD for ; Fri, 5 Oct 2018 13:55:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6F5E2931F; Fri, 5 Oct 2018 13:55:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 635C7292FD for ; Fri, 5 Oct 2018 13:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kSWwvylY3mXGH+Do5Os9HTAW2EVlY90PBAozNIB1iDY=; b=dj39FJ8HUVFKQ4 7vp6JmuEzx9l3nsKYc1rJXIWgrEZaaESLnD3wIKdZQY2EF1+VG2gNJOYSWRcula5D+jCtipCI6tOh lOskbVu1OYyrk1Ha4Vt18Lnd07XK1pVSy1WJsZK/eQJRFz54tIR3to6RXBnRpJGXmv0bepB2CTn3s Hpps2h3RX1mVgetzI7A7sqNd6ZebmcFUGn/n/q0WKFdKfU39EXT0NcdmHP19+1ZDb/+TDCXNLyTqK 4thlSbzUCkxociZe2t9noQzf7+V7paYG6JXQAlYGWFMOl2K1MRxOz/BvkObU6qZmAE9vG+76T1iWg nvvLbmJq54P8yztutJqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8QZW-0003S9-Vg; Fri, 05 Oct 2018 13:55:15 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8QZE-0003N0-1M for linux-arm-kernel@bombadil.infradead.org; Fri, 05 Oct 2018 13:54:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jpC8JhZveSRn0VImMr/igmTFAtMiGeGrgOtK/OITtJU=; b=DngOtgjQikdSEDhatj/wzOXdmV BFxbE1Xr4bw2Qcuq52rJwDA7pgsui3Zpu++jCF0GLCX8Aci6r/kAZTnZRkEbeSE2z+FSEedhnM6Ec qEMuDX+RYw9ri7Qz6mJTJFRYKchmlOPXwdRbEyRJPigb5z+6hNsKpEsrwfQyhYVGIWqw/EX+JyVtC nd0H7mDj6yDVotTzXLNFb7OMT87JVLx4O+6L8ORMmiWwL19BaPc5ohH8/MiHqrSon/ORj5FGznYIQ uQCTOYOVvmDmny3SRhJDFOr7H1DncGs7aaehs9mCmy0DwgmQb+qQhEHEFpnga81BLnZ1U5s//HliF dmFGFKiw==; Received: from foss.arm.com ([217.140.101.70]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8QU6-00059N-El for linux-arm-kernel@lists.infradead.org; Fri, 05 Oct 2018 13:49:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65BB77A9; Fri, 5 Oct 2018 06:49:27 -0700 (PDT) Received: from melchizedek.Emea.Arm.com (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C7693F5D3; Fri, 5 Oct 2018 06:49:26 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: mm: Use #ifdef for the __PAGETABLE_P?D_FOLDED defines Date: Fri, 5 Oct 2018 14:49:16 +0100 Message-Id: <20181005134916.12937-1-james.morse@arm.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181005_144938_625541_CDD95458 X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , Will Deacon , James Morse Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP __is_defined(__PAGETABLE_P?D_FOLDED) doesn't quite work as intended as these symbols are internal to asm-generic and aren't defined in the way kconfig expects. This makes them always evaluate to false. Switch to #ifdef. Signed-off-by: James Morse CC: Mark Rutland Tested-by: Geert Uytterhoeven --- arch/arm64/include/asm/pgtable.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b58f764babf8..50b1ef8584c0 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -445,10 +445,12 @@ static inline bool in_swapper_pgdir(void *addr) static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) { - if (__is_defined(__PAGETABLE_PMD_FOLDED) && in_swapper_pgdir(pmdp)) { +#ifdef __PAGETABLE_PMD_FOLDED + if (in_swapper_pgdir(pmdp)) { set_swapper_pgd((pgd_t *)pmdp, __pgd(pmd_val(pmd))); return; } +#endif /* __PAGETABLE_PMD_FOLDED */ WRITE_ONCE(*pmdp, pmd); @@ -503,10 +505,12 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd) static inline void set_pud(pud_t *pudp, pud_t pud) { - if (__is_defined(__PAGETABLE_PUD_FOLDED) && in_swapper_pgdir(pudp)) { +#ifdef __PAGETABLE_PUD_FOLDED + if (in_swapper_pgdir(pudp)) { set_swapper_pgd((pgd_t *)pudp, __pgd(pud_val(pud))); return; } +#endif /* __PAGETABLE_PUD_FOLDED */ WRITE_ONCE(*pudp, pud);