From c583f645c69432064ca45cccbe5735b0daa872fd Mon Sep 17 00:00:00 2001 From: Zhiteng Qiu Date: Tue, 16 Dec 2025 20:03:00 +0800 Subject: [PATCH] [linux-6.6/devel][Feat] Hygon: fix GPL-only symbols in NT copy_user path ZFS performs license checks during its build process and will refuse to build if any required kernel interfaces depend on GPL-only symbols (EXPORT_SYMBOL_GPL). If such dependencies are detected, the ZFS build fails early at the configure stage. Recent NT (Non-Temporal) optimization changes in the copy_user_generic_string path introduced new dependencies on several GPL-only exported symbols. As a result, common kernel interfaces used by ZFS (e.g. __copy_from_user_inatomic()) become indirectly dependent on GPL-only symbols, causing ZFS build failures and a functional regression in customer environments. Signed-off-by: qiuzhiteng --- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/hygon.c | 2 +- arch/x86/kernel/fpu/core.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index ae103cef0078..a7e3e1c82dea 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -94,7 +94,7 @@ EXPORT_SYMBOL_GPL(get_llc_id); DEFINE_PER_CPU_READ_MOSTLY(u16, cpu_l2c_id) = BAD_APICID; DEFINE_STATIC_KEY_FALSE(hygon_lmc_key); -EXPORT_SYMBOL_GPL(hygon_lmc_key); +EXPORT_SYMBOL(hygon_lmc_key); static struct ppin_info { int feature; diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c index 20de7142f086..fe5e244bd410 100644 --- a/arch/x86/kernel/cpu/hygon.c +++ b/arch/x86/kernel/cpu/hygon.c @@ -489,7 +489,7 @@ unsigned int get_nt_block_copy_mini_len(void) return mini_len; } -EXPORT_SYMBOL_GPL(get_nt_block_copy_mini_len); +EXPORT_SYMBOL(get_nt_block_copy_mini_len); static ssize_t show_nt_cpy_mini_len(struct kobject *kobj, struct kobj_attribute *attr, char *buf) diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 1f0871be9d53..9971dfa33b93 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -534,7 +534,7 @@ int kernel_fpu_begin_nonatomic_mask(unsigned int kfpu_mask) return -1; } -EXPORT_SYMBOL_GPL(kernel_fpu_begin_nonatomic_mask); +EXPORT_SYMBOL(kernel_fpu_begin_nonatomic_mask); void kernel_fpu_end_nonatomic(void) { @@ -550,7 +550,7 @@ void kernel_fpu_end_nonatomic(void) clear_thread_flag(TIF_USING_FPU_NONATOMIC); preempt_enable(); } -EXPORT_SYMBOL_GPL(kernel_fpu_end_nonatomic); +EXPORT_SYMBOL(kernel_fpu_end_nonatomic); void save_fpregs_to_fpkernelstate(struct fpu *kfpu) { -- Gitee