tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: a6042799048d28282f37a2a254f2757cea2c780a commit: 50d5bf1b6da9f74bf93f9dec601c09d45d6d8406 [4865/30000] x86: hugepage: use nt copy hugepage to AEP in x86 config: x86_64-randconfig-123-20240910 (https://download.01.org/0day-ci/archive/20240911/202409111327.wMHIgHKQ-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240911/202409111327.wMHIgHKQ-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409111327.wMHIgHKQ-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
arch/x86/lib/copy_highpages.c:10:1: sparse: sparse: symbol 'hugepage_nocache_copy' was not declared. Should it be static? arch/x86/lib/copy_highpages.c:33:47: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void * @@ got void [noderef] __user *buffer @@
arch/x86/lib/copy_highpages.c:33:47: sparse: expected void * arch/x86/lib/copy_highpages.c:33:47: sparse: got void [noderef] __user *buffer
arch/x86/lib/copy_highpages.c:20:5: sparse: sparse: symbol 'sysctl_hugepage_nocache_copy' was not declared. Should it be static? arch/x86/lib/copy_highpages.c:47:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
arch/x86/lib/copy_highpages.c:47:35: sparse: expected int ( [usertype] *proc_handler )( ... ) arch/x86/lib/copy_highpages.c:47:35: sparse: got int ( * )( ... )
vim +/hugepage_nocache_copy +10 arch/x86/lib/copy_highpages.c
9
10 DEFINE_STATIC_KEY_FALSE(hugepage_nocache_copy);
11 #ifdef CONFIG_SYSCTL 12 static void set_hugepage_nocache_copy(bool enabled) 13 { 14 if (enabled) 15 static_branch_enable(&hugepage_nocache_copy); 16 else 17 static_branch_disable(&hugepage_nocache_copy); 18 } 19
20 int sysctl_hugepage_nocache_copy(struct ctl_table *table, int write,
21 void __user *buffer, size_t *lenp, loff_t *ppos) 22 { 23 struct ctl_table t; 24 int err; 25 int state; 26 27 if (write && !capable(CAP_SYS_ADMIN)) 28 return -EPERM; 29 30 state = static_branch_unlikely(&hugepage_nocache_copy); 31 t = *table; 32 t.data = &state;
33 err = proc_dointvec_minmax(&t, write, buffer, lenp, ppos);
34 if (err < 0) 35 return err; 36 if (write) 37 set_hugepage_nocache_copy(state); 38 return err; 39 } 40 41 static struct ctl_table copy_highpages_table[] = { 42 { 43 .procname = "hugepage_nocache_copy", 44 .data = NULL, 45 .maxlen = sizeof(unsigned int), 46 .mode = 0600,
47 .proc_handler = sysctl_hugepage_nocache_copy,
48 .extra1 = SYSCTL_ZERO, 49 .extra2 = SYSCTL_ONE, 50 }, 51 {} 52 }; 53