CC: [email protected] CC: [email protected] TO: Ram Pai <[email protected]> CC: Michael Ellerman <[email protected]> CC: Cedric Le Goater <[email protected]> CC: Greg Kurz <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: d93a0d43e3d0ba9e19387be4dae4a8d5b175a8d7 commit: 094235222d41d68d35de18170058d94a96a82628 powerpc/xive: Share the event-queue page with the Hypervisor. date: 10 months ago :::::: branch date: 6 hours ago :::::: commit date: 10 months ago config: powerpc64-randconfig-m031-20210403 (attached as .config) compiler: powerpc64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> smatch warnings: arch/powerpc/sysdev/xive/spapr.c:509 xive_spapr_configure_queue() warn: should '1 << xive_alloc_order(order)' be a 64 bit type? arch/powerpc/sysdev/xive/spapr.c:544 xive_spapr_cleanup_queue() warn: should '1 << alloc_order' be a 64 bit type? vim +509 arch/powerpc/sysdev/xive/spapr.c b4868ff55d082b Cédric Le Goater 2019-08-14 461 eac1e731b59ee3 Cédric Le Goater 2017-08-30 462 /* This can be called multiple time to change a queue configuration */ eac1e731b59ee3 Cédric Le Goater 2017-08-30 463 static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio, eac1e731b59ee3 Cédric Le Goater 2017-08-30 464 __be32 *qpage, u32 order) eac1e731b59ee3 Cédric Le Goater 2017-08-30 465 { eac1e731b59ee3 Cédric Le Goater 2017-08-30 466 s64 rc = 0; eac1e731b59ee3 Cédric Le Goater 2017-08-30 467 unsigned long esn_page; eac1e731b59ee3 Cédric Le Goater 2017-08-30 468 unsigned long esn_size; eac1e731b59ee3 Cédric Le Goater 2017-08-30 469 u64 flags, qpage_phys; eac1e731b59ee3 Cédric Le Goater 2017-08-30 470 eac1e731b59ee3 Cédric Le Goater 2017-08-30 471 /* If there's an actual queue page, clean it */ eac1e731b59ee3 Cédric Le Goater 2017-08-30 472 if (order) { eac1e731b59ee3 Cédric Le Goater 2017-08-30 473 if (WARN_ON(!qpage)) eac1e731b59ee3 Cédric Le Goater 2017-08-30 474 return -EINVAL; eac1e731b59ee3 Cédric Le Goater 2017-08-30 475 qpage_phys = __pa(qpage); eac1e731b59ee3 Cédric Le Goater 2017-08-30 476 } else { eac1e731b59ee3 Cédric Le Goater 2017-08-30 477 qpage_phys = 0; eac1e731b59ee3 Cédric Le Goater 2017-08-30 478 } eac1e731b59ee3 Cédric Le Goater 2017-08-30 479 eac1e731b59ee3 Cédric Le Goater 2017-08-30 480 /* Initialize the rest of the fields */ eac1e731b59ee3 Cédric Le Goater 2017-08-30 481 q->msk = order ? ((1u << (order - 2)) - 1) : 0; eac1e731b59ee3 Cédric Le Goater 2017-08-30 482 q->idx = 0; eac1e731b59ee3 Cédric Le Goater 2017-08-30 483 q->toggle = 0; eac1e731b59ee3 Cédric Le Goater 2017-08-30 484 eac1e731b59ee3 Cédric Le Goater 2017-08-30 485 rc = plpar_int_get_queue_info(0, target, prio, &esn_page, &esn_size); eac1e731b59ee3 Cédric Le Goater 2017-08-30 486 if (rc) { 8e036c8d30a2cd Cédric Le Goater 2018-02-13 487 pr_err("Error %lld getting queue info CPU %d prio %d\n", rc, 8e036c8d30a2cd Cédric Le Goater 2018-02-13 488 target, prio); eac1e731b59ee3 Cédric Le Goater 2017-08-30 489 rc = -EIO; eac1e731b59ee3 Cédric Le Goater 2017-08-30 490 goto fail; eac1e731b59ee3 Cédric Le Goater 2017-08-30 491 } eac1e731b59ee3 Cédric Le Goater 2017-08-30 492 eac1e731b59ee3 Cédric Le Goater 2017-08-30 493 /* TODO: add support for the notification page */ eac1e731b59ee3 Cédric Le Goater 2017-08-30 494 q->eoi_phys = esn_page; eac1e731b59ee3 Cédric Le Goater 2017-08-30 495 eac1e731b59ee3 Cédric Le Goater 2017-08-30 496 /* Default is to always notify */ eac1e731b59ee3 Cédric Le Goater 2017-08-30 497 flags = XIVE_EQ_ALWAYS_NOTIFY; eac1e731b59ee3 Cédric Le Goater 2017-08-30 498 eac1e731b59ee3 Cédric Le Goater 2017-08-30 499 /* Configure and enable the queue in HW */ eac1e731b59ee3 Cédric Le Goater 2017-08-30 500 rc = plpar_int_set_queue_config(flags, target, prio, qpage_phys, order); eac1e731b59ee3 Cédric Le Goater 2017-08-30 501 if (rc) { 8e036c8d30a2cd Cédric Le Goater 2018-02-13 502 pr_err("Error %lld setting queue for CPU %d prio %d\n", rc, 8e036c8d30a2cd Cédric Le Goater 2018-02-13 503 target, prio); eac1e731b59ee3 Cédric Le Goater 2017-08-30 504 rc = -EIO; eac1e731b59ee3 Cédric Le Goater 2017-08-30 505 } else { eac1e731b59ee3 Cédric Le Goater 2017-08-30 506 q->qpage = qpage; 094235222d41d6 Ram Pai 2020-02-24 507 if (is_secure_guest()) 094235222d41d6 Ram Pai 2020-02-24 508 uv_share_page(PHYS_PFN(qpage_phys), 094235222d41d6 Ram Pai 2020-02-24 @509 1 << xive_alloc_order(order)); eac1e731b59ee3 Cédric Le Goater 2017-08-30 510 } eac1e731b59ee3 Cédric Le Goater 2017-08-30 511 fail: eac1e731b59ee3 Cédric Le Goater 2017-08-30 512 return rc; eac1e731b59ee3 Cédric Le Goater 2017-08-30 513 } eac1e731b59ee3 Cédric Le Goater 2017-08-30 514 eac1e731b59ee3 Cédric Le Goater 2017-08-30 515 static int xive_spapr_setup_queue(unsigned int cpu, struct xive_cpu *xc, eac1e731b59ee3 Cédric Le Goater 2017-08-30 516 u8 prio) eac1e731b59ee3 Cédric Le Goater 2017-08-30 517 { eac1e731b59ee3 Cédric Le Goater 2017-08-30 518 struct xive_q *q = &xc->queue[prio]; eac1e731b59ee3 Cédric Le Goater 2017-08-30 519 __be32 *qpage; eac1e731b59ee3 Cédric Le Goater 2017-08-30 520 eac1e731b59ee3 Cédric Le Goater 2017-08-30 521 qpage = xive_queue_page_alloc(cpu, xive_queue_shift); eac1e731b59ee3 Cédric Le Goater 2017-08-30 522 if (IS_ERR(qpage)) eac1e731b59ee3 Cédric Le Goater 2017-08-30 523 return PTR_ERR(qpage); eac1e731b59ee3 Cédric Le Goater 2017-08-30 524 8e036c8d30a2cd Cédric Le Goater 2018-02-13 525 return xive_spapr_configure_queue(get_hard_smp_processor_id(cpu), 8e036c8d30a2cd Cédric Le Goater 2018-02-13 526 q, prio, qpage, xive_queue_shift); eac1e731b59ee3 Cédric Le Goater 2017-08-30 527 } eac1e731b59ee3 Cédric Le Goater 2017-08-30 528 eac1e731b59ee3 Cédric Le Goater 2017-08-30 529 static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc, eac1e731b59ee3 Cédric Le Goater 2017-08-30 530 u8 prio) eac1e731b59ee3 Cédric Le Goater 2017-08-30 531 { eac1e731b59ee3 Cédric Le Goater 2017-08-30 532 struct xive_q *q = &xc->queue[prio]; eac1e731b59ee3 Cédric Le Goater 2017-08-30 533 unsigned int alloc_order; eac1e731b59ee3 Cédric Le Goater 2017-08-30 534 long rc; 8e036c8d30a2cd Cédric Le Goater 2018-02-13 535 int hw_cpu = get_hard_smp_processor_id(cpu); eac1e731b59ee3 Cédric Le Goater 2017-08-30 536 8e036c8d30a2cd Cédric Le Goater 2018-02-13 537 rc = plpar_int_set_queue_config(0, hw_cpu, prio, 0, 0); eac1e731b59ee3 Cédric Le Goater 2017-08-30 538 if (rc) 8e036c8d30a2cd Cédric Le Goater 2018-02-13 539 pr_err("Error %ld setting queue for CPU %d prio %d\n", rc, 8e036c8d30a2cd Cédric Le Goater 2018-02-13 540 hw_cpu, prio); eac1e731b59ee3 Cédric Le Goater 2017-08-30 541 eac1e731b59ee3 Cédric Le Goater 2017-08-30 542 alloc_order = xive_alloc_order(xive_queue_shift); 094235222d41d6 Ram Pai 2020-02-24 543 if (is_secure_guest()) 094235222d41d6 Ram Pai 2020-02-24 @544 uv_unshare_page(PHYS_PFN(__pa(q->qpage)), 1 << alloc_order); eac1e731b59ee3 Cédric Le Goater 2017-08-30 545 free_pages((unsigned long)q->qpage, alloc_order); eac1e731b59ee3 Cédric Le Goater 2017-08-30 546 q->qpage = NULL; eac1e731b59ee3 Cédric Le Goater 2017-08-30 547 } eac1e731b59ee3 Cédric Le Goater 2017-08-30 548 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
