Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp995229pxj; Fri, 28 May 2021 23:34:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZfnJrLTAxTyA0i3riNKzYKo5j92RVlX8GWJochJtnkwRv6yXrxdBp0pPwIsESJOhjqAvy X-Received: by 2002:a05:6e02:1b05:: with SMTP id i5mr10415820ilv.204.1622270085566; Fri, 28 May 2021 23:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622270085; cv=none; d=google.com; s=arc-20160816; b=nTeff25JZwvi1Od5b2801brIgoaWoZqFQxLDE2VZLDbA92Zl4A3zE/ZwgkcF12aB9Y 4Vo80fE20Ewdq17xpGhrUBX1hl45VwvIH825L8TApNRiKSW67B0FiUNFnOUu7UVimaDC 5Vk5/NvRnSTXUHf5UPdYgwsqJursc5vTsK7XkvfaLwE94XJpvhe5HZk0t6Azfcm5AaZQ 4gdiGJywb03kKfP1HJ0GaFaFlgAu4YErgdbH+dGZFzyPavhD422zDhJcMzPNq4yvOAO5 6n7rSGUiD4q2JMB3E0I9I14F2LGzgV9anEDOuAOFjTAptD6uQWBTNQwa4iCGX5w1LhAA ZlKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=n+B5tWNBo4gZ9tYFRxp3i8aCJ7/CaVXvlRihIznn7BQ=; b=J1GvCK9Uv/h48yjjzrZ8xkUSYOzR9isoBZRVPVFwqB4AOaairvxoa4zV4W8sQK4EEL UzzABTlg6HxlpRQEgoS+Eu60auXKpZLwNVx5HMxyxhp9QV5iuNKyNfDsEppKHhohqqmk r9QVnNRJpWvCElHOTGwBJ+Zjh7UKCwmHP+/MWeI9wfRvQfsOBz/gUN2z+ILF/Thpnb4A Ukg5HCAUupNQOxcjgmkxbN3E0hfLDZF1L7rO766oRJZdHoPFfK+AkkDPHimywnQJF5A6 b0DN5185jqfNx5lmScEwVx+GKCPwXNjUGeiRU55NLXExW5NmOUCWjk3DQqllp3zciAIb iNNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si8603174iou.15.2021.05.28.23.34.17; Fri, 28 May 2021 23:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbhE2GeC (ORCPT + 99 others); Sat, 29 May 2021 02:34:02 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2523 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbhE2GeA (ORCPT ); Sat, 29 May 2021 02:34:00 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FsWqm1H3bzYr5j; Sat, 29 May 2021 14:29:40 +0800 (CST) Received: from dggpemm500004.china.huawei.com (7.185.36.219) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 29 May 2021 14:32:21 +0800 Received: from huawei.com (10.174.28.241) by dggpemm500004.china.huawei.com (7.185.36.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 29 May 2021 14:32:20 +0800 From: Bixuan Cui To: , , CC: , , , , Bixuan Cui Subject: [PATCH -next v2] riscv: fix build error when CONFIG_SMP is disabled Date: Sat, 29 May 2021 14:31:22 +0800 Message-ID: <20210529063122.5258-1-cuibixuan@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.28.241] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500004.china.huawei.com (7.185.36.219) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix build error when disable CONFIG_SMP: mm/pgtable-generic.o: In function `.L19': pgtable-generic.c:(.text+0x42): undefined reference to `flush_pmd_tlb_range' mm/pgtable-generic.o: In function `pmdp_huge_clear_flush': pgtable-generic.c:(.text+0x6c): undefined reference to `flush_pmd_tlb_range' mm/pgtable-generic.o: In function `pmdp_invalidate': pgtable-generic.c:(.text+0x162): undefined reference to `flush_pmd_tlb_range' Fixes: e88b333142e4 ("riscv: mm: add THP support on 64-bit") Reported-by: Hulk Robot Signed-off-by: Bixuan Cui --- Changes from v2: Move the declaration of flush_pmd_tlb_rang to tlbflush.h arch/riscv/include/asm/pgtable.h | 5 ----- arch/riscv/include/asm/tlbflush.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 29e2c836848d..eda31002c4b1 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -622,11 +622,6 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma, { return __pmd(atomic_long_xchg((atomic_long_t *)pmdp, pmd_val(pmd))); } - -#define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE -void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end); - #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ /* diff --git a/arch/riscv/include/asm/tlbflush.h b/arch/riscv/include/asm/tlbflush.h index c84218ad7afc..6f78ac4601c9 100644 --- a/arch/riscv/include/asm/tlbflush.h +++ b/arch/riscv/include/asm/tlbflush.h @@ -33,6 +33,11 @@ void flush_tlb_mm(struct mm_struct *mm); void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr); void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +#define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE +void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end); +#endif #else /* CONFIG_SMP && CONFIG_MMU */ #define flush_tlb_all() local_flush_tlb_all() @@ -44,6 +49,12 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, local_flush_tlb_all(); } +static inline void flush_pmd_tlb_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end) +{ + local_flush_tlb_all(); +} + #define flush_tlb_mm(mm) flush_tlb_all() #endif /* !CONFIG_SMP || !CONFIG_MMU */ -- 2.17.1