[freescale-fslc:pr/475 13126/14916] drivers/firmware/imx/s400-api.c:455:3: error: implicit declaration of function '__cpuc_flush_dcache_area'
by kernel test robot
Hi Pankaj,
FYI, the error/warning still remains.
tree: https://github.com/Freescale/linux-fslc pr/475
head: ba04c793cdee9a8f7a2d7641cd652cebfd6a438e
commit: b57b8221587134978fbcd522e87aab6f44fea710 [13126/14916] s4muap arm: fix for compilation issue.
config: riscv-randconfig-r031-20211015 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6069a6a5049497a32a50a49661c2f4169078bdba)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/Freescale/linux-fslc/commit/b57b8221587134978fbcd522e8...
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/475
git checkout b57b8221587134978fbcd522e87aab6f44fea710
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
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/firmware/imx/s400-api.c:245:16: warning: no previous prototype for function 'imx_soc_device_register' [-Wmissing-prototypes]
struct device *imx_soc_device_register(void)
^
drivers/firmware/imx/s400-api.c:245:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct device *imx_soc_device_register(void)
^
static
>> drivers/firmware/imx/s400-api.c:455:3: error: implicit declaration of function '__cpuc_flush_dcache_area' [-Werror,-Wimplicit-function-declaration]
__cpuc_flush_dcache_area((void *) s, e);
^
1 warning and 1 error generated.
vim +/__cpuc_flush_dcache_area +455 drivers/firmware/imx/s400-api.c
338
339 static int s4_muap_ioctl_get_info(struct s4_mu_device_ctx *dev_ctx,
340 unsigned long arg)
341 {
342 struct imx_s400_api *s400_muap_priv = dev_ctx->s400_muap_priv;
343 struct s4_read_info info;
344
345 int ret = -EINVAL;
346
347 ret = (int)copy_from_user(&info, (u8 *)arg,
348 sizeof(info));
349 if (ret) {
350 devctx_err(dev_ctx, "Fail copy shared memory config to user\n");
351 ret = -EFAULT;
352 goto exit;
353 }
354
355 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
356 (info.cmd_id << 16) |
357 (info.size << 8) |
358 S400_VERSION;
359
360 ret = imx_s400_api_call(s400_muap_priv, (void *) &info.resp);
361 if (ret) {
362 devctx_err(dev_ctx, "%s: imx_s400_api_call failed for cmd [0x%x]\n",
363 __func__, info.cmd_id);
364 ret = -EIO;
365 }
366
367 ret = (int)copy_to_user((u8 *)arg, &info,
368 sizeof(info));
369 if (ret) {
370 devctx_err(dev_ctx, "Failed to copy iobuff setup to user\n");
371 ret = -EFAULT;
372 }
373
374 exit:
375 return ret;
376 }
377 static int s4_muap_ioctl_img_auth_cmd_handler(struct s4_mu_device_ctx *dev_ctx,
378 unsigned long arg)
379 {
380 struct imx_s400_api *s400_muap_priv = dev_ctx->s400_muap_priv;
381 struct s4_muap_auth_image s4_muap_auth_image;
382 struct container_hdr *phdr = &s4_muap_auth_image.chdr;
383 struct image_info *img = &s4_muap_auth_image.img_info[0];
384 unsigned long base_addr = (unsigned long) &s4_muap_auth_image;
385
386 int i;
387 u16 length;
388 unsigned long s, e;
389 int ret = -EINVAL;
390
391 /* Check if not already configured. */
392 if (dev_ctx->secure_mem.dma_addr != 0u) {
393 devctx_err(dev_ctx, "Shared memory not configured\n");
394 goto exit;
395 }
396
397 ret = (int)copy_from_user(&s4_muap_auth_image, (u8 *)arg,
398 sizeof(s4_muap_auth_image));
399 if (ret) {
400 devctx_err(dev_ctx, "Fail copy shared memory config to user\n");
401 ret = -EFAULT;
402 goto exit;
403 }
404
405
406 if (!IS_ALIGNED(base_addr, 4)) {
407 devctx_err(dev_ctx, "Error: Image's address is not 4 byte aligned\n");
408 return -EINVAL;
409 }
410
411 if (phdr->tag != 0x87 && phdr->version != 0x0) {
412 devctx_err(dev_ctx, "Error: Wrong container header\n");
413 return -EFAULT;
414 }
415
416 if (!phdr->num_images) {
417 devctx_err(dev_ctx, "Error: Wrong container, no image found\n");
418 return -EFAULT;
419 }
420 length = phdr->length_lsb + (phdr->length_msb << 8);
421
422 devctx_dbg(dev_ctx, "container length %u\n", length);
423
424 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
425 (S400_OEM_CNTN_AUTH_REQ << 16) |
426 (S400_OEM_CNTN_AUTH_REQ_SIZE << 8) |
427 S400_VERSION;
428 s400_muap_priv->tx_msg.data[0] = ((u32)(((base_addr) >> 16) >> 16));
429 s400_muap_priv->tx_msg.data[1] = ((u32)(base_addr));
430
431 ret = imx_s400_api_call(s400_muap_priv, (void *) &s4_muap_auth_image.resp);
432 if (ret || (s4_muap_auth_image.resp != S400_SUCCESS_IND)) {
433 devctx_err(dev_ctx, "Error: Container Authentication failed.\n");
434 ret = -EIO;
435 goto exit;
436 }
437
438 /* Copy images to dest address */
439 for (i = 0; i < phdr->num_images; i++) {
440 img = img + i;
441
442 //devctx_dbg(dev_ctx, "img %d, dst 0x%x, src 0x%lux, size 0x%x\n",
443 // i, (u32) img->dst,
444 // (unsigned long)img->offset + phdr, img->size);
445
446 memcpy((void *)img->dst, (const void *)(img->offset + phdr),
447 img->size);
448
449 s = img->dst & ~(CACHELINE_SIZE - 1);
450 e = ALIGN(img->dst + img->size, CACHELINE_SIZE) - 1;
451
452 #ifdef CONFIG_ARM64
453 __flush_dcache_area((void *) s, e);
454 #else
> 455 __cpuc_flush_dcache_area((void *) s, e);
456 #endif
457 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
458 (S400_VERIFY_IMAGE_REQ << 16) |
459 (S400_VERIFY_IMAGE_REQ_SIZE << 8) |
460 S400_VERSION;
461 s400_muap_priv->tx_msg.data[0] = 1 << i;
462 ret = imx_s400_api_call(s400_muap_priv, (void *) &s4_muap_auth_image.resp);
463 if (ret || (s4_muap_auth_image.resp != S400_SUCCESS_IND)) {
464 devctx_err(dev_ctx, "Error: Image Verification failed.\n");
465 ret = -EIO;
466 goto exit;
467 }
468 }
469
470 exit:
471 s400_muap_priv->tx_msg.header = (s400_muap_priv->cmd_tag << 24) |
472 (S400_RELEASE_CONTAINER_REQ << 16) |
473 (S400_RELEASE_CONTAINER_REQ_SIZE << 8) |
474 S400_VERSION;
475 ret = imx_s400_api_call(s400_muap_priv, (void *) &s4_muap_auth_image.resp);
476 if (ret || (s4_muap_auth_image.resp != S400_SUCCESS_IND)) {
477 devctx_err(dev_ctx, "Error: Release Container failed.\n");
478 ret = -EIO;
479 }
480
481 ret = (int)copy_to_user((u8 *)arg, &s4_muap_auth_image,
482 sizeof(s4_muap_auth_image));
483 if (ret) {
484 devctx_err(dev_ctx, "Failed to copy iobuff setup to user\n");
485 ret = -EFAULT;
486 }
487 return ret;
488 }
489
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH v3 6/6] i915/display/dp: send a more fine-grained link-status uevent
by kernel test robot
Hi Simon,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on f6632721cd6231e1bf28b5317dcc7543e43359f7]
url: https://github.com/0day-ci/linux/commits/Simon-Ser/drm-add-per-connector-...
base: f6632721cd6231e1bf28b5317dcc7543e43359f7
config: x86_64-randconfig-a006-20211015 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
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/fb2b373f5b3b0f1e37e56270bf7aa0e63...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Simon-Ser/drm-add-per-connector-hotplug-events/20211016-003611
git checkout fb2b373f5b3b0f1e37e56270bf7aa0e6332f880d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 errors (new ones prefixed by >>):
>> drivers/gpu/drm/i915/display/intel_dp.c:5267:2: error: implicit declaration of function 'drm_sysfs_connector_status_event' [-Werror,-Wimplicit-function-declaration]
drm_sysfs_connector_status_event(connector,
^
drivers/gpu/drm/i915/display/intel_dp.c:5267:2: note: did you mean 'drm_get_connector_status_name'?
include/drm/drm_connector.h:1729:13: note: 'drm_get_connector_status_name' declared here
const char *drm_get_connector_status_name(enum drm_connector_status status);
^
1 error generated.
vim +/drm_sysfs_connector_status_event +5267 drivers/gpu/drm/i915/display/intel_dp.c
5245
5246 static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
5247 {
5248 struct intel_connector *intel_connector;
5249 struct drm_connector *connector;
5250
5251 intel_connector = container_of(work, typeof(*intel_connector),
5252 modeset_retry_work);
5253 connector = &intel_connector->base;
5254 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
5255 connector->name);
5256
5257 /* Grab the locks before changing connector property*/
5258 mutex_lock(&connector->dev->mode_config.mutex);
5259 /* Set connector link status to BAD and send a Uevent to notify
5260 * userspace to do a modeset.
5261 */
5262 drm_connector_set_link_status_property(connector,
5263 DRM_MODE_LINK_STATUS_BAD);
5264 mutex_unlock(&connector->dev->mode_config.mutex);
5265 /* Send Hotplug uevent so userspace can reprobe */
5266 drm_kms_helper_hotplug_event(connector->dev);
> 5267 drm_sysfs_connector_status_event(connector,
5268 connector->dev->mode_config.link_status_property);
5269 }
5270
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[jimc:dd-drm-next 14/16] lib/dynamic_debug.c:440:3: error: too few arguments to function call, at least argument 'fmt' must be specified
by kernel test robot
tree: https://github.com/jimc/linux.git dd-drm-next
head: 713c9b94da96f63ca998790458e91ac311104609
commit: 8ddaf3cb5e140ad3788e5d6046a3da90780db690 [14/16] dyndbg: add print-to-tracefs, selftest with it - RFC
config: arm64-randconfig-r024-20211016 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/jimc/linux/commit/8ddaf3cb5e140ad3788e5d6046a3da90780d...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dd-drm-next
git checkout 8ddaf3cb5e140ad3788e5d6046a3da90780db690
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash
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 >>):
>> lib/dynamic_debug.c:440:3: error: too few arguments to function call, at least argument 'fmt' must be specified
WARN_ONCE("cannot enable T, CONFIG_TRACE=n\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/bug.h:150:29: note: expanded from macro 'WARN_ONCE'
DO_ONCE_LITE_IF(condition, WARN, 1, format)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
include/linux/once_lite.h:19:4: note: expanded from macro 'DO_ONCE_LITE_IF'
func(__VA_ARGS__); \
^~~~~~~~~~~~~~~~~
include/asm-generic/bug.h:132:3: note: expanded from macro 'WARN'
__WARN_printf(TAINT_WARN, format); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/bug.h:99:20: note: expanded from macro '__WARN_printf'
__warn_printk(arg); \
~~~~~~~~~~~~~ ^
include/asm-generic/bug.h:95:28: note: '__warn_printk' declared here
extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
^
lib/dynamic_debug.c:716:3: error: expected ')'
return __dynamic_emit_prefix(desc, buf);
^
lib/dynamic_debug.c:714:5: note: to match this '('
if (unlikely((dyndbg_site_is_enabled(desc)) &&
^
lib/dynamic_debug.c:739:3: error: implicit declaration of function 'trace_array_printk' [-Werror,-Wimplicit-function-declaration]
trace_array_printk(trace_arr, _THIS_IP_, "%s%pV", buf, &vaf);
^
lib/dynamic_debug.c:739:3: note: did you mean 'trace_printk'?
include/linux/kernel.h:467:5: note: 'trace_printk' declared here
int trace_printk(const char *fmt, ...)
^
lib/dynamic_debug.c:766:3: error: implicit declaration of function 'trace_array_printk' [-Werror,-Wimplicit-function-declaration]
trace_array_printk(trace_arr, _THIS_IP_, "%s%pV", buf, &vaf);
^
4 errors generated.
vim +/fmt +440 lib/dynamic_debug.c
435
436 static int ddebug_validate_flags(struct flag_settings *modifiers)
437 {
438 #if !defined(CONFIG_TRACING)
439 if (dyndbg_site_is_tracing(modifiers)) {
> 440 WARN_ONCE("cannot enable T, CONFIG_TRACE=n\n");
441 return -EINVAL;
442 }
443 #endif
444 return 0;
445 }
446 /*
447 * Parse `str' as a flags specification, format [-+=][p]+.
448 * Sets up *maskp and *flagsp to be used when changing the
449 * flags fields of matched _ddebug's. Returns 0 on success
450 * or <0 on error.
451 */
452 static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers)
453 {
454 int op, i;
455
456 switch (*str) {
457 case '+':
458 case '-':
459 case '=':
460 op = *str++;
461 break;
462 default:
463 pr_err("bad flag-op %c, at start of %s\n", *str, str);
464 return -EINVAL;
465 }
466 v3pr_info("op=<%c>\n", op);
467
468 for (; *str ; ++str) {
469 for (i = ARRAY_SIZE(opt_array) - 1; i >= 0; i--) {
470 if (*str == opt_array[i].opt_char) {
471 modifiers->flags |= opt_array[i].flag;
472 break;
473 }
474 }
475 if (i < 0) {
476 pr_err("unknown flag '%c'\n", *str);
477 return -EINVAL;
478 }
479 }
480 v3pr_info("flags=0x%x\n", modifiers->flags);
481
482 /* calculate final flags, mask based upon op */
483 switch (op) {
484 case '=':
485 /* modifiers->flags already set */
486 modifiers->mask = 0;
487 break;
488 case '+':
489 modifiers->mask = ~0U;
490 break;
491 case '-':
492 modifiers->mask = ~modifiers->flags;
493 modifiers->flags = 0;
494 break;
495 }
496 v3pr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask);
497
498 return ddebug_validate_flags(modifiers);
499 }
500
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[vgupta-arc:topic-zol-remove 112/188] mm/memory.c:773:1: error: no previous prototype for function 'copy_nonpresent_pte'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git topic-zol-remove
head: 5d273f5d5109b942d3be84a4db0ffe05feb901d4
commit: b55091ec6890b580d5ca97add1bb56b5502e67df [112/188] xxx: dbg: uninline copy_p*_range() functions
config: riscv-buildonly-randconfig-r005-20211016 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git/commit/?id...
git remote add vgupta-arc https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git
git fetch --no-tags vgupta-arc topic-zol-remove
git checkout b55091ec6890b580d5ca97add1bb56b5502e67df
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
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 >>):
>> mm/memory.c:773:1: error: no previous prototype for function 'copy_nonpresent_pte' [-Werror,-Wmissing-prototypes]
copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
^
mm/memory.c:772:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline unsigned long
^
static
>> mm/memory.c:1005:1: error: no previous prototype for function 'copy_pte_range' [-Werror,-Wmissing-prototypes]
copy_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1004:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
>> mm/memory.c:1129:1: error: no previous prototype for function 'copy_pmd_range' [-Werror,-Wmissing-prototypes]
copy_pmd_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1128:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
>> mm/memory.c:1166:1: error: no previous prototype for function 'copy_pud_range' [-Werror,-Wmissing-prototypes]
copy_pud_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1165:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
>> mm/memory.c:1203:1: error: no previous prototype for function 'copy_p4d_range' [-Werror,-Wmissing-prototypes]
copy_p4d_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1202:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
mm/memory.c:3717:21: error: no previous prototype for function 'do_anonymous_page' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
^
mm/memory.c:3717:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
^
static
mm/memory.c:3833:21: error: no previous prototype for function '__do_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t __do_fault(struct vm_fault *vmf)
^
mm/memory.c:3833:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t __do_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4157:21: error: no previous prototype for function 'do_read_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_read_fault(struct vm_fault *vmf)
^
mm/memory.c:4157:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_read_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4186:21: error: no previous prototype for function 'do_cow_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_cow_fault(struct vm_fault *vmf)
^
mm/memory.c:4186:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_cow_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4224:21: error: no previous prototype for function 'do_shared_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_shared_fault(struct vm_fault *vmf)
^
mm/memory.c:4224:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_shared_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4267:21: error: no previous prototype for function 'do_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_fault(struct vm_fault *vmf)
^
mm/memory.c:4267:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4506:21: error: no previous prototype for function 'handle_pte_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t handle_pte_fault(struct vm_fault *vmf)
^
mm/memory.c:4506:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t handle_pte_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4610:21: error: no previous prototype for function '__handle_mm_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
^
mm/memory.c:4610:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
^
static
13 errors generated.
vim +/copy_nonpresent_pte +773 mm/memory.c
b756a3b5e7ead8 Alistair Popple 2021-06-30 765
^1da177e4c3f41 Linus Torvalds 2005-04-16 766 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 767 * copy one vm_area from one task to the other. Assumes the page tables
^1da177e4c3f41 Linus Torvalds 2005-04-16 768 * already present in the new task to be cleared in the whole range
^1da177e4c3f41 Linus Torvalds 2005-04-16 769 * covered by this vma.
^1da177e4c3f41 Linus Torvalds 2005-04-16 770 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 771
b55091ec6890b5 Vineet Gupta 2020-12-17 772 noinline unsigned long
df3a57d1f6072d Linus Torvalds 2020-09-23 @773 copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
8f34f1eac3820f Peter Xu 2021-06-30 774 pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *dst_vma,
8f34f1eac3820f Peter Xu 2021-06-30 775 struct vm_area_struct *src_vma, unsigned long addr, int *rss)
^1da177e4c3f41 Linus Torvalds 2005-04-16 776 {
8f34f1eac3820f Peter Xu 2021-06-30 777 unsigned long vm_flags = dst_vma->vm_flags;
^1da177e4c3f41 Linus Torvalds 2005-04-16 778 pte_t pte = *src_pte;
^1da177e4c3f41 Linus Torvalds 2005-04-16 779 struct page *page;
0697212a411c1d Christoph Lameter 2006-06-23 780 swp_entry_t entry = pte_to_swp_entry(pte);
0697212a411c1d Christoph Lameter 2006-06-23 781
2022b4d18a491a Hugh Dickins 2014-12-02 782 if (likely(!non_swap_entry(entry))) {
570a335b8e2257 Hugh Dickins 2009-12-14 783 if (swap_duplicate(entry) < 0)
9a5cc85c407402 Alistair Popple 2021-06-30 784 return -EIO;
570a335b8e2257 Hugh Dickins 2009-12-14 785
^1da177e4c3f41 Linus Torvalds 2005-04-16 786 /* make sure dst_mm is on swapoff's mmlist. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 787 if (unlikely(list_empty(&dst_mm->mmlist))) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 788 spin_lock(&mmlist_lock);
f412ac08c9861b Hugh Dickins 2005-10-29 789 if (list_empty(&dst_mm->mmlist))
f412ac08c9861b Hugh Dickins 2005-10-29 790 list_add(&dst_mm->mmlist,
f412ac08c9861b Hugh Dickins 2005-10-29 791 &src_mm->mmlist);
^1da177e4c3f41 Linus Torvalds 2005-04-16 792 spin_unlock(&mmlist_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 793 }
b084d4353ff99d KAMEZAWA Hiroyuki 2010-03-05 794 rss[MM_SWAPENTS]++;
2022b4d18a491a Hugh Dickins 2014-12-02 795 } else if (is_migration_entry(entry)) {
af5cdaf82238fb Alistair Popple 2021-06-30 796 page = pfn_swap_entry_to_page(entry);
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 797
eca56ff906bdd0 Jerome Marchand 2016-01-14 798 rss[mm_counter(page)]++;
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 799
4dd845b5a3e57a Alistair Popple 2021-06-30 800 if (is_writable_migration_entry(entry) &&
0697212a411c1d Christoph Lameter 2006-06-23 801 is_cow_mapping(vm_flags)) {
0697212a411c1d Christoph Lameter 2006-06-23 802 /*
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 803 * COW mappings require pages in both
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 804 * parent and child to be set to read.
0697212a411c1d Christoph Lameter 2006-06-23 805 */
4dd845b5a3e57a Alistair Popple 2021-06-30 806 entry = make_readable_migration_entry(
4dd845b5a3e57a Alistair Popple 2021-06-30 807 swp_offset(entry));
0697212a411c1d Christoph Lameter 2006-06-23 808 pte = swp_entry_to_pte(entry);
c3d16e16522fe3 Cyrill Gorcunov 2013-10-16 809 if (pte_swp_soft_dirty(*src_pte))
c3d16e16522fe3 Cyrill Gorcunov 2013-10-16 810 pte = pte_swp_mksoft_dirty(pte);
f45ec5ff16a75f Peter Xu 2020-04-06 811 if (pte_swp_uffd_wp(*src_pte))
f45ec5ff16a75f Peter Xu 2020-04-06 812 pte = pte_swp_mkuffd_wp(pte);
0697212a411c1d Christoph Lameter 2006-06-23 813 set_pte_at(src_mm, addr, src_pte, pte);
0697212a411c1d Christoph Lameter 2006-06-23 814 }
5042db43cc26f5 Jérôme Glisse 2017-09-08 815 } else if (is_device_private_entry(entry)) {
af5cdaf82238fb Alistair Popple 2021-06-30 816 page = pfn_swap_entry_to_page(entry);
5042db43cc26f5 Jérôme Glisse 2017-09-08 817
5042db43cc26f5 Jérôme Glisse 2017-09-08 818 /*
5042db43cc26f5 Jérôme Glisse 2017-09-08 819 * Update rss count even for unaddressable pages, as
5042db43cc26f5 Jérôme Glisse 2017-09-08 820 * they should treated just like normal pages in this
5042db43cc26f5 Jérôme Glisse 2017-09-08 821 * respect.
5042db43cc26f5 Jérôme Glisse 2017-09-08 822 *
5042db43cc26f5 Jérôme Glisse 2017-09-08 823 * We will likely want to have some new rss counters
5042db43cc26f5 Jérôme Glisse 2017-09-08 824 * for unaddressable pages, at some point. But for now
5042db43cc26f5 Jérôme Glisse 2017-09-08 825 * keep things as they are.
5042db43cc26f5 Jérôme Glisse 2017-09-08 826 */
5042db43cc26f5 Jérôme Glisse 2017-09-08 827 get_page(page);
5042db43cc26f5 Jérôme Glisse 2017-09-08 828 rss[mm_counter(page)]++;
5042db43cc26f5 Jérôme Glisse 2017-09-08 829 page_dup_rmap(page, false);
5042db43cc26f5 Jérôme Glisse 2017-09-08 830
5042db43cc26f5 Jérôme Glisse 2017-09-08 831 /*
5042db43cc26f5 Jérôme Glisse 2017-09-08 832 * We do not preserve soft-dirty information, because so
5042db43cc26f5 Jérôme Glisse 2017-09-08 833 * far, checkpoint/restore is the only feature that
5042db43cc26f5 Jérôme Glisse 2017-09-08 834 * requires that. And checkpoint/restore does not work
5042db43cc26f5 Jérôme Glisse 2017-09-08 835 * when a device driver is involved (you cannot easily
5042db43cc26f5 Jérôme Glisse 2017-09-08 836 * save and restore device driver state).
5042db43cc26f5 Jérôme Glisse 2017-09-08 837 */
4dd845b5a3e57a Alistair Popple 2021-06-30 838 if (is_writable_device_private_entry(entry) &&
5042db43cc26f5 Jérôme Glisse 2017-09-08 839 is_cow_mapping(vm_flags)) {
4dd845b5a3e57a Alistair Popple 2021-06-30 840 entry = make_readable_device_private_entry(
4dd845b5a3e57a Alistair Popple 2021-06-30 841 swp_offset(entry));
5042db43cc26f5 Jérôme Glisse 2017-09-08 842 pte = swp_entry_to_pte(entry);
f45ec5ff16a75f Peter Xu 2020-04-06 843 if (pte_swp_uffd_wp(*src_pte))
f45ec5ff16a75f Peter Xu 2020-04-06 844 pte = pte_swp_mkuffd_wp(pte);
5042db43cc26f5 Jérôme Glisse 2017-09-08 845 set_pte_at(src_mm, addr, src_pte, pte);
5042db43cc26f5 Jérôme Glisse 2017-09-08 846 }
b756a3b5e7ead8 Alistair Popple 2021-06-30 847 } else if (is_device_exclusive_entry(entry)) {
b756a3b5e7ead8 Alistair Popple 2021-06-30 848 /*
b756a3b5e7ead8 Alistair Popple 2021-06-30 849 * Make device exclusive entries present by restoring the
b756a3b5e7ead8 Alistair Popple 2021-06-30 850 * original entry then copying as for a present pte. Device
b756a3b5e7ead8 Alistair Popple 2021-06-30 851 * exclusive entries currently only support private writable
b756a3b5e7ead8 Alistair Popple 2021-06-30 852 * (ie. COW) mappings.
b756a3b5e7ead8 Alistair Popple 2021-06-30 853 */
b756a3b5e7ead8 Alistair Popple 2021-06-30 854 VM_BUG_ON(!is_cow_mapping(src_vma->vm_flags));
b756a3b5e7ead8 Alistair Popple 2021-06-30 855 if (try_restore_exclusive_pte(src_pte, src_vma, addr))
b756a3b5e7ead8 Alistair Popple 2021-06-30 856 return -EBUSY;
b756a3b5e7ead8 Alistair Popple 2021-06-30 857 return -ENOENT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 858 }
8f34f1eac3820f Peter Xu 2021-06-30 859 if (!userfaultfd_wp(dst_vma))
8f34f1eac3820f Peter Xu 2021-06-30 860 pte = pte_swp_clear_uffd_wp(pte);
df3a57d1f6072d Linus Torvalds 2020-09-23 861 set_pte_at(dst_mm, addr, dst_pte, pte);
df3a57d1f6072d Linus Torvalds 2020-09-23 862 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 863 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 864
:::::: The code at line 773 was first introduced by commit
:::::: df3a57d1f6072d07978bafa7dbd9904cdf8f3e13 mm: split out the non-present case from copy_one_pte()
:::::: TO: Linus Torvalds <torvalds(a)linux-foundation.org>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[vgupta-arc:topic-zol-remove 79/188] mm/memory.c:3717:21: warning: no previous prototype for function 'do_anonymous_page'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git topic-zol-remove
head: 5d273f5d5109b942d3be84a4db0ffe05feb901d4
commit: 94f784d9992cf0c171122f44767c549fa4f353cb [79/188] xxx: disable address space randomization, fault around
config: hexagon-randconfig-r041-20211015 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
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/vgupta/arc.git/commit/?id...
git remote add vgupta-arc https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git
git fetch --no-tags vgupta-arc topic-zol-remove
git checkout 94f784d9992cf0c171122f44767c549fa4f353cb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
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 >>):
>> mm/memory.c:3717:21: warning: no previous prototype for function 'do_anonymous_page' [-Wmissing-prototypes]
noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
^
mm/memory.c:3717:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
^
static
>> mm/memory.c:3833:21: warning: no previous prototype for function '__do_fault' [-Wmissing-prototypes]
noinline vm_fault_t __do_fault(struct vm_fault *vmf)
^
mm/memory.c:3833:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t __do_fault(struct vm_fault *vmf)
^
static
>> mm/memory.c:4157:21: warning: no previous prototype for function 'do_read_fault' [-Wmissing-prototypes]
noinline vm_fault_t do_read_fault(struct vm_fault *vmf)
^
mm/memory.c:4157:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_read_fault(struct vm_fault *vmf)
^
static
>> mm/memory.c:4186:21: warning: no previous prototype for function 'do_cow_fault' [-Wmissing-prototypes]
noinline vm_fault_t do_cow_fault(struct vm_fault *vmf)
^
mm/memory.c:4186:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_cow_fault(struct vm_fault *vmf)
^
static
>> mm/memory.c:4224:21: warning: no previous prototype for function 'do_shared_fault' [-Wmissing-prototypes]
noinline vm_fault_t do_shared_fault(struct vm_fault *vmf)
^
mm/memory.c:4224:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_shared_fault(struct vm_fault *vmf)
^
static
>> mm/memory.c:4267:21: warning: no previous prototype for function 'do_fault' [-Wmissing-prototypes]
noinline vm_fault_t do_fault(struct vm_fault *vmf)
^
mm/memory.c:4267:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_fault(struct vm_fault *vmf)
^
static
>> mm/memory.c:4506:21: warning: no previous prototype for function 'handle_pte_fault' [-Wmissing-prototypes]
noinline vm_fault_t handle_pte_fault(struct vm_fault *vmf)
^
mm/memory.c:4506:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t handle_pte_fault(struct vm_fault *vmf)
^
static
>> mm/memory.c:4610:21: warning: no previous prototype for function '__handle_mm_fault' [-Wmissing-prototypes]
noinline vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
^
mm/memory.c:4610:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
^
static
8 warnings generated.
vim +/do_anonymous_page +3717 mm/memory.c
3711
3712 /*
3713 * We enter with non-exclusive mmap_lock (to exclude vma changes,
3714 * but allow concurrent faults), and pte mapped but not yet locked.
3715 * We return with mmap_lock still held, but pte unmapped and unlocked.
3716 */
> 3717 noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
3718 {
3719 struct vm_area_struct *vma = vmf->vma;
3720 struct page *page;
3721 vm_fault_t ret = 0;
3722 pte_t entry;
3723
3724 /* File mapping without ->vm_ops ? */
3725 if (vma->vm_flags & VM_SHARED)
3726 return VM_FAULT_SIGBUS;
3727
3728 /*
3729 * Use pte_alloc() instead of pte_alloc_map(). We can't run
3730 * pte_offset_map() on pmds where a huge pmd might be created
3731 * from a different thread.
3732 *
3733 * pte_alloc_map() is safe to use under mmap_write_lock(mm) or when
3734 * parallel threads are excluded by other means.
3735 *
3736 * Here we only have mmap_read_lock(mm).
3737 */
3738 if (pte_alloc(vma->vm_mm, vmf->pmd))
3739 return VM_FAULT_OOM;
3740
3741 /* See comment in handle_pte_fault() */
3742 if (unlikely(pmd_trans_unstable(vmf->pmd)))
3743 return 0;
3744
3745 /* Use the zero-page for reads */
3746 if (!(vmf->flags & FAULT_FLAG_WRITE) &&
3747 !mm_forbids_zeropage(vma->vm_mm)) {
3748 entry = pte_mkspecial(pfn_pte(my_zero_pfn(vmf->address),
3749 vma->vm_page_prot));
3750 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,
3751 vmf->address, &vmf->ptl);
3752 if (!pte_none(*vmf->pte)) {
3753 update_mmu_tlb(vma, vmf->address, vmf->pte);
3754 goto unlock;
3755 }
3756 ret = check_stable_address_space(vma->vm_mm);
3757 if (ret)
3758 goto unlock;
3759 /* Deliver the page fault to userland, check inside PT lock */
3760 if (userfaultfd_missing(vma)) {
3761 pte_unmap_unlock(vmf->pte, vmf->ptl);
3762 return handle_userfault(vmf, VM_UFFD_MISSING);
3763 }
3764 goto setpte;
3765 }
3766
3767 /* Allocate our own private page. */
3768 if (unlikely(anon_vma_prepare(vma)))
3769 goto oom;
3770 page = alloc_zeroed_user_highpage_movable(vma, vmf->address);
3771 if (!page)
3772 goto oom;
3773
3774 if (mem_cgroup_charge(page, vma->vm_mm, GFP_KERNEL))
3775 goto oom_free_page;
3776 cgroup_throttle_swaprate(page, GFP_KERNEL);
3777
3778 /*
3779 * The memory barrier inside __SetPageUptodate makes sure that
3780 * preceding stores to the page contents become visible before
3781 * the set_pte_at() write.
3782 */
3783 __SetPageUptodate(page);
3784
3785 entry = mk_pte(page, vma->vm_page_prot);
3786 entry = pte_sw_mkyoung(entry);
3787 if (vma->vm_flags & VM_WRITE)
3788 entry = pte_mkwrite(pte_mkdirty(entry));
3789
3790 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address,
3791 &vmf->ptl);
3792 if (!pte_none(*vmf->pte)) {
3793 update_mmu_cache(vma, vmf->address, vmf->pte);
3794 goto release;
3795 }
3796
3797 ret = check_stable_address_space(vma->vm_mm);
3798 if (ret)
3799 goto release;
3800
3801 /* Deliver the page fault to userland, check inside PT lock */
3802 if (userfaultfd_missing(vma)) {
3803 pte_unmap_unlock(vmf->pte, vmf->ptl);
3804 put_page(page);
3805 return handle_userfault(vmf, VM_UFFD_MISSING);
3806 }
3807
3808 inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES);
3809 page_add_new_anon_rmap(page, vma, vmf->address, false);
3810 lru_cache_add_inactive_or_unevictable(page, vma);
3811 setpte:
3812 set_pte_at(vma->vm_mm, vmf->address, vmf->pte, entry);
3813
3814 /* No need to invalidate - it was non-present before */
3815 update_mmu_cache(vma, vmf->address, vmf->pte);
3816 unlock:
3817 pte_unmap_unlock(vmf->pte, vmf->ptl);
3818 return ret;
3819 release:
3820 put_page(page);
3821 goto unlock;
3822 oom_free_page:
3823 put_page(page);
3824 oom:
3825 return VM_FAULT_OOM;
3826 }
3827
3828 /*
3829 * The mmap_lock must have been held on entry, and may have been
3830 * released depending on flags and vma->vm_ops->fault() return value.
3831 * See filemap_fault() and __lock_page_retry().
3832 */
> 3833 noinline vm_fault_t __do_fault(struct vm_fault *vmf)
3834 {
3835 struct vm_area_struct *vma = vmf->vma;
3836 vm_fault_t ret;
3837
3838 /*
3839 * Preallocate pte before we take page_lock because this might lead to
3840 * deadlocks for memcg reclaim which waits for pages under writeback:
3841 * lock_page(A)
3842 * SetPageWriteback(A)
3843 * unlock_page(A)
3844 * lock_page(B)
3845 * lock_page(B)
3846 * pte_alloc_one
3847 * shrink_page_list
3848 * wait_on_page_writeback(A)
3849 * SetPageWriteback(B)
3850 * unlock_page(B)
3851 * # flush A, B to clear the writeback
3852 */
3853 if (pmd_none(*vmf->pmd) && !vmf->prealloc_pte) {
3854 vmf->prealloc_pte = pte_alloc_one(vma->vm_mm);
3855 if (!vmf->prealloc_pte)
3856 return VM_FAULT_OOM;
3857 smp_wmb(); /* See comment in __pte_alloc() */
3858 }
3859
3860 ret = vma->vm_ops->fault(vmf);
3861 if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY |
3862 VM_FAULT_DONE_COW)))
3863 return ret;
3864
3865 if (unlikely(PageHWPoison(vmf->page))) {
3866 if (ret & VM_FAULT_LOCKED)
3867 unlock_page(vmf->page);
3868 put_page(vmf->page);
3869 vmf->page = NULL;
3870 return VM_FAULT_HWPOISON;
3871 }
3872
3873 if (unlikely(!(ret & VM_FAULT_LOCKED)))
3874 lock_page(vmf->page);
3875 else
3876 VM_BUG_ON_PAGE(!PageLocked(vmf->page), vmf->page);
3877
3878 return ret;
3879 }
3880
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH 08/10] ARM: kprobes: Make a frame pointer on __kretprobe_trampoline
by kernel test robot
Hi Masami,
I love your patch! Yet something to improve:
[auto build test ERROR on rostedt-trace/for-next]
[also build test ERROR on next-20211015]
[cannot apply to arm64/for-next/core tip/x86/core linus/master v5.15-rc5]
[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/Masami-Hiramatsu/kprobes-Make-KU...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: arm-randconfig-r016-20211015 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6069a6a5049497a32a50a49661c2f4169078bdba)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/4039c4f80aba40806049567ad4f916bc4...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Masami-Hiramatsu/kprobes-Make-KUnit-and-add-stacktrace-on-kretprobe-tests/20211015-205329
git checkout 4039c4f80aba40806049567ad4f916bc4b9c1576
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
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/arm/probes/kprobes/core.c:236:16: warning: no previous prototype for function 'kprobe_handler' [-Wmissing-prototypes]
void __kprobes kprobe_handler(struct pt_regs *regs)
^
arch/arm/probes/kprobes/core.c:236:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __kprobes kprobe_handler(struct pt_regs *regs)
^
static
>> arch/arm/probes/kprobes/core.c:379:38: error: writeback register not allowed in register list
"ldr lr, =__kretprobe_trampoline \n\t"
^
<inline asm>:2:13: note: instantiated into assembly here
stmdb sp!, {sp, lr, pc}
^
1 warning and 1 error generated.
vim +379 arch/arm/probes/kprobes/core.c
367
368 /*
369 * When a retprobed function returns, trampoline_handler() is called,
370 * calling the kretprobe's handler. We construct a struct pt_regs to
371 * give a view of registers r0-r11, sp, lr, and pc to the user
372 * return-handler. This is not a complete pt_regs structure, but that
373 * should be enough for stacktrace from the return handler with or
374 * without pt_regs.
375 */
376 void __naked __kprobes __kretprobe_trampoline(void)
377 {
378 __asm__ __volatile__ (
> 379 "ldr lr, =__kretprobe_trampoline \n\t"
380 "stmdb sp!, {sp, lr, pc} \n\t"
381 #ifdef CONFIG_FRAME_POINTER
382 /* __kretprobe_trampoline makes a framepointer on pt_regs. */
383 #ifdef CONFIG_CC_IS_CLANG
384 /* In clang case, pt_regs->ip = lr. */
385 "stmdb sp!, {lr} \n\t"
386 "stmdb sp!, {r0 - r11} \n\t"
387 /* fp points regs->r11 (fp) */
388 "add fp, sp, #44 \n\t"
389 #else /* !CONFIG_CC_IS_CLANG */
390 /* In gcc case, pt_regs->ip = fp. */
391 "stmdb sp!, {fp} \n\t"
392 "stmdb sp!, {r0 - r11} \n\t"
393 /* fp points regs->r15 (pc) */
394 "add fp, sp, #60 \n\t"
395 #endif /* CONFIG_CC_IS_CLANG */
396 #else /* !CONFIG_FRAME_POINTER */
397 "sub sp, sp, #4 \n\t"
398 "stmdb sp!, {r0 - r11} \n\t"
399 #endif /* CONFIG_FRAME_POINTER */
400 "mov r0, sp \n\t"
401 "bl trampoline_handler \n\t"
402 "mov lr, r0 \n\t"
403 "ldmia sp!, {r0 - r11} \n\t"
404 "add sp, sp, #16 \n\t"
405 #ifdef CONFIG_THUMB2_KERNEL
406 "bx lr \n\t"
407 #else
408 "mov pc, lr \n\t"
409 #endif
410 : : : "memory");
411 }
412
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[jimc:dd-drm-next 14/16] lib/dynamic_debug.c:440:3: error: expected expression
by kernel test robot
tree: https://github.com/jimc/linux.git dd-drm-next
head: 713c9b94da96f63ca998790458e91ac311104609
commit: 8ddaf3cb5e140ad3788e5d6046a3da90780db690 [14/16] dyndbg: add print-to-tracefs, selftest with it - RFC
config: hexagon-randconfig-r045-20211016 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
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/jimc/linux/commit/8ddaf3cb5e140ad3788e5d6046a3da90780d...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dd-drm-next
git checkout 8ddaf3cb5e140ad3788e5d6046a3da90780db690
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash
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 >>):
>> lib/dynamic_debug.c:440:3: error: expected expression
WARN_ONCE("cannot enable T, CONFIG_TRACE=n\n");
^
include/asm-generic/bug.h:150:29: note: expanded from macro 'WARN_ONCE'
DO_ONCE_LITE_IF(condition, WARN, 1, format)
^
>> lib/dynamic_debug.c:716:3: error: expected ')'
return __dynamic_emit_prefix(desc, buf);
^
lib/dynamic_debug.c:714:5: note: to match this '('
if (unlikely((dyndbg_site_is_enabled(desc)) &&
^
>> lib/dynamic_debug.c:739:3: error: implicit declaration of function 'trace_array_printk' [-Werror,-Wimplicit-function-declaration]
trace_array_printk(trace_arr, _THIS_IP_, "%s%pV", buf, &vaf);
^
lib/dynamic_debug.c:739:3: note: did you mean 'trace_printk'?
include/linux/kernel.h:467:5: note: 'trace_printk' declared here
int trace_printk(const char *fmt, ...)
^
lib/dynamic_debug.c:766:3: error: implicit declaration of function 'trace_array_printk' [-Werror,-Wimplicit-function-declaration]
trace_array_printk(trace_arr, _THIS_IP_, "%s%pV", buf, &vaf);
^
4 errors generated.
vim +440 lib/dynamic_debug.c
435
436 static int ddebug_validate_flags(struct flag_settings *modifiers)
437 {
438 #if !defined(CONFIG_TRACING)
439 if (dyndbg_site_is_tracing(modifiers)) {
> 440 WARN_ONCE("cannot enable T, CONFIG_TRACE=n\n");
441 return -EINVAL;
442 }
443 #endif
444 return 0;
445 }
446 /*
447 * Parse `str' as a flags specification, format [-+=][p]+.
448 * Sets up *maskp and *flagsp to be used when changing the
449 * flags fields of matched _ddebug's. Returns 0 on success
450 * or <0 on error.
451 */
452 static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers)
453 {
454 int op, i;
455
456 switch (*str) {
457 case '+':
458 case '-':
459 case '=':
460 op = *str++;
461 break;
462 default:
463 pr_err("bad flag-op %c, at start of %s\n", *str, str);
464 return -EINVAL;
465 }
466 v3pr_info("op=<%c>\n", op);
467
468 for (; *str ; ++str) {
469 for (i = ARRAY_SIZE(opt_array) - 1; i >= 0; i--) {
470 if (*str == opt_array[i].opt_char) {
471 modifiers->flags |= opt_array[i].flag;
472 break;
473 }
474 }
475 if (i < 0) {
476 pr_err("unknown flag '%c'\n", *str);
477 return -EINVAL;
478 }
479 }
480 v3pr_info("flags=0x%x\n", modifiers->flags);
481
482 /* calculate final flags, mask based upon op */
483 switch (op) {
484 case '=':
485 /* modifiers->flags already set */
486 modifiers->mask = 0;
487 break;
488 case '+':
489 modifiers->mask = ~0U;
490 break;
491 case '-':
492 modifiers->mask = ~modifiers->flags;
493 modifiers->flags = 0;
494 break;
495 }
496 v3pr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask);
497
498 return ddebug_validate_flags(modifiers);
499 }
500
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week