From: kernel test robot <lkp@intel.com>
To: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Jens Wiklander <jens.wiklander@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Subject: Re: [PATCH v4 1/4] remoteproc: Add TEE support
Date: Sun, 10 Mar 2024 11:18:59 +0800 [thread overview]
Message-ID: <202403101139.NIzJMqwP-lkp@intel.com> (raw)
In-Reply-To: <20240308144708.62362-2-arnaud.pouliquen@foss.st.com>
Hi Arnaud,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 62210f7509e13a2caa7b080722a45229b8f17a0a]
url: https://github.com/intel-lab-lkp/linux/commits/Arnaud-Pouliquen/remoteproc-Add-TEE-support/20240308-225116
base: 62210f7509e13a2caa7b080722a45229b8f17a0a
patch link: https://lore.kernel.org/r/20240308144708.62362-2-arnaud.pouliquen%40foss.st.com
patch subject: [PATCH v4 1/4] remoteproc: Add TEE support
config: arm-randconfig-r123-20240310 (https://download.01.org/0day-ci/archive/20240310/202403101139.NIzJMqwP-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240310/202403101139.NIzJMqwP-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/202403101139.NIzJMqwP-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/tee_remoteproc.c:163:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct resource_table *rsc_table @@ got void [noderef] __iomem * @@
drivers/remoteproc/tee_remoteproc.c:163:19: sparse: expected struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c:163:19: sparse: got void [noderef] __iomem *
>> drivers/remoteproc/tee_remoteproc.c:276:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct resource_table *rsc_table @@
drivers/remoteproc/tee_remoteproc.c:276:23: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/tee_remoteproc.c:276:23: sparse: got struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct resource_table *rsc_table @@
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: got struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c: note: in included file (through arch/arm/include/asm/traps.h, arch/arm/include/asm/thread_info.h, include/linux/thread_info.h, ...):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
vim +163 drivers/remoteproc/tee_remoteproc.c
131
132 struct resource_table *tee_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz)
133 {
134 struct tee_ioctl_invoke_arg arg;
135 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
136 struct tee_rproc *trproc = rproc->tee_interface;
137 struct resource_table *rsc_table;
138 int ret;
139
140 if (!trproc)
141 return ERR_PTR(-EINVAL);
142
143 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_GET_RSC_TABLE, &arg, param, 2);
144
145 param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT;
146 param[2].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT;
147
148 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
149 if (ret < 0 || arg.ret != 0) {
150 dev_err(tee_rproc_ctx->dev,
151 "TA_RPROC_FW_CMD_GET_RSC_TABLE invoke failed TEE err: %x, ret:%x\n",
152 arg.ret, ret);
153 return ERR_PTR(-EIO);
154 }
155
156 *table_sz = param[2].u.value.a;
157
158 /* If the size is null no resource table defined in the image */
159 if (!*table_sz)
160 return NULL;
161
162 /* Store the resource table address that would be updated by the remote core. */
> 163 rsc_table = ioremap_wc(param[1].u.value.a, *table_sz);
164 if (IS_ERR_OR_NULL(rsc_table)) {
165 dev_err(tee_rproc_ctx->dev, "Unable to map memory region: %lld+%zx\n",
166 param[1].u.value.a, *table_sz);
167 return ERR_PTR(-ENOMEM);
168 }
169
170 return rsc_table;
171 }
172 EXPORT_SYMBOL_GPL(tee_rproc_get_loaded_rsc_table);
173
174 int tee_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
175 {
176 struct tee_rproc *trproc = rproc->tee_interface;
177 struct resource_table *rsc_table;
178 size_t table_sz;
179 int ret;
180
181 ret = tee_rproc_load_fw(rproc, fw);
182 if (ret)
183 return ret;
184
185 rsc_table = tee_rproc_get_loaded_rsc_table(rproc, &table_sz);
186 if (IS_ERR(rsc_table))
187 return PTR_ERR(rsc_table);
188
189 /* Create a copy of the resource table to have same behaviour than the elf loader. */
190 rproc->cached_table = kmemdup(rsc_table, table_sz, GFP_KERNEL);
191 if (!rproc->cached_table)
192 return -ENOMEM;
193
194 rproc->table_ptr = rproc->cached_table;
195 rproc->table_sz = table_sz;
196 trproc->rsc_table = rsc_table;
197
198 return 0;
199 }
200 EXPORT_SYMBOL_GPL(tee_rproc_parse_fw);
201
202 struct resource_table *tee_rproc_find_loaded_rsc_table(struct rproc *rproc,
203 const struct firmware *fw)
204 {
205 struct tee_rproc *trproc = rproc->tee_interface;
206 struct resource_table *rsc_table;
207 size_t table_sz;
208
209 if (!trproc)
210 return ERR_PTR(-EINVAL);
211
212 /* Check if the resourse table has already been obtained in tee_rproc_parse_fw() */
213 if (trproc->rsc_table)
214 return trproc->rsc_table;
215
216 rsc_table = tee_rproc_get_loaded_rsc_table(rproc, &table_sz);
217 if (IS_ERR(rsc_table))
218 return rsc_table;
219
220 rproc->table_sz = table_sz;
221 trproc->rsc_table = rsc_table;
222
223 return rsc_table;
224 }
225 EXPORT_SYMBOL_GPL(tee_rproc_find_loaded_rsc_table);
226
227 int tee_rproc_start(struct rproc *rproc)
228 {
229 struct tee_ioctl_invoke_arg arg;
230 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
231 struct tee_rproc *trproc = rproc->tee_interface;
232 int ret;
233
234 if (!trproc)
235 return -EINVAL;
236
237 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_START_FW, &arg, param, 0);
238
239 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
240 if (ret < 0 || arg.ret != 0) {
241 dev_err(tee_rproc_ctx->dev,
242 "TA_RPROC_FW_CMD_START_FW invoke failed TEE err: %x, ret:%x\n",
243 arg.ret, ret);
244 if (!ret)
245 ret = -EIO;
246 }
247
248 return ret;
249 }
250 EXPORT_SYMBOL_GPL(tee_rproc_start);
251
252 int tee_rproc_stop(struct rproc *rproc)
253 {
254 struct tee_ioctl_invoke_arg arg;
255 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
256 struct tee_rproc *trproc = rproc->tee_interface;
257 int ret;
258
259 if (!trproc)
260 return -EINVAL;
261
262 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_STOP_FW, &arg, param, 0);
263
264 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
265 if (ret < 0 || arg.ret != 0) {
266 dev_err(tee_rproc_ctx->dev,
267 "TA_RPROC_FW_CMD_STOP_FW invoke failed TEE err: %x, ret:%x\n",
268 arg.ret, ret);
269 if (!ret)
270 ret = -EIO;
271 }
272
273 if (!rproc->table_ptr)
274 return ret;
275
> 276 iounmap(trproc->rsc_table);
277 trproc->rsc_table = NULL;
278 rproc->table_ptr = NULL;
279
280 return 0;
281 }
282 EXPORT_SYMBOL_GPL(tee_rproc_stop);
283
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: op-tee@lists.trustedfirmware.org
Subject: Re: [PATCH v4 1/4] remoteproc: Add TEE support
Date: Sun, 10 Mar 2024 11:18:59 +0800 [thread overview]
Message-ID: <202403101139.NIzJMqwP-lkp@intel.com> (raw)
In-Reply-To: <20240308144708.62362-2-arnaud.pouliquen@foss.st.com>
[-- Attachment #1: Type: text/plain, Size: 7909 bytes --]
Hi Arnaud,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 62210f7509e13a2caa7b080722a45229b8f17a0a]
url: https://github.com/intel-lab-lkp/linux/commits/Arnaud-Pouliquen/remoteproc-Add-TEE-support/20240308-225116
base: 62210f7509e13a2caa7b080722a45229b8f17a0a
patch link: https://lore.kernel.org/r/20240308144708.62362-2-arnaud.pouliquen%40foss.st.com
patch subject: [PATCH v4 1/4] remoteproc: Add TEE support
config: arm-randconfig-r123-20240310 (https://download.01.org/0day-ci/archive/20240310/202403101139.NIzJMqwP-lkp(a)intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240310/202403101139.NIzJMqwP-lkp(a)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/202403101139.NIzJMqwP-lkp(a)intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/tee_remoteproc.c:163:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct resource_table *rsc_table @@ got void [noderef] __iomem * @@
drivers/remoteproc/tee_remoteproc.c:163:19: sparse: expected struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c:163:19: sparse: got void [noderef] __iomem *
>> drivers/remoteproc/tee_remoteproc.c:276:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct resource_table *rsc_table @@
drivers/remoteproc/tee_remoteproc.c:276:23: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/tee_remoteproc.c:276:23: sparse: got struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct resource_table *rsc_table @@
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: got struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c: note: in included file (through arch/arm/include/asm/traps.h, arch/arm/include/asm/thread_info.h, include/linux/thread_info.h, ...):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
vim +163 drivers/remoteproc/tee_remoteproc.c
131
132 struct resource_table *tee_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz)
133 {
134 struct tee_ioctl_invoke_arg arg;
135 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
136 struct tee_rproc *trproc = rproc->tee_interface;
137 struct resource_table *rsc_table;
138 int ret;
139
140 if (!trproc)
141 return ERR_PTR(-EINVAL);
142
143 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_GET_RSC_TABLE, &arg, param, 2);
144
145 param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT;
146 param[2].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT;
147
148 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
149 if (ret < 0 || arg.ret != 0) {
150 dev_err(tee_rproc_ctx->dev,
151 "TA_RPROC_FW_CMD_GET_RSC_TABLE invoke failed TEE err: %x, ret:%x\n",
152 arg.ret, ret);
153 return ERR_PTR(-EIO);
154 }
155
156 *table_sz = param[2].u.value.a;
157
158 /* If the size is null no resource table defined in the image */
159 if (!*table_sz)
160 return NULL;
161
162 /* Store the resource table address that would be updated by the remote core. */
> 163 rsc_table = ioremap_wc(param[1].u.value.a, *table_sz);
164 if (IS_ERR_OR_NULL(rsc_table)) {
165 dev_err(tee_rproc_ctx->dev, "Unable to map memory region: %lld+%zx\n",
166 param[1].u.value.a, *table_sz);
167 return ERR_PTR(-ENOMEM);
168 }
169
170 return rsc_table;
171 }
172 EXPORT_SYMBOL_GPL(tee_rproc_get_loaded_rsc_table);
173
174 int tee_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
175 {
176 struct tee_rproc *trproc = rproc->tee_interface;
177 struct resource_table *rsc_table;
178 size_t table_sz;
179 int ret;
180
181 ret = tee_rproc_load_fw(rproc, fw);
182 if (ret)
183 return ret;
184
185 rsc_table = tee_rproc_get_loaded_rsc_table(rproc, &table_sz);
186 if (IS_ERR(rsc_table))
187 return PTR_ERR(rsc_table);
188
189 /* Create a copy of the resource table to have same behaviour than the elf loader. */
190 rproc->cached_table = kmemdup(rsc_table, table_sz, GFP_KERNEL);
191 if (!rproc->cached_table)
192 return -ENOMEM;
193
194 rproc->table_ptr = rproc->cached_table;
195 rproc->table_sz = table_sz;
196 trproc->rsc_table = rsc_table;
197
198 return 0;
199 }
200 EXPORT_SYMBOL_GPL(tee_rproc_parse_fw);
201
202 struct resource_table *tee_rproc_find_loaded_rsc_table(struct rproc *rproc,
203 const struct firmware *fw)
204 {
205 struct tee_rproc *trproc = rproc->tee_interface;
206 struct resource_table *rsc_table;
207 size_t table_sz;
208
209 if (!trproc)
210 return ERR_PTR(-EINVAL);
211
212 /* Check if the resourse table has already been obtained in tee_rproc_parse_fw() */
213 if (trproc->rsc_table)
214 return trproc->rsc_table;
215
216 rsc_table = tee_rproc_get_loaded_rsc_table(rproc, &table_sz);
217 if (IS_ERR(rsc_table))
218 return rsc_table;
219
220 rproc->table_sz = table_sz;
221 trproc->rsc_table = rsc_table;
222
223 return rsc_table;
224 }
225 EXPORT_SYMBOL_GPL(tee_rproc_find_loaded_rsc_table);
226
227 int tee_rproc_start(struct rproc *rproc)
228 {
229 struct tee_ioctl_invoke_arg arg;
230 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
231 struct tee_rproc *trproc = rproc->tee_interface;
232 int ret;
233
234 if (!trproc)
235 return -EINVAL;
236
237 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_START_FW, &arg, param, 0);
238
239 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
240 if (ret < 0 || arg.ret != 0) {
241 dev_err(tee_rproc_ctx->dev,
242 "TA_RPROC_FW_CMD_START_FW invoke failed TEE err: %x, ret:%x\n",
243 arg.ret, ret);
244 if (!ret)
245 ret = -EIO;
246 }
247
248 return ret;
249 }
250 EXPORT_SYMBOL_GPL(tee_rproc_start);
251
252 int tee_rproc_stop(struct rproc *rproc)
253 {
254 struct tee_ioctl_invoke_arg arg;
255 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
256 struct tee_rproc *trproc = rproc->tee_interface;
257 int ret;
258
259 if (!trproc)
260 return -EINVAL;
261
262 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_STOP_FW, &arg, param, 0);
263
264 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
265 if (ret < 0 || arg.ret != 0) {
266 dev_err(tee_rproc_ctx->dev,
267 "TA_RPROC_FW_CMD_STOP_FW invoke failed TEE err: %x, ret:%x\n",
268 arg.ret, ret);
269 if (!ret)
270 ret = -EIO;
271 }
272
273 if (!rproc->table_ptr)
274 return ret;
275
> 276 iounmap(trproc->rsc_table);
277 trproc->rsc_table = NULL;
278 rproc->table_ptr = NULL;
279
280 return 0;
281 }
282 EXPORT_SYMBOL_GPL(tee_rproc_stop);
283
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Jens Wiklander <jens.wiklander@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Subject: Re: [PATCH v4 1/4] remoteproc: Add TEE support
Date: Sun, 10 Mar 2024 11:18:59 +0800 [thread overview]
Message-ID: <202403101139.NIzJMqwP-lkp@intel.com> (raw)
In-Reply-To: <20240308144708.62362-2-arnaud.pouliquen@foss.st.com>
Hi Arnaud,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 62210f7509e13a2caa7b080722a45229b8f17a0a]
url: https://github.com/intel-lab-lkp/linux/commits/Arnaud-Pouliquen/remoteproc-Add-TEE-support/20240308-225116
base: 62210f7509e13a2caa7b080722a45229b8f17a0a
patch link: https://lore.kernel.org/r/20240308144708.62362-2-arnaud.pouliquen%40foss.st.com
patch subject: [PATCH v4 1/4] remoteproc: Add TEE support
config: arm-randconfig-r123-20240310 (https://download.01.org/0day-ci/archive/20240310/202403101139.NIzJMqwP-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240310/202403101139.NIzJMqwP-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/202403101139.NIzJMqwP-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/tee_remoteproc.c:163:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct resource_table *rsc_table @@ got void [noderef] __iomem * @@
drivers/remoteproc/tee_remoteproc.c:163:19: sparse: expected struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c:163:19: sparse: got void [noderef] __iomem *
>> drivers/remoteproc/tee_remoteproc.c:276:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct resource_table *rsc_table @@
drivers/remoteproc/tee_remoteproc.c:276:23: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/tee_remoteproc.c:276:23: sparse: got struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct resource_table *rsc_table @@
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/tee_remoteproc.c:399:38: sparse: got struct resource_table *rsc_table
drivers/remoteproc/tee_remoteproc.c: note: in included file (through arch/arm/include/asm/traps.h, arch/arm/include/asm/thread_info.h, include/linux/thread_info.h, ...):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
vim +163 drivers/remoteproc/tee_remoteproc.c
131
132 struct resource_table *tee_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz)
133 {
134 struct tee_ioctl_invoke_arg arg;
135 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
136 struct tee_rproc *trproc = rproc->tee_interface;
137 struct resource_table *rsc_table;
138 int ret;
139
140 if (!trproc)
141 return ERR_PTR(-EINVAL);
142
143 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_GET_RSC_TABLE, &arg, param, 2);
144
145 param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT;
146 param[2].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT;
147
148 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
149 if (ret < 0 || arg.ret != 0) {
150 dev_err(tee_rproc_ctx->dev,
151 "TA_RPROC_FW_CMD_GET_RSC_TABLE invoke failed TEE err: %x, ret:%x\n",
152 arg.ret, ret);
153 return ERR_PTR(-EIO);
154 }
155
156 *table_sz = param[2].u.value.a;
157
158 /* If the size is null no resource table defined in the image */
159 if (!*table_sz)
160 return NULL;
161
162 /* Store the resource table address that would be updated by the remote core. */
> 163 rsc_table = ioremap_wc(param[1].u.value.a, *table_sz);
164 if (IS_ERR_OR_NULL(rsc_table)) {
165 dev_err(tee_rproc_ctx->dev, "Unable to map memory region: %lld+%zx\n",
166 param[1].u.value.a, *table_sz);
167 return ERR_PTR(-ENOMEM);
168 }
169
170 return rsc_table;
171 }
172 EXPORT_SYMBOL_GPL(tee_rproc_get_loaded_rsc_table);
173
174 int tee_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
175 {
176 struct tee_rproc *trproc = rproc->tee_interface;
177 struct resource_table *rsc_table;
178 size_t table_sz;
179 int ret;
180
181 ret = tee_rproc_load_fw(rproc, fw);
182 if (ret)
183 return ret;
184
185 rsc_table = tee_rproc_get_loaded_rsc_table(rproc, &table_sz);
186 if (IS_ERR(rsc_table))
187 return PTR_ERR(rsc_table);
188
189 /* Create a copy of the resource table to have same behaviour than the elf loader. */
190 rproc->cached_table = kmemdup(rsc_table, table_sz, GFP_KERNEL);
191 if (!rproc->cached_table)
192 return -ENOMEM;
193
194 rproc->table_ptr = rproc->cached_table;
195 rproc->table_sz = table_sz;
196 trproc->rsc_table = rsc_table;
197
198 return 0;
199 }
200 EXPORT_SYMBOL_GPL(tee_rproc_parse_fw);
201
202 struct resource_table *tee_rproc_find_loaded_rsc_table(struct rproc *rproc,
203 const struct firmware *fw)
204 {
205 struct tee_rproc *trproc = rproc->tee_interface;
206 struct resource_table *rsc_table;
207 size_t table_sz;
208
209 if (!trproc)
210 return ERR_PTR(-EINVAL);
211
212 /* Check if the resourse table has already been obtained in tee_rproc_parse_fw() */
213 if (trproc->rsc_table)
214 return trproc->rsc_table;
215
216 rsc_table = tee_rproc_get_loaded_rsc_table(rproc, &table_sz);
217 if (IS_ERR(rsc_table))
218 return rsc_table;
219
220 rproc->table_sz = table_sz;
221 trproc->rsc_table = rsc_table;
222
223 return rsc_table;
224 }
225 EXPORT_SYMBOL_GPL(tee_rproc_find_loaded_rsc_table);
226
227 int tee_rproc_start(struct rproc *rproc)
228 {
229 struct tee_ioctl_invoke_arg arg;
230 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
231 struct tee_rproc *trproc = rproc->tee_interface;
232 int ret;
233
234 if (!trproc)
235 return -EINVAL;
236
237 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_START_FW, &arg, param, 0);
238
239 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
240 if (ret < 0 || arg.ret != 0) {
241 dev_err(tee_rproc_ctx->dev,
242 "TA_RPROC_FW_CMD_START_FW invoke failed TEE err: %x, ret:%x\n",
243 arg.ret, ret);
244 if (!ret)
245 ret = -EIO;
246 }
247
248 return ret;
249 }
250 EXPORT_SYMBOL_GPL(tee_rproc_start);
251
252 int tee_rproc_stop(struct rproc *rproc)
253 {
254 struct tee_ioctl_invoke_arg arg;
255 struct tee_param param[MAX_TEE_PARAM_ARRY_MEMBER];
256 struct tee_rproc *trproc = rproc->tee_interface;
257 int ret;
258
259 if (!trproc)
260 return -EINVAL;
261
262 tee_rproc_prepare_args(trproc, TA_RPROC_FW_CMD_STOP_FW, &arg, param, 0);
263
264 ret = tee_client_invoke_func(tee_rproc_ctx->tee_ctx, &arg, param);
265 if (ret < 0 || arg.ret != 0) {
266 dev_err(tee_rproc_ctx->dev,
267 "TA_RPROC_FW_CMD_STOP_FW invoke failed TEE err: %x, ret:%x\n",
268 arg.ret, ret);
269 if (!ret)
270 ret = -EIO;
271 }
272
273 if (!rproc->table_ptr)
274 return ret;
275
> 276 iounmap(trproc->rsc_table);
277 trproc->rsc_table = NULL;
278 rproc->table_ptr = NULL;
279
280 return 0;
281 }
282 EXPORT_SYMBOL_GPL(tee_rproc_stop);
283
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-10 3:19 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 14:47 [PATCH v4 0/4] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
2024-03-08 14:48 ` Arnaud Pouliquen
2024-03-08 14:47 ` Arnaud Pouliquen
2024-03-08 14:47 ` [PATCH v4 1/4] remoteproc: Add TEE support Arnaud Pouliquen
2024-03-08 14:48 ` Arnaud Pouliquen
2024-03-08 14:47 ` Arnaud Pouliquen
2024-03-10 3:18 ` kernel test robot [this message]
2024-03-10 3:18 ` kernel test robot
2024-03-10 3:18 ` kernel test robot
2024-03-25 16:46 ` Mathieu Poirier
2024-03-25 16:46 ` Mathieu Poirier
2024-03-25 16:46 ` Mathieu Poirier
2024-03-26 19:18 ` Arnaud POULIQUEN
2024-03-26 19:19 ` Arnaud POULIQUEN
2024-03-26 19:18 ` Arnaud POULIQUEN
2024-03-27 17:07 ` Mathieu Poirier
2024-03-27 17:07 ` Mathieu Poirier
2024-03-27 17:07 ` Mathieu Poirier
2024-03-29 8:58 ` Arnaud POULIQUEN
2024-03-29 8:59 ` Arnaud POULIQUEN
2024-03-29 8:58 ` Arnaud POULIQUEN
2024-04-01 15:54 ` Mathieu Poirier
2024-04-01 15:54 ` Mathieu Poirier
2024-04-01 15:54 ` Mathieu Poirier
2024-03-08 14:47 ` [PATCH v4 2/4] dt-bindings: remoteproc: Add compatibility for " Arnaud Pouliquen
2024-03-08 14:48 ` Arnaud Pouliquen
2024-03-08 14:47 ` Arnaud Pouliquen
2024-03-08 14:47 ` [PATCH v4 3/4] remoteproc: stm32: Create sub-functions to request shutdown and release Arnaud Pouliquen
2024-03-08 14:48 ` Arnaud Pouliquen
2024-03-08 14:47 ` Arnaud Pouliquen
2024-03-25 16:48 ` Mathieu Poirier
2024-03-25 16:48 ` Mathieu Poirier
2024-03-25 16:48 ` Mathieu Poirier
2024-03-08 14:47 ` [PATCH v4 4/4] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware Arnaud Pouliquen
2024-03-08 14:48 ` Arnaud Pouliquen
2024-03-08 14:47 ` Arnaud Pouliquen
2024-03-25 16:51 ` Mathieu Poirier
2024-03-25 16:51 ` Mathieu Poirier
2024-03-25 16:51 ` Mathieu Poirier
2024-03-26 19:31 ` Arnaud POULIQUEN
2024-03-26 19:32 ` Arnaud POULIQUEN
2024-03-26 19:31 ` Arnaud POULIQUEN
2024-03-27 17:14 ` Mathieu Poirier
2024-03-27 17:14 ` Mathieu Poirier
2024-03-27 17:14 ` Mathieu Poirier
2024-03-29 10:57 ` Arnaud POULIQUEN
2024-03-29 11:00 ` Arnaud POULIQUEN
2024-03-29 10:57 ` Arnaud POULIQUEN
2024-04-01 15:46 ` Mathieu Poirier
2024-04-01 15:46 ` Mathieu Poirier
2024-04-01 15:46 ` Mathieu Poirier
2024-04-03 7:04 ` Arnaud POULIQUEN
2024-04-03 7:05 ` Arnaud POULIQUEN
2024-04-03 7:04 ` Arnaud POULIQUEN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202403101139.NIzJMqwP-lkp@intel.com \
--to=lkp@intel.com \
--cc=andersson@kernel.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jens.wiklander@linaro.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mathieu.poirier@linaro.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=op-tee@lists.trustedfirmware.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.