fs/io_uring.c:5465:65: sparse: sparse: incorrect type in argument 1 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: aa43477b040251f451db0d844073ac00a8ab66ee io_uring: poll rework
date: 4 weeks ago
config: csky-randconfig-s032-20220120 (https://download.01.org/0day-ci/archive/20220125/202201251339.3yJhTpLS-lk...)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# 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 aa43477b040251f451db0d844073ac00a8ab66ee
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash
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 >>)
fs/io_uring.c:3196:24: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __user * @@ got struct io_buffer *[assigned] kbuf @@
fs/io_uring.c:3196:24: sparse: expected void [noderef] __user *
fs/io_uring.c:3196:24: sparse: got struct io_buffer *[assigned] kbuf
fs/io_uring.c:4740:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *file @@ got struct file [noderef] __rcu * @@
fs/io_uring.c:4740:14: sparse: expected struct file *file
fs/io_uring.c:4740:14: sparse: got struct file [noderef] __rcu *
fs/io_uring.c:5460:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] result @@ got restricted __poll_t @@
fs/io_uring.c:5460:37: sparse: expected unsigned int [usertype] result
fs/io_uring.c:5460:37: sparse: got restricted __poll_t
fs/io_uring.c:5465:71: sparse: sparse: restricted __poll_t degrades to integer
>> fs/io_uring.c:5465:65: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __poll_t [usertype] val @@ got unsigned int @@
fs/io_uring.c:5465:65: sparse: expected restricted __poll_t [usertype] val
fs/io_uring.c:5465:65: sparse: got unsigned int
>> fs/io_uring.c:5465:52: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __poll_t [usertype] mask @@ got unsigned short @@
fs/io_uring.c:5465:52: sparse: expected restricted __poll_t [usertype] mask
fs/io_uring.c:5465:52: sparse: got unsigned short
>> fs/io_uring.c:5469:71: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected signed int [usertype] res @@ got restricted __poll_t [usertype] mask @@
fs/io_uring.c:5469:71: sparse: expected signed int [usertype] res
fs/io_uring.c:5469:71: sparse: got restricted __poll_t [usertype] mask
fs/io_uring.c:5499:66: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5499:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __poll_t [usertype] val @@ got unsigned int @@
fs/io_uring.c:5499:55: sparse: expected restricted __poll_t [usertype] val
fs/io_uring.c:5499:55: sparse: got unsigned int
fs/io_uring.c:5572:40: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected int mask @@ got restricted __poll_t [usertype] mask @@
fs/io_uring.c:5572:40: sparse: expected int mask
fs/io_uring.c:5572:40: sparse: got restricted __poll_t [usertype] mask
>> fs/io_uring.c:5658:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got restricted __poll_t [assigned] [usertype] mask @@
fs/io_uring.c:5658:24: sparse: expected int
fs/io_uring.c:5658:24: sparse: got restricted __poll_t [assigned] [usertype] mask
fs/io_uring.c:5675:40: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected int mask @@ got restricted __poll_t [assigned] [usertype] mask @@
fs/io_uring.c:5675:40: sparse: expected int mask
fs/io_uring.c:5675:40: sparse: got restricted __poll_t [assigned] [usertype] mask
fs/io_uring.c:5710:25: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5710:48: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __poll_t [usertype] mask @@ got unsigned int @@
fs/io_uring.c:5710:48: sparse: expected restricted __poll_t [usertype] mask
fs/io_uring.c:5710:48: sparse: got unsigned int
fs/io_uring.c:5719:22: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5719:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5719:22: sparse: right side has type int
fs/io_uring.c:5724:30: sparse: sparse: invalid assignment: &=
fs/io_uring.c:5724:30: sparse: left side has type restricted __poll_t
fs/io_uring.c:5724:30: sparse: right side has type int
fs/io_uring.c:5726:22: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5726:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5726:22: sparse: right side has type int
fs/io_uring.c:5742:33: sparse: sparse: incorrect type in argument 5 (different base types) @@ expected int mask @@ got restricted __poll_t [usertype] mask @@
fs/io_uring.c:5742:33: sparse: expected int mask
fs/io_uring.c:5742:33: sparse: got restricted __poll_t [usertype] mask
fs/io_uring.c:5742:50: sparse: sparse: incorrect type in argument 6 (different base types) @@ expected int events @@ got restricted __poll_t [usertype] events @@
fs/io_uring.c:5742:50: sparse: expected int events
fs/io_uring.c:5742:50: sparse: got restricted __poll_t [usertype] events
fs/io_uring.c:5823:24: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5823:24: sparse: left side has type unsigned int
fs/io_uring.c:5823:24: sparse: right side has type restricted __poll_t
fs/io_uring.c:5824:65: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5824:29: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5824:38: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted __poll_t @@ got unsigned int @@
fs/io_uring.c:5824:38: sparse: expected restricted __poll_t
fs/io_uring.c:5824:38: sparse: got unsigned int
fs/io_uring.c:5913:43: sparse: sparse: invalid assignment: &=
fs/io_uring.c:5913:43: sparse: left side has type restricted __poll_t
fs/io_uring.c:5913:43: sparse: right side has type int
fs/io_uring.c:5914:62: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5914:43: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5914:43: sparse: left side has type restricted __poll_t
fs/io_uring.c:5914:43: sparse: right side has type unsigned int
fs/io_uring.c:2241:17: sparse: sparse: context imbalance in 'handle_prev_tw_list' - different lock contexts for basic block
fs/io_uring.c:7945:9: sparse: sparse: context imbalance in 'io_sq_thread_unpark' - wrong count at exit
fs/io_uring.c:7956:9: sparse: sparse: context imbalance in 'io_sq_thread_park' - wrong count at exit
vim +5465 fs/io_uring.c
5429
5430 /*
5431 * All poll tw should go through this. Checks for poll events, manages
5432 * references, does rewait, etc.
5433 *
5434 * Returns a negative error on failure. >0 when no action require, which is
5435 * either spurious wakeup or multishot CQE is served. 0 when it's done with
5436 * the request, then the mask is stored in req->result.
5437 */
5438 static int io_poll_check_events(struct io_kiocb *req)
5439 {
5440 struct io_ring_ctx *ctx = req->ctx;
5441 struct io_poll_iocb *poll = io_poll_get_single(req);
5442 int v;
5443
5444 /* req->task == current here, checking PF_EXITING is safe */
5445 if (unlikely(req->task->flags & PF_EXITING))
5446 io_poll_mark_cancelled(req);
5447
5448 do {
5449 v = atomic_read(&req->poll_refs);
5450
5451 /* tw handler should be the owner, and so have some references */
5452 if (WARN_ON_ONCE(!(v & IO_POLL_REF_MASK)))
5453 return 0;
5454 if (v & IO_POLL_CANCEL_FLAG)
5455 return -ECANCELED;
5456
5457 if (!req->result) {
5458 struct poll_table_struct pt = { ._key = poll->events };
5459
5460 req->result = vfs_poll(req->file, &pt) & poll->events;
5461 }
5462
5463 /* multishot, just fill an CQE and proceed */
5464 if (req->result && !(poll->events & EPOLLONESHOT)) {
> 5465 __poll_t mask = mangle_poll(req->result & poll->events);
5466 bool filled;
5467
5468 spin_lock(&ctx->completion_lock);
> 5469 filled = io_fill_cqe_aux(ctx, req->user_data, mask,
5470 IORING_CQE_F_MORE);
5471 io_commit_cqring(ctx);
5472 spin_unlock(&ctx->completion_lock);
5473 if (unlikely(!filled))
5474 return -ECANCELED;
5475 io_cqring_ev_posted(ctx);
5476 } else if (req->result) {
5477 return 0;
5478 }
5479
5480 /*
5481 * Release all references, retry if someone tried to restart
5482 * task_work while we were executing it.
5483 */
5484 } while (atomic_sub_return(v & IO_POLL_REF_MASK, &req->poll_refs));
5485
5486 return 1;
5487 }
5488
5489 static void io_poll_task_func(struct io_kiocb *req, bool *locked)
5490 {
5491 struct io_ring_ctx *ctx = req->ctx;
5492 int ret;
5493
5494 ret = io_poll_check_events(req);
5495 if (ret > 0)
5496 return;
5497
5498 if (!ret) {
5499 req->result = mangle_poll(req->result & req->poll.events);
5500 } else {
5501 req->result = ret;
5502 req_set_fail(req);
5503 }
5504
5505 io_poll_remove_entries(req);
5506 spin_lock(&ctx->completion_lock);
5507 hash_del(&req->hash_node);
5508 __io_req_complete_post(req, req->result, 0);
5509 io_commit_cqring(ctx);
5510 spin_unlock(&ctx->completion_lock);
5511 io_cqring_ev_posted(ctx);
5512 }
5513
5514 static void io_apoll_task_func(struct io_kiocb *req, bool *locked)
5515 {
5516 struct io_ring_ctx *ctx = req->ctx;
5517 int ret;
5518
5519 ret = io_poll_check_events(req);
5520 if (ret > 0)
5521 return;
5522
5523 io_poll_remove_entries(req);
5524 spin_lock(&ctx->completion_lock);
5525 hash_del(&req->hash_node);
5526 spin_unlock(&ctx->completion_lock);
5527
5528 if (!ret)
5529 io_req_task_submit(req, locked);
5530 else
5531 io_req_complete_failed(req, ret);
5532 }
5533
5534 static void __io_poll_execute(struct io_kiocb *req, int mask)
5535 {
5536 req->result = mask;
5537 if (req->opcode == IORING_OP_POLL_ADD)
5538 req->io_task_work.func = io_poll_task_func;
5539 else
5540 req->io_task_work.func = io_apoll_task_func;
5541
5542 trace_io_uring_task_add(req->ctx, req->opcode, req->user_data, mask);
5543 io_req_task_work_add(req, false);
5544 }
5545
5546 static inline void io_poll_execute(struct io_kiocb *req, int res)
5547 {
5548 if (io_poll_get_ownership(req))
5549 __io_poll_execute(req, res);
5550 }
5551
5552 static void io_poll_cancel_req(struct io_kiocb *req)
5553 {
5554 io_poll_mark_cancelled(req);
5555 /* kick tw, which should complete the request */
5556 io_poll_execute(req, 0);
5557 }
5558
5559 static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
5560 void *key)
5561 {
5562 struct io_kiocb *req = wait->private;
5563 struct io_poll_iocb *poll = container_of(wait, struct io_poll_iocb,
5564 wait);
5565 __poll_t mask = key_to_poll(key);
5566
5567 /* for instances that support it check for an event match first */
5568 if (mask && !(mask & poll->events))
5569 return 0;
5570
5571 if (io_poll_get_ownership(req))
5572 __io_poll_execute(req, mask);
5573 return 1;
5574 }
5575
5576 static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt,
5577 struct wait_queue_head *head,
5578 struct io_poll_iocb **poll_ptr)
5579 {
5580 struct io_kiocb *req = pt->req;
5581
5582 /*
5583 * The file being polled uses multiple waitqueues for poll handling
5584 * (e.g. one for read, one for write). Setup a separate io_poll_iocb
5585 * if this happens.
5586 */
5587 if (unlikely(pt->nr_entries)) {
5588 struct io_poll_iocb *first = poll;
5589
5590 /* double add on the same waitqueue head, ignore */
5591 if (first->head == head)
5592 return;
5593 /* already have a 2nd entry, fail a third attempt */
5594 if (*poll_ptr) {
5595 if ((*poll_ptr)->head == head)
5596 return;
5597 pt->error = -EINVAL;
5598 return;
5599 }
5600
5601 poll = kmalloc(sizeof(*poll), GFP_ATOMIC);
5602 if (!poll) {
5603 pt->error = -ENOMEM;
5604 return;
5605 }
5606 io_init_poll_iocb(poll, first->events, first->wait.func);
5607 *poll_ptr = poll;
5608 if (req->opcode == IORING_OP_POLL_ADD)
5609 req->flags |= REQ_F_ASYNC_DATA;
5610 }
5611
5612 pt->nr_entries++;
5613 poll->head = head;
5614 poll->wait.private = req;
5615
5616 if (poll->events & EPOLLEXCLUSIVE)
5617 add_wait_queue_exclusive(head, &poll->wait);
5618 else
5619 add_wait_queue(head, &poll->wait);
5620 }
5621
5622 static void io_poll_queue_proc(struct file *file, struct wait_queue_head *head,
5623 struct poll_table_struct *p)
5624 {
5625 struct io_poll_table *pt = container_of(p, struct io_poll_table, pt);
5626
5627 __io_queue_proc(&pt->req->poll, pt, head,
5628 (struct io_poll_iocb **) &pt->req->async_data);
5629 }
5630
5631 static int __io_arm_poll_handler(struct io_kiocb *req,
5632 struct io_poll_iocb *poll,
5633 struct io_poll_table *ipt, __poll_t mask)
5634 {
5635 struct io_ring_ctx *ctx = req->ctx;
5636 int v;
5637
5638 INIT_HLIST_NODE(&req->hash_node);
5639 io_init_poll_iocb(poll, mask, io_poll_wake);
5640 poll->file = req->file;
5641 poll->wait.private = req;
5642
5643 ipt->pt._key = mask;
5644 ipt->req = req;
5645 ipt->error = 0;
5646 ipt->nr_entries = 0;
5647
5648 /*
5649 * Take the ownership to delay any tw execution up until we're done
5650 * with poll arming. see io_poll_get_ownership().
5651 */
5652 atomic_set(&req->poll_refs, 1);
5653 mask = vfs_poll(req->file, &ipt->pt) & poll->events;
5654
5655 if (mask && (poll->events & EPOLLONESHOT)) {
5656 io_poll_remove_entries(req);
5657 /* no one else has access to the req, forget about the ref */
> 5658 return mask;
5659 }
5660 if (!mask && unlikely(ipt->error || !ipt->nr_entries)) {
5661 io_poll_remove_entries(req);
5662 if (!ipt->error)
5663 ipt->error = -EINVAL;
5664 return 0;
5665 }
5666
5667 spin_lock(&ctx->completion_lock);
5668 io_poll_req_insert(req);
5669 spin_unlock(&ctx->completion_lock);
5670
5671 if (mask) {
5672 /* can't multishot if failed, just queue the event we've got */
5673 if (unlikely(ipt->error || !ipt->nr_entries))
5674 poll->events |= EPOLLONESHOT;
5675 __io_poll_execute(req, mask);
5676 return 0;
5677 }
5678
5679 /*
5680 * Release ownership. If someone tried to queue a tw while it was
5681 * locked, kick it off for them.
5682 */
5683 v = atomic_dec_return(&req->poll_refs);
5684 if (unlikely(v & IO_POLL_REF_MASK))
5685 __io_poll_execute(req, 0);
5686 return 0;
5687 }
5688
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[ammarfaizi2-block:google/android/kernel/common/android12-5.4 400/9999] kernel/sched/core.c:94:22: sparse: sparse: incorrect type in initializer (different address spaces)
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android12-5.4
head: 3307e1a058380163f1a11c8f7632706168f9fcb1
commit: a0212dbcef6d8b619371eb766da024aaf25e877b [400/9999] ANDROID: GKI: core: Export for runqueues
config: x86_64-randconfig-s022 (https://download.01.org/0day-ci/archive/20220125/202201251245.Jpz3uXmU-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/ammarfaizi2/linux-block/commit/a0212dbcef6d8b619371eb7...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android12-5.4
git checkout a0212dbcef6d8b619371eb766da024aaf25e877b
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash
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/sched/core.c:94:22: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:94:22: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:94:22: sparse: got struct rq *
kernel/sched/core.c:96:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:96:21: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:96:21: sparse: got struct rq *
kernel/sched/core.c:118:22: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:118:22: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:118:22: sparse: got struct rq *
kernel/sched/core.c:137:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:137:21: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:137:21: sparse: got struct rq *
kernel/sched/core.c:541:25: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:541:25: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:541:25: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:569:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:569:9: sparse: got struct rq *
kernel/sched/core.c:569:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/core.c:569:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/core.c:569:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/core.c:600:25: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:600:25: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:600:25: sparse: got struct rq *
kernel/sched/core.c:1691:14: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:1691:14: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:1691:14: sparse: got struct rq *
kernel/sched/core.c:1738:25: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:1738:25: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:1738:25: sparse: got struct rq *
kernel/sched/core.c:1760:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:1760:13: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:1760:13: sparse: got struct rq *
kernel/sched/core.c:1785:25: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:1785:25: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:1785:25: sparse: got struct rq *
kernel/sched/core.c:1929:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:1929:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:1929:9: sparse: got struct rq *
kernel/sched/core.c:2098:22: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2098:22: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2098:22: sparse: got struct rq *
kernel/sched/core.c:2334:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2334:40: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2334:40: sparse: got struct rq *
kernel/sched/core.c:2350:9: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2350:9: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2350:9: sparse: got struct rq *
kernel/sched/core.c:2379:14: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2379:14: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2379:14: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2390:17: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2390:17: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2390:17: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2390:17: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2390:17: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2390:17: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2390:17: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2390:17: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2390:17: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2390:17: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
kernel/sched/core.c:2390:17: sparse: expected void const [noderef] <asn:3> *__vpp_verify
kernel/sched/core.c:2390:17: sparse: got struct rq *
kernel/sched/core.c:2390:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct rq * @@
vim +94 kernel/sched/core.c
fa85ae2418e684 kernel/sched.c Peter Zijlstra 2008-01-25 82
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 83 /*
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 84 * __task_rq_lock - lock the rq @p resides on.
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 85 */
eb58075149b7f0 kernel/sched/core.c Peter Zijlstra 2015-07-31 86 struct rq *__task_rq_lock(struct task_struct *p, struct rq_flags *rf)
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 87 __acquires(rq->lock)
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 88 {
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 89 struct rq *rq;
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 90
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 91 lockdep_assert_held(&p->pi_lock);
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 92
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 93 for (;;) {
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 @94 rq = task_rq(p);
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 95 raw_spin_lock(&rq->lock);
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 96 if (likely(rq == task_rq(p) && !task_on_rq_migrating(p))) {
d8ac897137a230 kernel/sched/core.c Matt Fleming 2016-09-21 97 rq_pin_lock(rq, rf);
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 98 return rq;
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 99 }
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 100 raw_spin_unlock(&rq->lock);
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 101
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 102 while (unlikely(task_on_rq_migrating(p)))
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 103 cpu_relax();
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 104 }
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 105 }
3e71a462dd483c kernel/sched/core.c Peter Zijlstra 2016-04-28 106
:::::: The code at line 94 was first introduced by commit
:::::: 3e71a462dd483ce508a723356b293731e7d788ea sched/core: Move task_rq_lock() out of line
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[mingo-tip:sched/headers 2357/2384] drivers/usb/chipidea/ci.h:427:32: error: implicit declaration of function '__ffs'
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head: 4c707c1c0de83967079b4e385012fa5b00e2cd11
commit: 61ea5a6fab5c8fae043a02a100970041dc6a877e [2357/2384] headers/deps: delay: Optimize <linux/delay.h> dependencies, remove <linux/sched.h> inclusion
config: mips-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220125/202201251220.wdEh9zG4-lk...)
compiler: mips64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=...
git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
git fetch --no-tags mingo-tip sched/headers
git checkout 61ea5a6fab5c8fae043a02a100970041dc6a877e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash drivers/usb/
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/usb/chipidea/otg.c:23:
drivers/usb/chipidea/ci.h: In function 'hw_test_and_write':
>> drivers/usb/chipidea/ci.h:427:32: error: implicit declaration of function '__ffs' [-Werror=implicit-function-declaration]
427 | return (val & mask) >> __ffs(mask);
| ^~~~~
cc1: some warnings being treated as errors
vim +/__ffs +427 drivers/usb/chipidea/ci.h
e443b333629f82 Alexander Shishkin 2012-05-11 411
e443b333629f82 Alexander Shishkin 2012-05-11 412 /**
e443b333629f82 Alexander Shishkin 2012-05-11 413 * hw_test_and_write: tests & writes a hw register
19353881b4afc9 Peter Chen 2014-09-22 414 * @ci: the controller
e443b333629f82 Alexander Shishkin 2012-05-11 415 * @reg: register index
e443b333629f82 Alexander Shishkin 2012-05-11 416 * @mask: bitfield mask
e443b333629f82 Alexander Shishkin 2012-05-11 417 * @data: new value
e443b333629f82 Alexander Shishkin 2012-05-11 418 *
e443b333629f82 Alexander Shishkin 2012-05-11 419 * This function returns register contents
e443b333629f82 Alexander Shishkin 2012-05-11 420 */
8e22978c57087a Alexander Shishkin 2013-06-24 421 static inline u32 hw_test_and_write(struct ci_hdrc *ci, enum ci_hw_regs reg,
e443b333629f82 Alexander Shishkin 2012-05-11 422 u32 mask, u32 data)
e443b333629f82 Alexander Shishkin 2012-05-11 423 {
26c696c678c4ce Richard Zhao 2012-07-07 424 u32 val = hw_read(ci, reg, ~0);
e443b333629f82 Alexander Shishkin 2012-05-11 425
26c696c678c4ce Richard Zhao 2012-07-07 426 hw_write(ci, reg, mask, data);
727b4ddb48dcd8 Felipe Balbi 2013-03-30 @427 return (val & mask) >> __ffs(mask);
e443b333629f82 Alexander Shishkin 2012-05-11 428 }
e443b333629f82 Alexander Shishkin 2012-05-11 429
:::::: The code at line 427 was first introduced by commit
:::::: 727b4ddb48dcd8c9ca81b58ca58191233bdf75aa usb: chipidea: don't redefine __ffs()
:::::: TO: Felipe Balbi <balbi(a)ti.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[android-common:upstream-f2fs-stable-linux-4.19.y 724/977] fs/f2fs/file.o: warning: objtool: trace_f2fs_shutdown()+0x13d: sibling call from callable instruction with modified stack frame
by kernel test robot
Hi Chao,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common upstream-f2fs-stable-linux-4.19.y
head: 80a2667babab8bd3f8aa4b54a4188788f03ae591
commit: d3dfd47d65e36dfeccc5f59b05ea6dd95d87ebdd [724/977] f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220125/202201251238.HxXZTxT5-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common upstream-f2fs-stable-linux-4.19.y
git checkout d3dfd47d65e36dfeccc5f59b05ea6dd95d87ebdd
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
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 >>):
In file included from fs/f2fs/file.c:26:
fs/f2fs/f2fs.h: In function 'blkaddr_in_node':
fs/f2fs/f2fs.h:2457:30: warning: taking address of packed member of 'struct f2fs_inode' may result in an unaligned pointer value [-Waddress-of-packed-member]
2457 | return RAW_IS_INODE(node) ? node->i.i_addr : node->dn.addr;
| ^~~~
fs/f2fs/f2fs.h:2457:47: warning: taking address of packed member of 'struct direct_node' may result in an unaligned pointer value [-Waddress-of-packed-member]
2457 | return RAW_IS_INODE(node) ? node->i.i_addr : node->dn.addr;
| ^~~~
fs/f2fs/file.c: In function 'f2fs_ioc_getfslabel':
fs/f2fs/file.c:3390:40: warning: taking address of packed member of 'struct f2fs_super_block' may result in an unaligned pointer value [-Waddress-of-packed-member]
3390 | count = utf16s_to_utf8s(sbi->raw_super->volume_name,
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~
fs/f2fs/file.c: In function 'f2fs_ioc_setfslabel':
fs/f2fs/file.c:3426:18: warning: taking address of packed member of 'struct f2fs_super_block' may result in an unaligned pointer value [-Waddress-of-packed-member]
3426 | sbi->raw_super->volume_name,
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~
>> fs/f2fs/file.o: warning: objtool: trace_f2fs_shutdown()+0x13d: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_filemap_fault()+0x24d: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_file_read_iter()+0x131: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: reserve_compress_blocks()+0x630: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_setflags_common()+0x614: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_zero_range()+0x8e1: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_do_sync_file()+0x54e: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_ioc_defragment()+0x878: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_release_compress_blocks()+0x121b: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_vm_page_mkwrite()+0xe3f: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_truncate_data_blocks_range()+0xebc: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_do_truncate_blocks()+0x954: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_truncate()+0x336: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_file_write_iter()+0x9fd: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: __clone_blkaddrs()+0x73c: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: __exchange_data_block()+0xdb4: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_fallocate()+0xf2e: sibling call from callable instruction with modified stack frame
fs/f2fs/file.o: warning: objtool: f2fs_ioctl()+0x2587: sibling call from callable instruction with modified stack frame
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH v6 31/39] kasan, vmalloc: only tag normal vmalloc allocations
by kernel test robot
Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc1 next-20220124]
[cannot apply to arm64/for-next/core rostedt-trace/for-next hnaz-mm/master]
[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/andrey-konovalov-linux-dev/kasan...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
config: x86_64-randconfig-s022-20220124 (https://download.01.org/0day-ci/archive/20220125/202201251257.quQ9h8XG-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/e53c62ef4d4998f3bdd75ec887bc39a1e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review andrey-konovalov-linux-dev/kasan-vmalloc-arm64-add-vmalloc-tagging-support-for-SW-HW_TAGS/20220125-021005
git checkout e53c62ef4d4998f3bdd75ec887bc39a1ef2dd740
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash mm/kasan/
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 >>)
>> mm/kasan/shadow.c:495:15: sparse: sparse: restricted kasan_vmalloc_flags_t degrades to integer
vim +495 mm/kasan/shadow.c
477
478 void *__kasan_unpoison_vmalloc(const void *start, unsigned long size,
479 kasan_vmalloc_flags_t flags)
480 {
481 /*
482 * Software KASAN modes unpoison both VM_ALLOC and non-VM_ALLOC
483 * mappings, so the KASAN_VMALLOC_VM_ALLOC flag is ignored.
484 * Software KASAN modes can't optimize zeroing memory by combining it
485 * with setting memory tags, so the KASAN_VMALLOC_INIT flag is ignored.
486 */
487
488 if (!is_vmalloc_or_module_addr(start))
489 return (void *)start;
490
491 /*
492 * Don't tag executable memory.
493 * The kernel doesn't tolerate having the PC register tagged.
494 */
> 495 if (!(flags & KASAN_VMALLOC_PROT_NORMAL))
496 return (void *)start;
497
498 start = set_tag(start, kasan_random_tag());
499 kasan_unpoison(start, size, false);
500 return (void *)start;
501 }
502
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH v4 1/2] leds: ktd20xx: Extension of the KTD20xx family of LED drivers from Kinetic
by kernel test robot
Hi Florian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pavel-leds/for-next]
[also build test WARNING on robh/for-next linux/master linus/master v5.17-rc1 next-20220124]
[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/Florian-Eckert/leds-add-ktd20xx-...
base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20220125/202201251140.YNV7J1Ot-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a18910867ba6795066e044293e6daf89edf5)
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/8e24c9cc5b5a807f40eec9cc643c2ea43...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Florian-Eckert/leds-add-ktd20xx-LED-driver-support/20220121-220338
git checkout 8e24c9cc5b5a807f40eec9cc643c2ea43f75e8a3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kvm/ drivers/leds/
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/leds/leds-ktd20xx.c:490:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (IS_ERR(chip->regmap)) {
^~~~~~~~~~~~~~~~~~~~
drivers/leds/leds-ktd20xx.c:542:9: note: uninitialized use occurs here
return ret;
^~~
drivers/leds/leds-ktd20xx.c:490:2: note: remove the 'if' if its condition is always false
if (IS_ERR(chip->regmap)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/leds-ktd20xx.c:478:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +490 drivers/leds/leds-ktd20xx.c
469
470 static int ktd20xx_probe(struct i2c_client *client,
471 const struct i2c_device_id *id)
472 {
473 struct ktd20xx *chip;
474 unsigned int vendor;
475 unsigned int chip_id;
476 unsigned int chip_rev;
477 struct device *dev;
478 int ret;
479
480 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
481 if (!chip)
482 return -ENOMEM;
483
484 mutex_init(&chip->lock);
485 chip->client = client;
486 dev = &client->dev;
487 i2c_set_clientdata(client, chip);
488
489 chip->regmap = devm_regmap_init_i2c(client, &ktd20xx_regmap_config);
> 490 if (IS_ERR(chip->regmap)) {
491 dev_err_probe(dev, PTR_ERR(chip->regmap),
492 "Failed to allocate register map\n");
493 goto error;
494 }
495
496 chip->control_mode = devm_regmap_field_alloc(dev, chip->regmap,
497 kt20xx_control_mode);
498 chip->faderate = devm_regmap_field_alloc(dev, chip->regmap,
499 kt20xx_faderate);
500 chip->vendor = devm_regmap_field_alloc(dev, chip->regmap,
501 kt20xx_vendor);
502 chip->chip_id = devm_regmap_field_alloc(dev, chip->regmap,
503 kt20xx_chip_id);
504 chip->chip_rev = devm_regmap_field_alloc(dev, chip->regmap,
505 kt20xx_chip_rev);
506
507 /* Reset all registers to hardware device default settings */
508 regmap_field_write(chip->control_mode, CONTROL_MODE_RESET);
509
510 ret = regmap_field_read(chip->vendor, &vendor);
511 if (ret) {
512 dev_err_probe(dev, ret, "Failed to read vendor\n");
513 goto error;
514 }
515
516 ret = regmap_field_read(chip->chip_id, &chip_id);
517 if (ret) {
518 dev_err_probe(dev, ret, "Failed to read chip id\n");
519 goto error;
520 }
521
522 ret = regmap_field_read(chip->chip_rev, &chip_rev);
523 if (ret) {
524 dev_err_probe(dev, ret, "Failed to read chip rev\n");
525 goto error;
526 }
527
528 dev_info(dev, "vendor: 0x%02x chip-id: 0x%02x chip-rev: 0x%02x\n",
529 vendor, chip_id, chip_rev);
530
531 ret = ktd20xx_probe_dt(chip);
532 if (ret)
533 goto error;
534
535 ret = ktd20xx_hwinit(chip);
536 if (ret)
537 goto error;
538
539 return 0;
540
541 error:
542 return ret;
543 }
544
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH] KVM: x86/cpuid: Exclude unpermitted xfeatures sizes at KVM_GET_SUPPORTED_CPUID
by kernel test robot
Hi Like,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on kvm/queue]
[also build test ERROR on v5.17-rc1 next-20220124]
[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/Like-Xu/KVM-x86-cpuid-Exclude-un...
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
config: i386-randconfig-a002 (https://download.01.org/0day-ci/archive/20220125/202201251137.85eenHWr-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a18910867ba6795066e044293e6daf89edf5)
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/b29c71ea177d9a2225208d50198759861...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Like-Xu/KVM-x86-cpuid-Exclude-unpermitted-xfeatures-sizes-at-KVM_GET_SUPPORTED_CPUID/20220124-160452
git checkout b29c71ea177d9a2225208d501987598610261749
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/kvm/cpuid.c:890:24: error: variable 'supported_xcr0' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]
u64 supported_xcr0 = supported_xcr0 & xstate_get_guest_group_perm();
~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
1 error generated.
vim +/supported_xcr0 +890 arch/x86/kvm/cpuid.c
758
759 static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
760 {
761 struct kvm_cpuid_entry2 *entry;
762 int r, i, max_idx;
763
764 /* all calls to cpuid_count() should be made on the same cpu */
765 get_cpu();
766
767 r = -E2BIG;
768
769 entry = do_host_cpuid(array, function, 0);
770 if (!entry)
771 goto out;
772
773 switch (function) {
774 case 0:
775 /* Limited to the highest leaf implemented in KVM. */
776 entry->eax = min(entry->eax, 0x1fU);
777 break;
778 case 1:
779 cpuid_entry_override(entry, CPUID_1_EDX);
780 cpuid_entry_override(entry, CPUID_1_ECX);
781 break;
782 case 2:
783 /*
784 * On ancient CPUs, function 2 entries are STATEFUL. That is,
785 * CPUID(function=2, index=0) may return different results each
786 * time, with the least-significant byte in EAX enumerating the
787 * number of times software should do CPUID(2, 0).
788 *
789 * Modern CPUs, i.e. every CPU KVM has *ever* run on are less
790 * idiotic. Intel's SDM states that EAX & 0xff "will always
791 * return 01H. Software should ignore this value and not
792 * interpret it as an informational descriptor", while AMD's
793 * APM states that CPUID(2) is reserved.
794 *
795 * WARN if a frankenstein CPU that supports virtualization and
796 * a stateful CPUID.0x2 is encountered.
797 */
798 WARN_ON_ONCE((entry->eax & 0xff) > 1);
799 break;
800 /* functions 4 and 0x8000001d have additional index. */
801 case 4:
802 case 0x8000001d:
803 /*
804 * Read entries until the cache type in the previous entry is
805 * zero, i.e. indicates an invalid entry.
806 */
807 for (i = 1; entry->eax & 0x1f; ++i) {
808 entry = do_host_cpuid(array, function, i);
809 if (!entry)
810 goto out;
811 }
812 break;
813 case 6: /* Thermal management */
814 entry->eax = 0x4; /* allow ARAT */
815 entry->ebx = 0;
816 entry->ecx = 0;
817 entry->edx = 0;
818 break;
819 /* function 7 has additional index. */
820 case 7:
821 entry->eax = min(entry->eax, 1u);
822 cpuid_entry_override(entry, CPUID_7_0_EBX);
823 cpuid_entry_override(entry, CPUID_7_ECX);
824 cpuid_entry_override(entry, CPUID_7_EDX);
825
826 /* KVM only supports 0x7.0 and 0x7.1, capped above via min(). */
827 if (entry->eax == 1) {
828 entry = do_host_cpuid(array, function, 1);
829 if (!entry)
830 goto out;
831
832 cpuid_entry_override(entry, CPUID_7_1_EAX);
833 entry->ebx = 0;
834 entry->ecx = 0;
835 entry->edx = 0;
836 }
837 break;
838 case 9:
839 break;
840 case 0xa: { /* Architectural Performance Monitoring */
841 struct x86_pmu_capability cap;
842 union cpuid10_eax eax;
843 union cpuid10_edx edx;
844
845 perf_get_x86_pmu_capability(&cap);
846
847 /*
848 * The guest architecture pmu is only supported if the architecture
849 * pmu exists on the host and the module parameters allow it.
850 */
851 if (!cap.version || !enable_pmu)
852 memset(&cap, 0, sizeof(cap));
853
854 eax.split.version_id = min(cap.version, 2);
855 eax.split.num_counters = cap.num_counters_gp;
856 eax.split.bit_width = cap.bit_width_gp;
857 eax.split.mask_length = cap.events_mask_len;
858
859 edx.split.num_counters_fixed = min(cap.num_counters_fixed, MAX_FIXED_COUNTERS);
860 edx.split.bit_width_fixed = cap.bit_width_fixed;
861 if (cap.version)
862 edx.split.anythread_deprecated = 1;
863 edx.split.reserved1 = 0;
864 edx.split.reserved2 = 0;
865
866 entry->eax = eax.full;
867 entry->ebx = cap.events_mask;
868 entry->ecx = 0;
869 entry->edx = edx.full;
870 break;
871 }
872 /*
873 * Per Intel's SDM, the 0x1f is a superset of 0xb,
874 * thus they can be handled by common code.
875 */
876 case 0x1f:
877 case 0xb:
878 /*
879 * Populate entries until the level type (ECX[15:8]) of the
880 * previous entry is zero. Note, CPUID EAX.{0x1f,0xb}.0 is
881 * the starting entry, filled by the primary do_host_cpuid().
882 */
883 for (i = 1; entry->ecx & 0xff00; ++i) {
884 entry = do_host_cpuid(array, function, i);
885 if (!entry)
886 goto out;
887 }
888 break;
889 case 0xd: {
> 890 u64 supported_xcr0 = supported_xcr0 & xstate_get_guest_group_perm();
891
892 entry->eax &= supported_xcr0;
893 entry->ebx = xstate_required_size(supported_xcr0, false);
894 entry->ecx = entry->ebx;
895 entry->edx &= supported_xcr0 >> 32;
896 if (!supported_xcr0)
897 break;
898
899 entry = do_host_cpuid(array, function, 1);
900 if (!entry)
901 goto out;
902
903 cpuid_entry_override(entry, CPUID_D_1_EAX);
904 if (entry->eax & (F(XSAVES)|F(XSAVEC)))
905 entry->ebx = xstate_required_size(supported_xcr0 | supported_xss,
906 true);
907 else {
908 WARN_ON_ONCE(supported_xss != 0);
909 entry->ebx = 0;
910 }
911 entry->ecx &= supported_xss;
912 entry->edx &= supported_xss >> 32;
913
914 for (i = 2; i < 64; ++i) {
915 bool s_state;
916 if (supported_xcr0 & BIT_ULL(i))
917 s_state = false;
918 else if (supported_xss & BIT_ULL(i))
919 s_state = true;
920 else
921 continue;
922
923 entry = do_host_cpuid(array, function, i);
924 if (!entry)
925 goto out;
926
927 /*
928 * The supported check above should have filtered out
929 * invalid sub-leafs. Only valid sub-leafs should
930 * reach this point, and they should have a non-zero
931 * save state size. Furthermore, check whether the
932 * processor agrees with supported_xcr0/supported_xss
933 * on whether this is an XCR0- or IA32_XSS-managed area.
934 */
935 if (WARN_ON_ONCE(!entry->eax || (entry->ecx & 0x1) != s_state)) {
936 --array->nent;
937 continue;
938 }
939
940 if (!kvm_cpu_cap_has(X86_FEATURE_XFD))
941 entry->ecx &= ~BIT_ULL(2);
942 entry->edx = 0;
943 }
944 break;
945 }
946 case 0x12:
947 /* Intel SGX */
948 if (!kvm_cpu_cap_has(X86_FEATURE_SGX)) {
949 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
950 break;
951 }
952
953 /*
954 * Index 0: Sub-features, MISCSELECT (a.k.a extended features)
955 * and max enclave sizes. The SGX sub-features and MISCSELECT
956 * are restricted by kernel and KVM capabilities (like most
957 * feature flags), while enclave size is unrestricted.
958 */
959 cpuid_entry_override(entry, CPUID_12_EAX);
960 entry->ebx &= SGX_MISC_EXINFO;
961
962 entry = do_host_cpuid(array, function, 1);
963 if (!entry)
964 goto out;
965
966 /*
967 * Index 1: SECS.ATTRIBUTES. ATTRIBUTES are restricted a la
968 * feature flags. Advertise all supported flags, including
969 * privileged attributes that require explicit opt-in from
970 * userspace. ATTRIBUTES.XFRM is not adjusted as userspace is
971 * expected to derive it from supported XCR0.
972 */
973 entry->eax &= SGX_ATTR_DEBUG | SGX_ATTR_MODE64BIT |
974 SGX_ATTR_PROVISIONKEY | SGX_ATTR_EINITTOKENKEY |
975 SGX_ATTR_KSS;
976 entry->ebx &= 0;
977 break;
978 /* Intel PT */
979 case 0x14:
980 if (!kvm_cpu_cap_has(X86_FEATURE_INTEL_PT)) {
981 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
982 break;
983 }
984
985 for (i = 1, max_idx = entry->eax; i <= max_idx; ++i) {
986 if (!do_host_cpuid(array, function, i))
987 goto out;
988 }
989 break;
990 /* Intel AMX TILE */
991 case 0x1d:
992 if (!kvm_cpu_cap_has(X86_FEATURE_AMX_TILE)) {
993 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
994 break;
995 }
996
997 for (i = 1, max_idx = entry->eax; i <= max_idx; ++i) {
998 if (!do_host_cpuid(array, function, i))
999 goto out;
1000 }
1001 break;
1002 case 0x1e: /* TMUL information */
1003 if (!kvm_cpu_cap_has(X86_FEATURE_AMX_TILE)) {
1004 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
1005 break;
1006 }
1007 break;
1008 case KVM_CPUID_SIGNATURE: {
1009 const u32 *sigptr = (const u32 *)KVM_SIGNATURE;
1010 entry->eax = KVM_CPUID_FEATURES;
1011 entry->ebx = sigptr[0];
1012 entry->ecx = sigptr[1];
1013 entry->edx = sigptr[2];
1014 break;
1015 }
1016 case KVM_CPUID_FEATURES:
1017 entry->eax = (1 << KVM_FEATURE_CLOCKSOURCE) |
1018 (1 << KVM_FEATURE_NOP_IO_DELAY) |
1019 (1 << KVM_FEATURE_CLOCKSOURCE2) |
1020 (1 << KVM_FEATURE_ASYNC_PF) |
1021 (1 << KVM_FEATURE_PV_EOI) |
1022 (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) |
1023 (1 << KVM_FEATURE_PV_UNHALT) |
1024 (1 << KVM_FEATURE_PV_TLB_FLUSH) |
1025 (1 << KVM_FEATURE_ASYNC_PF_VMEXIT) |
1026 (1 << KVM_FEATURE_PV_SEND_IPI) |
1027 (1 << KVM_FEATURE_POLL_CONTROL) |
1028 (1 << KVM_FEATURE_PV_SCHED_YIELD) |
1029 (1 << KVM_FEATURE_ASYNC_PF_INT);
1030
1031 if (sched_info_on())
1032 entry->eax |= (1 << KVM_FEATURE_STEAL_TIME);
1033
1034 entry->ebx = 0;
1035 entry->ecx = 0;
1036 entry->edx = 0;
1037 break;
1038 case 0x80000000:
1039 entry->eax = min(entry->eax, 0x8000001f);
1040 break;
1041 case 0x80000001:
1042 cpuid_entry_override(entry, CPUID_8000_0001_EDX);
1043 cpuid_entry_override(entry, CPUID_8000_0001_ECX);
1044 break;
1045 case 0x80000006:
1046 /* L2 cache and TLB: pass through host info. */
1047 break;
1048 case 0x80000007: /* Advanced power management */
1049 /* invariant TSC is CPUID.80000007H:EDX[8] */
1050 entry->edx &= (1 << 8);
1051 /* mask against host */
1052 entry->edx &= boot_cpu_data.x86_power;
1053 entry->eax = entry->ebx = entry->ecx = 0;
1054 break;
1055 case 0x80000008: {
1056 unsigned g_phys_as = (entry->eax >> 16) & 0xff;
1057 unsigned virt_as = max((entry->eax >> 8) & 0xff, 48U);
1058 unsigned phys_as = entry->eax & 0xff;
1059
1060 /*
1061 * If TDP (NPT) is disabled use the adjusted host MAXPHYADDR as
1062 * the guest operates in the same PA space as the host, i.e.
1063 * reductions in MAXPHYADDR for memory encryption affect shadow
1064 * paging, too.
1065 *
1066 * If TDP is enabled but an explicit guest MAXPHYADDR is not
1067 * provided, use the raw bare metal MAXPHYADDR as reductions to
1068 * the HPAs do not affect GPAs.
1069 */
1070 if (!tdp_enabled)
1071 g_phys_as = boot_cpu_data.x86_phys_bits;
1072 else if (!g_phys_as)
1073 g_phys_as = phys_as;
1074
1075 entry->eax = g_phys_as | (virt_as << 8);
1076 entry->edx = 0;
1077 cpuid_entry_override(entry, CPUID_8000_0008_EBX);
1078 break;
1079 }
1080 case 0x8000000A:
1081 if (!kvm_cpu_cap_has(X86_FEATURE_SVM)) {
1082 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
1083 break;
1084 }
1085 entry->eax = 1; /* SVM revision 1 */
1086 entry->ebx = 8; /* Lets support 8 ASIDs in case we add proper
1087 ASID emulation to nested SVM */
1088 entry->ecx = 0; /* Reserved */
1089 cpuid_entry_override(entry, CPUID_8000_000A_EDX);
1090 break;
1091 case 0x80000019:
1092 entry->ecx = entry->edx = 0;
1093 break;
1094 case 0x8000001a:
1095 case 0x8000001e:
1096 break;
1097 case 0x8000001F:
1098 if (!kvm_cpu_cap_has(X86_FEATURE_SEV)) {
1099 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
1100 } else {
1101 cpuid_entry_override(entry, CPUID_8000_001F_EAX);
1102
1103 /*
1104 * Enumerate '0' for "PA bits reduction", the adjusted
1105 * MAXPHYADDR is enumerated directly (see 0x80000008).
1106 */
1107 entry->ebx &= ~GENMASK(11, 6);
1108 }
1109 break;
1110 /*Add support for Centaur's CPUID instruction*/
1111 case 0xC0000000:
1112 /*Just support up to 0xC0000004 now*/
1113 entry->eax = min(entry->eax, 0xC0000004);
1114 break;
1115 case 0xC0000001:
1116 cpuid_entry_override(entry, CPUID_C000_0001_EDX);
1117 break;
1118 case 3: /* Processor serial number */
1119 case 5: /* MONITOR/MWAIT */
1120 case 0xC0000002:
1121 case 0xC0000003:
1122 case 0xC0000004:
1123 default:
1124 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
1125 break;
1126 }
1127
1128 r = 0;
1129
1130 out:
1131 put_cpu();
1132
1133 return r;
1134 }
1135
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[mlankhorst:xe 8/165] drivers/gpu/drm/xe/xe_pci.c:1230:39: error: 'adl_p_info' defined but not used
by kernel test robot
tree: git://people.freedesktop.org/~mlankhorst/linux xe
head: 4bc3039b4403c76a13d58f7ac1f7c07dca6f88d8
commit: 6fc3424d304d6766e3abe371a586b83fc10d625f [8/165] drm/xe: Initial commit
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220125/202201251102.C8Uyp5F7-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add mlankhorst git://people.freedesktop.org/~mlankhorst/linux
git fetch --no-tags mlankhorst xe
git checkout 6fc3424d304d6766e3abe371a586b83fc10d625f
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/xe/xe_pci.c:1373:5: error: no previous prototype for 'i915_register_pci_driver' [-Werror=missing-prototypes]
1373 | int i915_register_pci_driver(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:1378:6: error: no previous prototype for 'i915_unregister_pci_driver' [-Werror=missing-prototypes]
1378 | void i915_unregister_pci_driver(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1230:39: error: 'adl_p_info' defined but not used [-Werror=unused-const-variable=]
1230 | static const struct intel_device_info adl_p_info = {
| ^~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1175:39: error: 'adl_s_info' defined but not used [-Werror=unused-const-variable=]
1175 | static const struct intel_device_info adl_s_info = {
| ^~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1142:39: error: 'rkl_info' defined but not used [-Werror=unused-const-variable=]
1142 | static const struct intel_device_info rkl_info = {
| ^~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:1134:39: error: 'tgl_info' defined but not used [-Werror=unused-const-variable=]
1134 | static const struct intel_device_info tgl_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1099:39: error: 'jsl_info' defined but not used [-Werror=unused-const-variable=]
1099 | static const struct intel_device_info jsl_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1092:39: error: 'ehl_info' defined but not used [-Werror=unused-const-variable=]
1092 | static const struct intel_device_info ehl_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1085:39: error: 'icl_info' defined but not used [-Werror=unused-const-variable=]
1085 | static const struct intel_device_info icl_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1045:39: error: 'cnl_info' defined but not used [-Werror=unused-const-variable=]
1045 | static const struct intel_device_info cnl_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1032:39: error: 'cml_gt2_info' defined but not used [-Werror=unused-const-variable=]
1032 | static const struct intel_device_info cml_gt2_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1027:39: error: 'cml_gt1_info' defined but not used [-Werror=unused-const-variable=]
1027 | static const struct intel_device_info cml_gt1_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1016:39: error: 'cfl_gt3_info' defined but not used [-Werror=unused-const-variable=]
1016 | static const struct intel_device_info cfl_gt3_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1011:39: error: 'cfl_gt2_info' defined but not used [-Werror=unused-const-variable=]
1011 | static const struct intel_device_info cfl_gt2_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:1006:39: error: 'cfl_gt1_info' defined but not used [-Werror=unused-const-variable=]
1006 | static const struct intel_device_info cfl_gt1_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:995:39: error: 'kbl_gt3_info' defined but not used [-Werror=unused-const-variable=]
995 | static const struct intel_device_info kbl_gt3_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:990:39: error: 'kbl_gt2_info' defined but not used [-Werror=unused-const-variable=]
990 | static const struct intel_device_info kbl_gt2_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:985:39: error: 'kbl_gt1_info' defined but not used [-Werror=unused-const-variable=]
985 | static const struct intel_device_info kbl_gt1_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:973:39: error: 'glk_info' defined but not used [-Werror=unused-const-variable=]
973 | static const struct intel_device_info glk_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:967:39: error: 'bxt_info' defined but not used [-Werror=unused-const-variable=]
967 | static const struct intel_device_info bxt_info = {
| ^~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:925:39: error: 'skl_gt4_info' defined but not used [-Werror=unused-const-variable=]
925 | static const struct intel_device_info skl_gt4_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:920:39: error: 'skl_gt3_info' defined but not used [-Werror=unused-const-variable=]
920 | static const struct intel_device_info skl_gt3_info = {
| ^~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_pci.c:909:39: error: 'skl_gt2_info' defined but not used [-Werror=unused-const-variable=]
909 | static const struct intel_device_info skl_gt2_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:904:39: error: 'skl_gt1_info' defined but not used [-Werror=unused-const-variable=]
904 | static const struct intel_device_info skl_gt1_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:857:39: error: 'chv_info' defined but not used [-Werror=unused-const-variable=]
857 | static const struct intel_device_info chv_info = {
| ^~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:850:39: error: 'bdw_gt3_info' defined but not used [-Werror=unused-const-variable=]
850 | static const struct intel_device_info bdw_gt3_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:842:39: error: 'bdw_rsvd_info' defined but not used [-Werror=unused-const-variable=]
842 | static const struct intel_device_info bdw_rsvd_info = {
| ^~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:837:39: error: 'bdw_gt2_info' defined but not used [-Werror=unused-const-variable=]
837 | static const struct intel_device_info bdw_gt2_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:832:39: error: 'bdw_gt1_info' defined but not used [-Werror=unused-const-variable=]
832 | static const struct intel_device_info bdw_gt1_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:814:39: error: 'hsw_gt3_info' defined but not used [-Werror=unused-const-variable=]
814 | static const struct intel_device_info hsw_gt3_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:809:39: error: 'hsw_gt2_info' defined but not used [-Werror=unused-const-variable=]
809 | static const struct intel_device_info hsw_gt2_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:804:39: error: 'hsw_gt1_info' defined but not used [-Werror=unused-const-variable=]
804 | static const struct intel_device_info hsw_gt1_info = {
| ^~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:759:39: error: 'vlv_info' defined but not used [-Werror=unused-const-variable=]
759 | static const struct intel_device_info vlv_info = {
| ^~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:750:39: error: 'ivb_q_info' defined but not used [-Werror=unused-const-variable=]
750 | static const struct intel_device_info ivb_q_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:745:39: error: 'ivb_m_gt2_info' defined but not used [-Werror=unused-const-variable=]
745 | static const struct intel_device_info ivb_m_gt2_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:740:39: error: 'ivb_m_gt1_info' defined but not used [-Werror=unused-const-variable=]
740 | static const struct intel_device_info ivb_m_gt1_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:729:39: error: 'ivb_d_gt2_info' defined but not used [-Werror=unused-const-variable=]
729 | static const struct intel_device_info ivb_d_gt2_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:724:39: error: 'ivb_d_gt1_info' defined but not used [-Werror=unused-const-variable=]
724 | static const struct intel_device_info ivb_d_gt1_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:692:39: error: 'snb_m_gt2_info' defined but not used [-Werror=unused-const-variable=]
692 | static const struct intel_device_info snb_m_gt2_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:687:39: error: 'snb_m_gt1_info' defined but not used [-Werror=unused-const-variable=]
687 | static const struct intel_device_info snb_m_gt1_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:676:39: error: 'snb_d_gt2_info' defined but not used [-Werror=unused-const-variable=]
676 | static const struct intel_device_info snb_d_gt2_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:671:39: error: 'snb_d_gt1_info' defined but not used [-Werror=unused-const-variable=]
671 | static const struct intel_device_info snb_d_gt1_info = {
| ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:638:39: error: 'ilk_m_info' defined but not used [-Werror=unused-const-variable=]
638 | static const struct intel_device_info ilk_m_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:633:39: error: 'ilk_d_info' defined but not used [-Werror=unused-const-variable=]
633 | static const struct intel_device_info ilk_d_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:606:39: error: 'gm45_info' defined but not used [-Werror=unused-const-variable=]
606 | static const struct intel_device_info gm45_info = {
| ^~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:599:39: error: 'g45_info' defined but not used [-Werror=unused-const-variable=]
599 | static const struct intel_device_info g45_info = {
| ^~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:588:39: error: 'i965gm_info' defined but not used [-Werror=unused-const-variable=]
588 | static const struct intel_device_info i965gm_info = {
| ^~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:580:39: error: 'i965g_info' defined but not used [-Werror=unused-const-variable=]
580 | static const struct intel_device_info i965g_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:554:39: error: 'pnv_m_info' defined but not used [-Werror=unused-const-variable=]
554 | static const struct intel_device_info pnv_m_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:546:39: error: 'pnv_g_info' defined but not used [-Werror=unused-const-variable=]
546 | static const struct intel_device_info pnv_g_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:538:39: error: 'g33_info' defined but not used [-Werror=unused-const-variable=]
538 | static const struct intel_device_info g33_info = {
| ^~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:524:39: error: 'i945gm_info' defined but not used [-Werror=unused-const-variable=]
524 | static const struct intel_device_info i945gm_info = {
| ^~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:513:39: error: 'i945g_info' defined but not used [-Werror=unused-const-variable=]
513 | static const struct intel_device_info i945g_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:500:39: error: 'i915gm_info' defined but not used [-Werror=unused-const-variable=]
500 | static const struct intel_device_info i915gm_info = {
| ^~~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:489:39: error: 'i915g_info' defined but not used [-Werror=unused-const-variable=]
489 | static const struct intel_device_info i915g_info = {
| ^~~~~~~~~~
drivers/gpu/drm/xe/xe_pci.c:467:39: error: 'i865g_info' defined but not used [-Werror=unused-const-variable=]
467 | static const struct intel_device_info i865g_info = {
vim +/adl_p_info +1230 drivers/gpu/drm/xe/xe_pci.c
1031
> 1032 static const struct intel_device_info cml_gt2_info = {
1033 CML_PLATFORM,
1034 .gt = 2,
1035 };
1036
1037 #define GEN10_FEATURES \
1038 GEN9_FEATURES, \
1039 GEN(10), \
1040 .dbuf.size = 1024 - 4, /* 4 blocks for bypass path allocation */ \
1041 .display.has_dsc = 1, \
1042 .has_coherent_ggtt = false, \
1043 GLK_COLORS
1044
> 1045 static const struct intel_device_info cnl_info = {
1046 GEN10_FEATURES,
1047 PLATFORM(INTEL_CANNONLAKE),
1048 .gt = 2,
1049 };
1050
1051 #define GEN11_DEFAULT_PAGE_SIZES \
1052 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
1053 I915_GTT_PAGE_SIZE_64K | \
1054 I915_GTT_PAGE_SIZE_2M
1055
1056 #define GEN11_FEATURES \
1057 GEN10_FEATURES, \
1058 GEN11_DEFAULT_PAGE_SIZES, \
1059 .abox_mask = BIT(0), \
1060 .cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
1061 BIT(TRANSCODER_C) | BIT(TRANSCODER_EDP) | \
1062 BIT(TRANSCODER_DSI_0) | BIT(TRANSCODER_DSI_1), \
1063 .pipe_offsets = { \
1064 [TRANSCODER_A] = PIPE_A_OFFSET, \
1065 [TRANSCODER_B] = PIPE_B_OFFSET, \
1066 [TRANSCODER_C] = PIPE_C_OFFSET, \
1067 [TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
1068 [TRANSCODER_DSI_0] = PIPE_DSI0_OFFSET, \
1069 [TRANSCODER_DSI_1] = PIPE_DSI1_OFFSET, \
1070 }, \
1071 .trans_offsets = { \
1072 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
1073 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
1074 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
1075 [TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
1076 [TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \
1077 [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \
1078 }, \
1079 GEN(11), \
1080 .dbuf.size = 2048, \
1081 .dbuf.slice_mask = BIT(DBUF_S1) | BIT(DBUF_S2), \
1082 .has_logical_ring_elsq = 1, \
1083 .color = { .degamma_lut_size = 33, .gamma_lut_size = 262145 }
1084
> 1085 static const struct intel_device_info icl_info = {
1086 GEN11_FEATURES,
1087 PLATFORM(INTEL_ICELAKE),
1088 .platform_engine_mask =
1089 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2),
1090 };
1091
> 1092 static const struct intel_device_info ehl_info = {
1093 GEN11_FEATURES,
1094 PLATFORM(INTEL_ELKHARTLAKE),
1095 .platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0) | BIT(VECS0),
1096 .ppgtt_size = 36,
1097 };
1098
> 1099 static const struct intel_device_info jsl_info = {
1100 GEN11_FEATURES,
1101 PLATFORM(INTEL_JASPERLAKE),
1102 .platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0) | BIT(VECS0),
1103 .ppgtt_size = 36,
1104 };
1105
1106 #define GEN12_FEATURES \
1107 GEN11_FEATURES, \
1108 GEN(12), \
1109 .abox_mask = GENMASK(2, 1), \
1110 .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), \
1111 .cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
1112 BIT(TRANSCODER_C) | BIT(TRANSCODER_D) | \
1113 BIT(TRANSCODER_DSI_0) | BIT(TRANSCODER_DSI_1), \
1114 .pipe_offsets = { \
1115 [TRANSCODER_A] = PIPE_A_OFFSET, \
1116 [TRANSCODER_B] = PIPE_B_OFFSET, \
1117 [TRANSCODER_C] = PIPE_C_OFFSET, \
1118 [TRANSCODER_D] = PIPE_D_OFFSET, \
1119 [TRANSCODER_DSI_0] = PIPE_DSI0_OFFSET, \
1120 [TRANSCODER_DSI_1] = PIPE_DSI1_OFFSET, \
1121 }, \
1122 .trans_offsets = { \
1123 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
1124 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
1125 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
1126 [TRANSCODER_D] = TRANSCODER_D_OFFSET, \
1127 [TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \
1128 [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \
1129 }, \
1130 TGL_CURSOR_OFFSETS, \
1131 .has_global_mocs = 1, \
1132 .display.has_dsb = 1
1133
1134 static const struct intel_device_info tgl_info = {
1135 GEN12_FEATURES,
1136 PLATFORM(INTEL_TIGERLAKE),
1137 .display.has_modular_fia = 1,
1138 .platform_engine_mask =
1139 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2),
1140 };
1141
> 1142 static const struct intel_device_info rkl_info = {
1143 GEN12_FEATURES,
1144 PLATFORM(INTEL_ROCKETLAKE),
1145 .abox_mask = BIT(0),
1146 .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
1147 .cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
1148 BIT(TRANSCODER_C),
1149 .display.has_hti = 1,
1150 .display.has_psr_hw_tracking = 0,
1151 .platform_engine_mask =
1152 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0),
1153 };
1154
1155 #define DGFX_FEATURES \
1156 .memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \
1157 .has_llc = 0, \
1158 .has_snoop = 1, \
1159 .is_dgfx = 1
1160
1161 static const struct intel_device_info dg1_info __maybe_unused = {
1162 GEN12_FEATURES,
1163 DGFX_FEATURES,
1164 .graphics_rel = 10,
1165 PLATFORM(INTEL_DG1),
1166 .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
1167 .require_force_probe = 1,
1168 .platform_engine_mask =
1169 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) |
1170 BIT(VCS0) | BIT(VCS2),
1171 /* Wa_16011227922 */
1172 .ppgtt_size = 47,
1173 };
1174
> 1175 static const struct intel_device_info adl_s_info = {
1176 GEN12_FEATURES,
1177 PLATFORM(INTEL_ALDERLAKE_S),
1178 .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
1179 .require_force_probe = 1,
1180 .display.has_hti = 1,
1181 .display.has_psr_hw_tracking = 0,
1182 .platform_engine_mask =
1183 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2),
1184 .dma_mask_size = 39,
1185 };
1186
1187 #define XE_LPD_CURSOR_OFFSETS \
1188 .cursor_offsets = { \
1189 [PIPE_A] = CURSOR_A_OFFSET, \
1190 [PIPE_B] = IVB_CURSOR_B_OFFSET, \
1191 [PIPE_C] = IVB_CURSOR_C_OFFSET, \
1192 [PIPE_D] = TGL_CURSOR_D_OFFSET, \
1193 }
1194
1195 #define XE_LPD_FEATURES \
1196 .abox_mask = GENMASK(1, 0), \
1197 .color = { .degamma_lut_size = 0, .gamma_lut_size = 0 }, \
1198 .cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
1199 BIT(TRANSCODER_C) | BIT(TRANSCODER_D), \
1200 .dbuf.size = 4096, \
1201 .dbuf.slice_mask = BIT(DBUF_S1) | BIT(DBUF_S2) | BIT(DBUF_S3) | \
1202 BIT(DBUF_S4), \
1203 .display.has_ddi = 1, \
1204 .display.has_dmc = 1, \
1205 .display.has_dp_mst = 1, \
1206 .display.has_dsb = 1, \
1207 .display.has_dsc = 1, \
1208 .display.has_fbc = 1, \
1209 .display.has_fpga_dbg = 1, \
1210 .display.has_hdcp = 1, \
1211 .display.has_hotplug = 1, \
1212 .display.has_ipc = 1, \
1213 .display.has_psr = 1, \
1214 .display.ver = 13, \
1215 .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), \
1216 .pipe_offsets = { \
1217 [TRANSCODER_A] = PIPE_A_OFFSET, \
1218 [TRANSCODER_B] = PIPE_B_OFFSET, \
1219 [TRANSCODER_C] = PIPE_C_OFFSET, \
1220 [TRANSCODER_D] = PIPE_D_OFFSET, \
1221 }, \
1222 .trans_offsets = { \
1223 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
1224 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
1225 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
1226 [TRANSCODER_D] = TRANSCODER_D_OFFSET, \
1227 }, \
1228 XE_LPD_CURSOR_OFFSETS
1229
> 1230 static const struct intel_device_info adl_p_info = {
1231 GEN12_FEATURES,
1232 XE_LPD_FEATURES,
1233 PLATFORM(INTEL_ALDERLAKE_P),
1234 .require_force_probe = 1,
1235 .display.has_cdclk_crawl = 1,
1236 .display.has_modular_fia = 1,
1237 .display.has_psr_hw_tracking = 0,
1238 .platform_engine_mask =
1239 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2),
1240 .ppgtt_size = 48,
1241 .dma_mask_size = 39,
1242 };
1243
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH v6 30/39] kasan, vmalloc: add vmalloc tagging for HW_TAGS
by kernel test robot
Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc1 next-20220124]
[cannot apply to arm64/for-next/core rostedt-trace/for-next]
[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/andrey-konovalov-linux-dev/kasan...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
config: microblaze-randconfig-s032-20220124 (https://download.01.org/0day-ci/archive/20220125/202201251102.bV52975D-lk...)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/04d94d9a5279576fc7d5b6dd381a6d4a8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review andrey-konovalov-linux-dev/kasan-vmalloc-arm64-add-vmalloc-tagging-support-for-SW-HW_TAGS/20220125-021005
git checkout 04d94d9a5279576fc7d5b6dd381a6d4a86edfac2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash
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 >>)
mm/vmalloc.c:3156:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted kasan_vmalloc_flags_t [usertype] kasan_flags @@ got unsigned int @@
mm/vmalloc.c:3156:21: sparse: expected restricted kasan_vmalloc_flags_t [usertype] kasan_flags
mm/vmalloc.c:3156:21: sparse: got unsigned int
>> mm/vmalloc.c:3158:29: sparse: sparse: invalid assignment: |=
>> mm/vmalloc.c:3158:29: sparse: left side has type restricted kasan_vmalloc_flags_t
>> mm/vmalloc.c:3158:29: sparse: right side has type unsigned int
vim +3158 mm/vmalloc.c
3038
3039 /**
3040 * __vmalloc_node_range - allocate virtually contiguous memory
3041 * @size: allocation size
3042 * @align: desired alignment
3043 * @start: vm area range start
3044 * @end: vm area range end
3045 * @gfp_mask: flags for the page level allocator
3046 * @prot: protection mask for the allocated pages
3047 * @vm_flags: additional vm area flags (e.g. %VM_NO_GUARD)
3048 * @node: node to use for allocation or NUMA_NO_NODE
3049 * @caller: caller's return address
3050 *
3051 * Allocate enough pages to cover @size from the page level
3052 * allocator with @gfp_mask flags. Please note that the full set of gfp
3053 * flags are not supported. GFP_KERNEL, GFP_NOFS and GFP_NOIO are all
3054 * supported.
3055 * Zone modifiers are not supported. From the reclaim modifiers
3056 * __GFP_DIRECT_RECLAIM is required (aka GFP_NOWAIT is not supported)
3057 * and only __GFP_NOFAIL is supported (i.e. __GFP_NORETRY and
3058 * __GFP_RETRY_MAYFAIL are not supported).
3059 *
3060 * __GFP_NOWARN can be used to suppress failures messages.
3061 *
3062 * Map them into contiguous kernel virtual space, using a pagetable
3063 * protection of @prot.
3064 *
3065 * Return: the address of the area or %NULL on failure
3066 */
3067 void *__vmalloc_node_range(unsigned long size, unsigned long align,
3068 unsigned long start, unsigned long end, gfp_t gfp_mask,
3069 pgprot_t prot, unsigned long vm_flags, int node,
3070 const void *caller)
3071 {
3072 struct vm_struct *area;
3073 void *ret;
3074 kasan_vmalloc_flags_t kasan_flags;
3075 unsigned long real_size = size;
3076 unsigned long real_align = align;
3077 unsigned int shift = PAGE_SHIFT;
3078
3079 if (WARN_ON_ONCE(!size))
3080 return NULL;
3081
3082 if ((size >> PAGE_SHIFT) > totalram_pages()) {
3083 warn_alloc(gfp_mask, NULL,
3084 "vmalloc error: size %lu, exceeds total pages",
3085 real_size);
3086 return NULL;
3087 }
3088
3089 if (vmap_allow_huge && !(vm_flags & VM_NO_HUGE_VMAP)) {
3090 unsigned long size_per_node;
3091
3092 /*
3093 * Try huge pages. Only try for PAGE_KERNEL allocations,
3094 * others like modules don't yet expect huge pages in
3095 * their allocations due to apply_to_page_range not
3096 * supporting them.
3097 */
3098
3099 size_per_node = size;
3100 if (node == NUMA_NO_NODE)
3101 size_per_node /= num_online_nodes();
3102 if (arch_vmap_pmd_supported(prot) && size_per_node >= PMD_SIZE)
3103 shift = PMD_SHIFT;
3104 else
3105 shift = arch_vmap_pte_supported_shift(size_per_node);
3106
3107 align = max(real_align, 1UL << shift);
3108 size = ALIGN(real_size, 1UL << shift);
3109 }
3110
3111 again:
3112 area = __get_vm_area_node(real_size, align, shift, VM_ALLOC |
3113 VM_UNINITIALIZED | vm_flags, start, end, node,
3114 gfp_mask, caller);
3115 if (!area) {
3116 bool nofail = gfp_mask & __GFP_NOFAIL;
3117 warn_alloc(gfp_mask, NULL,
3118 "vmalloc error: size %lu, vm_struct allocation failed%s",
3119 real_size, (nofail) ? ". Retrying." : "");
3120 if (nofail) {
3121 schedule_timeout_uninterruptible(1);
3122 goto again;
3123 }
3124 goto fail;
3125 }
3126
3127 /* Prepare arguments for __vmalloc_area_node(). */
3128 if (kasan_hw_tags_enabled() &&
3129 pgprot_val(prot) == pgprot_val(PAGE_KERNEL)) {
3130 /*
3131 * Modify protection bits to allow tagging.
3132 * This must be done before mapping in __vmalloc_area_node().
3133 */
3134 prot = arch_vmap_pgprot_tagged(prot);
3135
3136 /*
3137 * Skip page_alloc poisoning and zeroing for physical pages
3138 * backing VM_ALLOC mapping. Memory is instead poisoned and
3139 * zeroed by kasan_unpoison_vmalloc().
3140 */
3141 gfp_mask |= __GFP_SKIP_KASAN_UNPOISON | __GFP_SKIP_ZERO;
3142 }
3143
3144 /* Allocate physical pages and map them into vmalloc space. */
3145 ret = __vmalloc_area_node(area, gfp_mask, prot, shift, node);
3146 if (!ret)
3147 goto fail;
3148
3149 /*
3150 * Mark the pages as accessible, now that they are mapped.
3151 * The init condition should match the one in post_alloc_hook()
3152 * (except for the should_skip_init() check) to make sure that memory
3153 * is initialized under the same conditions regardless of the enabled
3154 * KASAN mode.
3155 */
3156 kasan_flags = KASAN_VMALLOC_VM_ALLOC;
3157 if (!want_init_on_free() && want_init_on_alloc(gfp_mask))
> 3158 kasan_flags |= KASAN_VMALLOC_INIT;
3159 area->addr = kasan_unpoison_vmalloc(area->addr, real_size, kasan_flags);
3160
3161 /*
3162 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
3163 * flag. It means that vm_struct is not fully initialized.
3164 * Now, it is fully initialized, so remove this flag here.
3165 */
3166 clear_vm_uninitialized_flag(area);
3167
3168 size = PAGE_ALIGN(size);
3169 if (!(vm_flags & VM_DEFER_KMEMLEAK))
3170 kmemleak_vmalloc(area, size, gfp_mask);
3171
3172 return area->addr;
3173
3174 fail:
3175 if (shift > PAGE_SHIFT) {
3176 shift = PAGE_SHIFT;
3177 align = real_align;
3178 size = real_size;
3179 goto again;
3180 }
3181
3182 return NULL;
3183 }
3184
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks