Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp943139pxj; Fri, 28 May 2021 21:46:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiuIhi8xy+1iSPX52ftYtwVULi6q3Mw7Y2b494nxgUhZXhX0mQw0zd0N+fCIllZJrUpYY/ X-Received: by 2002:a17:906:26cb:: with SMTP id u11mr12754945ejc.385.1622263606802; Fri, 28 May 2021 21:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622263606; cv=none; d=google.com; s=arc-20160816; b=d92tjkAq0fQ3oWzrSDBAZvZhQTeZpSjpGZrWbKf6kwCHU2VHOyVXXEEGg5wsq5Gtc8 k4gdUlpLpw5LtP6qiPCb3uXiHiF3NzGmMEYf93bXqcq1ZCVWyEGfurU+fMQgRFgFxOqG xdSxUi68FbRF53XlXbb5VFrM5EW3v6vpqFboPN1DuA2e2DyhogD39hrNkAwQzUHJZgsd 9K703gwG7nevL/eILpuvXemSae7lPqt+w+chmS8V/UkQzm/GONxigohAsbn+zjbiHxfB Iz5LtCnpDflxhodIQemBjblHJ/NaZKqSnsSA1NWSXYMymnb1hQScp0mMeYagUjdUvJTZ c1tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=pod5FeawmltqHL7mzf246+tuBEk3bE/ITLSCFLmXmDY=; b=D3gR2AScpL6a0o2dcLzXtc7w//ymft7NA81nV1mqM+NURG83S16lyR0Nn3ct3m5JHc 8ny0R401Q95UqBf33xTl+cOxJlm6oYUcUZeup65SyOQJ+EfukjwcurLv8KPyyOafbwTI KYBkkaqcZ2p4XOnXwjTjBbatciNALhhm2Ppz51Rr7ZgROkguwvWSv4o6dXiNbLTo1qe2 D/6GmO9LcdFwxrX0axPJMWcgeca80Xi3h1pS5nR3I3bMladzS2Ps5auL+TwTZJCmFCnh UctkRfFv8Hc3AQIozI1Jp6NrSeXNhVTSWhFhBClK/OlT2UuKcDz5PEaZCW43U/qWkHN5 KTLg== 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 gv3si8369588ejc.220.2021.05.28.21.46.11; Fri, 28 May 2021 21:46:46 -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 S229597AbhE2Eoo (ORCPT + 99 others); Sat, 29 May 2021 00:44:44 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2522 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhE2Eoo (ORCPT ); Sat, 29 May 2021 00:44:44 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FsTPh73bWzYqqY; Sat, 29 May 2021 12:40:24 +0800 (CST) Received: from dggpemm000001.china.huawei.com (7.185.36.245) 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 12:43:06 +0800 Received: from [10.174.177.231] (10.174.177.231) by dggpemm000001.china.huawei.com (7.185.36.245) 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 12:43:05 +0800 Subject: Re: [PATCH -next] module: fix build error when CONFIG_SMP is disabled To: Bixuan Cui , , , CC: , , References: <20210529020328.36863-1-cuibixuan@huawei.com> From: "Sunnanyong (Nanyong Sun, Intelligent Computing Solution Development Dep)" Message-ID: <4798a93f-f0a5-60f6-5b02-7d507fe60d4f@huawei.com> Date: Sat, 29 May 2021 12:43:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210529020328.36863-1-cuibixuan@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.231] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm000001.china.huawei.com (7.185.36.245) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/5/29 10:03, Bixuan Cui wrote: > diff --git a/arch/riscv/include/asm/tlbflush.h b/arch/riscv/include/asm/tlbflush.h > index c84218ad7afc..9d5801f6e2c3 100644 > --- a/arch/riscv/include/asm/tlbflush.h > +++ b/arch/riscv/include/asm/tlbflush.h > @@ -44,6 +44,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 */ Move the prototype of flush_pmd_tlb_range from pgtable.h to tlbflush.h can also fix this problem, and it seems that declare flush_pmd_tlb_range in tlbflush.h is better. We could 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..b9b9c64ac974 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 /* CONFIG_TRANSPARENT_HUGEPAGE */  #else /* CONFIG_SMP && CONFIG_MMU */  #define flush_tlb_all() local_flush_tlb_all() In this way , flush_p(m/u)d_tlb_range will be defined in include/linux/pgtable.h if CONFIG_SMP is not set.