From patchwork Tue Jul 5 15:47:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12906746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5F70CCA47B for ; Tue, 5 Jul 2022 15:48:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 453BA6B007E; Tue, 5 Jul 2022 11:48:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 403276B0080; Tue, 5 Jul 2022 11:48:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F2C16B0081; Tue, 5 Jul 2022 11:48:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 217306B007E for ; Tue, 5 Jul 2022 11:48:17 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EDBB835664 for ; Tue, 5 Jul 2022 15:48:16 +0000 (UTC) X-FDA: 79653477792.19.4587FD3 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id 73EE4160045 for ; Tue, 5 Jul 2022 15:48:16 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5B428B81824; Tue, 5 Jul 2022 15:48:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AFC7C36AF5; Tue, 5 Jul 2022 15:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657036093; bh=Vue7H8LCr+M1pj6DZ3BvkAhUx8ulVRB7UqrqmOhXw0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KUuAjX3ls21sld82+qncE1IqLvb+UaJbLEzg+zR4FHBiItcxPyQI9YPQPiPrexqHK rFngIr/HU/ZA0Ev4D41wN+HP076RxleRBt/L69xJ/B8r16G4gDNVgEG6/nl62cN3l5 CVHVfgu25+HyKSo8bauTWNkf0JIw2IXiMDVlrUvOiCbBa2i+meVIloBk3mrraZlKaV iFg6LI+OPWIHIgnO3SdFXCOUW/cVI6HpVoGQuYww7GJC2D8zjTX4BASR34IGXkg/fG Wy4mtYDz1nqMgrCdSnu4I5NG++Nh9pYJ1t4EHgncfXjBqZLyxEIUQspta5O/gphKJ9 hjOLZDMDfCkMw== From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Dinh Nguyen , Guo Ren , Helge Deller , Huacai Chen , "James E.J. Bottomley" , Matthew Wilcox , Max Filippov , Mike Rapoport , Mike Rapoport , "Russell King (Oracle)" , Thomas Bogendoerfer , WANG Xuerui , linux-arch@vger.kernel.org, linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, loongarch@lists.linux.dev Subject: [PATCH v2 08/15] nios2: drop definition of PGD_ORDER Date: Tue, 5 Jul 2022 18:47:01 +0300 Message-Id: <20220705154708.181258-9-rppt@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220705154708.181258-1-rppt@kernel.org> References: <20220705154708.181258-1-rppt@kernel.org> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KUuAjX3l; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657036096; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xqeFx/hEiHeiLFUZSradoBktCTFSt9U4DFx3M+zjXMY=; b=70VJlIj4Bjw7/bMWNrHVmtlGyucsK+WnUpHAKQvMUN2GI/VWd4DuHSwyQSslRRqmc3qc76 Afb1ROhilpExS24Wj8itsIOJrkq60YO2t3qJORcDIOl7TsPuO6y9/3rMauwUQO0/RNkpHv F8FIPFA/9eHz4SeqZXzwYascWVqHCXU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657036096; a=rsa-sha256; cv=none; b=VbzUKddMCQV2B4wP+jtBrcDquE1Ty9EhdAjO7zEKOeK7LAq9KORH2QiHW1tl4jbV6S1Jg8 Owg3b7WA8TRCPr+EFkYRWRYkerWvilGePEFgdBFOSgXJhjl4Hh2VwUVGxC9EqAAl6CkW6e AB9RXi0jx1ZUlj8ViL7sHovDDWmEDt8= X-Stat-Signature: 6ykbpq77s5t41nt1pznhzs95a9yzdgm6 X-Rspamd-Queue-Id: 73EE4160045 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KUuAjX3l; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspamd-Server: rspam03 X-Rspam-User: X-HE-Tag: 1657036096-445906 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Mike Rapoport This is the order of the page table allocation, not the order of a PGD. Since its always hardwired to 0, simply drop it. Signed-off-by: Mike Rapoport Acked-by: Dinh Nguyen --- arch/nios2/include/asm/pgtable.h | 4 +--- arch/nios2/mm/init.c | 3 +-- arch/nios2/mm/pgtable.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/nios2/include/asm/pgtable.h b/arch/nios2/include/asm/pgtable.h index eaf8f28baa8b..74af16dafe86 100644 --- a/arch/nios2/include/asm/pgtable.h +++ b/arch/nios2/include/asm/pgtable.h @@ -68,9 +68,7 @@ struct mm_struct; #define PAGE_COPY MKP(0, 0, 1) -#define PGD_ORDER 0 - -#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) +#define PTRS_PER_PGD (PAGE_SIZE / sizeof(pgd_t)) #define PTRS_PER_PTE (PAGE_SIZE / sizeof(pte_t)) #define USER_PTRS_PER_PGD \ diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c index 2d6dbf7701f6..eab65e8ea69c 100644 --- a/arch/nios2/mm/init.c +++ b/arch/nios2/mm/init.c @@ -78,8 +78,7 @@ void __init mmu_init(void) flush_tlb_all(); } -#define __page_aligned(order) __aligned(PAGE_SIZE << (order)) -pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); +pgd_t swapper_pg_dir[PTRS_PER_PGD] __aligned(PAGE_SIZE); pte_t invalid_pte_table[PTRS_PER_PTE] __aligned(PAGE_SIZE); static struct page *kuser_page[1]; diff --git a/arch/nios2/mm/pgtable.c b/arch/nios2/mm/pgtable.c index 9b587fd592dd..7c76e8a7447a 100644 --- a/arch/nios2/mm/pgtable.c +++ b/arch/nios2/mm/pgtable.c @@ -54,7 +54,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) { pgd_t *ret, *init; - ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); + ret = (pgd_t *) __get_free_page(GFP_KERNEL); if (ret) { init = pgd_offset(&init_mm, 0UL); pgd_init(ret);