[chao-linux:simple_copy 3/5] drivers/nvme/host/core.c:2009:42: sparse: sparse: cast to restricted __le64
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git simple_copy
head: d6f32b90156624ae9dc06ef5873334a48e9b9806
commit: 8fcfa60ee742c99c9aeb2cc6efbc8c51ca435a77 [3/5] nvme: add simple copy support
config: arm-randconfig-s032-20210209 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/commit/?id...
git remote add chao-linux https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git
git fetch --no-tags chao-linux simple_copy
git checkout 8fcfa60ee742c99c9aeb2cc6efbc8c51ca435a77
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/nvme/host/core.c:2009:42: sparse: sparse: cast to restricted __le64
>> drivers/nvme/host/core.c:2009:42: sparse: sparse: cast from restricted __le32
>> drivers/nvme/host/core.c:2011:48: sparse: sparse: cast to restricted __le32
>> drivers/nvme/host/core.c:2011:48: sparse: sparse: cast from restricted __le16
drivers/nvme/host/core.c: note: in included file (through include/linux/notifier.h, include/linux/memory_hotplug.h, include/linux/mmzone.h, ...):
include/linux/srcu.h:179:9: sparse: sparse: context imbalance in 'nvme_put_ns_from_disk' - unexpected unlock
vim +2009 drivers/nvme/host/core.c
1990
1991 static void nvme_config_copy(struct gendisk *disk, struct nvme_ns *ns,
1992 struct nvme_id_ns *id)
1993 {
1994 struct nvme_ctrl *ctrl = ns->ctrl;
1995 struct request_queue *queue = disk->queue;
1996
1997 if (!(ctrl->oncs & NVME_CTRL_ONCS_COPY)) {
1998 queue->limits.copy_offload = 0;
1999 queue->limits.max_copy_sectors = 0;
2000 queue->limits.max_copy_range_sectors = 0;
2001 queue->limits.max_copy_nr_ranges = 0;
2002 blk_queue_flag_clear(QUEUE_FLAG_COPY, queue);
2003 return;
2004 }
2005
2006 /* setting copy limits */
2007 blk_queue_flag_test_and_set(QUEUE_FLAG_COPY, queue);
2008 queue->limits.copy_offload = 0;
> 2009 queue->limits.max_copy_sectors = le64_to_cpu(id->mcl) *
2010 (1 << (ns->lba_shift - 9));
> 2011 queue->limits.max_copy_range_sectors = le32_to_cpu(id->mssrl) *
2012 (1 << (ns->lba_shift - 9));
2013 queue->limits.max_copy_nr_ranges = id->msrc + 1;
2014 }
2015
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[saeed:queue-next 838/854] drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c:2892:8: error: implicit declaration of function 'mlx5_vport_get_other_func_cap'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git queue-next
head: 5c5a42bb5d698f59a292fe847bfccf65b693ca79
commit: 80a0334aff57bce1b9e5d860854a4b474c3030b9 [838/854] net/mlx5e: E-Switch, Maintain vhca_id to vport_num mapping
config: arm-allyesconfig (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://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git/commit/?i...
git remote add saeed https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git
git fetch --no-tags saeed queue-next
git checkout 80a0334aff57bce1b9e5d860854a4b474c3030b9
# 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 errors (new ones prefixed by >>):
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c: In function 'mlx5_esw_query_vport_vhca_id':
>> drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c:2892:8: error: implicit declaration of function 'mlx5_vport_get_other_func_cap' [-Werror=implicit-function-declaration]
2892 | err = mlx5_vport_get_other_func_cap(esw->dev, vport_num, query_ctx);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/mlx5_vport_get_other_func_cap +2892 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
2875
2876 static int mlx5_esw_query_vport_vhca_id(struct mlx5_eswitch *esw, u16 vport_num, u16 *vhca_id)
2877 {
2878 int query_out_sz = MLX5_ST_SZ_BYTES(query_hca_cap_out);
2879 void *query_ctx;
2880 void *hca_caps;
2881 int err;
2882
2883 *vhca_id = 0;
2884 if (mlx5_esw_is_manager_vport(esw, vport_num) ||
2885 !MLX5_CAP_GEN(esw->dev, vhca_resource_manager))
2886 return -EPERM;
2887
2888 query_ctx = kzalloc(query_out_sz, GFP_KERNEL);
2889 if (!query_ctx)
2890 return -ENOMEM;
2891
> 2892 err = mlx5_vport_get_other_func_cap(esw->dev, vport_num, query_ctx);
2893 if (err)
2894 goto out_free;
2895
2896 hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
2897 *vhca_id = MLX5_GET(cmd_hca_cap, hca_caps, vhca_id);
2898
2899 out_free:
2900 kfree(query_ctx);
2901 return err;
2902 }
2903
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH RFC 4/6] btrfs: Check if the filesystem is has mixed type of devices
by Dan Carpenter
Hi Michal,
url: https://github.com/0day-ci/linux/commits/Michal-Rostecki/Add-roundrobin-r...
base: 92bf22614b21a2706f4993b278017e437f7785b3
config: i386-randconfig-m021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/btrfs/volumes.c:635 btrfs_check_mixed() error: uninitialized symbol 'prev_device'.
Old smatch warnings:
fs/btrfs/volumes.c:1264 open_fs_devices() error: we previously assumed 'latest_dev' could be null (see line 1252)
vim +/prev_device +635 fs/btrfs/volumes.c
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 629 static bool btrfs_check_mixed(struct btrfs_fs_devices *fs_devices,
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 630 bool new_device_rotating)
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 631 {
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 632 struct btrfs_device *device, *prev_device;
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 633
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 634 list_for_each_entry(device, &fs_devices->devices, dev_list) {
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 @635 if (prev_device == NULL &&
^^^^^^^^^^^^^^^^^^^
Uninitialized.
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 636 device->rotating != new_device_rotating)
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 637 return true;
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 638 if (prev_device != NULL &&
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 639 (device->rotating != prev_device->rotating ||
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 640 device->rotating != new_device_rotating))
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 641 return true;
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 642
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 643 prev_device = device;
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 644 }
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 645
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 646 return false;
bd7608b9a9bbf6 Michal Rostecki 2021-02-09 647 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[kbuild:for-next 13/15] arch/ia64/kernel/crash.c:79:1: warning: no previous prototype for 'machine_crash_shutdown'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next
head: 49362029a00b1c8af81d635333806e3d0dc8fdc1
commit: 092d5045cefaf39a0c8ea8a20ccd640a038dac32 [13/15] ia64: remove unneeded header includes from <asm/mca.h>
config: ia64-randconfig-r013-20210209 (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/masahiroy/linux-kbuild.gi...
git remote add kbuild https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
git fetch --no-tags kbuild for-next
git checkout 092d5045cefaf39a0c8ea8a20ccd640a038dac32
# 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 >>):
>> arch/ia64/kernel/crash.c:79:1: warning: no previous prototype for 'machine_crash_shutdown' [-Wmissing-prototypes]
79 | machine_crash_shutdown(struct pt_regs *pt)
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/machine_crash_shutdown +79 arch/ia64/kernel/crash.c
a79561134f38de Zou Nan hai 2006-12-07 77
a79561134f38de Zou Nan hai 2006-12-07 78 void
a79561134f38de Zou Nan hai 2006-12-07 @79 machine_crash_shutdown(struct pt_regs *pt)
a79561134f38de Zou Nan hai 2006-12-07 80 {
a79561134f38de Zou Nan hai 2006-12-07 81 /* This function is only called after the system
a79561134f38de Zou Nan hai 2006-12-07 82 * has paniced or is otherwise in a critical state.
a79561134f38de Zou Nan hai 2006-12-07 83 * The minimum amount of code to allow a kexec'd kernel
a79561134f38de Zou Nan hai 2006-12-07 84 * to run successfully needs to happen here.
a79561134f38de Zou Nan hai 2006-12-07 85 *
a79561134f38de Zou Nan hai 2006-12-07 86 * In practice this means shooting down the other cpus in
a79561134f38de Zou Nan hai 2006-12-07 87 * an SMP system.
a79561134f38de Zou Nan hai 2006-12-07 88 */
a79561134f38de Zou Nan hai 2006-12-07 89 kexec_disable_iosapic();
a79561134f38de Zou Nan hai 2006-12-07 90 #ifdef CONFIG_SMP
1726b0883dd086 Hidetoshi Seto 2009-08-06 91 /*
1726b0883dd086 Hidetoshi Seto 2009-08-06 92 * If kdump_on_init is set and an INIT is asserted here, kdump will
1726b0883dd086 Hidetoshi Seto 2009-08-06 93 * be started again via INIT monarch.
1726b0883dd086 Hidetoshi Seto 2009-08-06 94 */
1726b0883dd086 Hidetoshi Seto 2009-08-06 95 local_irq_disable();
1726b0883dd086 Hidetoshi Seto 2009-08-06 96 ia64_set_psr_mc(); /* mask MCA/INIT */
1726b0883dd086 Hidetoshi Seto 2009-08-06 97 if (atomic_inc_return(&kdump_in_progress) != 1)
1726b0883dd086 Hidetoshi Seto 2009-08-06 98 unw_init_running(kdump_cpu_freeze, NULL);
1726b0883dd086 Hidetoshi Seto 2009-08-06 99
1726b0883dd086 Hidetoshi Seto 2009-08-06 100 /*
1726b0883dd086 Hidetoshi Seto 2009-08-06 101 * Now this cpu is ready for kdump.
1726b0883dd086 Hidetoshi Seto 2009-08-06 102 * Stop all others by IPI or INIT. They could receive INIT from
1726b0883dd086 Hidetoshi Seto 2009-08-06 103 * outside and might be INIT monarch, but only thing they have to
1726b0883dd086 Hidetoshi Seto 2009-08-06 104 * do is falling into kdump_cpu_freeze().
1726b0883dd086 Hidetoshi Seto 2009-08-06 105 *
1726b0883dd086 Hidetoshi Seto 2009-08-06 106 * If an INIT is asserted here:
1726b0883dd086 Hidetoshi Seto 2009-08-06 107 * - All receivers might be slaves, since some of cpus could already
1726b0883dd086 Hidetoshi Seto 2009-08-06 108 * be frozen and INIT might be masked on monarch. In this case,
0cced40e7c58b1 Hidetoshi Seto 2009-08-06 109 * all slaves will be frozen soon since kdump_in_progress will let
0cced40e7c58b1 Hidetoshi Seto 2009-08-06 110 * them into DIE_INIT_SLAVE_LEAVE.
1726b0883dd086 Hidetoshi Seto 2009-08-06 111 * - One might be a monarch, but INIT rendezvous will fail since
1726b0883dd086 Hidetoshi Seto 2009-08-06 112 * at least this cpu already have INIT masked so it never join
1726b0883dd086 Hidetoshi Seto 2009-08-06 113 * to the rendezvous. In this case, all slaves and monarch will
0cced40e7c58b1 Hidetoshi Seto 2009-08-06 114 * be frozen soon with no wait since the INIT rendezvous is skipped
0cced40e7c58b1 Hidetoshi Seto 2009-08-06 115 * by kdump_in_progress.
1726b0883dd086 Hidetoshi Seto 2009-08-06 116 */
a79561134f38de Zou Nan hai 2006-12-07 117 kdump_smp_send_stop();
0ac1faca4a63fc Simon Horman 2007-02-14 118 /* not all cpu response to IPI, send INIT to freeze them */
5959906ee9dee6 Hidetoshi Seto 2009-08-06 119 if (kdump_wait_cpu_freeze()) {
a79561134f38de Zou Nan hai 2006-12-07 120 kdump_smp_send_init();
5959906ee9dee6 Hidetoshi Seto 2009-08-06 121 /* wait again, don't go ahead if possible */
5959906ee9dee6 Hidetoshi Seto 2009-08-06 122 kdump_wait_cpu_freeze();
a79561134f38de Zou Nan hai 2006-12-07 123 }
a79561134f38de Zou Nan hai 2006-12-07 124 #endif
a79561134f38de Zou Nan hai 2006-12-07 125 }
a79561134f38de Zou Nan hai 2006-12-07 126
:::::: The code at line 79 was first introduced by commit
:::::: a79561134f38de12dce14ed72138f38e55ef53fc [IA64] IA64 Kexec/kdump
:::::: TO: Zou Nan hai <nanhai.zou(a)intel.com>
:::::: CC: Tony Luck <tony.luck(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[hch-dma-mapping:for-next 9/9] drivers/media/usb/uvc/uvc_video.c:1109:0: warning: Redundant assignment of 'dma_dev' to itself.
by kernel test robot
tree: git://git.infradead.org/users/hch/dma-mapping for-next
head: fdcd02a641e224c7364c8eca218b65619a1ee0a0
commit: fdcd02a641e224c7364c8eca218b65619a1ee0a0 [9/9] media: uvcvideo: Use dma_alloc_noncontiguos API
compiler: hppa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"cppcheck warnings: (new ones prefixed by >>)"
>> drivers/media/usb/uvc/uvc_video.c:1109:0: warning: Redundant assignment of 'dma_dev' to itself. [selfAssignment]
struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_urb->stream);
^
drivers/media/usb/uvc/uvc_video.c:1588:0: warning: Redundant assignment of 'dma_dev' to itself. [selfAssignment]
struct device *dma_dev = dma_dev = stream_to_dmadev(stream);
^
vim +/dma_dev +1109 drivers/media/usb/uvc/uvc_video.c
1106
1107 static void uvc_urb_dma_sync(struct uvc_urb *uvc_urb, bool for_device)
1108 {
> 1109 struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_urb->stream);
1110
1111 if (for_device) {
1112 dma_sync_sgtable_for_device(dma_dev, uvc_urb->sgt,
1113 DMA_FROM_DEVICE);
1114 } else {
1115 dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt,
1116 DMA_FROM_DEVICE);
1117 invalidate_kernel_vmap_range(uvc_urb->buffer,
1118 uvc_urb->stream->urb_size);
1119 }
1120 }
1121
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[android-common:android12-5.10 3/3] arch/arm64/mm/fault.c:594:15: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: https://android.googlesource.com/kernel/common android12-5.10
head: 9e4d84273c9d786ee7592970f0a46c1c28eb3c18
commit: 9e4d84273c9d786ee7592970f0a46c1c28eb3c18 [3/3] ANDROID: Fix sparse warning in __handle_speculative_fault caused by SPF
config: arm64-randconfig-s031-20210209 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10
git checkout 9e4d84273c9d786ee7592970f0a46c1c28eb3c18
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
arch/arm64/mm/fault.c:494:31: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got restricted vm_fault_t @@
arch/arm64/mm/fault.c:494:31: sparse: expected int
arch/arm64/mm/fault.c:494:31: sparse: got restricted vm_fault_t
>> arch/arm64/mm/fault.c:594:15: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted vm_fault_t [assigned] [usertype] fault @@ got int @@
arch/arm64/mm/fault.c:594:15: sparse: expected restricted vm_fault_t [assigned] [usertype] fault
arch/arm64/mm/fault.c:594:15: sparse: got int
arch/arm64/mm/fault.c:623:13: sparse: sparse: restricted vm_fault_t degrades to integer
arch/arm64/mm/fault.c:623:13: sparse: sparse: restricted vm_fault_t degrades to integer
arch/arm64/mm/fault.c:666:39: sparse: sparse: restricted vm_fault_t degrades to integer
vim +594 arch/arm64/mm/fault.c
c49bd02f4c7412 Anshuman Khandual 2019-06-07 510
1ad9551f1d90e3 Peter Collingbourne 2021-01-22 511 static int __kprobes do_page_fault(unsigned long far, unsigned int esr,
1d18c47c735e8a Catalin Marinas 2012-03-05 512 struct pt_regs *regs)
1d18c47c735e8a Catalin Marinas 2012-03-05 513 {
2d2837fab5fada Eric W. Biederman 2018-09-22 514 const struct fault_info *inf;
61681036004318 Anshuman Khandual 2019-06-03 515 struct mm_struct *mm = current->mm;
6a1bb025d28e10 Peter Xu 2020-08-11 516 vm_fault_t fault;
6cb4d9a2870d20 Anshuman Khandual 2020-04-10 517 unsigned long vm_flags = VM_ACCESS_FLAGS;
dde1607248328c Peter Xu 2020-04-01 518 unsigned int mm_flags = FAULT_FLAG_DEFAULT;
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 519 struct vm_area_struct *vma = NULL;
1ad9551f1d90e3 Peter Collingbourne 2021-01-22 520 unsigned long addr = untagged_addr(far);
db6f41063cbdb5 Will Deacon 2013-07-19 521
b98cca444d287a Anshuman Khandual 2019-07-16 522 if (kprobe_page_fault(regs, esr))
2dd0e8d2d2a157 Sandeepa Prabhu 2016-07-08 523 return 0;
2dd0e8d2d2a157 Sandeepa Prabhu 2016-07-08 524
1d18c47c735e8a Catalin Marinas 2012-03-05 525 /*
1d18c47c735e8a Catalin Marinas 2012-03-05 526 * If we're in an interrupt or have no user context, we must not take
1d18c47c735e8a Catalin Marinas 2012-03-05 527 * the fault.
1d18c47c735e8a Catalin Marinas 2012-03-05 528 */
70ffdb9393a726 David Hildenbrand 2015-05-11 529 if (faulthandler_disabled() || !mm)
1d18c47c735e8a Catalin Marinas 2012-03-05 530 goto no_context;
1d18c47c735e8a Catalin Marinas 2012-03-05 531
759496ba6407c6 Johannes Weiner 2013-09-12 532 if (user_mode(regs))
759496ba6407c6 Johannes Weiner 2013-09-12 533 mm_flags |= FAULT_FLAG_USER;
759496ba6407c6 Johannes Weiner 2013-09-12 534
541ec870ef3143 Mark Rutland 2016-05-31 535 if (is_el0_instruction_abort(esr)) {
759496ba6407c6 Johannes Weiner 2013-09-12 536 vm_flags = VM_EXEC;
01de1776f62e64 Anshuman Khandual 2019-05-05 537 mm_flags |= FAULT_FLAG_INSTRUCTION;
c49bd02f4c7412 Anshuman Khandual 2019-06-07 538 } else if (is_write_abort(esr)) {
759496ba6407c6 Johannes Weiner 2013-09-12 539 vm_flags = VM_WRITE;
759496ba6407c6 Johannes Weiner 2013-09-12 540 mm_flags |= FAULT_FLAG_WRITE;
759496ba6407c6 Johannes Weiner 2013-09-12 541 }
759496ba6407c6 Johannes Weiner 2013-09-12 542
356607f21e6035 Andrey Konovalov 2018-12-28 543 if (is_ttbr0_addr(addr) && is_el1_permission_fault(addr, esr, regs)) {
e19a6ee2460bdd James Morse 2016-06-20 544 /* regs->orig_addr_limit may be 0 if we entered from EL0 */
e19a6ee2460bdd James Morse 2016-06-20 545 if (regs->orig_addr_limit == KERNEL_DS)
c870f14ea115bb Mark Rutland 2018-05-21 546 die_kernel_fault("access to user memory with fs=KERNEL_DS",
c870f14ea115bb Mark Rutland 2018-05-21 547 addr, esr, regs);
705441960033e6 James Morse 2016-02-05 548
9adeb8e72dbfe9 Laura Abbott 2016-08-09 549 if (is_el1_instruction_abort(esr))
c870f14ea115bb Mark Rutland 2018-05-21 550 die_kernel_fault("execution of user memory",
c870f14ea115bb Mark Rutland 2018-05-21 551 addr, esr, regs);
9adeb8e72dbfe9 Laura Abbott 2016-08-09 552
57f4959bad0a15 James Morse 2016-02-05 553 if (!search_exception_tables(regs->pc))
c870f14ea115bb Mark Rutland 2018-05-21 554 die_kernel_fault("access to user memory outside uaccess routines",
c870f14ea115bb Mark Rutland 2018-05-21 555 addr, esr, regs);
57f4959bad0a15 James Morse 2016-02-05 556 }
338d4f49d6f711 James Morse 2015-07-22 557
0e3a9026396cd7 Punit Agrawal 2017-06-08 558 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
0e3a9026396cd7 Punit Agrawal 2017-06-08 559
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 560 /*
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 561 * let's try a speculative page fault without grabbing the
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 562 * mmap_sem.
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 563 */
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 564 fault = handle_speculative_fault(mm, addr, mm_flags, &vma);
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 565 if (fault != VM_FAULT_RETRY)
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 566 goto done;
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 567
1d18c47c735e8a Catalin Marinas 2012-03-05 568 /*
1d18c47c735e8a Catalin Marinas 2012-03-05 569 * As per x86, we may deadlock here. However, since the kernel only
1d18c47c735e8a Catalin Marinas 2012-03-05 570 * validly references user space from well defined areas of the code,
1d18c47c735e8a Catalin Marinas 2012-03-05 571 * we can bug out early if this is from code which shouldn't.
1d18c47c735e8a Catalin Marinas 2012-03-05 572 */
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 573 if (!mmap_read_trylock(mm)) {
1d18c47c735e8a Catalin Marinas 2012-03-05 574 if (!user_mode(regs) && !search_exception_tables(regs->pc))
1d18c47c735e8a Catalin Marinas 2012-03-05 575 goto no_context;
1d18c47c735e8a Catalin Marinas 2012-03-05 576 retry:
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 577 mmap_read_lock(mm);
1d18c47c735e8a Catalin Marinas 2012-03-05 578 } else {
1d18c47c735e8a Catalin Marinas 2012-03-05 579 /*
1d18c47c735e8a Catalin Marinas 2012-03-05 580 * The above down_read_trylock() might have succeeded in which
1d18c47c735e8a Catalin Marinas 2012-03-05 581 * case, we'll have missed the might_sleep() from down_read().
1d18c47c735e8a Catalin Marinas 2012-03-05 582 */
1d18c47c735e8a Catalin Marinas 2012-03-05 583 might_sleep();
1d18c47c735e8a Catalin Marinas 2012-03-05 584 #ifdef CONFIG_DEBUG_VM
a0509313d5dea0 Anshuman Khandual 2019-06-03 585 if (!user_mode(regs) && !search_exception_tables(regs->pc)) {
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 586 mmap_read_unlock(mm);
1d18c47c735e8a Catalin Marinas 2012-03-05 587 goto no_context;
a0509313d5dea0 Anshuman Khandual 2019-06-03 588 }
1d18c47c735e8a Catalin Marinas 2012-03-05 589 #endif
1d18c47c735e8a Catalin Marinas 2012-03-05 590 }
1d18c47c735e8a Catalin Marinas 2012-03-05 591
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 592 if (!vma || !can_reuse_spf_vma(vma, addr))
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 593 vma = find_vma(mm, addr);
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 @594 fault = __do_page_fault(vma, addr, mm_flags, vm_flags, regs);
1d18c47c735e8a Catalin Marinas 2012-03-05 595
b502f038f2ffc9 Peter Xu 2020-04-01 596 /* Quick path to respond to signals */
b502f038f2ffc9 Peter Xu 2020-04-01 597 if (fault_signal_pending(fault, regs)) {
289d07a2dc6c6b Mark Rutland 2017-07-11 598 if (!user_mode(regs))
289d07a2dc6c6b Mark Rutland 2017-07-11 599 goto no_context;
1d18c47c735e8a Catalin Marinas 2012-03-05 600 return 0;
289d07a2dc6c6b Mark Rutland 2017-07-11 601 }
1d18c47c735e8a Catalin Marinas 2012-03-05 602
b502f038f2ffc9 Peter Xu 2020-04-01 603 if (fault & VM_FAULT_RETRY) {
0e3a9026396cd7 Punit Agrawal 2017-06-08 604 if (mm_flags & FAULT_FLAG_ALLOW_RETRY) {
569ba74a7ba69f Mark Salyzyn 2015-09-21 605 mm_flags |= FAULT_FLAG_TRIED;
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 606
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 607 /*
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 608 * Do not try to reuse this vma and fetch it
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 609 * again since we will release the mmap_sem.
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 610 */
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 611 vma = NULL;
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 612
1d18c47c735e8a Catalin Marinas 2012-03-05 613 goto retry;
1d18c47c735e8a Catalin Marinas 2012-03-05 614 }
1d18c47c735e8a Catalin Marinas 2012-03-05 615 }
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 616 mmap_read_unlock(mm);
1d18c47c735e8a Catalin Marinas 2012-03-05 617
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 618 done:
2fd69fa6bcab98 Mahendran Ganesh 2018-05-04 619
1d18c47c735e8a Catalin Marinas 2012-03-05 620 /*
0e3a9026396cd7 Punit Agrawal 2017-06-08 621 * Handle the "normal" (no error) case first.
1d18c47c735e8a Catalin Marinas 2012-03-05 622 */
1d18c47c735e8a Catalin Marinas 2012-03-05 623 if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP |
6a1bb025d28e10 Peter Xu 2020-08-11 624 VM_FAULT_BADACCESS))))
1d18c47c735e8a Catalin Marinas 2012-03-05 625 return 0;
1d18c47c735e8a Catalin Marinas 2012-03-05 626
871341023c771a Johannes Weiner 2013-09-12 627 /*
871341023c771a Johannes Weiner 2013-09-12 628 * If we are in kernel mode at this point, we have no context to
871341023c771a Johannes Weiner 2013-09-12 629 * handle this fault with.
871341023c771a Johannes Weiner 2013-09-12 630 */
871341023c771a Johannes Weiner 2013-09-12 631 if (!user_mode(regs))
871341023c771a Johannes Weiner 2013-09-12 632 goto no_context;
871341023c771a Johannes Weiner 2013-09-12 633
1d18c47c735e8a Catalin Marinas 2012-03-05 634 if (fault & VM_FAULT_OOM) {
1d18c47c735e8a Catalin Marinas 2012-03-05 635 /*
1d18c47c735e8a Catalin Marinas 2012-03-05 636 * We ran out of memory, call the OOM killer, and return to
1d18c47c735e8a Catalin Marinas 2012-03-05 637 * userspace (which will retry the fault, or kill us if we got
1d18c47c735e8a Catalin Marinas 2012-03-05 638 * oom-killed).
1d18c47c735e8a Catalin Marinas 2012-03-05 639 */
1d18c47c735e8a Catalin Marinas 2012-03-05 640 pagefault_out_of_memory();
1d18c47c735e8a Catalin Marinas 2012-03-05 641 return 0;
1d18c47c735e8a Catalin Marinas 2012-03-05 642 }
1d18c47c735e8a Catalin Marinas 2012-03-05 643
2d2837fab5fada Eric W. Biederman 2018-09-22 644 inf = esr_to_fault_info(esr);
559d8d91a89cc2 Eric W. Biederman 2018-09-22 645 set_thread_esr(addr, esr);
1d18c47c735e8a Catalin Marinas 2012-03-05 646 if (fault & VM_FAULT_SIGBUS) {
1d18c47c735e8a Catalin Marinas 2012-03-05 647 /*
1d18c47c735e8a Catalin Marinas 2012-03-05 648 * We had some memory, but were unable to successfully fix up
1d18c47c735e8a Catalin Marinas 2012-03-05 649 * this page fault.
1d18c47c735e8a Catalin Marinas 2012-03-05 650 */
1ad9551f1d90e3 Peter Collingbourne 2021-01-22 651 arm64_force_sig_fault(SIGBUS, BUS_ADRERR, far, inf->name);
9ea3a9743cac4f Eric W. Biederman 2018-09-22 652 } else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
9ea3a9743cac4f Eric W. Biederman 2018-09-22 653 unsigned int lsb;
9ea3a9743cac4f Eric W. Biederman 2018-09-22 654
9ea3a9743cac4f Eric W. Biederman 2018-09-22 655 lsb = PAGE_SHIFT;
9ea3a9743cac4f Eric W. Biederman 2018-09-22 656 if (fault & VM_FAULT_HWPOISON_LARGE)
9ea3a9743cac4f Eric W. Biederman 2018-09-22 657 lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
92ff0674f5d801 Will Deacon 2018-02-20 658
1ad9551f1d90e3 Peter Collingbourne 2021-01-22 659 arm64_force_sig_mceerr(BUS_MCEERR_AR, far, lsb, inf->name);
1d18c47c735e8a Catalin Marinas 2012-03-05 660 } else {
1d18c47c735e8a Catalin Marinas 2012-03-05 661 /*
1d18c47c735e8a Catalin Marinas 2012-03-05 662 * Something tried to access memory that isn't in our memory
1d18c47c735e8a Catalin Marinas 2012-03-05 663 * map.
1d18c47c735e8a Catalin Marinas 2012-03-05 664 */
feca355b3d8eba Eric W. Biederman 2018-09-22 665 arm64_force_sig_fault(SIGSEGV,
feca355b3d8eba Eric W. Biederman 2018-09-22 666 fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR,
1ad9551f1d90e3 Peter Collingbourne 2021-01-22 667 far, inf->name);
1d18c47c735e8a Catalin Marinas 2012-03-05 668 }
1d18c47c735e8a Catalin Marinas 2012-03-05 669
1d18c47c735e8a Catalin Marinas 2012-03-05 670 return 0;
1d18c47c735e8a Catalin Marinas 2012-03-05 671
1d18c47c735e8a Catalin Marinas 2012-03-05 672 no_context:
67ce16ec15ce9d Kristina Martsenko 2017-06-09 673 __do_kernel_fault(addr, esr, regs);
1d18c47c735e8a Catalin Marinas 2012-03-05 674 return 0;
1d18c47c735e8a Catalin Marinas 2012-03-05 675 }
1d18c47c735e8a Catalin Marinas 2012-03-05 676
:::::: The code at line 594 was first introduced by commit
:::::: 2fd69fa6bcab984b56ccfd4860b10f11f1966bed FROMLIST: arm64/mm: add speculative page fault
:::::: TO: Mahendran Ganesh <opensource.ganesh(a)gmail.com>
:::::: CC: Suren Baghdasaryan <surenb(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[agd5f:drm-next 17/61] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning: variable 'structure_size' is used uninitialized whenever switch default is taken
by kernel test robot
tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next
head: ebeff894af6654fef910e5b6da4f515aa7c73583
commit: de4b7cd8cb87c12559e0545d9c9c631cb2e8ee6f [17/61] drm/amd/pm/swsmu: unify the init soft gpu metrics function
config: riscv-randconfig-r012-20210209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f drm-next
git checkout de4b7cd8cb87c12559e0545d9c9c631cb2e8ee6f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
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/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning: variable 'structure_size' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:770:23: note: uninitialized use occurs here
memset(header, 0xFF, structure_size);
^~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:753:25: note: initialize the variable 'structure_size' to silence this warning
uint16_t structure_size;
^
= 0
1 warning generated.
vim +/structure_size +764 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c
756
757 switch (METRICS_VERSION(frev, crev)) {
758 case METRICS_VERSION(1, 0):
759 structure_size = sizeof(struct gpu_metrics_v1_0);
760 break;
761 case METRICS_VERSION(2, 0):
762 structure_size = sizeof(struct gpu_metrics_v2_0);
763 break;
> 764 default:
765 break;
766 }
767
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months