[peterz-queue:sched/core-sched 5/19] kernel/sched/core.c:123:6: warning: no previous prototype for 'sched_core_get'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core-sched
head: bd5f71ae62a7c0b435fef9392db13aa2eed28bf9
commit: a908448df9da98d91fce14eed521167e30c40341 [5/19] sched: Core-wide rq->lock
config: ia64-randconfig-r005-20210316 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/core-sched
git checkout a908448df9da98d91fce14eed521167e30c40341
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/pgtable.h:6,
from arch/ia64/include/asm/uaccess.h:40,
from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/sched/cputime.h:5,
from kernel/sched/sched.h:11,
from kernel/sched/core.c:13:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
127 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
kernel/sched/core.c: At top level:
>> kernel/sched/core.c:123:6: warning: no previous prototype for 'sched_core_get' [-Wmissing-prototypes]
123 | void sched_core_get(void)
| ^~~~~~~~~~~~~~
>> kernel/sched/core.c:131:6: warning: no previous prototype for 'sched_core_put' [-Wmissing-prototypes]
131 | void sched_core_put(void)
| ^~~~~~~~~~~~~~
kernel/sched/core.c:2904:6: warning: no previous prototype for 'sched_set_stop_task' [-Wmissing-prototypes]
2904 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
vim +/sched_core_get +123 kernel/sched/core.c
12
> 13 #include "sched.h"
14
15 #include <linux/nospec.h>
16
17 #include <linux/kcov.h>
18 #include <linux/scs.h>
19
20 #include <asm/switch_to.h>
21 #include <asm/tlb.h>
22
23 #include "../workqueue_internal.h"
24 #include "../../fs/io-wq.h"
25 #include "../smpboot.h"
26
27 #include "pelt.h"
28 #include "smp.h"
29
30 /*
31 * Export tracepoints that act as a bare tracehook (ie: have no trace event
32 * associated with them) to allow external modules to probe them.
33 */
34 EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_cfs_tp);
35 EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_rt_tp);
36 EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_dl_tp);
37 EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_irq_tp);
38 EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_se_tp);
39 EXPORT_TRACEPOINT_SYMBOL_GPL(sched_cpu_capacity_tp);
40 EXPORT_TRACEPOINT_SYMBOL_GPL(sched_overutilized_tp);
41 EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp);
42 EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp);
43 EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
44
45 DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
46
47 #ifdef CONFIG_SCHED_DEBUG
48 /*
49 * Debugging: various feature bits
50 *
51 * If SCHED_DEBUG is disabled, each compilation unit has its own copy of
52 * sysctl_sched_features, defined in sched.h, to allow constants propagation
53 * at compile time and compiler optimization based on features default.
54 */
55 #define SCHED_FEAT(name, enabled) \
56 (1UL << __SCHED_FEAT_##name) * enabled |
57 const_debug unsigned int sysctl_sched_features =
58 #include "features.h"
59 0;
60 #undef SCHED_FEAT
61 #endif
62
63 /*
64 * Number of tasks to iterate in a single balance run.
65 * Limited because this is done with IRQs disabled.
66 */
67 const_debug unsigned int sysctl_sched_nr_migrate = 32;
68
69 /*
70 * period over which we measure -rt task CPU usage in us.
71 * default: 1s
72 */
73 unsigned int sysctl_sched_rt_period = 1000000;
74
75 __read_mostly int scheduler_running;
76
77 #ifdef CONFIG_SCHED_CORE
78
79 DEFINE_STATIC_KEY_FALSE(__sched_core_enabled);
80
81 /*
82 * The static-key + stop-machine variable are needed such that:
83 *
84 * spin_lock(rq_lockp(rq));
85 * ...
86 * spin_unlock(rq_lockp(rq));
87 *
88 * ends up locking and unlocking the _same_ lock, and all CPUs
89 * always agree on what rq has what lock.
90 *
91 * XXX entirely possible to selectively enable cores, don't bother for now.
92 */
93 static int __sched_core_stopper(void *data)
94 {
95 bool enabled = !!(unsigned long)data;
96 int cpu;
97
98 for_each_possible_cpu(cpu)
99 cpu_rq(cpu)->core_enabled = enabled;
100
101 return 0;
102 }
103
104 static DEFINE_MUTEX(sched_core_mutex);
105 static int sched_core_count;
106
107 static void __sched_core_enable(void)
108 {
109 // XXX verify there are no cookie tasks (yet)
110
111 static_branch_enable(&__sched_core_enabled);
112 stop_machine(__sched_core_stopper, (void *)true, NULL);
113 }
114
115 static void __sched_core_disable(void)
116 {
117 // XXX verify there are no cookie tasks (left)
118
119 stop_machine(__sched_core_stopper, (void *)false, NULL);
120 static_branch_disable(&__sched_core_enabled);
121 }
122
> 123 void sched_core_get(void)
124 {
125 mutex_lock(&sched_core_mutex);
126 if (!sched_core_count++)
127 __sched_core_enable();
128 mutex_unlock(&sched_core_mutex);
129 }
130
> 131 void sched_core_put(void)
132 {
133 mutex_lock(&sched_core_mutex);
134 if (!--sched_core_count)
135 __sched_core_disable();
136 mutex_unlock(&sched_core_mutex);
137 }
138
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH v5 3/3] misc/pvpanic: add PCI driver
by kernel test robot
Hi Mihai,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.12-rc3 next-20210316]
[cannot apply to char-misc/char-misc-testing soc/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Mihai-Carabas/misc-pvpanic-split...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a74e6a014c9d4d4161061f770c9b4f98372ac778
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/6e945cc8314339e4fd5fc2076a2a2abbd...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mihai-Carabas/misc-pvpanic-split-up-generic-and-platform-dependent-code/20210316-212047
git checkout 6e945cc8314339e4fd5fc2076a2a2abbd32fc1da
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/misc/pvpanic/pvpanic-pci.c:22:34: error: 'PVPANIC_PANICKED' undeclared here (not in a function)
22 | static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
| ^~~~~~~~~~~~~~~~
>> drivers/misc/pvpanic/pvpanic-pci.c:22:53: error: 'PVPANIC_CRASH_LOADED' undeclared here (not in a function)
22 | static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
| ^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kobject.h:20,
from include/linux/module.h:20,
from drivers/misc/pvpanic/pvpanic-pci.c:9:
>> drivers/misc/pvpanic/pvpanic-pci.c:64:18: error: 'pvpanici_pci_dev_attrs' undeclared here (not in a function); did you mean 'pvpanic_pci_dev_attrs'?
64 | ATTRIBUTE_GROUPS(pvpanici_pci_dev);
| ^~~~~~~~~~~~~~~~
include/linux/sysfs.h:161:11: note: in definition of macro 'ATTRIBUTE_GROUPS'
161 | .attrs = _name##_attrs, \
| ^~~~~
drivers/misc/pvpanic/pvpanic-pci.c: In function 'pvpanic_pci_probe':
drivers/misc/pvpanic/pvpanic-pci.c:70:18: warning: unused variable 'res' [-Wunused-variable]
70 | struct resource res;
| ^~~
drivers/misc/pvpanic/pvpanic-pci.c: At top level:
>> drivers/misc/pvpanic/pvpanic-pci.c:97:18: error: 'pvpanic_pci_dev_groups' undeclared here (not in a function); did you mean 'pvpanici_pci_dev_groups'?
97 | .groups = pvpanic_pci_dev_groups,
| ^~~~~~~~~~~~~~~~~~~~~~
| pvpanici_pci_dev_groups
In file included from include/linux/kobject.h:20,
from include/linux/module.h:20,
from drivers/misc/pvpanic/pvpanic-pci.c:9:
drivers/misc/pvpanic/pvpanic-pci.c:64:18: warning: 'pvpanici_pci_dev_groups' defined but not used [-Wunused-variable]
64 | ATTRIBUTE_GROUPS(pvpanici_pci_dev);
| ^~~~~~~~~~~~~~~~
include/linux/sysfs.h:154:38: note: in definition of macro '__ATTRIBUTE_GROUPS'
154 | static const struct attribute_group *_name##_groups[] = { \
| ^~~~~
drivers/misc/pvpanic/pvpanic-pci.c:64:1: note: in expansion of macro 'ATTRIBUTE_GROUPS'
64 | ATTRIBUTE_GROUPS(pvpanici_pci_dev);
| ^~~~~~~~~~~~~~~~
drivers/misc/pvpanic/pvpanic-pci.c:59:26: warning: 'pvpanic_pci_dev_attrs' defined but not used [-Wunused-variable]
59 | static struct attribute *pvpanic_pci_dev_attrs[] = {
| ^~~~~~~~~~~~~~~~~~~~~
vim +/PVPANIC_PANICKED +22 drivers/misc/pvpanic/pvpanic-pci.c
16
17 static void __iomem *base;
18 static const struct pci_device_id pvpanic_pci_id_tbl[] = {
19 { PCI_DEVICE(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_PVPANIC),},
20 {}
21 };
> 22 static unsigned int capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
23 static unsigned int events;
24
25 static ssize_t capability_show(struct device *dev,
26 struct device_attribute *attr, char *buf)
27 {
28 return sysfs_emit(buf, "%x\n", capability);
29 }
30 static DEVICE_ATTR_RO(capability);
31
32 static ssize_t events_show(struct device *dev, struct device_attribute *attr, char *buf)
33 {
34 return sysfs_emit(buf, "%x\n", events);
35 }
36
37 static ssize_t events_store(struct device *dev, struct device_attribute *attr,
38 const char *buf, size_t count)
39 {
40 unsigned int tmp;
41 int err;
42
43 err = kstrtouint(buf, 16, &tmp);
44 if (err)
45 return err;
46
47 if ((tmp & capability) != tmp)
48 return -EINVAL;
49
50 events = tmp;
51
52 pvpanic_set_events(base, events);
53
54 return count;
55
56 }
57 static DEVICE_ATTR_RW(events);
58
59 static struct attribute *pvpanic_pci_dev_attrs[] = {
60 &dev_attr_capability.attr,
61 &dev_attr_events.attr,
62 NULL
63 };
> 64 ATTRIBUTE_GROUPS(pvpanici_pci_dev);
65
66 static int pvpanic_pci_probe(struct pci_dev *pdev,
67 const struct pci_device_id *ent)
68 {
69 int ret;
70 struct resource res;
71
72 ret = pci_enable_device(pdev);
73 if (ret < 0)
74 return ret;
75
76 base = pci_iomap(pdev, 0, 0);
77 if (IS_ERR(base))
78 return PTR_ERR(base);
79
80 /* initlize capability by RDPT */
81 capability &= ioread8(base);
82 events = capability;
83
84 return pvpanic_probe(base, capability);
85 }
86
87 static void pvpanic_pci_remove(struct pci_dev *pdev)
88 {
89 pvpanic_remove(base);
90 iounmap(base);
91 pci_disable_device(pdev);
92 }
93
94 static struct pci_driver pvpanic_pci_driver = {
95 .name = "pvpanic-pci",
96 .id_table = pvpanic_pci_id_tbl,
> 97 .groups = pvpanic_pci_dev_groups,
98 .probe = pvpanic_pci_probe,
99 .remove = pvpanic_pci_remove,
100 };
101
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH v5 01/10] coresight: syscfg: Initial coresight system configuration
by kernel test robot
Hi Mike,
I love your patch! Perhaps something to improve:
[auto build test WARNING on lwn/docs-next]
[also build test WARNING on linus/master v5.12-rc3 next-20210316]
[cannot apply to soc/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Mike-Leach/CoreSight-configurati...
base: git://git.lwn.net/linux-2.6 docs-next
config: arm-randconfig-r035-20210316 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/76d2cecb5af2a820d6910c10996ed1122...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mike-Leach/CoreSight-configuration-management-ETM-strobing/20210317-021436
git checkout 76d2cecb5af2a820d6910c10996ed11222799ce8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/hwtracing/coresight/coresight-syscfg.c:132:6: warning: no previous prototype for 'cscfg_dev_release' [-Wmissing-prototypes]
132 | void cscfg_dev_release(struct device *dev)
| ^~~~~~~~~~~~~~~~~
>> drivers/hwtracing/coresight/coresight-syscfg.c:139:5: warning: no previous prototype for 'cscfg_create_device' [-Wmissing-prototypes]
139 | int cscfg_create_device(void)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/hwtracing/coresight/coresight-syscfg.c:168:6: warning: no previous prototype for 'cscfg_clear_device' [-Wmissing-prototypes]
168 | void cscfg_clear_device(void)
| ^~~~~~~~~~~~~~~~~~
vim +/cscfg_dev_release +132 drivers/hwtracing/coresight/coresight-syscfg.c
130
131 /* Must have a release function or the kernel will complain on module unload */
> 132 void cscfg_dev_release(struct device *dev)
133 {
134 kfree(cscfg_mgr);
135 cscfg_mgr = NULL;
136 }
137
138 /* a device is needed to "own" some kernel elements such as sysfs entries. */
> 139 int cscfg_create_device(void)
140 {
141 struct device *dev;
142 int err = -ENOMEM;
143
144 mutex_lock(&cscfg_mutex);
145 if (cscfg_mgr) {
146 err = -EINVAL;
147 goto create_dev_exit_unlock;
148 }
149
150 cscfg_mgr = kzalloc(sizeof(struct cscfg_manager), GFP_KERNEL);
151 if (!cscfg_mgr)
152 goto create_dev_exit_unlock;
153
154 /* setup the device */
155 dev = cscfg_device();
156 dev->release = cscfg_dev_release;
157 dev->init_name = "cs_system_cfg";
158
159 err = device_register(dev);
160 if (err)
161 cscfg_dev_release(dev);
162
163 create_dev_exit_unlock:
164 mutex_unlock(&cscfg_mutex);
165 return err;
166 }
167
> 168 void cscfg_clear_device(void)
169 {
170 mutex_lock(&cscfg_mutex);
171 device_unregister(cscfg_device());
172 mutex_unlock(&cscfg_mutex);
173 }
174
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[efi:next 3/4] arch/x86/platform/efi/efi_64.c:163:23: error: passing 'const void to parameter of type 'volatile void discards qualifiers
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head: e233b65935c946ba420ba1b5a42f9b5625861da8
commit: ceec4ec8c41f622b7076157288804549b18fea04 [3/4] efi: use const* paramaters for get/setvar by-ref arguments annotated as IN
config: x86_64-randconfig-a004-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=ce...
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git fetch --no-tags efi next
git checkout ceec4ec8c41f622b7076157288804549b18fea04
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/platform/efi/efi_64.c:163:23: error: passing 'const void *' to parameter of type 'volatile void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
return virt_to_phys(va);
^~
arch/x86/include/asm/io.h:129:55: note: passing argument to parameter 'address' here
static inline phys_addr_t virt_to_phys(volatile void *address)
^
>> arch/x86/platform/efi/efi_64.c:165:25: error: passing 'const void *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
pa = slow_virt_to_phys(va);
^~
arch/x86/include/asm/pgtable_types.h:569:44: note: passing argument to parameter '__address' here
extern phys_addr_t slow_virt_to_phys(void *__address);
^
2 errors generated.
vim +163 arch/x86/platform/efi/efi_64.c
d2f7cbe7b26a74 Borislav Petkov 2013-10-31 150
f6697df36bdf0b Matt Fleming 2016-11-12 151 /*
f6697df36bdf0b Matt Fleming 2016-11-12 152 * Wrapper for slow_virt_to_phys() that handles NULL addresses.
f6697df36bdf0b Matt Fleming 2016-11-12 153 */
f6697df36bdf0b Matt Fleming 2016-11-12 154 static inline phys_addr_t
ceec4ec8c41f62 Ard Biesheuvel 2021-03-12 155 virt_to_phys_or_null_size(const void *va, unsigned long size)
f6697df36bdf0b Matt Fleming 2016-11-12 156 {
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 157 phys_addr_t pa;
f6697df36bdf0b Matt Fleming 2016-11-12 158
f6697df36bdf0b Matt Fleming 2016-11-12 159 if (!va)
f6697df36bdf0b Matt Fleming 2016-11-12 160 return 0;
f6697df36bdf0b Matt Fleming 2016-11-12 161
f6697df36bdf0b Matt Fleming 2016-11-12 162 if (virt_addr_valid(va))
f6697df36bdf0b Matt Fleming 2016-11-12 @163 return virt_to_phys(va);
f6697df36bdf0b Matt Fleming 2016-11-12 164
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 @165 pa = slow_virt_to_phys(va);
f6697df36bdf0b Matt Fleming 2016-11-12 166
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 167 /* check if the object crosses a page boundary */
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 168 if (WARN_ON((pa ^ (pa + size - 1)) & PAGE_MASK))
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 169 return 0;
f6697df36bdf0b Matt Fleming 2016-11-12 170
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 171 return pa;
f6697df36bdf0b Matt Fleming 2016-11-12 172 }
f6697df36bdf0b Matt Fleming 2016-11-12 173
:::::: The code at line 163 was first introduced by commit
:::::: f6697df36bdf0bf7fce984605c2918d4a7b4269f x86/efi: Prevent mixed mode boot corruption with CONFIG_VMAP_STACK=y
:::::: TO: Matt Fleming <matt(a)codeblueprint.co.uk>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[ext3:for_next 7/16] arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_quotactl_path'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git for_next
head: 4c8e583da146ce683ce590d82107deac6d7199f4
commit: 72dd1ce7ebd305e0b37dbecbce3ee220241db18c [7/16] quota: wire up quotactl_path
config: x86_64-randconfig-r015-20210316 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git/commit/...
git remote add ext3 https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git
git fetch --no-tags ext3 for_next
git checkout 72dd1ce7ebd305e0b37dbecbce3ee220241db18c
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:69:1: note: in expansion of macro 'COND_SYSCALL'
69 | COND_SYSCALL(epoll_pwait);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_epoll_pwait2' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:71:1: note: in expansion of macro 'COND_SYSCALL'
71 | COND_SYSCALL(epoll_pwait2);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_inotify_init1' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:77:1: note: in expansion of macro 'COND_SYSCALL'
77 | COND_SYSCALL(inotify_init1);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_inotify_add_watch' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:78:1: note: in expansion of macro 'COND_SYSCALL'
78 | COND_SYSCALL(inotify_add_watch);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_inotify_rm_watch' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:79:1: note: in expansion of macro 'COND_SYSCALL'
79 | COND_SYSCALL(inotify_rm_watch);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_ioprio_set' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:84:1: note: in expansion of macro 'COND_SYSCALL'
84 | COND_SYSCALL(ioprio_set);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_ioprio_get' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:85:1: note: in expansion of macro 'COND_SYSCALL'
85 | COND_SYSCALL(ioprio_get);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_flock' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:88:1: note: in expansion of macro 'COND_SYSCALL'
88 | COND_SYSCALL(flock);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_quotactl' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:101:1: note: in expansion of macro 'COND_SYSCALL'
101 | COND_SYSCALL(quotactl);
| ^~~~~~~~~~~~
>> arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_quotactl_path' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:102:1: note: in expansion of macro 'COND_SYSCALL'
102 | COND_SYSCALL(quotactl_path);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_signalfd4' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:113:1: note: in expansion of macro 'COND_SYSCALL'
113 | COND_SYSCALL(signalfd4);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_create' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:123:1: note: in expansion of macro 'COND_SYSCALL'
123 | COND_SYSCALL(timerfd_create);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_settime' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:124:1: note: in expansion of macro 'COND_SYSCALL'
124 | COND_SYSCALL(timerfd_settime);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_settime32' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:125:1: note: in expansion of macro 'COND_SYSCALL'
125 | COND_SYSCALL(timerfd_settime32);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_gettime' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:126:1: note: in expansion of macro 'COND_SYSCALL'
126 | COND_SYSCALL(timerfd_gettime);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_gettime32' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:127:1: note: in expansion of macro 'COND_SYSCALL'
127 | COND_SYSCALL(timerfd_gettime32);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_acct' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:132:1: note: in expansion of macro 'COND_SYSCALL'
132 | COND_SYSCALL(acct);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_capget' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
vim +/__x64_sys_quotactl_path +83 arch/x86/include/asm/syscall_wrapper.h
cc42c045af1ff4 Brian Gerst 2020-03-13 13
25c619e59b395a Brian Gerst 2020-03-13 14 /*
25c619e59b395a Brian Gerst 2020-03-13 15 * Instead of the generic __SYSCALL_DEFINEx() definition, the x86 version takes
25c619e59b395a Brian Gerst 2020-03-13 16 * struct pt_regs *regs as the only argument of the syscall stub(s) named as:
25c619e59b395a Brian Gerst 2020-03-13 17 * __x64_sys_*() - 64-bit native syscall
25c619e59b395a Brian Gerst 2020-03-13 18 * __ia32_sys_*() - 32-bit native syscall or common compat syscall
25c619e59b395a Brian Gerst 2020-03-13 19 * __ia32_compat_sys_*() - 32-bit compat syscall
25c619e59b395a Brian Gerst 2020-03-13 20 * __x32_compat_sys_*() - 64-bit X32 compat syscall
25c619e59b395a Brian Gerst 2020-03-13 21 *
25c619e59b395a Brian Gerst 2020-03-13 22 * The registers are decoded according to the ABI:
25c619e59b395a Brian Gerst 2020-03-13 23 * 64-bit: RDI, RSI, RDX, R10, R8, R9
25c619e59b395a Brian Gerst 2020-03-13 24 * 32-bit: EBX, ECX, EDX, ESI, EDI, EBP
25c619e59b395a Brian Gerst 2020-03-13 25 *
25c619e59b395a Brian Gerst 2020-03-13 26 * The stub then passes the decoded arguments to the __se_sys_*() wrapper to
25c619e59b395a Brian Gerst 2020-03-13 27 * perform sign-extension (omitted for zero-argument syscalls). Finally the
25c619e59b395a Brian Gerst 2020-03-13 28 * arguments are passed to the __do_sys_*() function which is the actual
25c619e59b395a Brian Gerst 2020-03-13 29 * syscall. These wrappers are marked as inline so the compiler can optimize
25c619e59b395a Brian Gerst 2020-03-13 30 * the functions where appropriate.
25c619e59b395a Brian Gerst 2020-03-13 31 *
25c619e59b395a Brian Gerst 2020-03-13 32 * Example assembly (slightly re-ordered for better readability):
25c619e59b395a Brian Gerst 2020-03-13 33 *
25c619e59b395a Brian Gerst 2020-03-13 34 * <__x64_sys_recv>: <-- syscall with 4 parameters
25c619e59b395a Brian Gerst 2020-03-13 35 * callq <__fentry__>
25c619e59b395a Brian Gerst 2020-03-13 36 *
25c619e59b395a Brian Gerst 2020-03-13 37 * mov 0x70(%rdi),%rdi <-- decode regs->di
25c619e59b395a Brian Gerst 2020-03-13 38 * mov 0x68(%rdi),%rsi <-- decode regs->si
25c619e59b395a Brian Gerst 2020-03-13 39 * mov 0x60(%rdi),%rdx <-- decode regs->dx
25c619e59b395a Brian Gerst 2020-03-13 40 * mov 0x38(%rdi),%rcx <-- decode regs->r10
25c619e59b395a Brian Gerst 2020-03-13 41 *
25c619e59b395a Brian Gerst 2020-03-13 42 * xor %r9d,%r9d <-- clear %r9
25c619e59b395a Brian Gerst 2020-03-13 43 * xor %r8d,%r8d <-- clear %r8
25c619e59b395a Brian Gerst 2020-03-13 44 *
25c619e59b395a Brian Gerst 2020-03-13 45 * callq __sys_recvfrom <-- do the actual work in __sys_recvfrom()
25c619e59b395a Brian Gerst 2020-03-13 46 * which takes 6 arguments
25c619e59b395a Brian Gerst 2020-03-13 47 *
25c619e59b395a Brian Gerst 2020-03-13 48 * cltq <-- extend return value to 64-bit
25c619e59b395a Brian Gerst 2020-03-13 49 * retq <-- return
25c619e59b395a Brian Gerst 2020-03-13 50 *
25c619e59b395a Brian Gerst 2020-03-13 51 * This approach avoids leaking random user-provided register content down
25c619e59b395a Brian Gerst 2020-03-13 52 * the call chain.
25c619e59b395a Brian Gerst 2020-03-13 53 */
25c619e59b395a Brian Gerst 2020-03-13 54
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 55 /* Mapping of registers to parameters for syscalls on x86-64 and x32 */
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 56 #define SC_X86_64_REGS_TO_ARGS(x, ...) \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 57 __MAP(x,__SC_ARGS \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 58 ,,regs->di,,regs->si,,regs->dx \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 59 ,,regs->r10,,regs->r8,,regs->r9) \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 60
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 61 /* Mapping of registers to parameters for syscalls on i386 */
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 62 #define SC_IA32_REGS_TO_ARGS(x, ...) \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 63 __MAP(x,__SC_ARGS \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 64 ,,(unsigned int)regs->bx,,(unsigned int)regs->cx \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 65 ,,(unsigned int)regs->dx,,(unsigned int)regs->si \
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 66 ,,(unsigned int)regs->di,,(unsigned int)regs->bp)
ebeb8c82ffaf94 Dominik Brodowski 2018-04-05 67
d2b5de495ee983 Brian Gerst 2020-03-13 68 #define __SYS_STUB0(abi, name) \
0f78ff17112d8b Brian Gerst 2020-03-13 69 long __##abi##_##name(const struct pt_regs *regs); \
d2b5de495ee983 Brian Gerst 2020-03-13 70 ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO); \
0f78ff17112d8b Brian Gerst 2020-03-13 71 long __##abi##_##name(const struct pt_regs *regs) \
d2b5de495ee983 Brian Gerst 2020-03-13 72 __alias(__do_##name);
d2b5de495ee983 Brian Gerst 2020-03-13 73
4399e0cf494f73 Brian Gerst 2020-03-13 74 #define __SYS_STUBx(abi, name, ...) \
0f78ff17112d8b Brian Gerst 2020-03-13 75 long __##abi##_##name(const struct pt_regs *regs); \
4399e0cf494f73 Brian Gerst 2020-03-13 76 ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO); \
0f78ff17112d8b Brian Gerst 2020-03-13 77 long __##abi##_##name(const struct pt_regs *regs) \
4399e0cf494f73 Brian Gerst 2020-03-13 78 { \
4399e0cf494f73 Brian Gerst 2020-03-13 79 return __se_##name(__VA_ARGS__); \
4399e0cf494f73 Brian Gerst 2020-03-13 80 }
4399e0cf494f73 Brian Gerst 2020-03-13 81
6cc8d2b286d9e7 Brian Gerst 2020-03-13 82 #define __COND_SYSCALL(abi, name) \
0f78ff17112d8b Brian Gerst 2020-03-13 @83 __weak long __##abi##_##name(const struct pt_regs *__unused) \
6cc8d2b286d9e7 Brian Gerst 2020-03-13 84 { \
6cc8d2b286d9e7 Brian Gerst 2020-03-13 85 return sys_ni_syscall(); \
6cc8d2b286d9e7 Brian Gerst 2020-03-13 86 }
6cc8d2b286d9e7 Brian Gerst 2020-03-13 87
:::::: The code at line 83 was first introduced by commit
:::::: 0f78ff17112d8b3469b805ff4ea9780cc1e5c93b x86/entry: Drop asmlinkage from syscalls
:::::: TO: Brian Gerst <brgerst(a)gmail.com>
:::::: CC: Thomas Gleixner <tglx(a)linutronix.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[RFC PATCH] ftrace: ftrace_alloc_direct_func() can be static
by kernel test robot
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1f94a100e5877..2b688418f05be 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5045,7 +5045,7 @@ struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr)
return NULL;
}
-struct ftrace_direct_func *ftrace_alloc_direct_func(unsigned long addr)
+static struct ftrace_direct_func *ftrace_alloc_direct_func(unsigned long addr)
{
struct ftrace_direct_func *direct;
1 year, 6 months
Re: [PATCH v2 bpf] ftrace: Fix modify_ftrace_direct.
by kernel test robot
Hi Alexei,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf/master]
url: https://github.com/0day-ci/linux/commits/Alexei-Starovoitov/ftrace-Fix-mo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git master
config: i386-randconfig-s002-20210316 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://github.com/0day-ci/linux/commit/517b5af19a5e543f639389ecd65badacf...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexei-Starovoitov/ftrace-Fix-modify_ftrace_direct/20210317-031309
git checkout 517b5af19a5e543f639389ecd65badacf7523a69
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/trace/ftrace.c:302:5: warning: no previous prototype for '__register_ftrace_function' [-Wmissing-prototypes]
302 | int __register_ftrace_function(struct ftrace_ops *ops)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:345:5: warning: no previous prototype for '__unregister_ftrace_function' [-Wmissing-prototypes]
345 | int __unregister_ftrace_function(struct ftrace_ops *ops)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:584:5: warning: no previous prototype for 'ftrace_profile_pages_init' [-Wmissing-prototypes]
584 | int ftrace_profile_pages_init(struct ftrace_profile_stat *stat)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:3876:15: warning: no previous prototype for 'arch_ftrace_match_adjust' [-Wmissing-prototypes]
3876 | char * __weak arch_ftrace_match_adjust(char *str, const char *search)
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:5048:28: warning: no previous prototype for 'ftrace_alloc_direct_func' [-Wmissing-prototypes]
5048 | struct ftrace_direct_func *ftrace_alloc_direct_func(unsigned long addr)
| ^~~~~~~~~~~~~~~~~~~~~~~~
sparse warnings: (new ones prefixed by >>)
kernel/trace/ftrace.c:118:59: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list @@ got struct ftrace_ops * @@
kernel/trace/ftrace.c:118:59: sparse: expected struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list
kernel/trace/ftrace.c:118:59: sparse: got struct ftrace_ops *
kernel/trace/ftrace.c:202:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_ops *ops @@ got struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list @@
kernel/trace/ftrace.c:202:49: sparse: expected struct ftrace_ops *ops
kernel/trace/ftrace.c:202:49: sparse: got struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list
kernel/trace/ftrace.c:285:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops [noderef] __rcu * @@ got struct ftrace_ops * @@
kernel/trace/ftrace.c:285:23: sparse: expected struct ftrace_ops [noderef] __rcu *
kernel/trace/ftrace.c:285:23: sparse: got struct ftrace_ops *
kernel/trace/ftrace.c:289:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops **p @@ got struct ftrace_ops [noderef] __rcu **list @@
kernel/trace/ftrace.c:289:16: sparse: expected struct ftrace_ops **p
kernel/trace/ftrace.c:289:16: sparse: got struct ftrace_ops [noderef] __rcu **list
kernel/trace/ftrace.c:289:50: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops **p @@ got struct ftrace_ops [noderef] __rcu ** @@
kernel/trace/ftrace.c:289:50: sparse: expected struct ftrace_ops **p
kernel/trace/ftrace.c:289:50: sparse: got struct ftrace_ops [noderef] __rcu **
kernel/trace/ftrace.c:296:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops * @@ got struct ftrace_ops [noderef] __rcu *next @@
kernel/trace/ftrace.c:296:12: sparse: expected struct ftrace_ops *
kernel/trace/ftrace.c:296:12: sparse: got struct ftrace_ops [noderef] __rcu *next
kernel/trace/ftrace.c:584:5: sparse: sparse: symbol 'ftrace_profile_pages_init' was not declared. Should it be static?
kernel/trace/ftrace.c:1040:43: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *notrace_hash @@ got struct ftrace_hash * @@
kernel/trace/ftrace.c:1040:43: sparse: expected struct ftrace_hash [noderef] __rcu *notrace_hash
kernel/trace/ftrace.c:1040:43: sparse: got struct ftrace_hash *
kernel/trace/ftrace.c:1041:43: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *filter_hash @@ got struct ftrace_hash * @@
kernel/trace/ftrace.c:1041:43: sparse: expected struct ftrace_hash [noderef] __rcu *filter_hash
kernel/trace/ftrace.c:1041:43: sparse: got struct ftrace_hash *
kernel/trace/ftrace.c:1259:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1259:40: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:1259:40: sparse: got struct ftrace_hash [noderef] __rcu *filter_hash
kernel/trace/ftrace.c:1260:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:1260:40: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:1260:40: sparse: got struct ftrace_hash [noderef] __rcu *notrace_hash
kernel/trace/ftrace.c:1957:54: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash *old_hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1957:54: sparse: expected struct ftrace_hash *old_hash
kernel/trace/ftrace.c:1957:54: sparse: got struct ftrace_hash [noderef] __rcu *filter_hash
kernel/trace/ftrace.c:1441:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/ftrace.c:1441:9: sparse: struct ftrace_hash [noderef] __rcu *
kernel/trace/ftrace.c:1441:9: sparse: struct ftrace_hash *
kernel/trace/ftrace.c:1457:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1458:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1459:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:1460:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:1614:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops *ops @@ got struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list @@
kernel/trace/ftrace.c:1615:43: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops *ops @@ got struct ftrace_ops [noderef] __rcu *next @@
kernel/trace/ftrace.c:1663:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1664:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *other_hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:1669:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:1670:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *other_hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1935:50: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:1946:50: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:3295:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:3312:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:3787:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:3790:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:4191:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:4193:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:4565:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:4707:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:4713:34: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *filter_hash @@ got struct ftrace_hash *[assigned] old_hash @@
kernel/trace/ftrace.c:4965:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:4967:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
>> kernel/trace/ftrace.c:5048:27: sparse: sparse: symbol 'ftrace_alloc_direct_func' was not declared. Should it be static?
kernel/trace/ftrace.c:5576:35: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *extern [addressable] [toplevel] ftrace_graph_hash @@ got struct ftrace_hash *[assigned] hash @@
kernel/trace/ftrace.c:5578:43: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *extern [addressable] [toplevel] ftrace_graph_notrace_hash @@ got struct ftrace_hash *[assigned] hash @@
kernel/trace/ftrace.c:5636:35: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:5640:35: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_hash **orig_hash @@ got struct ftrace_hash [noderef] __rcu ** @@
kernel/trace/ftrace.c:5694:47: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *[addressable] [toplevel] ftrace_graph_hash @@ got struct ftrace_hash * @@
kernel/trace/ftrace.c:5695:55: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ftrace_hash [noderef] __rcu *[addressable] [toplevel] ftrace_graph_notrace_hash @@ got struct ftrace_hash * @@
kernel/trace/ftrace.c:6311:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops *ops @@ got struct ftrace_ops [noderef] __rcu *[addressable] [toplevel] ftrace_ops_list @@
kernel/trace/ftrace.c:6311:66: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ftrace_ops *ops @@ got struct ftrace_ops [noderef] __rcu *next @@
kernel/trace/ftrace.c:6363:59: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:6364:59: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:6734:62: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:6735:62: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:6781:36: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/ftrace.c:6781:36: sparse: struct ftrace_ops [noderef] __rcu *
kernel/trace/ftrace.c:6781:36: sparse: struct ftrace_ops *
kernel/trace/ftrace.c:200:20: sparse: sparse: dereference of noderef expression
kernel/trace/ftrace.c:200:20: sparse: sparse: dereference of noderef expression
kernel/trace/ftrace.c:200:20: sparse: sparse: dereference of noderef expression
kernel/trace/ftrace.c:3084:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:3084:46: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:3084:46: sparse: got struct ftrace_hash [noderef] __rcu *filter_hash
kernel/trace/ftrace.c:3085:47: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:3085:47: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:3085:47: sparse: got struct ftrace_hash [noderef] __rcu *filter_hash
kernel/trace/ftrace.c:3089:44: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:3089:44: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:3089:44: sparse: got struct ftrace_hash [noderef] __rcu *notrace_hash
kernel/trace/ftrace.c:3061:48: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *filter_hash @@
kernel/trace/ftrace.c:3061:48: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:3061:48: sparse: got struct ftrace_hash [noderef] __rcu *filter_hash
kernel/trace/ftrace.c:3062:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct ftrace_hash *hash @@ got struct ftrace_hash [noderef] __rcu *notrace_hash @@
kernel/trace/ftrace.c:3062:49: sparse: expected struct ftrace_hash *hash
kernel/trace/ftrace.c:3062:49: sparse: got struct ftrace_hash [noderef] __rcu *notrace_hash
Please review and possibly fold the followup patch.
vim +/ftrace_alloc_direct_func +5048 kernel/trace/ftrace.c
5047
> 5048 struct ftrace_direct_func *ftrace_alloc_direct_func(unsigned long addr)
5049 {
5050 struct ftrace_direct_func *direct;
5051
5052 direct = kmalloc(sizeof(*direct), GFP_KERNEL);
5053 if (!direct)
5054 return NULL;
5055 direct->addr = addr;
5056 direct->count = 0;
5057 list_add_rcu(&direct->next, &ftrace_direct_funcs);
5058 ftrace_direct_func_count++;
5059 return direct;
5060 }
5061
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[mhiramat:kprobes/kretprobe-stackfix 9/10] arch/x86/kernel/unwind_orc.c:547:20: error: no member named 'kr_iter' in 'struct unwind_state'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix
head: 6e2b8966c87adc1be0fb4a386fb24ae438f4cb79
commit: 3f16730e94371a16e7c5490095b089cb198440e6 [9/10] x86/unwind/orc,kprobes: Fixup kretprobe trampoline entry
config: x86_64-randconfig-r036-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/commit...
git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
git fetch --no-tags mhiramat kprobes/kretprobe-stackfix
git checkout 3f16730e94371a16e7c5490095b089cb198440e6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/kernel/unwind_orc.c:547:20: error: no member named 'kr_iter' in 'struct unwind_state'
&state->kr_iter);
~~~~~ ^
1 error generated.
vim +547 arch/x86/kernel/unwind_orc.c
417
418 bool unwind_next_frame(struct unwind_state *state)
419 {
420 unsigned long ip_p, sp, tmp, orig_ip = state->ip, prev_sp = state->sp;
421 enum stack_type prev_type = state->stack_info.type;
422 struct orc_entry *orc;
423 bool indirect = false;
424
425 if (unwind_done(state))
426 return false;
427
428 /* Don't let modules unload while we're reading their ORC data. */
429 preempt_disable();
430
431 /* End-of-stack check for user tasks: */
432 if (state->regs && user_mode(state->regs))
433 goto the_end;
434
435 /*
436 * Find the orc_entry associated with the text address.
437 *
438 * For a call frame (as opposed to a signal frame), state->ip points to
439 * the instruction after the call. That instruction's stack layout
440 * could be different from the call instruction's layout, for example
441 * if the call was to a noreturn function. So get the ORC data for the
442 * call instruction itself.
443 */
444 orc = orc_find(state->signal ? state->ip : state->ip - 1);
445 if (!orc) {
446 /*
447 * As a fallback, try to assume this code uses a frame pointer.
448 * This is useful for generated code, like BPF, which ORC
449 * doesn't know about. This is just a guess, so the rest of
450 * the unwind is no longer considered reliable.
451 */
452 orc = &orc_fp_entry;
453 state->error = true;
454 }
455
456 /* End-of-stack check for kernel threads: */
457 if (orc->sp_reg == ORC_REG_UNDEFINED) {
458 if (!orc->end)
459 goto err;
460
461 goto the_end;
462 }
463
464 /* Find the previous frame's stack: */
465 switch (orc->sp_reg) {
466 case ORC_REG_SP:
467 sp = state->sp + orc->sp_offset;
468 break;
469
470 case ORC_REG_BP:
471 sp = state->bp + orc->sp_offset;
472 break;
473
474 case ORC_REG_SP_INDIRECT:
475 sp = state->sp;
476 indirect = true;
477 break;
478
479 case ORC_REG_BP_INDIRECT:
480 sp = state->bp + orc->sp_offset;
481 indirect = true;
482 break;
483
484 case ORC_REG_R10:
485 if (!get_reg(state, offsetof(struct pt_regs, r10), &sp)) {
486 orc_warn_current("missing R10 value at %pB\n",
487 (void *)state->ip);
488 goto err;
489 }
490 break;
491
492 case ORC_REG_R13:
493 if (!get_reg(state, offsetof(struct pt_regs, r13), &sp)) {
494 orc_warn_current("missing R13 value at %pB\n",
495 (void *)state->ip);
496 goto err;
497 }
498 break;
499
500 case ORC_REG_DI:
501 if (!get_reg(state, offsetof(struct pt_regs, di), &sp)) {
502 orc_warn_current("missing RDI value at %pB\n",
503 (void *)state->ip);
504 goto err;
505 }
506 break;
507
508 case ORC_REG_DX:
509 if (!get_reg(state, offsetof(struct pt_regs, dx), &sp)) {
510 orc_warn_current("missing DX value at %pB\n",
511 (void *)state->ip);
512 goto err;
513 }
514 break;
515
516 default:
517 orc_warn("unknown SP base reg %d at %pB\n",
518 orc->sp_reg, (void *)state->ip);
519 goto err;
520 }
521
522 if (indirect) {
523 if (!deref_stack_reg(state, sp, &sp))
524 goto err;
525
526 if (orc->sp_reg == ORC_REG_SP_INDIRECT)
527 sp += orc->sp_offset;
528 }
529
530 /* Find IP, SP and possibly regs: */
531 switch (orc->type) {
532 case UNWIND_HINT_TYPE_CALL:
533 ip_p = sp - sizeof(long);
534
535 if (!deref_stack_reg(state, ip_p, &state->ip))
536 goto err;
537
538 state->ip = ftrace_graph_ret_addr(state->task, &state->graph_idx,
539 state->ip, (void *)ip_p);
540 /*
541 * When the unwinder finds the kretprobe_trampoline instead of
542 * the real return address on stack, find the correct return
543 * address from task->kretprobe_instances list.
544 */
545 if (is_kretprobe_trampoline(state->ip))
546 state->ip = kretprobe_find_ret_addr(state->task,
> 547 &state->kr_iter);
548
549 state->sp = sp;
550 state->regs = NULL;
551 state->prev_regs = NULL;
552 state->signal = false;
553 break;
554
555 case UNWIND_HINT_TYPE_REGS:
556 if (!deref_stack_regs(state, sp, &state->ip, &state->sp)) {
557 orc_warn_current("can't access registers at %pB\n",
558 (void *)orig_ip);
559 goto err;
560 }
561
562 state->regs = (struct pt_regs *)sp;
563 state->prev_regs = NULL;
564 state->full_regs = true;
565 state->signal = true;
566 break;
567
568 case UNWIND_HINT_TYPE_REGS_PARTIAL:
569 if (!deref_stack_iret_regs(state, sp, &state->ip, &state->sp)) {
570 orc_warn_current("can't access iret registers at %pB\n",
571 (void *)orig_ip);
572 goto err;
573 }
574
575 if (state->full_regs)
576 state->prev_regs = state->regs;
577 state->regs = (void *)sp - IRET_FRAME_OFFSET;
578 state->full_regs = false;
579 state->signal = true;
580 break;
581
582 default:
583 orc_warn("unknown .orc_unwind entry type %d at %pB\n",
584 orc->type, (void *)orig_ip);
585 goto err;
586 }
587
588 /* Find BP: */
589 switch (orc->bp_reg) {
590 case ORC_REG_UNDEFINED:
591 if (get_reg(state, offsetof(struct pt_regs, bp), &tmp))
592 state->bp = tmp;
593 break;
594
595 case ORC_REG_PREV_SP:
596 if (!deref_stack_reg(state, sp + orc->bp_offset, &state->bp))
597 goto err;
598 break;
599
600 case ORC_REG_BP:
601 if (!deref_stack_reg(state, state->bp + orc->bp_offset, &state->bp))
602 goto err;
603 break;
604
605 default:
606 orc_warn("unknown BP base reg %d for ip %pB\n",
607 orc->bp_reg, (void *)orig_ip);
608 goto err;
609 }
610
611 /* Prevent a recursive loop due to bad ORC data: */
612 if (state->stack_info.type == prev_type &&
613 on_stack(&state->stack_info, (void *)state->sp, sizeof(long)) &&
614 state->sp <= prev_sp) {
615 orc_warn_current("stack going in the wrong direction? at %pB\n",
616 (void *)orig_ip);
617 goto err;
618 }
619
620 preempt_enable();
621 return true;
622
623 err:
624 state->error = true;
625
626 the_end:
627 preempt_enable();
628 state->stack_info.type = STACK_TYPE_UNKNOWN;
629 return false;
630 }
631 EXPORT_SYMBOL_GPL(unwind_next_frame);
632
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months