From patchwork Sat Sep 5 11:25:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 1358238 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BkXnx1pspz9sTX for ; Sun, 6 Sep 2020 10:48:05 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BkXnx0hDlzDqj1 for ; Sun, 6 Sep 2020 10:48:05 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=45.249.212.35; helo=huawei.com; envelope-from=yangyingliang@huawei.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BkC223jmszDqTN for ; Sat, 5 Sep 2020 21:27:22 +1000 (AEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0816BF94880A8F88B017; Sat, 5 Sep 2020 19:27:13 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Sat, 5 Sep 2020 19:27:04 +0800 From: Yang Yingliang To: , Subject: [PATCH -next] powerpc/book3s64: fix link error with CONFIG_PPC_RADIX_MMU=n Date: Sat, 5 Sep 2020 19:25:48 +0800 Message-ID: <20200905112548.3265530-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Sun, 06 Sep 2020 10:44:49 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yangyingliang@huawei.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Fix link error when CONFIG_PPC_RADIX_MMU is disabled: powerpc64-linux-gnu-ld: arch/powerpc/platforms/pseries/lpar.o:(.toc+0x0): undefined reference to `mmu_pid_bits' Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- arch/powerpc/mm/book3s64/mmu_context.c | 4 ++++ arch/powerpc/platforms/pseries/lpar.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c index 0ba30b8b935b..a8e292cd88f0 100644 --- a/arch/powerpc/mm/book3s64/mmu_context.c +++ b/arch/powerpc/mm/book3s64/mmu_context.c @@ -152,6 +152,7 @@ void hash__setup_new_exec(void) static int radix__init_new_context(struct mm_struct *mm) { +#ifdef CONFIG_PPC_RADIX_MMU unsigned long rts_field; int index, max_id; @@ -177,6 +178,9 @@ static int radix__init_new_context(struct mm_struct *mm) mm->context.hash_context = NULL; return index; +#else + return -ENOTSUPP; +#endif } int init_new_context(struct task_struct *tsk, struct mm_struct *mm) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index baf24eacd268..e454e218dbba 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c @@ -1726,10 +1726,12 @@ void __init hpte_init_pseries(void) void radix_init_pseries(void) { +#ifdef CONFIG_PPC_RADIX_MMU pr_info("Using radix MMU under hypervisor\n"); pseries_lpar_register_process_table(__pa(process_tb), 0, PRTB_SIZE_SHIFT - 12); +#endif } #ifdef CONFIG_PPC_SMLPAR