Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2832659imm; Thu, 18 Oct 2018 23:57:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV617JKlMWqOG0p59Kv7DOV5y9uFzNCa5H5Du6VKgq22h1qC5G8mAgDf6wchOBl6e7x7HY3I7 X-Received: by 2002:a65:40c2:: with SMTP id u2-v6mr31413319pgp.123.1539932268068; Thu, 18 Oct 2018 23:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539932268; cv=none; d=google.com; s=arc-20160816; b=dgq6AbgckTv6dZ1adLEZbmwj3DtkZH5k+P/+OnvaWMWjD7ZQ+GUGW01fqsEqZYXfF3 tak2H8i2rtPcnQnXwaa5LMQY8mo/P1qi89A9WiNiOvVuqYzYpnPelLS+dzQ07oiN2pWp GYJfFM9RDLpQqNLnFT9l49AGFNqU658N+vqVZBJTx17dpSZlAbqln7eiComg5Tkki7ud v9bI96yCHzsqgYBYZGqvbFFLvAgQ2w6DCxSO8fOFneIMfD1HxF6XG6wvzhCGOA7Ecupj UZuYtJXbXhON8QguvlEOB3z621WwCaqKDB5SVXmu/ACZ9llIenkkSwgpGqU9epmpSgcI tF6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=+JOdtiDjfIudtqKlvhwwZ8g+SIvNw/fyA77zElwfaMg=; b=IZv3oiutW5cjDkJGvAg8AsnHqrVe2HdCEA3rYCXAlAXmVFdqZXIfhQlDgWq2cn4Ot+ N3A3ksfa0DdB6GivUNHLsvYCrxLk5p9B4RGr4lDjnUeFq9HX0tROnyTx06AgFof1ugPZ t6fT7qUZ1grxZaGx7oB16U8JV0WVoh1yZ+tq//Z4sJ4uijRxm7Npub/gfsW2bVDBOLhj EZpeYIu2uuVzZhjDDyCzUlnbAnd/pmrLlBsGdTTHzRoSkG4bPekMtdQz+5J6sFsWU0q0 JrtzG7z5JxoeazC7D9H8hkSAZJoHPLxwPMBWoZLzuMCIdpj2mfcelFjzBJKbb9M+diAv 0+Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b59-v6si18450422plc.257.2018.10.18.23.57.33; Thu, 18 Oct 2018 23:57:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727418AbeJSO76 (ORCPT + 99 others); Fri, 19 Oct 2018 10:59:58 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:8812 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727393AbeJSO75 (ORCPT ); Fri, 19 Oct 2018 10:59:57 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42bxW34Jkrz9ttFT; Fri, 19 Oct 2018 08:55:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id CGWfijFFKmI1; Fri, 19 Oct 2018 08:55:11 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42bxW33ngJz9ttFM; Fri, 19 Oct 2018 08:55:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A94998B8DF; Fri, 19 Oct 2018 08:55:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id QwpsrPdsAq60; Fri, 19 Oct 2018 08:55:12 +0200 (CEST) Received: from pc13168vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8452A8B75B; Fri, 19 Oct 2018 08:55:12 +0200 (CEST) Received: by pc13168vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 600986F496; Fri, 19 Oct 2018 06:55:12 +0000 (UTC) Message-Id: <4d14168ad502bbad2e11e2df9162f81e50bb6cb0.1539931702.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v6 10/20] powerpc/8xx: Temporarily disable 16k pages and 512k hugepages To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 19 Oct 2018 06:55:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation of making use of hardware assistance in TLB handlers, this patch temporarily disables 16K pages and 512K pages. The reason is that when using HW assistance in 4K pages mode, the linux model fit with the HW model for 4K pages and 8M pages. However for 16K pages and 512K mode some additional work is needed to get linux model fit with HW model. Therefore the 4K pages mode will be implemented first and without support for 512k hugepages. Then the 512k hugepages will be brought back. And the 16K pages will be implemented in further steps. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/head_8xx.S | 36 ------------------------------------ arch/powerpc/mm/tlb_nohash.c | 3 --- 3 files changed, 1 insertion(+), 40 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 3d008115fe18..287befcf37ab 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -690,7 +690,7 @@ config PPC_4K_PAGES config PPC_16K_PAGES bool "16k page size" - depends on 44x || PPC_8xx + depends on 44x config PPC_64K_PAGES bool "64k page size" diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index c203defe49a4..9b31721b522c 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S @@ -363,7 +363,6 @@ InstructionTLBMiss: #ifdef CONFIG_HUGETLB_PAGE mtcr r11 bt- 28, 10f /* bit 28 = Large page (8M) */ - bt- 29, 20f /* bit 29 = Large page (8M or 512k) */ #endif rlwimi r10, r11, 0, 0, 32 - PAGE_SHIFT - 1 /* Add level 2 base */ lwz r10, 0(r10) /* Get the pte */ @@ -414,23 +413,8 @@ InstructionTLBMiss: #ifdef CONFIG_HUGETLB_PAGE 10: /* 8M pages */ -#ifdef CONFIG_PPC_16K_PAGES - /* Extract level 2 index */ - rlwinm r10, r10, 32 - (PAGE_SHIFT_8M - PAGE_SHIFT), 32 + PAGE_SHIFT_8M - (PAGE_SHIFT << 1), 29 - /* Add level 2 base */ - rlwimi r10, r11, 0, 0, 32 + PAGE_SHIFT_8M - (PAGE_SHIFT << 1) - 1 -#else /* Level 2 base */ rlwinm r10, r11, 0, ~HUGEPD_SHIFT_MASK -#endif - lwz r10, 0(r10) /* Get the pte */ - b 4b - -20: /* 512k pages */ - /* Extract level 2 index */ - rlwinm r10, r10, 32 - (PAGE_SHIFT_512K - PAGE_SHIFT), 32 + PAGE_SHIFT_512K - (PAGE_SHIFT << 1), 29 - /* Add level 2 base */ - rlwimi r10, r11, 0, 0, 32 + PAGE_SHIFT_512K - (PAGE_SHIFT << 1) - 1 lwz r10, 0(r10) /* Get the pte */ b 4b #endif @@ -475,7 +459,6 @@ DataStoreTLBMiss: #ifdef CONFIG_HUGETLB_PAGE mtcr r11 bt- 28, 10f /* bit 28 = Large page (8M) */ - bt- 29, 20f /* bit 29 = Large page (8M or 512k) */ #endif rlwimi r10, r11, 0, 0, 32 - PAGE_SHIFT - 1 /* Add level 2 base */ lwz r10, 0(r10) /* Get the pte */ @@ -537,22 +520,8 @@ DataStoreTLBMiss: #ifdef CONFIG_HUGETLB_PAGE 10: /* 8M pages */ /* Extract level 2 index */ -#ifdef CONFIG_PPC_16K_PAGES - rlwinm r10, r10, 32 - (PAGE_SHIFT_8M - PAGE_SHIFT), 32 + PAGE_SHIFT_8M - (PAGE_SHIFT << 1), 29 - /* Add level 2 base */ - rlwimi r10, r11, 0, 0, 32 + PAGE_SHIFT_8M - (PAGE_SHIFT << 1) - 1 -#else /* Level 2 base */ rlwinm r10, r11, 0, ~HUGEPD_SHIFT_MASK -#endif - lwz r10, 0(r10) /* Get the pte */ - b 4b - -20: /* 512k pages */ - /* Extract level 2 index */ - rlwinm r10, r10, 32 - (PAGE_SHIFT_512K - PAGE_SHIFT), 32 + PAGE_SHIFT_512K - (PAGE_SHIFT << 1), 29 - /* Add level 2 base */ - rlwimi r10, r11, 0, 0, 32 + PAGE_SHIFT_512K - (PAGE_SHIFT << 1) - 1 lwz r10, 0(r10) /* Get the pte */ b 4b #endif @@ -773,12 +742,7 @@ FixupDAR:/* Entry point for dcbx workaround. */ /* concat physical page address(r11) and page offset(r10) */ 200: -#ifdef CONFIG_PPC_16K_PAGES - rlwinm r11, r11, 0, 0, 32 + PAGE_SHIFT_8M - (PAGE_SHIFT << 1) - 1 - rlwimi r11, r10, 32 - (PAGE_SHIFT_8M - 2), 32 + PAGE_SHIFT_8M - (PAGE_SHIFT << 1), 29 -#else rlwinm r11, r10, 0, ~HUGEPD_SHIFT_MASK -#endif lwz r11, 0(r11) /* Get the pte */ /* concat physical page address(r11) and page offset(r10) */ rlwimi r11, r10, 0, 32 - PAGE_SHIFT_8M, 31 diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index ae5d568e267f..8ad7aab150b7 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c @@ -97,9 +97,6 @@ struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = { .shift = 14, }, #endif - [MMU_PAGE_512K] = { - .shift = 19, - }, [MMU_PAGE_8M] = { .shift = 23, }, -- 2.13.3