Re: [PATCH v9 6/8] media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder
by kernel test robot
Hi "Mirela,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on shawnguo/for-next robh/for-next linus/master v5.12-rc2 next-20210310]
[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/Mirela-Rabulea-OSS/Add-V4L2-driv...
base: git://linuxtv.org/media_tree.git master
config: microblaze-randconfig-r021-20210308 (attached as .config)
compiler: microblaze-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://github.com/0day-ci/linux/commit/c6db61a15ca1a173f200f4a2344b31986...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mirela-Rabulea-OSS/Add-V4L2-driver-for-i-MX8-JPEG-Encoder-Decoder/20210311-083324
git checkout c6db61a15ca1a173f200f4a2344b3198652d64a6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
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/media/platform/imx-jpeg/mxc-jpeg.c: In function 'mxc_jpeg_probe':
>> drivers/media/platform/imx-jpeg/mxc-jpeg.c:1967:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1967 | mode = (int)(u64)of_id->data;
| ^
vim +1967 drivers/media/platform/imx-jpeg/mxc-jpeg.c
1954
1955 static int mxc_jpeg_probe(struct platform_device *pdev)
1956 {
1957 struct mxc_jpeg_dev *jpeg;
1958 struct device *dev = &pdev->dev;
1959 struct resource *res;
1960 int dec_irq;
1961 int ret;
1962 int mode;
1963 const struct of_device_id *of_id;
1964 unsigned int slot;
1965
1966 of_id = of_match_node(mxc_jpeg_match, dev->of_node);
> 1967 mode = (int)(u64)of_id->data;
1968
1969 jpeg = devm_kzalloc(dev, sizeof(struct mxc_jpeg_dev), GFP_KERNEL);
1970 if (!jpeg)
1971 return -ENOMEM;
1972
1973 mutex_init(&jpeg->lock);
1974 spin_lock_init(&jpeg->hw_lock);
1975
1976 ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
1977 if (ret) {
1978 dev_err(&pdev->dev, "No suitable DMA available.\n");
1979 goto err_irq;
1980 }
1981
1982 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1983 jpeg->base_reg = devm_ioremap_resource(&pdev->dev, res);
1984 if (IS_ERR(jpeg->base_reg))
1985 return PTR_ERR(jpeg->base_reg);
1986
1987 for (slot = 0; slot < MXC_MAX_SLOTS; slot++) {
1988 dec_irq = platform_get_irq(pdev, slot);
1989 if (dec_irq < 0) {
1990 dev_err(&pdev->dev, "Failed to get irq %d\n", dec_irq);
1991 ret = dec_irq;
1992 goto err_irq;
1993 }
1994 ret = devm_request_irq(&pdev->dev, dec_irq, mxc_jpeg_dec_irq,
1995 0, pdev->name, jpeg);
1996 if (ret) {
1997 dev_err(&pdev->dev, "Failed to request irq %d (%d)\n",
1998 dec_irq, ret);
1999 goto err_irq;
2000 }
2001 }
2002
2003 jpeg->pdev = pdev;
2004 jpeg->dev = dev;
2005 jpeg->mode = mode;
2006
2007 ret = mxc_jpeg_attach_pm_domains(jpeg);
2008 if (ret < 0) {
2009 dev_err(dev, "failed to attach power domains %d\n", ret);
2010 return ret;
2011 }
2012
2013 /* v4l2 */
2014 ret = v4l2_device_register(dev, &jpeg->v4l2_dev);
2015 if (ret) {
2016 dev_err(dev, "failed to register v4l2 device\n");
2017 goto err_register;
2018 }
2019 jpeg->m2m_dev = v4l2_m2m_init(&mxc_jpeg_m2m_ops);
2020 if (IS_ERR(jpeg->m2m_dev)) {
2021 dev_err(dev, "failed to register v4l2 device\n");
2022 goto err_m2m;
2023 }
2024
2025 jpeg->dec_vdev = video_device_alloc();
2026 if (!jpeg->dec_vdev) {
2027 dev_err(dev, "failed to register v4l2 device\n");
2028 goto err_vdev_alloc;
2029 }
2030 if (mode == MXC_JPEG_ENCODE)
2031 snprintf(jpeg->dec_vdev->name,
2032 sizeof(jpeg->dec_vdev->name),
2033 "%s-enc", MXC_JPEG_NAME);
2034 else
2035 snprintf(jpeg->dec_vdev->name,
2036 sizeof(jpeg->dec_vdev->name),
2037 "%s-dec", MXC_JPEG_NAME);
2038
2039 jpeg->dec_vdev->fops = &mxc_jpeg_fops;
2040 jpeg->dec_vdev->ioctl_ops = &mxc_jpeg_ioctl_ops;
2041 jpeg->dec_vdev->minor = -1;
2042 jpeg->dec_vdev->release = video_device_release;
2043 jpeg->dec_vdev->lock = &jpeg->lock; /* lock for ioctl serialization */
2044 jpeg->dec_vdev->v4l2_dev = &jpeg->v4l2_dev;
2045 jpeg->dec_vdev->vfl_dir = VFL_DIR_M2M;
2046 jpeg->dec_vdev->device_caps = V4L2_CAP_STREAMING |
2047 V4L2_CAP_VIDEO_M2M_MPLANE;
2048 if (mode == MXC_JPEG_ENCODE) {
2049 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_DECODER_CMD);
2050 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_TRY_DECODER_CMD);
2051 } else {
2052 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_ENCODER_CMD);
2053 v4l2_disable_ioctl(jpeg->dec_vdev, VIDIOC_TRY_ENCODER_CMD);
2054 }
2055 ret = video_register_device(jpeg->dec_vdev, VFL_TYPE_VIDEO, -1);
2056 if (ret) {
2057 dev_err(dev, "failed to register video device\n");
2058 goto err_vdev_register;
2059 }
2060 video_set_drvdata(jpeg->dec_vdev, jpeg);
2061 if (mode == MXC_JPEG_ENCODE)
2062 v4l2_info(&jpeg->v4l2_dev,
2063 "encoder device registered as /dev/video%d (%d,%d)\n",
2064 jpeg->dec_vdev->num, VIDEO_MAJOR,
2065 jpeg->dec_vdev->minor);
2066 else
2067 v4l2_info(&jpeg->v4l2_dev,
2068 "decoder device registered as /dev/video%d (%d,%d)\n",
2069 jpeg->dec_vdev->num, VIDEO_MAJOR,
2070 jpeg->dec_vdev->minor);
2071
2072 platform_set_drvdata(pdev, jpeg);
2073
2074 return 0;
2075
2076 err_vdev_register:
2077 video_device_release(jpeg->dec_vdev);
2078
2079 err_vdev_alloc:
2080 v4l2_m2m_release(jpeg->m2m_dev);
2081
2082 err_m2m:
2083 v4l2_device_unregister(&jpeg->v4l2_dev);
2084
2085 err_register:
2086 err_irq:
2087 return ret;
2088 }
2089
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH] ptrace: Allow other threads to access tracee
by kernel test robot
Hi Jim,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.12-rc2 next-20210310]
[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/Jim-Newsome/ptrace-Allow-other-t...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32
config: x86_64-randconfig-s021-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-262-g5e674421-dirty
# https://github.com/0day-ci/linux/commit/874466f21257b7eb31b17d2bdb19da3f3...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jim-Newsome/ptrace-Allow-other-threads-to-access-tracee/20210311-050039
git checkout 874466f21257b7eb31b17d2bdb19da3f365436d7
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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 >>)"
>> kernel/ptrace.c:53:44: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct task_struct *p2 @@ got struct task_struct [noderef] __rcu *parent @@
kernel/ptrace.c:53:44: sparse: expected struct task_struct *p2
kernel/ptrace.c:53:44: sparse: got struct task_struct [noderef] __rcu *parent
kernel/ptrace.c:72:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct [noderef] __rcu *parent @@ got struct task_struct *new_parent @@
kernel/ptrace.c:72:23: sparse: expected struct task_struct [noderef] __rcu *parent
kernel/ptrace.c:72:23: sparse: got struct task_struct *new_parent
kernel/ptrace.c:73:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cred const [noderef] __rcu *ptracer_cred @@ got struct cred const * @@
kernel/ptrace.c:73:29: sparse: expected struct cred const [noderef] __rcu *ptracer_cred
kernel/ptrace.c:73:29: sparse: got struct cred const *
kernel/ptrace.c:127:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cred const *old_cred @@ got struct cred const [noderef] __rcu *ptracer_cred @@
kernel/ptrace.c:127:18: sparse: expected struct cred const *old_cred
kernel/ptrace.c:127:18: sparse: got struct cred const [noderef] __rcu *ptracer_cred
kernel/ptrace.c:131:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:131:25: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:131:25: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:169:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:169:27: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:169:27: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:181:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:181:28: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:181:28: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:186:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:186:30: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:186:30: sparse: got struct spinlock [noderef] __rcu *
>> kernel/ptrace.c:196:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p1 @@ got struct task_struct [noderef] __rcu *parent @@
kernel/ptrace.c:196:9: sparse: expected struct task_struct *p1
kernel/ptrace.c:196:9: sparse: got struct task_struct [noderef] __rcu *parent
kernel/ptrace.c:202:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:202:28: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:202:28: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:209:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:209:30: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:209:30: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:241:53: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p1 @@ got struct task_struct [noderef] __rcu *parent @@
kernel/ptrace.c:241:53: sparse: expected struct task_struct *p1
kernel/ptrace.c:241:53: sparse: got struct task_struct [noderef] __rcu *parent
kernel/ptrace.c:415:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:415:24: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:415:24: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:438:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:438:26: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:438:26: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:474:54: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *parent @@ got struct task_struct [noderef] __rcu *parent @@
kernel/ptrace.c:474:54: sparse: expected struct task_struct *parent
kernel/ptrace.c:474:54: sparse: got struct task_struct [noderef] __rcu *parent
kernel/ptrace.c:482:53: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct task_struct *new_parent @@ got struct task_struct [noderef] __rcu *real_parent @@
kernel/ptrace.c:482:53: sparse: expected struct task_struct *new_parent
kernel/ptrace.c:482:53: sparse: got struct task_struct [noderef] __rcu *real_parent
kernel/ptrace.c:530:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p1 @@ got struct task_struct [noderef] __rcu *real_parent @@
kernel/ptrace.c:530:41: sparse: expected struct task_struct *p1
kernel/ptrace.c:530:41: sparse: got struct task_struct [noderef] __rcu *real_parent
kernel/ptrace.c:532:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sighand_struct *sigh @@ got struct sighand_struct [noderef] __rcu *sighand @@
kernel/ptrace.c:532:50: sparse: expected struct sighand_struct *sigh
kernel/ptrace.c:532:50: sparse: got struct sighand_struct [noderef] __rcu *sighand
kernel/ptrace.c:734:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:734:37: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:734:37: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:742:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:742:39: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:742:39: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:847:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:847:37: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:847:37: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:851:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:851:39: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:851:39: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:1081:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:1081:37: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:1081:37: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:1083:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/ptrace.c:1083:39: sparse: expected struct spinlock [usertype] *lock
kernel/ptrace.c:1083:39: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:480:38: sparse: sparse: dereference of noderef expression
kernel/ptrace.c: note: in included file (through include/linux/rcuwait.h, include/linux/percpu-rwsem.h, include/linux/fs.h, ...):
include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
include/linux/sched/signal.h:708:37: sparse: expected struct spinlock [usertype] *lock
include/linux/sched/signal.h:708:37: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:681:9: sparse: sparse: context imbalance in 'ptrace_getsiginfo' - different lock contexts for basic block
include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
include/linux/sched/signal.h:708:37: sparse: expected struct spinlock [usertype] *lock
include/linux/sched/signal.h:708:37: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:697:9: sparse: sparse: context imbalance in 'ptrace_setsiginfo' - different lock contexts for basic block
kernel/ptrace.c:853:9: sparse: sparse: context imbalance in 'ptrace_resume' - different lock contexts for basic block
include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
include/linux/sched/signal.h:708:37: sparse: expected struct spinlock [usertype] *lock
include/linux/sched/signal.h:708:37: sparse: got struct spinlock [noderef] __rcu *
include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
include/linux/sched/signal.h:708:37: sparse: expected struct spinlock [usertype] *lock
include/linux/sched/signal.h:708:37: sparse: got struct spinlock [noderef] __rcu *
kernel/ptrace.c:1229:9: sparse: sparse: context imbalance in 'ptrace_request' - different lock contexts for basic block
vim +53 kernel/ptrace.c
36
37 /*
38 * Access another process' address space via ptrace.
39 * Source/target buffer must be kernel space,
40 * Do not walk the page table directly, use get_user_pages
41 */
42 int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,
43 void *buf, int len, unsigned int gup_flags)
44 {
45 struct mm_struct *mm;
46 int ret;
47
48 mm = get_task_mm(tsk);
49 if (!mm)
50 return 0;
51
52 if (!tsk->ptrace ||
> 53 !same_thread_group(current, tsk->parent) ||
54 ((get_dumpable(mm) != SUID_DUMP_USER) &&
55 !ptracer_capable(tsk, mm->user_ns))) {
56 mmput(mm);
57 return 0;
58 }
59
60 ret = __access_remote_vm(mm, addr, buf, len, gup_flags);
61 mmput(mm);
62
63 return ret;
64 }
65
66
67 void __ptrace_link(struct task_struct *child, struct task_struct *new_parent,
68 const struct cred *ptracer_cred)
69 {
70 BUG_ON(!list_empty(&child->ptrace_entry));
71 list_add(&child->ptrace_entry, &new_parent->ptraced);
72 child->parent = new_parent;
73 child->ptracer_cred = get_cred(ptracer_cred);
74 }
75
76 /*
77 * ptrace a task: make the debugger its new parent and
78 * move it to the ptrace list.
79 *
80 * Must be called with the tasklist lock write-held.
81 */
82 static void ptrace_link(struct task_struct *child, struct task_struct *new_parent)
83 {
84 __ptrace_link(child, new_parent, current_cred());
85 }
86
87 /**
88 * __ptrace_unlink - unlink ptracee and restore its execution state
89 * @child: ptracee to be unlinked
90 *
91 * Remove @child from the ptrace list, move it back to the original parent,
92 * and restore the execution state so that it conforms to the group stop
93 * state.
94 *
95 * Unlinking can happen via two paths - explicit PTRACE_DETACH or ptracer
96 * exiting. For PTRACE_DETACH, unless the ptracee has been killed between
97 * ptrace_check_attach() and here, it's guaranteed to be in TASK_TRACED.
98 * If the ptracer is exiting, the ptracee can be in any state.
99 *
100 * After detach, the ptracee should be in a state which conforms to the
101 * group stop. If the group is stopped or in the process of stopping, the
102 * ptracee should be put into TASK_STOPPED; otherwise, it should be woken
103 * up from TASK_TRACED.
104 *
105 * If the ptracee is in TASK_TRACED and needs to be moved to TASK_STOPPED,
106 * it goes through TRACED -> RUNNING -> STOPPED transition which is similar
107 * to but in the opposite direction of what happens while attaching to a
108 * stopped task. However, in this direction, the intermediate RUNNING
109 * state is not hidden even from the current ptracer and if it immediately
110 * re-attaches and performs a WNOHANG wait(2), it may fail.
111 *
112 * CONTEXT:
113 * write_lock_irq(tasklist_lock)
114 */
115 void __ptrace_unlink(struct task_struct *child)
116 {
117 const struct cred *old_cred;
118 BUG_ON(!child->ptrace);
119
120 clear_task_syscall_work(child, SYSCALL_TRACE);
121 #if defined(CONFIG_GENERIC_ENTRY) || defined(TIF_SYSCALL_EMU)
122 clear_task_syscall_work(child, SYSCALL_EMU);
123 #endif
124
125 child->parent = child->real_parent;
126 list_del_init(&child->ptrace_entry);
127 old_cred = child->ptracer_cred;
128 child->ptracer_cred = NULL;
129 put_cred(old_cred);
130
131 spin_lock(&child->sighand->siglock);
132 child->ptrace = 0;
133 /*
134 * Clear all pending traps and TRAPPING. TRAPPING should be
135 * cleared regardless of JOBCTL_STOP_PENDING. Do it explicitly.
136 */
137 task_clear_jobctl_pending(child, JOBCTL_TRAP_MASK);
138 task_clear_jobctl_trapping(child);
139
140 /*
141 * Reinstate JOBCTL_STOP_PENDING if group stop is in effect and
142 * @child isn't dead.
143 */
144 if (!(child->flags & PF_EXITING) &&
145 (child->signal->flags & SIGNAL_STOP_STOPPED ||
146 child->signal->group_stop_count)) {
147 child->jobctl |= JOBCTL_STOP_PENDING;
148
149 /*
150 * This is only possible if this thread was cloned by the
151 * traced task running in the stopped group, set the signal
152 * for the future reports.
153 * FIXME: we should change ptrace_init_task() to handle this
154 * case.
155 */
156 if (!(child->jobctl & JOBCTL_STOP_SIGMASK))
157 child->jobctl |= SIGSTOP;
158 }
159
160 /*
161 * If transition to TASK_STOPPED is pending or in TASK_TRACED, kick
162 * @child in the butt. Note that @resume should be used iff @child
163 * is in TASK_TRACED; otherwise, we might unduly disrupt
164 * TASK_KILLABLE sleeps.
165 */
166 if (child->jobctl & JOBCTL_STOP_PENDING || task_is_traced(child))
167 ptrace_signal_wake_up(child, true);
168
169 spin_unlock(&child->sighand->siglock);
170 }
171
172 /* Ensure that nothing can wake it up, even SIGKILL */
173 static bool ptrace_freeze_traced(struct task_struct *task)
174 {
175 bool ret = false;
176
177 /* Lockless, nobody but us can set this flag */
178 if (task->jobctl & JOBCTL_LISTENING)
179 return ret;
180
181 spin_lock_irq(&task->sighand->siglock);
182 if (task_is_traced(task) && !__fatal_signal_pending(task)) {
183 task->state = __TASK_TRACED;
184 ret = true;
185 }
186 spin_unlock_irq(&task->sighand->siglock);
187
188 return ret;
189 }
190
191 static void ptrace_unfreeze_traced(struct task_struct *task)
192 {
193 if (task->state != __TASK_TRACED)
194 return;
195
> 196 WARN_ON(!task->ptrace || !same_thread_group(task->parent, current));
197
198 /*
199 * PTRACE_LISTEN can allow ptrace_trap_notify to wake us up remotely.
200 * Recheck state under the lock to close this race.
201 */
202 spin_lock_irq(&task->sighand->siglock);
203 if (task->state == __TASK_TRACED) {
204 if (__fatal_signal_pending(task))
205 wake_up_state(task, __TASK_TRACED);
206 else
207 task->state = TASK_TRACED;
208 }
209 spin_unlock_irq(&task->sighand->siglock);
210 }
211
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[peterz-queue:x86/fpu 6/9] arch/x86/kernel/jump_label.c:40:27: error: 'JUMP_LABEL_NOP_SIZE' undeclared; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/fpu
head: fb58f76671de512da1ee76a77977eb6edb4d0071
commit: 0972ae347d728f65574452d8e0fa18ed7c68bfe5 [6/9] jump_label, x86: Introduce jump_entry_size()
config: x86_64-rhel-7.6-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/fpu
git checkout 0972ae347d728f65574452d8e0fa18ed7c68bfe5
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/x86/kernel/jump_label.c: In function '__jump_label_set_jump_code':
>> arch/x86/kernel/jump_label.c:40:27: error: 'JUMP_LABEL_NOP_SIZE' undeclared (first use in this function); did you mean 'JUMP_LABEL_NOP'?
40 | if (memcmp(addr, expect, JUMP_LABEL_NOP_SIZE)) {
| ^~~~~~~~~~~~~~~~~~~
| JUMP_LABEL_NOP
arch/x86/kernel/jump_label.c:40:27: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/linux/kernel.h:16,
from arch/x86/include/asm/percpu.h:27,
from arch/x86/include/asm/current.h:6,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/memory.h:19,
from arch/x86/kernel/jump_label.c:9:
arch/x86/kernel/jump_label.c:47:31: error: 'init' undeclared (first use in this function); did you mean 'int'?
47 | addr, addr, addr, expect, init, type);
| ^~~~
include/linux/printk.h:333:34: note: in definition of macro 'pr_crit'
333 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
arch/x86/kernel/jump_label.c: In function '__jump_label_transform':
arch/x86/kernel/jump_label.c:76:5: error: 'JUMP_LABEL_NOP_SIZE' undeclared (first use in this function); did you mean 'JUMP_LABEL_NOP'?
76 | JUMP_LABEL_NOP_SIZE);
| ^~~~~~~~~~~~~~~~~~~
| JUMP_LABEL_NOP
arch/x86/kernel/jump_label.c: In function 'arch_jump_label_transform_queue':
arch/x86/kernel/jump_label.c:114:12: error: 'JUMP_LABEL_NOP_SIZE' undeclared (first use in this function); did you mean 'JUMP_LABEL_NOP'?
114 | opcode, JUMP_LABEL_NOP_SIZE, NULL);
| ^~~~~~~~~~~~~~~~~~~
| JUMP_LABEL_NOP
vim +40 arch/x86/kernel/jump_label.c
0972ae347d728f Peter Zijlstra 2019-06-28 23
18cbc8bed0c707 Peter Zijlstra 2019-08-26 24 static const void *
86fa366b2e1b57 Peter Zijlstra 2021-03-10 25 __jump_label_set_jump_code(struct jump_entry *entry, enum jump_label_type type)
d9f5ab7b1c0a52 Jason Baron 2010-09-17 26 {
63f62addb88ec4 Peter Zijlstra 2019-10-03 27 const void *expect, *code;
63f62addb88ec4 Peter Zijlstra 2019-10-03 28 const void *addr, *dest;
9fc0f798ab8a6c Ard Biesheuvel 2018-09-18 29
63f62addb88ec4 Peter Zijlstra 2019-10-03 30 addr = (void *)jump_entry_code(entry);
63f62addb88ec4 Peter Zijlstra 2019-10-03 31 dest = (void *)jump_entry_target(entry);
18cbc8bed0c707 Peter Zijlstra 2019-08-26 32
63f62addb88ec4 Peter Zijlstra 2019-10-03 33 code = text_gen_insn(JMP32_INSN_OPCODE, addr, dest);
d9f5ab7b1c0a52 Jason Baron 2010-09-17 34
8388f5d27cf18a Peter Zijlstra 2019-06-28 35 if (type == JUMP_LABEL_JMP)
8388f5d27cf18a Peter Zijlstra 2019-06-28 36 expect = x86_nops[5];
8388f5d27cf18a Peter Zijlstra 2019-06-28 37 else
8388f5d27cf18a Peter Zijlstra 2019-06-28 38 expect = code;
e71a5be15e47a7 Jeremy Fitzhardinge 2011-09-29 39
8388f5d27cf18a Peter Zijlstra 2019-06-28 @40 if (memcmp(addr, expect, JUMP_LABEL_NOP_SIZE)) {
8388f5d27cf18a Peter Zijlstra 2019-06-28 41 /*
8388f5d27cf18a Peter Zijlstra 2019-06-28 42 * The location is not an op that we were expecting.
8388f5d27cf18a Peter Zijlstra 2019-06-28 43 * Something went wrong. Crash the box, as something could be
8388f5d27cf18a Peter Zijlstra 2019-06-28 44 * corrupting the kernel.
8388f5d27cf18a Peter Zijlstra 2019-06-28 45 */
8388f5d27cf18a Peter Zijlstra 2019-06-28 46 pr_crit("jump_label: Fatal kernel bug, unexpected op at %pS [%p] (%5ph != %5ph)) init:%d type:%d\n",
8388f5d27cf18a Peter Zijlstra 2019-06-28 47 addr, addr, addr, expect, init, type);
8388f5d27cf18a Peter Zijlstra 2019-06-28 48 BUG();
8388f5d27cf18a Peter Zijlstra 2019-06-28 49 }
9fc0f798ab8a6c Ard Biesheuvel 2018-09-18 50
4cc6620b5e4c89 Daniel Bristot de Oliveira 2019-06-12 51 if (type == JUMP_LABEL_NOP)
86fa366b2e1b57 Peter Zijlstra 2021-03-10 52 code = x86_nops[5];
18cbc8bed0c707 Peter Zijlstra 2019-08-26 53
63f62addb88ec4 Peter Zijlstra 2019-10-03 54 return code;
4cc6620b5e4c89 Daniel Bristot de Oliveira 2019-06-12 55 }
4cc6620b5e4c89 Daniel Bristot de Oliveira 2019-06-12 56
:::::: The code at line 40 was first introduced by commit
:::::: 8388f5d27cf18ab67cb40c4ff289c5ab3f721369 jump_label, x86: Improve error when we fail expected text
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: CC: Peter Zijlstra <peterz(a)infradead.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH v2 1/1] gpio: Support interrupts in gpio-mlxbf2.c
by kernel test robot
Hi Asmaa,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on gpio/for-next]
[also build test ERROR on v5.12-rc2 next-20210310]
[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/Asmaa-Mnebhi/gpio-Support-interr...
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-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://github.com/0day-ci/linux/commit/8495cb2b31bda48cb427278a04332bc2d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Asmaa-Mnebhi/gpio-Support-interrupts-in-gpio-mlxbf2-c/20210311-031707
git checkout 8495cb2b31bda48cb427278a04332bc2d57a1614
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 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 errors (new ones prefixed by >>):
drivers/gpio/gpio-mlxbf2.c: In function 'mlxbf2_gpio_send_work':
>> drivers/gpio/gpio-mlxbf2.c:336:2: error: implicit declaration of function 'acpi_bus_generate_netlink_event' [-Werror=implicit-function-declaration]
336 | acpi_bus_generate_netlink_event("button/power.*", "Power Button",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mlxbf2.c:332:30: warning: variable 'gs' set but not used [-Wunused-but-set-variable]
332 | struct mlxbf2_gpio_context *gs;
| ^~
cc1: some warnings being treated as errors
vim +/acpi_bus_generate_netlink_event +336 drivers/gpio/gpio-mlxbf2.c
329
330 static void mlxbf2_gpio_send_work(struct work_struct *work)
331 {
332 struct mlxbf2_gpio_context *gs;
333
334 gs = container_of(work, struct mlxbf2_gpio_context, send_work);
335
> 336 acpi_bus_generate_netlink_event("button/power.*", "Power Button",
337 0x80, 1);
338 }
339
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH bpf-next 1/5] bpf: Add a ARG_PTR_TO_CONST_STR argument type
by kernel test robot
Hi Florent,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Florent-Revest/bpf-Add-a-ARG_PTR...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: i386-randconfig-s001-20210308 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-262-g5e674421-dirty
# https://github.com/0day-ci/linux/commit/cbb95ec99fafe0955aeada270c9be3d14...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Florent-Revest/bpf-Add-a-ARG_PTR_TO_CONST_STR-argument-type/20210311-070306
git checkout cbb95ec99fafe0955aeada270c9be3d1477c3866
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
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 >>)"
kernel/bpf/verifier.c:11728:76: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12136:81: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12140:81: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12144:81: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12148:79: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12152:78: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12156:79: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12160:78: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:12204:38: sparse: sparse: subtraction of functions? Share your drugs
>> kernel/bpf/verifier.c:4918:36: sparse: sparse: non size-preserving integer to pointer cast
vim +4918 kernel/bpf/verifier.c
4695
4696 static int check_func_arg(struct bpf_verifier_env *env, u32 arg,
4697 struct bpf_call_arg_meta *meta,
4698 const struct bpf_func_proto *fn)
4699 {
4700 u32 regno = BPF_REG_1 + arg;
4701 struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
4702 enum bpf_arg_type arg_type = fn->arg_type[arg];
4703 enum bpf_reg_type type = reg->type;
4704 int err = 0;
4705
4706 if (arg_type == ARG_DONTCARE)
4707 return 0;
4708
4709 err = check_reg_arg(env, regno, SRC_OP);
4710 if (err)
4711 return err;
4712
4713 if (arg_type == ARG_ANYTHING) {
4714 if (is_pointer_value(env, regno)) {
4715 verbose(env, "R%d leaks addr into helper function\n",
4716 regno);
4717 return -EACCES;
4718 }
4719 return 0;
4720 }
4721
4722 if (type_is_pkt_pointer(type) &&
4723 !may_access_direct_pkt_data(env, meta, BPF_READ)) {
4724 verbose(env, "helper access to the packet is not allowed\n");
4725 return -EACCES;
4726 }
4727
4728 if (arg_type == ARG_PTR_TO_MAP_VALUE ||
4729 arg_type == ARG_PTR_TO_UNINIT_MAP_VALUE ||
4730 arg_type == ARG_PTR_TO_MAP_VALUE_OR_NULL) {
4731 err = resolve_map_arg_type(env, meta, &arg_type);
4732 if (err)
4733 return err;
4734 }
4735
4736 if (register_is_null(reg) && arg_type_may_be_null(arg_type))
4737 /* A NULL register has a SCALAR_VALUE type, so skip
4738 * type checking.
4739 */
4740 goto skip_type_check;
4741
4742 err = check_reg_type(env, regno, arg_type, fn->arg_btf_id[arg]);
4743 if (err)
4744 return err;
4745
4746 if (type == PTR_TO_CTX) {
4747 err = check_ctx_reg(env, reg, regno);
4748 if (err < 0)
4749 return err;
4750 }
4751
4752 skip_type_check:
4753 if (reg->ref_obj_id) {
4754 if (meta->ref_obj_id) {
4755 verbose(env, "verifier internal error: more than one arg with ref_obj_id R%d %u %u\n",
4756 regno, reg->ref_obj_id,
4757 meta->ref_obj_id);
4758 return -EFAULT;
4759 }
4760 meta->ref_obj_id = reg->ref_obj_id;
4761 }
4762
4763 if (arg_type == ARG_CONST_MAP_PTR) {
4764 /* bpf_map_xxx(map_ptr) call: remember that map_ptr */
4765 meta->map_ptr = reg->map_ptr;
4766 } else if (arg_type == ARG_PTR_TO_MAP_KEY) {
4767 /* bpf_map_xxx(..., map_ptr, ..., key) call:
4768 * check that [key, key + map->key_size) are within
4769 * stack limits and initialized
4770 */
4771 if (!meta->map_ptr) {
4772 /* in function declaration map_ptr must come before
4773 * map_key, so that it's verified and known before
4774 * we have to check map_key here. Otherwise it means
4775 * that kernel subsystem misconfigured verifier
4776 */
4777 verbose(env, "invalid map_ptr to access map->key\n");
4778 return -EACCES;
4779 }
4780 err = check_helper_mem_access(env, regno,
4781 meta->map_ptr->key_size, false,
4782 NULL);
4783 } else if (arg_type == ARG_PTR_TO_MAP_VALUE ||
4784 (arg_type == ARG_PTR_TO_MAP_VALUE_OR_NULL &&
4785 !register_is_null(reg)) ||
4786 arg_type == ARG_PTR_TO_UNINIT_MAP_VALUE) {
4787 /* bpf_map_xxx(..., map_ptr, ..., value) call:
4788 * check [value, value + map->value_size) validity
4789 */
4790 if (!meta->map_ptr) {
4791 /* kernel subsystem misconfigured verifier */
4792 verbose(env, "invalid map_ptr to access map->value\n");
4793 return -EACCES;
4794 }
4795 meta->raw_mode = (arg_type == ARG_PTR_TO_UNINIT_MAP_VALUE);
4796 err = check_helper_mem_access(env, regno,
4797 meta->map_ptr->value_size, false,
4798 meta);
4799 } else if (arg_type == ARG_PTR_TO_PERCPU_BTF_ID) {
4800 if (!reg->btf_id) {
4801 verbose(env, "Helper has invalid btf_id in R%d\n", regno);
4802 return -EACCES;
4803 }
4804 meta->ret_btf = reg->btf;
4805 meta->ret_btf_id = reg->btf_id;
4806 } else if (arg_type == ARG_PTR_TO_SPIN_LOCK) {
4807 if (meta->func_id == BPF_FUNC_spin_lock) {
4808 if (process_spin_lock(env, regno, true))
4809 return -EACCES;
4810 } else if (meta->func_id == BPF_FUNC_spin_unlock) {
4811 if (process_spin_lock(env, regno, false))
4812 return -EACCES;
4813 } else {
4814 verbose(env, "verifier internal error\n");
4815 return -EFAULT;
4816 }
4817 } else if (arg_type == ARG_PTR_TO_FUNC) {
4818 meta->subprogno = reg->subprogno;
4819 } else if (arg_type_is_mem_ptr(arg_type)) {
4820 /* The access to this pointer is only checked when we hit the
4821 * next is_mem_size argument below.
4822 */
4823 meta->raw_mode = (arg_type == ARG_PTR_TO_UNINIT_MEM);
4824 } else if (arg_type_is_mem_size(arg_type)) {
4825 bool zero_size_allowed = (arg_type == ARG_CONST_SIZE_OR_ZERO);
4826
4827 /* This is used to refine r0 return value bounds for helpers
4828 * that enforce this value as an upper bound on return values.
4829 * See do_refine_retval_range() for helpers that can refine
4830 * the return value. C type of helper is u32 so we pull register
4831 * bound from umax_value however, if negative verifier errors
4832 * out. Only upper bounds can be learned because retval is an
4833 * int type and negative retvals are allowed.
4834 */
4835 meta->msize_max_value = reg->umax_value;
4836
4837 /* The register is SCALAR_VALUE; the access check
4838 * happens using its boundaries.
4839 */
4840 if (!tnum_is_const(reg->var_off))
4841 /* For unprivileged variable accesses, disable raw
4842 * mode so that the program is required to
4843 * initialize all the memory that the helper could
4844 * just partially fill up.
4845 */
4846 meta = NULL;
4847
4848 if (reg->smin_value < 0) {
4849 verbose(env, "R%d min value is negative, either use unsigned or 'var &= const'\n",
4850 regno);
4851 return -EACCES;
4852 }
4853
4854 if (reg->umin_value == 0) {
4855 err = check_helper_mem_access(env, regno - 1, 0,
4856 zero_size_allowed,
4857 meta);
4858 if (err)
4859 return err;
4860 }
4861
4862 if (reg->umax_value >= BPF_MAX_VAR_SIZ) {
4863 verbose(env, "R%d unbounded memory access, use 'var &= const' or 'if (var < const)'\n",
4864 regno);
4865 return -EACCES;
4866 }
4867 err = check_helper_mem_access(env, regno - 1,
4868 reg->umax_value,
4869 zero_size_allowed, meta);
4870 if (!err)
4871 err = mark_chain_precision(env, regno);
4872 } else if (arg_type_is_alloc_size(arg_type)) {
4873 if (!tnum_is_const(reg->var_off)) {
4874 verbose(env, "R%d is not a known constant'\n",
4875 regno);
4876 return -EACCES;
4877 }
4878 meta->mem_size = reg->var_off.value;
4879 } else if (arg_type_is_int_ptr(arg_type)) {
4880 int size = int_ptr_type_to_size(arg_type);
4881
4882 err = check_helper_mem_access(env, regno, size, false, meta);
4883 if (err)
4884 return err;
4885 err = check_ptr_alignment(env, reg, 0, size, true);
4886 } else if (arg_type == ARG_PTR_TO_CONST_STR) {
4887 struct bpf_map *map = reg->map_ptr;
4888 int map_off, i;
4889 u64 map_addr;
4890 char *map_ptr;
4891
4892 if (!map || !bpf_map_is_rdonly(map)) {
4893 verbose(env, "R%d does not point to a readonly map'\n", regno);
4894 return -EACCES;
4895 }
4896
4897 if (!tnum_is_const(reg->var_off)) {
4898 verbose(env, "R%d is not a constant address'\n", regno);
4899 return -EACCES;
4900 }
4901
4902 if (!map->ops->map_direct_value_addr) {
4903 verbose(env, "no direct value access support for this map type\n");
4904 return -EACCES;
4905 }
4906
4907 err = check_helper_mem_access(env, regno,
4908 map->value_size - reg->off,
4909 false, meta);
4910 if (err)
4911 return err;
4912
4913 map_off = reg->off + reg->var_off.value;
4914 err = map->ops->map_direct_value_addr(map, &map_addr, map_off);
4915 if (err)
4916 return err;
4917
> 4918 map_ptr = (char *)(map_addr);
4919 for (i = map_off; map_ptr[i] != '\0'; i++) {
4920 if (i == map->value_size - 1) {
4921 verbose(env, "map does not contain a NULL-terminated string\n");
4922 return -EACCES;
4923 }
4924 }
4925 }
4926
4927 return err;
4928 }
4929
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH 3/3] arm64: mm: hugetlb: add support for free vmemmap pages of HugeTLB
by kernel test robot
Hi Muchun,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on next-20210310]
[cannot apply to hnaz-linux-mm/master arm64/for-next/core tip/x86/mm linus/master v5.12-rc2 v5.12-rc1 v5.11 v5.12-rc2]
[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/Muchun-Song/mm-bootmem_info-mark...
base: b01d57bfdc41c8f635b08b8a5af8a31217d46936
config: x86_64-randconfig-r002-20210309 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project cd9a69289c7825d54450cb6829fef2c8e0f1963a)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/d0b8d83bb423fd25a85be4a62a8bed9f8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Muchun-Song/mm-bootmem_info-mark-register_page_bootmem_info_section-__init/20210310-161619
git checkout d0b8d83bb423fd25a85be4a62a8bed9f8d8a0d96
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/x86/mm/init_64.c:1585:6: error: implicit declaration of function 'vmemmap_use_new_sub_pmd' [-Werror,-Wimplicit-function-declaration]
vmemmap_use_new_sub_pmd(addr, next);
^
arch/x86/mm/init_64.c:1591:4: error: implicit declaration of function 'vmemmap_use_sub_pmd' [-Werror,-Wimplicit-function-declaration]
vmemmap_use_sub_pmd(addr, next);
^
>> arch/x86/mm/init_64.c:1625:6: warning: no previous prototype for function 'arch_free_vmemmap_page' [-Wmissing-prototypes]
void arch_free_vmemmap_page(struct page *page)
^
arch/x86/mm/init_64.c:1625:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void arch_free_vmemmap_page(struct page *page)
^
static
1 warning and 2 errors generated.
--
mm/bootmem_info.c:87:11: error: implicit declaration of function 'sparse_decode_mem_map' [-Werror,-Wimplicit-function-declaration]
memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr);
^
>> mm/bootmem_info.c:87:9: warning: incompatible integer to pointer conversion assigning to 'struct page *' from 'int' [-Wint-conversion]
memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +/arch_free_vmemmap_page +1625 arch/x86/mm/init_64.c
c2b91e2eec9678 Yinghai Lu 2008-04-12 1623
cd28b1a6791da0 Muchun Song 2021-03-09 1624 #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
92924b23a9f6de Muchun Song 2021-03-10 @1625 void arch_free_vmemmap_page(struct page *page)
92924b23a9f6de Muchun Song 2021-03-10 1626 {
92924b23a9f6de Muchun Song 2021-03-10 1627 free_bootmem_page(page);
92924b23a9f6de Muchun Song 2021-03-10 1628 }
92924b23a9f6de Muchun Song 2021-03-10 1629
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[linux-next:master 2744/3213] drivers/scsi/lpfc/lpfc_els.c:5840:36: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b01d57bfdc41c8f635b08b8a5af8a31217d46936
commit: 960984d964a9341cf50bf2b4ffdf0beb14467517 [2744/3213] include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
config: i386-randconfig-s001-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-262-g5e674421-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 960984d964a9341cf50bf2b4ffdf0beb14467517
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
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/scsi/lpfc/lpfc_els.c:5612:28: sparse: got restricted __be16 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5614:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] flags @@ got restricted __be16 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5614:30: sparse: expected unsigned short [usertype] flags
drivers/scsi/lpfc/lpfc_els.c:5614:30: sparse: got restricted __be16 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5615:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5615:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5615:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5626:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5626:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5626:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5630:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] port_type @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5630:30: sparse: expected unsigned int [usertype] port_type
drivers/scsi/lpfc/lpfc_els.c:5630:30: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5632:49: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] link_failure_cnt @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5632:49: sparse: expected unsigned int [usertype] link_failure_cnt
drivers/scsi/lpfc/lpfc_els.c:5632:49: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5634:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] loss_of_synch_cnt @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5634:50: sparse: expected unsigned int [usertype] loss_of_synch_cnt
drivers/scsi/lpfc/lpfc_els.c:5634:50: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5636:51: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] loss_of_signal_cnt @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5636:51: sparse: expected unsigned int [usertype] loss_of_signal_cnt
drivers/scsi/lpfc/lpfc_els.c:5636:51: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5638:56: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] primitive_seq_proto_err @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5638:56: sparse: expected unsigned int [usertype] primitive_seq_proto_err
drivers/scsi/lpfc/lpfc_els.c:5638:56: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5640:51: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] invalid_trans_word @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5640:51: sparse: expected unsigned int [usertype] invalid_trans_word
drivers/scsi/lpfc/lpfc_els.c:5640:51: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5642:48: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] invalid_crc_cnt @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5642:48: sparse: expected unsigned int [usertype] invalid_crc_cnt
drivers/scsi/lpfc/lpfc_els.c:5642:48: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5644:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5644:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5644:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5655:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5655:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5655:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5659:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] port_bbc @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5659:33: sparse: expected unsigned int [usertype] port_bbc
drivers/scsi/lpfc/lpfc_els.c:5659:33: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5663:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] attached_port_bbc @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5663:50: sparse: expected unsigned int [usertype] attached_port_bbc
drivers/scsi/lpfc/lpfc_els.c:5663:50: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5669:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5669:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5669:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5680:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5680:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5680:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5697:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5697:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:5697:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5698:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5698:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5698:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5709:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5709:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5709:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5726:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5726:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:5726:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5727:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5727:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5727:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5738:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5738:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5738:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5755:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5755:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:5755:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5756:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5756:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5756:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5767:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5767:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5767:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5784:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5784:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:5784:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5785:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5785:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5785:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5797:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5797:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5797:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5814:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5814:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:5814:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5815:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5815:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5815:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5823:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5823:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5823:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5829:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5829:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5829:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5838:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5838:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5838:19: sparse: got restricted __be32 [usertype]
>> drivers/scsi/lpfc/lpfc_els.c:5840:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] CorrectedBlocks @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5840:36: sparse: expected unsigned int [usertype] CorrectedBlocks
drivers/scsi/lpfc/lpfc_els.c:5840:36: sparse: got restricted __be32 [usertype]
>> drivers/scsi/lpfc/lpfc_els.c:5842:40: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] UncorrectableBlocks @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5842:40: sparse: expected unsigned int [usertype] UncorrectableBlocks
drivers/scsi/lpfc/lpfc_els.c:5842:40: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5845:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5845:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5845:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5856:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5856:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5856:19: sparse: got restricted __be32 [usertype]
>> drivers/scsi/lpfc/lpfc_els.c:5888:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] speed @@ got restricted __be16 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5888:37: sparse: expected unsigned short [usertype] speed
drivers/scsi/lpfc/lpfc_els.c:5888:37: sparse: got restricted __be16 [usertype]
>> drivers/scsi/lpfc/lpfc_els.c:5914:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] capabilities @@ got restricted __be16 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5914:44: sparse: expected unsigned short [usertype] capabilities
drivers/scsi/lpfc/lpfc_els.c:5914:44: sparse: got restricted __be16 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5915:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5915:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5915:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5924:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5924:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5924:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5932:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5932:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5932:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5941:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5941:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:5941:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:5956:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:5956:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:5956:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6047:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6047:25: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6047:25: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6055:22: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6186:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6195:25: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6197:36: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6200:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:6405:17: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:6410:21: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:6420:17: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:6465:9: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:6465:9: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:6609:31: sparse: sparse: too many warnings
--
drivers/scsi/lpfc/lpfc_sli.c:17359:20: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:14622:13: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:14623:17: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:14623:17: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:14623:17: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:14623:17: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:14632:16: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:8201:16: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:8204:21: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:8205:23: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:695:13: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:715:17: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:715:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word3 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:715:17: sparse: expected unsigned int [usertype] word3
drivers/scsi/lpfc/lpfc_sli.c:715:17: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:454:13: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:580:17: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:580:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word0 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:580:17: sparse: expected unsigned int [usertype] word0
drivers/scsi/lpfc/lpfc_sli.c:580:17: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:602:24: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:2087:35: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:2189:38: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:2190:38: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:2193:35: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:2194:36: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:8655:33: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:8701:41: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9589:38: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9597:37: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9598:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sge_len @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:9598:38: sparse: expected unsigned int [usertype] sge_len
drivers/scsi/lpfc/lpfc_sli.c:9598:38: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:9615:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word2 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:9615:36: sparse: expected unsigned int [usertype] word2
drivers/scsi/lpfc/lpfc_sli.c:9615:36: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:9624:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] addr_hi @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:9624:38: sparse: expected unsigned int [usertype] addr_hi
drivers/scsi/lpfc/lpfc_sli.c:9624:38: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:9626:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] addr_lo @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:9626:38: sparse: expected unsigned int [usertype] addr_lo
drivers/scsi/lpfc/lpfc_sli.c:9626:38: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:9628:38: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9630:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word2 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:9630:36: sparse: expected unsigned int [usertype] word2
drivers/scsi/lpfc/lpfc_sli.c:9630:36: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:9631:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sge_len @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:9631:38: sparse: expected unsigned int [usertype] sge_len
drivers/scsi/lpfc/lpfc_sli.c:9631:38: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:9701:46: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9702:45: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9706:43: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:9710:38: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:10022:37: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:11354:25: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:11382:25: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:13369:37: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:13381:45: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:14050:16: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:17154:57: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg0_addr_lo @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17154:57: sparse: expected unsigned int [usertype] sgl_pg0_addr_lo
drivers/scsi/lpfc/lpfc_sli.c:17154:57: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17156:57: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg0_addr_hi @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17156:57: sparse: expected unsigned int [usertype] sgl_pg0_addr_hi
drivers/scsi/lpfc/lpfc_sli.c:17156:57: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17159:57: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg1_addr_lo @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17159:57: sparse: expected unsigned int [usertype] sgl_pg1_addr_lo
drivers/scsi/lpfc/lpfc_sli.c:17159:57: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17161:57: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg1_addr_hi @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17161:57: sparse: expected unsigned int [usertype] sgl_pg1_addr_hi
drivers/scsi/lpfc/lpfc_sli.c:17161:57: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17450:47: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg0_addr_lo @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17450:47: sparse: expected unsigned int [usertype] sgl_pg0_addr_lo
drivers/scsi/lpfc/lpfc_sli.c:17450:47: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17452:47: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg0_addr_hi @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17452:47: sparse: expected unsigned int [usertype] sgl_pg0_addr_hi
drivers/scsi/lpfc/lpfc_sli.c:17452:47: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17459:47: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg1_addr_lo @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17459:47: sparse: expected unsigned int [usertype] sgl_pg1_addr_lo
drivers/scsi/lpfc/lpfc_sli.c:17459:47: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17461:47: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sgl_pg1_addr_hi @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17461:47: sparse: expected unsigned int [usertype] sgl_pg1_addr_hi
drivers/scsi/lpfc/lpfc_sli.c:17461:47: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17472:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word0 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:17472:20: sparse: expected unsigned int [usertype] word0
drivers/scsi/lpfc/lpfc_sli.c:17472:20: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_sli.c:17694:9: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_sli.c:18311:16: sparse: sparse: restricted __be16 degrades to integer
>> drivers/scsi/lpfc/lpfc_sli.c:20004:45: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20004:45: sparse: expected unsigned int
drivers/scsi/lpfc/lpfc_sli.c:20004:45: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:20370:38: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:20378:37: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:20379:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sge_len @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20379:38: sparse: expected unsigned int [usertype] sge_len
drivers/scsi/lpfc/lpfc_sli.c:20379:38: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:20413:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word2 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20413:36: sparse: expected unsigned int [usertype] word2
drivers/scsi/lpfc/lpfc_sli.c:20413:36: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:20422:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] addr_hi @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20422:30: sparse: expected unsigned int [usertype] addr_hi
drivers/scsi/lpfc/lpfc_sli.c:20422:30: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:20423:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] addr_lo @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20423:30: sparse: expected unsigned int [usertype] addr_lo
drivers/scsi/lpfc/lpfc_sli.c:20423:30: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:20424:30: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_sli.c:20426:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] word2 @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20426:28: sparse: expected unsigned int [usertype] word2
drivers/scsi/lpfc/lpfc_sli.c:20426:28: sparse: got restricted __le32 [usertype]
drivers/scsi/lpfc/lpfc_sli.c:20427:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] sge_len @@ got restricted __le32 [usertype] @@
drivers/scsi/lpfc/lpfc_sli.c:20427:30: sparse: expected unsigned int [usertype] sge_len
drivers/scsi/lpfc/lpfc_sli.c:20427:30: sparse: got restricted __le32 [usertype]
>> drivers/scsi/lpfc/lpfc_sli.c:12078:36: sparse: sparse: context imbalance in 'lpfc_sli_abort_taskmgmt' - different lock contexts for basic block
vim +5840 drivers/scsi/lpfc/lpfc_els.c
56204984761d80 James Smart 2016-03-31 5832
bd4b3e5c8adf2b Baoyou Xie 2016-09-25 5833 static uint32_t
4258e98ee3862c James Smart 2015-12-16 5834 lpfc_rdp_res_fec_desc(struct fc_fec_rdp_desc *desc, READ_LNK_VAR *stat)
4258e98ee3862c James Smart 2015-12-16 5835 {
4258e98ee3862c James Smart 2015-12-16 5836 if (bf_get(lpfc_read_link_stat_gec2, stat) == 0)
4258e98ee3862c James Smart 2015-12-16 5837 return 0;
4258e98ee3862c James Smart 2015-12-16 5838 desc->tag = cpu_to_be32(RDP_FEC_DESC_TAG);
4258e98ee3862c James Smart 2015-12-16 5839
4258e98ee3862c James Smart 2015-12-16 @5840 desc->info.CorrectedBlocks =
4258e98ee3862c James Smart 2015-12-16 5841 cpu_to_be32(stat->fecCorrBlkCount);
4258e98ee3862c James Smart 2015-12-16 @5842 desc->info.UncorrectableBlocks =
4258e98ee3862c James Smart 2015-12-16 5843 cpu_to_be32(stat->fecUncorrBlkCount);
4258e98ee3862c James Smart 2015-12-16 5844
4258e98ee3862c James Smart 2015-12-16 5845 desc->length = cpu_to_be32(sizeof(desc->info));
4258e98ee3862c James Smart 2015-12-16 5846
4258e98ee3862c James Smart 2015-12-16 5847 return sizeof(struct fc_fec_rdp_desc);
4258e98ee3862c James Smart 2015-12-16 5848 }
4258e98ee3862c James Smart 2015-12-16 5849
bd4b3e5c8adf2b Baoyou Xie 2016-09-25 5850 static uint32_t
86478875eb4d2e James Smart 2015-05-21 5851 lpfc_rdp_res_speed(struct fc_rdp_port_speed_desc *desc, struct lpfc_hba *phba)
86478875eb4d2e James Smart 2015-05-21 5852 {
86478875eb4d2e James Smart 2015-05-21 5853 uint16_t rdp_cap = 0;
86478875eb4d2e James Smart 2015-05-21 5854 uint16_t rdp_speed;
86478875eb4d2e James Smart 2015-05-21 5855
86478875eb4d2e James Smart 2015-05-21 5856 desc->tag = cpu_to_be32(RDP_PORT_SPEED_DESC_TAG);
86478875eb4d2e James Smart 2015-05-21 5857
81e7517723fc17 James Smart 2015-12-16 5858 switch (phba->fc_linkspeed) {
81e7517723fc17 James Smart 2015-12-16 5859 case LPFC_LINK_SPEED_1GHZ:
86478875eb4d2e James Smart 2015-05-21 5860 rdp_speed = RDP_PS_1GB;
86478875eb4d2e James Smart 2015-05-21 5861 break;
81e7517723fc17 James Smart 2015-12-16 5862 case LPFC_LINK_SPEED_2GHZ:
86478875eb4d2e James Smart 2015-05-21 5863 rdp_speed = RDP_PS_2GB;
86478875eb4d2e James Smart 2015-05-21 5864 break;
81e7517723fc17 James Smart 2015-12-16 5865 case LPFC_LINK_SPEED_4GHZ:
86478875eb4d2e James Smart 2015-05-21 5866 rdp_speed = RDP_PS_4GB;
86478875eb4d2e James Smart 2015-05-21 5867 break;
81e7517723fc17 James Smart 2015-12-16 5868 case LPFC_LINK_SPEED_8GHZ:
86478875eb4d2e James Smart 2015-05-21 5869 rdp_speed = RDP_PS_8GB;
86478875eb4d2e James Smart 2015-05-21 5870 break;
81e7517723fc17 James Smart 2015-12-16 5871 case LPFC_LINK_SPEED_10GHZ:
86478875eb4d2e James Smart 2015-05-21 5872 rdp_speed = RDP_PS_10GB;
86478875eb4d2e James Smart 2015-05-21 5873 break;
81e7517723fc17 James Smart 2015-12-16 5874 case LPFC_LINK_SPEED_16GHZ:
86478875eb4d2e James Smart 2015-05-21 5875 rdp_speed = RDP_PS_16GB;
86478875eb4d2e James Smart 2015-05-21 5876 break;
a085e87c814567 James Smart 2015-12-16 5877 case LPFC_LINK_SPEED_32GHZ:
a085e87c814567 James Smart 2015-12-16 5878 rdp_speed = RDP_PS_32GB;
a085e87c814567 James Smart 2015-12-16 5879 break;
fbd8a6ba65443a James Smart 2018-02-22 5880 case LPFC_LINK_SPEED_64GHZ:
fbd8a6ba65443a James Smart 2018-02-22 5881 rdp_speed = RDP_PS_64GB;
fbd8a6ba65443a James Smart 2018-02-22 5882 break;
86478875eb4d2e James Smart 2015-05-21 5883 default:
86478875eb4d2e James Smart 2015-05-21 5884 rdp_speed = RDP_PS_UNKNOWN;
86478875eb4d2e James Smart 2015-05-21 5885 break;
86478875eb4d2e James Smart 2015-05-21 5886 }
86478875eb4d2e James Smart 2015-05-21 5887
86478875eb4d2e James Smart 2015-05-21 @5888 desc->info.port_speed.speed = cpu_to_be16(rdp_speed);
86478875eb4d2e James Smart 2015-05-21 5889
1dc5ec2452025c James Smart 2018-10-23 5890 if (phba->lmt & LMT_128Gb)
1dc5ec2452025c James Smart 2018-10-23 5891 rdp_cap |= RDP_PS_128GB;
fbd8a6ba65443a James Smart 2018-02-22 5892 if (phba->lmt & LMT_64Gb)
fbd8a6ba65443a James Smart 2018-02-22 5893 rdp_cap |= RDP_PS_64GB;
d38dd52c79bc11 James Smart 2015-08-31 5894 if (phba->lmt & LMT_32Gb)
d38dd52c79bc11 James Smart 2015-08-31 5895 rdp_cap |= RDP_PS_32GB;
86478875eb4d2e James Smart 2015-05-21 5896 if (phba->lmt & LMT_16Gb)
86478875eb4d2e James Smart 2015-05-21 5897 rdp_cap |= RDP_PS_16GB;
86478875eb4d2e James Smart 2015-05-21 5898 if (phba->lmt & LMT_10Gb)
86478875eb4d2e James Smart 2015-05-21 5899 rdp_cap |= RDP_PS_10GB;
86478875eb4d2e James Smart 2015-05-21 5900 if (phba->lmt & LMT_8Gb)
86478875eb4d2e James Smart 2015-05-21 5901 rdp_cap |= RDP_PS_8GB;
86478875eb4d2e James Smart 2015-05-21 5902 if (phba->lmt & LMT_4Gb)
86478875eb4d2e James Smart 2015-05-21 5903 rdp_cap |= RDP_PS_4GB;
86478875eb4d2e James Smart 2015-05-21 5904 if (phba->lmt & LMT_2Gb)
86478875eb4d2e James Smart 2015-05-21 5905 rdp_cap |= RDP_PS_2GB;
86478875eb4d2e James Smart 2015-05-21 5906 if (phba->lmt & LMT_1Gb)
86478875eb4d2e James Smart 2015-05-21 5907 rdp_cap |= RDP_PS_1GB;
86478875eb4d2e James Smart 2015-05-21 5908
86478875eb4d2e James Smart 2015-05-21 5909 if (rdp_cap == 0)
86478875eb4d2e James Smart 2015-05-21 5910 rdp_cap = RDP_CAP_UNKNOWN;
56204984761d80 James Smart 2016-03-31 5911 if (phba->cfg_link_speed != LPFC_USER_LINK_SPEED_AUTO)
56204984761d80 James Smart 2016-03-31 5912 rdp_cap |= RDP_CAP_USER_CONFIGURED;
86478875eb4d2e James Smart 2015-05-21 5913
86478875eb4d2e James Smart 2015-05-21 @5914 desc->info.port_speed.capabilities = cpu_to_be16(rdp_cap);
86478875eb4d2e James Smart 2015-05-21 5915 desc->length = cpu_to_be32(sizeof(desc->info));
6c92d1d0ce4eff James Smart 2016-07-06 5916 return sizeof(struct fc_rdp_port_speed_desc);
86478875eb4d2e James Smart 2015-05-21 5917 }
86478875eb4d2e James Smart 2015-05-21 5918
:::::: The code at line 5840 was first introduced by commit
:::::: 4258e98ee3862ca7036654b43c839ab7668043e0 lpfc: Modularize and cleanup FDMI code in driver
:::::: TO: James Smart <james.smart(a)avagotech.com>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
drivers/gpu/drm/i915/gt/selftest_execlists.c:167:4: error: format string is not a string literal (potentially insecure)
by kernel test robot
Hi Chris,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a74e6a014c9d4d4161061f770c9b4f98372ac778
commit: 70a2b431c36483c0c06e589e11c59e438cd0ac06 drm/i915/gt: Rename lrc.c to execlists_submission.c
date: 3 months ago
config: x86_64-randconfig-a014-20210311 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project cd9a69289c7825d54450cb6829fef2c8e0f1963a)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 70a2b431c36483c0c06e589e11c59e438cd0ac06
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 >>):
In file included from drivers/gpu/drm/i915/gt/intel_execlists_submission.c:6116:
>> drivers/gpu/drm/i915/gt/selftest_execlists.c:167:4: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("spinner failed to start\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:69:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:724:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:738:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/gt/selftest_execlists.c:167:4: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:69:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:724:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:738:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
In file included from drivers/gpu/drm/i915/gt/intel_execlists_submission.c:6116:
drivers/gpu/drm/i915/gt/selftest_execlists.c:1790:4: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("lo spinner failed to start\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:69:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:724:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:738:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/gt/selftest_execlists.c:1790:4: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:69:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:724:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:738:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
In file included from drivers/gpu/drm/i915/gt/intel_execlists_submission.c:6116:
drivers/gpu/drm/i915/gt/selftest_execlists.c:1807:4: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("hi spinner failed to start\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:69:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:724:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:738:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/gt/selftest_execlists.c:1807:4: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:69:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:724:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:738:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
3 errors generated.
vim +167 drivers/gpu/drm/i915/gt/selftest_execlists.c
280e285dc78f73 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2020-02-27 134
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 135 static int live_sanitycheck(void *arg)
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 136 {
1357fa8136ea03 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-10-16 137 struct intel_gt *gt = arg;
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 138 struct intel_engine_cs *engine;
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 139 enum intel_engine_id id;
8d2f6e2f272109 drivers/gpu/drm/i915/selftests/intel_lrc.c Tvrtko Ursulin 2018-11-30 140 struct igt_spinner spin;
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 141 int err = 0;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 142
1357fa8136ea03 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-10-16 143 if (!HAS_LOGICAL_RING_CONTEXTS(gt->i915))
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 144 return 0;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 145
1357fa8136ea03 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-10-16 146 if (igt_spinner_init(&spin, gt))
2af402982ab382 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-10-04 147 return -ENOMEM;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 148
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 149 for_each_engine(engine, gt, id) {
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 150 struct intel_context *ce;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 151 struct i915_request *rq;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 152
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 153 ce = intel_context_create(engine);
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 154 if (IS_ERR(ce)) {
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 155 err = PTR_ERR(ce);
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 156 break;
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 157 }
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 158
f277bc0c98a407 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-07-31 159 rq = igt_spinner_create_request(&spin, ce, MI_NOOP);
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 160 if (IS_ERR(rq)) {
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 161 err = PTR_ERR(rq);
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 162 goto out_ctx;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 163 }
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 164
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 165 i915_request_add(rq);
8d2f6e2f272109 drivers/gpu/drm/i915/selftests/intel_lrc.c Tvrtko Ursulin 2018-11-30 166 if (!igt_wait_for_spinner(&spin, rq)) {
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 @167 GEM_TRACE("spinner failed to start\n");
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 168 GEM_TRACE_DUMP();
1357fa8136ea03 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-10-16 169 intel_gt_set_wedged(gt);
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 170 err = -EIO;
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 171 goto out_ctx;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 172 }
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 173
8d2f6e2f272109 drivers/gpu/drm/i915/selftests/intel_lrc.c Tvrtko Ursulin 2018-11-30 174 igt_spinner_end(&spin);
1357fa8136ea03 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-10-16 175 if (igt_flush_test(gt->i915)) {
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 176 err = -EIO;
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 177 goto out_ctx;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 178 }
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 179
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 180 out_ctx:
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 181 intel_context_put(ce);
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 182 if (err)
e6ba76480299a0 drivers/gpu/drm/i915/gt/selftest_lrc.c Chris Wilson 2019-12-21 183 break;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 184 }
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 185
8d2f6e2f272109 drivers/gpu/drm/i915/selftests/intel_lrc.c Tvrtko Ursulin 2018-11-30 186 igt_spinner_fini(&spin);
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 187 return err;
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 188 }
2c66555ec19235 drivers/gpu/drm/i915/selftests/intel_lrc.c Chris Wilson 2018-04-04 189
:::::: The code at line 167 was first introduced by commit
:::::: 2c66555ec19235efd689741c44bbeb893aa8e7de drm/i915/selftests: Add basic sanitychecks for execlists
:::::: TO: Chris Wilson <chris(a)chris-wilson.co.uk>
:::::: CC: Chris Wilson <chris(a)chris-wilson.co.uk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months