From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out198-24.us.a.mail.aliyun.com (out198-24.us.a.mail.aliyun.com [47.90.198.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBD7029A1 for ; Fri, 16 Jan 2026 03:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.198.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768535263; cv=none; b=NIOlfLdk6NtsXTlIcjP9GWKd5zyKESLIJfKKSMzAbcAgc7PSToR3l+aEfhXMq/KSqJMRbKKGHqIOIHdl1bXQw9ztHOmrh2lddlrcvQfIqHDcJ8iRdg7f9nIvRo87VB8SAxIZWwq45LWN+m8CtGqVWunlsjRVwl5ClAU/GNL1ZTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768535263; c=relaxed/simple; bh=FhvH4PHzVe4/wtm8I5/1W5buombQWk0i+Zi7IZKDQhQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Xp2g0eGPTrOj7fywOcAg4hc9+qiov1qZzpgcFbjW4V6cFz/rIYkE+tEXzoi+ZfFwAF6D1AgKRRRyr9Fz4gztq6QyknsR7A7VexQ9KqeVK1gceTmHs4WXeqdxdHd0iqYYB8fjHPlVlaE0oongeGhqk+K3UUnvDmw6rlckSAq9IJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b=aP0StLL7; arc=none smtp.client-ip=47.90.198.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="aP0StLL7" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1768535244; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; bh=/nBQwcHoZ3XeD/ZaCkSgQ4cnn3FzbLy3XjaOkKmt3jM=; b=aP0StLL7pErWLGSWnn+3WWaUwUdDlUJUIwuOozUNFF0EU6HSicIPuwcSl86ZjovtVIcUVbci/8vm6FIXxxP0U+ZfZ+wgEAdn7oq0gx+ZfMYuIN4BaE+6qKRhdi4K/XJ8RSN0u1KzxogUPU+IRA371ueu4M1ECxm3oj4J2JDZ7ow= Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.g7iPwdO_1768535242 cluster:ay29) by smtp.aliyun-inc.com; Fri, 16 Jan 2026 11:47:22 +0800 Date: Fri, 16 Jan 2026 11:47:22 +0800 From: Hou Wenlong To: Borislav Petkov Cc: linux-kernel@vger.kernel.org, Rik van Riel , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Andrew Morton , Will Deacon , Ryan Roberts , Jann Horn , Barry Song Subject: Re: [PATCH v2] x86/mm: Hide mm_free_global_asid() definition under 'CONFIG_BROADCAST_TLB_FLUSH' Message-ID: <20260116034722.GA104434@k08j02272.eu95sqa> References: <20260115091506.GAaWiwGnvRTOOUVGtv@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260115091506.GAaWiwGnvRTOOUVGtv@fat_crate.local> User-Agent: Mutt/1.5.21 (2010-09-15) On Thu, Jan 15, 2026 at 10:15:06AM +0100, Borislav Petkov wrote: > On Thu, Jan 15, 2026 at 11:38:34AM +0800, Hou Wenlong wrote: > > When 'CONFIG_BROADCAST_TLB_FLUSH' is not enabled, mm_free_global_asid() > > remains a globally visible symbol and generates a useless function call > > to it in destroy_context(). Therefore, hide the mm_free_global_asid() > > definition under 'CONFIG_BROADCAST_TLB_FLUSH' and provide a static > > inline empty version when it is not enabled to remove the function call. > > > > Reviewed-by: Rik van Riel > > Signed-off-by: Hou Wenlong > > --- > > v1->v2: > > Keep the declarations of mm_init_global_asid() and mm_free_global_asid() > > in 'asm/mmu_context.h' to fix the compilation failure of module > > building. > > --- > > arch/x86/include/asm/mmu_context.h | 2 -- > > arch/x86/include/asm/tlbflush.h | 3 +++ > > arch/x86/mm/tlb.c | 4 ++-- > > 3 files changed, 5 insertions(+), 4 deletions(-) > > Did you run the build tests I asked you to do before you sent this? > Honestly, I did not run all the tests you asked. I admit that my attitude was somewhat hasty and not thorough. I sincerely apologize for the trouble this has caused you and for taking up your time. After testing the configuration you provided, I analyzed my code modifications and noticed that the definition of 'mm_free_global_asid()' is included under '#ifndef module' and is only called in destroy_context(). Therefore, I checked all the places where destroy_context() is called and found that it is only called in 'kernel/fork.c', which is not invoked in a module (and the original mm_free_global_asid() was not exported either). To save time, I only tested 'allyesconfig' and my test configuration with module compilation under 'x86_64' and 'i386', and since I did not encounter any issues, I went ahead and sent the patch. I realize now that I did not conduct a complete set of tests. Upon carefully comparing the configuration you provided, I found that the GCC versions are different (mine is 12.2.0 and yours is 13.3.0), and I am using the tip/master branch from the 12th, which also does not match your '6.19-rc3'. After a full night of testing (using the tip/master branch and the '6.19-rc5' tag), I still did not find any issues; it may be related to the compiler. I will try using GCC 13.3.0 to see if that makes a difference and will conduct more randconfig tests. Finally, I apologize once again for taking up your time and thank you for your kind reply. Here is the script I used for testing: ``` # 64-bit make clean LOCALVERSION="" make allnoconfig LOCALVERSION="" make -j32 make clean LOCALVERSION="" make defconfig LOCALVERSION="" make -j32 make clean LOCALVERSION="" make allmodconfig LOCALVERSION="" make -j32 make clean LOCALVERSION="" make allyesconfig LOCALVERSION="" make -j32 # 32-bit make clean LOCALVERSION="" make allnoconfig ARCH=i386 LOCALVERSION="" make -j32 ARCH=i386 make clean LOCALVERSION="" make defconfig ARCH=i386 LOCALVERSION="" make -j32 ARCH=i386 make clean LOCALVERSION="" make allmodconfig ARCH=i386 LOCALVERSION="" make -j32 ARCH=i386 make clean LOCALVERSION="" make allyesconfig ARCH=i386 LOCALVERSION="" make -j32 ARCH=i386 ``` Thanks! > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette