Hi Vipin,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on kvm/linux-next]
[also build test WARNING on vhost/linux-next linus/master cgroup/for-next v5.9-rc6
next-20200921]
[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/Vipin-Sharma/KVM-SVM-Cgroup-supp...
base:
https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# 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 >>):
> arch/x86/kvm/svm/sev_cgroup.c:103:5: warning: no previous
prototype for 'sev_asid_try_charge' [-Wmissing-prototypes]
103 | int
sev_asid_try_charge(int pos)
| ^~~~~~~~~~~~~~~~~~~
> arch/x86/kvm/svm/sev_cgroup.c:145:6: warning: no previous
prototype for 'sev_asid_uncharge' [-Wmissing-prototypes]
145 | void
sev_asid_uncharge(int pos)
| ^~~~~~~~~~~~~~~~~
> arch/x86/kvm/svm/sev_cgroup.c:171:5: warning: no previous
prototype for 'sev_cgroup_setup' [-Wmissing-prototypes]
171 | int
sev_cgroup_setup(unsigned int max)
| ^~~~~~~~~~~~~~~~
> arch/x86/kvm/svm/sev_cgroup.c:198:6: warning: no previous
prototype for 'sev_cgroup_teardown' [-Wmissing-prototypes]
198 | void
sev_cgroup_teardown(void)
| ^~~~~~~~~~~~~~~~~~~
#
https://github.com/0day-ci/linux/commit/a6ea9901dcea64e24118ff35965406ed1...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Vipin-Sharma/KVM-SVM-Cgroup-support-for-SVM-SEV-ASIDs/20200922-084116
git checkout a6ea9901dcea64e24118ff35965406ed101d614f
vim +/sev_asid_try_charge +103 arch/x86/kvm/svm/sev_cgroup.c
88
89 /**
90 * sev_asid_try_charge() - Try charging an SEV ASID to the cgroup.
91 * @pos: Index of SEV ASID in the SEV ASIDs bitmap.
92 *
93 * Try charging an SEV ASID to the current task's cgroup and all its ancestors
94 * up to the root. If charging is not possible due to the limit constraint,
95 * then notify the event file and return -errorno.
96 *
97 * Context: Process context. Takes and release sev_cgroup_lock mutex.
98 * Return:
99 * * 0 - If successfully charged the cgroup.
100 * * -EINVAL - If pos is not valid.
101 * * -EBUSY - If usage has already reached the limit.
102 */
103 int sev_asid_try_charge(int pos)
104 {
105 struct sev_cgroup *start, *i, *j;
106 int ret = 0;
107
108 mutex_lock(&sev_cgroup_lock);
109
110 start = css_sev(task_css(current, sev_cgrp_id));
111
112 for (i = start; i; i = parent_sev_cgroup(i)) {
113 if (i->usage == i->max)
114 goto e_limit;
115
116 i->usage++;
117 }
118
119 sev_asids_cgroup_array[pos] = start;
120 exit:
121 mutex_unlock(&sev_cgroup_lock);
122 return ret;
123
124 e_limit:
125 for (j = start; j != i; j = parent_sev_cgroup(j))
126 sev_asid_cgroup_dec(j);
127
128 start->allocation_failure_event++;
129 cgroup_file_notify(&start->events_file);
130
131 ret = -EBUSY;
132 goto exit;
133 }
134 EXPORT_SYMBOL(sev_asid_try_charge);
135
136 /**
137 * sev_asid_uncharge() - Uncharge an SEV ASID from the cgroup.
138 * @pos: Index of SEV ASID in the SEV ASIDs bitmap.
139 *
140 * Uncharge an SEV ASID from the cgroup to which it was charged in
141 * sev_asid_try_charge().
142 *
143 * Context: Process context. Takes and release sev_cgroup_lock mutex.
144 */
145 void sev_asid_uncharge(int pos)
146 {
147 struct sev_cgroup *i;
148
149 mutex_lock(&sev_cgroup_lock);
150
151 for (i = sev_asids_cgroup_array[pos]; i; i = parent_sev_cgroup(i))
152 sev_asid_cgroup_dec(i);
153
154 sev_asids_cgroup_array[pos] = NULL;
155
156 mutex_unlock(&sev_cgroup_lock);
157 }
158 EXPORT_SYMBOL(sev_asid_uncharge);
159
160 /**
161 * sev_cgroup_setup() - Setup the sev cgroup before charging.
162 * @max: Maximum number of SEV ASIDs supported by the platform.
163 *
164 * Initialize the sev_asids_cgroup_array which stores ASID to cgroup mapping.
165 *
166 * Context: Process context. Takes and release sev_cgroup_lock mutex.
167 * Return:
168 * * 0 - If setup was successful.
169 * * -ENOMEM - If memory not available to allocate the array.
170 */
171 int sev_cgroup_setup(unsigned int max)
172 {
173 int ret = 0;
174
175 mutex_lock(&sev_cgroup_lock);
176
177 sev_max_asids = max;
178 sev_asids_cgroup_array = kcalloc(sev_max_asids,
179 sizeof(struct sev_cgroup *),
180 GFP_KERNEL);
181 if (!sev_asids_cgroup_array) {
182 sev_max_asids = 0;
183 ret = -ENOMEM;
184 }
185
186 mutex_unlock(&sev_cgroup_lock);
187
188 return ret;
189 }
190 EXPORT_SYMBOL(sev_cgroup_setup);
191
192 /**
193 * sev_cgroup_teardown() - Release resources, no more charging/uncharging will
194 * happen.
195 *
196 * Context: Process context. Takes and release sev_cgroup_lock mutex.
197 */
198 void sev_cgroup_teardown(void)
199 {
200 mutex_lock(&sev_cgroup_lock);
201
202 kfree(sev_asids_cgroup_array);
203 sev_asids_cgroup_array = NULL;
204 sev_max_asids = 0;
205
206 mutex_unlock(&sev_cgroup_lock);
207 }
208 EXPORT_SYMBOL(sev_cgroup_teardown);
209
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org