* [openeuler:OLK-6.6 13/13] drivers/ub/urma/uburma/uburma_mmap.c:20:6: warning: no previous prototype for 'uburma_umap_priv_init'
@ 2025-12-28 13:03 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-12-28 13:03 UTC (permalink / raw)
To: kernel, Yongqiang Guo; +Cc: oe-kbuild-all
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 03c9c649e6f28e26260d276ce755f785b2435da3
commit: f01eef756655bd5f66bd1e3770da92e31982556d [13/13] uburma: introduce uburma basic types and helper functions
config: arm64-randconfig-004-20251226 (https://download.01.org/0day-ci/archive/20251228/202512282153.oGLU3b14-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251228/202512282153.oGLU3b14-lkp@intel.com/reproduce)
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/202512282153.oGLU3b14-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/ub/urma/uburma/uburma_mmap.c:20:6: warning: no previous prototype for 'uburma_umap_priv_init' [-Wmissing-prototypes]
20 | void uburma_umap_priv_init(struct uburma_umap_priv *priv,
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/ub/urma/uburma/uburma_mmap.c:33:6: warning: no previous prototype for 'uburma_unmap_vma_pages' [-Wmissing-prototypes]
33 | void uburma_unmap_vma_pages(struct uburma_file *ufile)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/ub/urma/uburma/uburma_mmap.c:169:36: warning: no previous prototype for 'uburma_get_umap_ops' [-Wmissing-prototypes]
169 | const struct vm_operations_struct *uburma_get_umap_ops(void)
| ^~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for RESCTRL_FS
Depends on [n]: MISC_FILESYSTEMS [=n] && ARCH_HAS_CPU_RESCTRL [=y]
Selected by [y]:
- ARM64_MPAM [=y]
vim +/uburma_umap_priv_init +20 drivers/ub/urma/uburma/uburma_mmap.c
19
> 20 void uburma_umap_priv_init(struct uburma_umap_priv *priv,
21 struct vm_area_struct *vma)
22 {
23 struct uburma_file *ufile = vma->vm_file->private_data;
24
25 priv->vma = vma;
26 vma->vm_private_data = priv;
27
28 mutex_lock(&ufile->umap_mutex);
29 list_add(&priv->node, &ufile->umaps_list);
30 mutex_unlock(&ufile->umap_mutex);
31 }
32
> 33 void uburma_unmap_vma_pages(struct uburma_file *ufile)
34 {
35 struct uburma_umap_priv *priv, *next_priv;
36 struct mm_struct *mm;
37
38 if (list_empty(&ufile->umaps_list))
39 return;
40
41 lockdep_assert_held(&ufile->cleanup_rwsem);
42 while (1) {
43 struct list_head local_list;
44
45 INIT_LIST_HEAD(&local_list);
46 mm = NULL;
47 mutex_lock(&ufile->umap_mutex);
48 list_for_each_entry_safe(priv, next_priv, &ufile->umaps_list,
49 node) {
50 struct mm_struct *curr_mm = priv->vma->vm_mm;
51
52 if (!mm) {
53 if (!mmget_not_zero(curr_mm)) {
54 list_del_init(&priv->node);
55 continue;
56 }
57 mm = curr_mm;
58 list_move_tail(&priv->node, &local_list);
59 } else if (curr_mm == mm) {
60 list_move_tail(&priv->node, &local_list);
61 }
62 }
63 mutex_unlock(&ufile->umap_mutex);
64
65 if (list_empty(&local_list)) {
66 if (mm)
67 mmput(mm);
68 return;
69 }
70
71 mmap_read_lock(mm);
72
73 list_for_each_entry_safe(priv, next_priv, &local_list, node) {
74 struct vm_area_struct *vma = priv->vma;
75
76 list_del_init(&priv->node);
77 if (vma->vm_mm == mm)
78 zap_vma_ptes(vma, vma->vm_start,
79 vma->vm_end - vma->vm_start);
80 }
81 mmap_read_unlock(mm);
82
83 mmput(mm);
84 }
85 }
86
87 static void uburma_umap_open(struct vm_area_struct *vma)
88 {
89 struct uburma_file *ufile = vma->vm_file->private_data;
90 struct uburma_umap_priv *priv;
91
92 if (!down_read_trylock(&ufile->cleanup_rwsem))
93 goto out_zap;
94
95 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
96 if (!priv)
97 goto out_unlock;
98
99 uburma_umap_priv_init(priv, vma);
100
101 up_read(&ufile->cleanup_rwsem);
102 return;
103
104 out_unlock:
105 up_read(&ufile->cleanup_rwsem);
106 out_zap:
107 vma->vm_private_data = NULL;
108 zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start);
109 }
110
111 static void uburma_umap_close(struct vm_area_struct *vma)
112 {
113 struct uburma_file *ufile = vma->vm_file->private_data;
114 struct uburma_umap_priv *priv = vma->vm_private_data;
115
116 if (!priv)
117 return;
118
119 mutex_lock(&ufile->umap_mutex);
120 list_del(&priv->node);
121 mutex_unlock(&ufile->umap_mutex);
122 kfree(priv);
123 vma->vm_private_data = NULL;
124 }
125
126 static vm_fault_t uburma_umap_fault(struct vm_fault *vmf)
127 {
128 struct uburma_file *ufile = vmf->vma->vm_file->private_data;
129 struct uburma_umap_priv *priv = vmf->vma->vm_private_data;
130 struct page *page;
131
132 if (unlikely(!priv))
133 return VM_FAULT_SIGBUS;
134
135 if (!(vmf->vma->vm_flags & (VM_WRITE | VM_MAYWRITE))) {
136 vmf->page = ZERO_PAGE(0);
137 get_page(vmf->page);
138 return 0;
139 }
140
141 page = READ_ONCE(ufile->fault_page);
142 if (likely(page)) {
143 vmf->page = page;
144 get_page(vmf->page);
145 return 0;
146 }
147
148 mutex_lock(&ufile->umap_mutex);
149 if (!ufile->fault_page) {
150 ufile->fault_page = alloc_pages(vmf->gfp_mask | __GFP_ZERO, 0);
151 if (!ufile->fault_page) {
152 mutex_unlock(&ufile->umap_mutex);
153 return VM_FAULT_SIGBUS;
154 }
155 }
156 vmf->page = ufile->fault_page;
157 get_page(vmf->page);
158 mutex_unlock(&ufile->umap_mutex);
159
160 return 0;
161 }
162
163 static const struct vm_operations_struct g_urma_umap_ops = {
164 .open = uburma_umap_open,
165 .close = uburma_umap_close,
166 .fault = uburma_umap_fault,
167 };
168
> 169 const struct vm_operations_struct *uburma_get_umap_ops(void)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-28 13:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-28 13:03 [openeuler:OLK-6.6 13/13] drivers/ub/urma/uburma/uburma_mmap.c:20:6: warning: no previous prototype for 'uburma_umap_priv_init' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.