From patchwork Sun Feb 24 07:13:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Xuerui X-Patchwork-Id: 10827741 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 6E50217E9 for ; Sun, 24 Feb 2019 07:15:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55D572BC62 for ; Sun, 24 Feb 2019 07:15:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A4B72BC7A; Sun, 24 Feb 2019 07:15:12 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BF962BC62 for ; Sun, 24 Feb 2019 07:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbfBXHPL (ORCPT ); Sun, 24 Feb 2019 02:15:11 -0500 Received: from smtpbg202.qq.com ([184.105.206.29]:60537 "EHLO smtpbg202.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbfBXHPK (ORCPT ); Sun, 24 Feb 2019 02:15:10 -0500 X-QQ-mid: bizesmtp3t1550992507txx3g4rbu Received: from localhost.localdomain (unknown [116.236.177.50]) by esmtp4.qq.com (ESMTP) with id ; Sun, 24 Feb 2019 15:15:05 +0800 (CST) X-QQ-SSF: 01400000002000C0EG82B00A0000000 X-QQ-FEAT: 92FxZ2TPvnd29DML+O608EXmytofcWCyLdLE6qSbHeMaU8KYSnEZcvEJlaizi lqUA2OCAqkND+tB6NrCjo5ZnKyzeG7TcYLNzoxn3hgWPUREacru/bN9yFSAhhjjWLtLnCDr Ji6Btf6mk+C7RexpFVOHh19aNA3fKKQCjOJnfVpCet0ieYLMdXWADUX/B5Cd7gu1ZRFZwzd nWLBVAT7JpkCvXRZ9K/H3JXjCqFu2X32AW8l3KAu3HHAt3L3QeOHuesKfY6s/wLdDg9UnPn G3kiRkwyYc7borL0Ukz70JqCw= X-QQ-GoodBg: 2 From: Wang Xuerui To: linux-mips@vger.kernel.org Cc: Wang Xuerui , Huacai Chen , Jiaxun Yang , Alex Belits , James Hogan , Ralf Baechle , linux-mips@linux-mips.org Subject: [PATCH 3/4] MIPS: define virtual address size in Kconfig Date: Sun, 24 Feb 2019 15:13:54 +0800 Message-Id: <20190224071355.14488-4-wangxuerui@qiniu.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20190224071355.14488-1-wangxuerui@qiniu.com> References: <20190224071355.14488-1-wangxuerui@qiniu.com> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:qiniu.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To ease addition of new VA sizes, punt the constant in processor.h to Kconfig. Signed-off-by: Wang Xuerui Cc: Huacai Chen Cc: Jiaxun Yang Cc: Alex Belits Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org --- arch/mips/Kconfig | 5 +++++ arch/mips/include/asm/processor.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index b0068a1e1e33..a1ab9e7924a0 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2191,6 +2191,11 @@ endchoice config MIPS_LARGE_VA bool +config MIPS_VA_BITS + int + default 48 if MIPS_VA_BITS_48 + default 40 + choice prompt "Kernel page size" default PAGE_SIZE_4KB diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index 226cf46cc89c..9119e9a44d9c 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h @@ -63,7 +63,7 @@ extern unsigned int vced_count, vcei_count; */ #define TASK_SIZE32 0x7fff8000UL #ifdef CONFIG_MIPS_LARGE_VA -#define TASK_SIZE64 (0x1UL << min(cpu_data[0].vmbits, 48)) +#define TASK_SIZE64 (0x1UL << min(cpu_data[0].vmbits, CONFIG_MIPS_VA_BITS)) #else #define TASK_SIZE64 0x10000000000UL #endif