[peterz-queue:x86/module 3/5] collect2: error: ld returned 1 exit status
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/module
head: b35af90d7fadf374ae145713872d354b02f23125
commit: 58083deac365c2b72e52ba993b5754e4aee167b0 [3/5] x86,module: Detect VMX vs SLD conflicts
config: um-defconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout 58083deac365c2b72e52ba993b5754e4aee167b0
# save the attached .config to linux build tree
make ARCH=um
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
/usr/bin/ld: arch/x86/um/../kernel/module.o: in function `decode_module':
module.c:(.text+0x25): undefined reference to `split_lock_enabled'
/usr/bin/ld: module.c:(.text+0x37): undefined reference to `insn_init'
/usr/bin/ld: module.c:(.text+0x69): undefined reference to `insn_get_length'
/usr/bin/ld: module.c:(.text+0x14e): undefined reference to `insn_get_prefixes'
>> collect2: error: ld returned 1 exit status
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-next:master 10267/10701] drivers/clocksource/timer-ti-dm-systimer.c:517:6: warning: variable 'pa' set but not used
by kbuild test robot
Hi Tony,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: fb57b1fabcb28f358901b2df90abd2b48abc1ca8
commit: aba1ad05da088944a62eb87fb0cd8391152e8985 [10267/10701] clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support
config: arm-randconfig-r013-20200519 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout aba1ad05da088944a62eb87fb0cd8391152e8985
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/clocksource/timer-ti-dm-systimer.c: In function 'dmtimer_clockevent_init':
>> drivers/clocksource/timer-ti-dm-systimer.c:517:6: warning: variable 'pa' set but not used [-Wunused-but-set-variable]
517 | u32 pa;
| ^~
drivers/clocksource/timer-ti-dm-systimer.c: In function 'dmtimer_clocksource_init':
drivers/clocksource/timer-ti-dm-systimer.c:640:6: warning: variable 'pa' set but not used [-Wunused-but-set-variable]
640 | u32 pa;
| ^~
vim +/pa +517 drivers/clocksource/timer-ti-dm-systimer.c
510
511 static int __init dmtimer_clockevent_init(struct device_node *np)
512 {
513 struct dmtimer_clockevent *clkevt;
514 struct clock_event_device *dev;
515 struct dmtimer_systimer *t;
516 int error;
> 517 u32 pa;
518
519 clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);
520 if (!clkevt)
521 return -ENOMEM;
522
523 t = &clkevt->t;
524 dev = &clkevt->dev;
525
526 /*
527 * We mostly use cpuidle_coupled with ARM local timers for runtime,
528 * so there's probably no use for CLOCK_EVT_FEAT_DYNIRQ here.
529 */
530 dev->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
531 dev->rating = 300;
532 dev->set_next_event = dmtimer_set_next_event;
533 dev->set_state_shutdown = dmtimer_clockevent_shutdown;
534 dev->set_state_periodic = dmtimer_set_periodic;
535 dev->set_state_oneshot = dmtimer_clockevent_shutdown;
536 dev->tick_resume = dmtimer_clockevent_shutdown;
537 dev->cpumask = cpu_possible_mask;
538
539 dev->irq = irq_of_parse_and_map(np, 0);
540 if (!dev->irq) {
541 error = -ENXIO;
542 goto err_out_free;
543 }
544
545 error = dmtimer_systimer_setup(np, &clkevt->t);
546 if (error)
547 goto err_out_free;
548
549 clkevt->period = 0xffffffff - DIV_ROUND_CLOSEST(t->rate, HZ);
550
551 /*
552 * For clock-event timers we never read the timer counter and
553 * so we are not impacted by errata i103 and i767. Therefore,
554 * we can safely ignore this errata for clock-event timers.
555 */
556 writel_relaxed(OMAP_TIMER_CTRL_POSTED, t->base + t->ifctrl);
557
558 error = request_irq(dev->irq, dmtimer_clockevent_interrupt,
559 IRQF_TIMER, "clockevent", clkevt);
560 if (error)
561 goto err_out_unmap;
562
563 writel_relaxed(OMAP_TIMER_INT_OVERFLOW, t->base + t->irq_ena);
564 writel_relaxed(OMAP_TIMER_INT_OVERFLOW, t->base + t->wakeup);
565
566 pa = of_translate_address(np, of_get_address(np, 0, NULL, NULL));
567 pr_info("TI gptimer clockevent: %s%lu Hz at %pOF\n",
568 of_find_property(np, "ti,timer-alwon", NULL) ?
569 "always-on " : "", t->rate, np->parent);
570
571 clockevents_config_and_register(dev, t->rate,
572 3, /* Timer internal resynch latency */
573 0xffffffff);
574
575 if (of_device_is_compatible(np, "ti,am33xx") ||
576 of_device_is_compatible(np, "ti,am43")) {
577 dev->suspend = omap_clockevent_idle;
578 dev->resume = omap_clockevent_unidle;
579 }
580
581 return 0;
582
583 err_out_unmap:
584 iounmap(t->base);
585
586 err_out_free:
587 kfree(clkevt);
588
589 return error;
590 }
591
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[dlezcano:timers/drivers/next 5/22] drivers/clocksource/timer-of.c:151:24: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kbuild test robot
Hi Michael,
First bad commit (maybe != root cause):
tree: https://git.linaro.org/people/dlezcano/linux timers/drivers/next
head: ba82fe3233ec7a10d8b47cc59f93ee844a0da31f
commit: 25259f7a5de2de9d67793dc584b15c83a3134c93 [5/22] clocksource/drivers/timer-microchip-pit64b: Select CONFIG_TIMER_OF
config: openrisc-randconfig-s001-20200519 (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout 25259f7a5de2de9d67793dc584b15c83a3134c93
# save the attached .config to linux build tree
make C=1 ARCH=openrisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/clocksource/timer-of.c:29:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:3> * @@ got strvoid [noderef] <asn:3> * @@
drivers/clocksource/timer-of.c:29:46: sparse: expected void [noderef] <asn:3> *
drivers/clocksource/timer-of.c:29:46: sparse: got struct clock_event_device *clkevt
drivers/clocksource/timer-of.c:74:51: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected void [noderef] <asn:3> *percpu_dev_id @@ got strvoid [noderef] <asn:3> *percpu_dev_id @@
drivers/clocksource/timer-of.c:74:51: sparse: expected void [noderef] <asn:3> *percpu_dev_id
drivers/clocksource/timer-of.c:74:51: sparse: got struct clock_event_device *clkevt
>> drivers/clocksource/timer-of.c:151:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asvoid *addr @@
>> drivers/clocksource/timer-of.c:151:24: sparse: expected void *addr
>> drivers/clocksource/timer-of.c:151:24: sparse: got void [noderef] <asn:2> *base
vim +151 drivers/clocksource/timer-of.c
dc11bae7852952 Daniel Lezcano 2017-06-05 148
5bbf4ad945a9bb Daniel Lezcano 2018-01-08 149 static __init void timer_of_base_exit(struct of_timer_base *of_base)
dc11bae7852952 Daniel Lezcano 2017-06-05 150 {
dc11bae7852952 Daniel Lezcano 2017-06-05 @151 iounmap(of_base->base);
dc11bae7852952 Daniel Lezcano 2017-06-05 152 }
dc11bae7852952 Daniel Lezcano 2017-06-05 153
:::::: The code at line 151 was first introduced by commit
:::::: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine
:::::: TO: Daniel Lezcano <daniel.lezcano(a)linaro.org>
:::::: CC: Daniel Lezcano <daniel.lezcano(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-next:master 10250/10701] drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:259: undefined reference to `__aeabi_uldivmod'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: fb57b1fabcb28f358901b2df90abd2b48abc1ca8
commit: 04d9044f6c577948609c03b4e33b8fbc8b87c4b1 [10250/10701] drm/msm/dpu: add support for clk and bw scaling for display
config: arm-randconfig-r013-20200519 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 04d9044f6c577948609c03b4e33b8fbc8b87c4b1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
arm-linux-gnueabi-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.o: in function `_dpu_core_perf_crtc_update_bus':
>> drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:259: undefined reference to `__aeabi_uldivmod'
arm-linux-gnueabi-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:263: undefined reference to `__aeabi_uldivmod'
arm-linux-gnueabi-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.o: in function `_dpu_core_perf_calc_bw':
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:57: undefined reference to `__aeabi_uldivmod'
arm-linux-gnueabi-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:57: undefined reference to `__aeabi_uldivmod'
arm-linux-gnueabi-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:57: undefined reference to `__aeabi_uldivmod'
arm-linux-gnueabi-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.o:drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:93: more undefined references to `__aeabi_uldivmod' follow
vim +259 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
229
230 static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
231 struct drm_crtc *crtc)
232 {
233 struct dpu_core_perf_params perf = { 0 };
234 enum dpu_crtc_client_type curr_client_type
235 = dpu_crtc_get_client_type(crtc);
236 struct drm_crtc *tmp_crtc;
237 struct dpu_crtc_state *dpu_cstate;
238 int i, ret = 0;
239 u64 avg_bw;
240
241 drm_for_each_crtc(tmp_crtc, crtc->dev) {
242 if (tmp_crtc->enabled &&
243 curr_client_type ==
244 dpu_crtc_get_client_type(tmp_crtc)) {
245 dpu_cstate = to_dpu_crtc_state(tmp_crtc->state);
246
247 perf.max_per_pipe_ib = max(perf.max_per_pipe_ib,
248 dpu_cstate->new_perf.max_per_pipe_ib);
249
250 perf.bw_ctl += dpu_cstate->new_perf.bw_ctl;
251
252 DPU_DEBUG("crtc=%d bw=%llu paths:%d\n",
253 tmp_crtc->base.id,
254 dpu_cstate->new_perf.bw_ctl, kms->num_paths);
255 }
256 }
257
258 avg_bw = kms->num_paths ?
> 259 perf.bw_ctl / kms->num_paths : 0;
260
261 for (i = 0; i < kms->num_paths; i++)
262 icc_set_bw(kms->path[i],
263 Bps_to_icc(avg_bw), (perf.max_per_pipe_ib));
264
265 return ret;
266 }
267
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH v2 3/4] counter: Add character device interface
by kbuild test robot
Hi William,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc6 next-20200519]
[cannot apply to stm32/stm32-next linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/William-Breathitt-Gray/Introduce...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 12bf0b632ed090358cbf03e323e5342212d0b2e4
config: arm64-randconfig-r026-20200519 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/counter/counter-chrdev.c:632:5: warning: no previous prototype for function 'counter_chrdev_add' [-Wmissing-prototypes]
int counter_chrdev_add(struct counter_device *const counter,
^
drivers/counter/counter-chrdev.c:632:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int counter_chrdev_add(struct counter_device *const counter,
^
static
>> drivers/counter/counter-chrdev.c:652:6: warning: no previous prototype for function 'counter_chrdev_free' [-Wmissing-prototypes]
void counter_chrdev_free(struct counter_device *const counter)
^
drivers/counter/counter-chrdev.c:652:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void counter_chrdev_free(struct counter_device *const counter)
^
static
2 warnings generated.
vim +/counter_chrdev_add +632 drivers/counter/counter-chrdev.c
631
> 632 int counter_chrdev_add(struct counter_device *const counter,
633 const dev_t counter_devt)
634 {
635 struct device *const dev = &counter->dev;
636 struct cdev *const chrdev = &counter->chrdev;
637
638 /* Initialize Counter character device control selection */
639 memset(counter->selection, 0, sizeof(counter->selection));
640
641 /* Initialize Counter character device selected controls list */
642 INIT_LIST_HEAD(&counter->control_list);
643
644 /* Initialize character device */
645 cdev_init(chrdev, &counter_fops);
646 dev->devt = MKDEV(MAJOR(counter_devt), counter->id);
647 cdev_set_parent(chrdev, &dev->kobj);
648
649 return cdev_add(chrdev, dev->devt, 1);
650 }
651
> 652 void counter_chrdev_free(struct counter_device *const counter)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-sof-driver:pr/2088 2/11] drivers/soundwire/qcom.c:792:35: error: passing argument 1 of 'sdw_master_device_add' from incompatible pointer type
by kbuild test robot
tree: https://github.com/thesofproject/linux pr/2088
head: b7b26d7f347a38bdf2a75ce61f25a5e5cddaff66
commit: 9f9308f0723ec981f867a75b9eedf82f77440807 [2/11] soundwire: use a single API to add/delete master device
config: arm64-sof-customedconfig-nobloat-imx-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 9f9308f0723ec981f867a75b9eedf82f77440807
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/soundwire/qcom.c: In function 'qcom_swrm_probe':
>> drivers/soundwire/qcom.c:792:35: error: passing argument 1 of 'sdw_master_device_add' from incompatible pointer type [-Werror=incompatible-pointer-types]
792 | ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
| ^~~
| |
| struct device *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:22:43: note: expected 'struct sdw_bus *' but argument is of type 'struct device *'
22 | int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
| ~~~~~~~~~~~~~~~~^~~
drivers/soundwire/qcom.c:793:10: error: passing argument 2 of 'sdw_master_device_add' from incompatible pointer type [-Werror=incompatible-pointer-types]
793 | dev->fwnode,
| ~~~^~~~~~~~
| |
| struct fwnode_handle *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:22:63: note: expected 'struct device *' but argument is of type 'struct fwnode_handle *'
22 | int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
| ~~~~~~~~~~~~~~~^~~~~~
>> drivers/soundwire/qcom.c:792:13: error: too many arguments to function 'sdw_master_device_add'
792 | ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:22:5: note: declared here
22 | int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/soundwire/qcom.c:792:11: warning: assignment to 'struct sdw_master_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
792 | ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
| ^
>> drivers/soundwire/qcom.c:864:34: error: passing argument 1 of 'sdw_master_device_del' from incompatible pointer type [-Werror=incompatible-pointer-types]
864 | err = sdw_master_device_del(ctrl->md);
| ~~~~^~~~
| |
| struct sdw_master_device *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:24:43: note: expected 'struct sdw_bus *' but argument is of type 'struct sdw_master_device *'
24 | int sdw_master_device_del(struct sdw_bus *bus);
| ~~~~~~~~~~~~~~~~^~~
drivers/soundwire/qcom.c: In function 'qcom_swrm_remove':
drivers/soundwire/qcom.c:878:2: error: implicit declaration of function 'sdw_delete_bus_master' [-Werror=implicit-function-declaration]
878 | sdw_delete_bus_master(&ctrl->bus);
| ^~~~~~~~~~~~~~~~~~~~~
drivers/soundwire/qcom.c:879:34: error: passing argument 1 of 'sdw_master_device_del' from incompatible pointer type [-Werror=incompatible-pointer-types]
879 | err = sdw_master_device_del(ctrl->md);
| ~~~~^~~~
| |
| struct sdw_master_device *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:24:43: note: expected 'struct sdw_bus *' but argument is of type 'struct sdw_master_device *'
24 | int sdw_master_device_del(struct sdw_bus *bus);
| ~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
vim +/sdw_master_device_add +792 drivers/soundwire/qcom.c
02efb49aa805cee Srinivas Kandagatla 2020-01-13 743
02efb49aa805cee Srinivas Kandagatla 2020-01-13 744 static int qcom_swrm_probe(struct platform_device *pdev)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 745 {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 746 struct device *dev = &pdev->dev;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 747 struct sdw_master_prop *prop;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 748 struct sdw_bus_params *params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 749 struct qcom_swrm_ctrl *ctrl;
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 750 int ret, err;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 751 u32 val;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 752
02efb49aa805cee Srinivas Kandagatla 2020-01-13 753 ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 754 if (!ctrl)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 755 return -ENOMEM;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 756
02efb49aa805cee Srinivas Kandagatla 2020-01-13 757 if (dev->parent->bus == &slimbus_bus) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 758 ctrl->reg_read = qcom_swrm_abh_reg_read;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 759 ctrl->reg_write = qcom_swrm_ahb_reg_write;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 760 ctrl->regmap = dev_get_regmap(dev->parent, NULL);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 761 if (!ctrl->regmap)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 762 return -EINVAL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 763 } else {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 764 /* Only WCD based SoundWire controller is supported */
02efb49aa805cee Srinivas Kandagatla 2020-01-13 765 return -ENOTSUPP;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 766 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 767
02efb49aa805cee Srinivas Kandagatla 2020-01-13 768 ctrl->irq = of_irq_get(dev->of_node, 0);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 769 if (ctrl->irq < 0) {
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 770 ret = ctrl->irq;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 771 goto err_init;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 772 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 773
02efb49aa805cee Srinivas Kandagatla 2020-01-13 774 ctrl->hclk = devm_clk_get(dev, "iface");
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 775 if (IS_ERR(ctrl->hclk)) {
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 776 ret = PTR_ERR(ctrl->hclk);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 777 goto err_init;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 778 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 779
02efb49aa805cee Srinivas Kandagatla 2020-01-13 780 clk_prepare_enable(ctrl->hclk);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 781
02efb49aa805cee Srinivas Kandagatla 2020-01-13 782 ctrl->dev = dev;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 783 dev_set_drvdata(&pdev->dev, ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 784 spin_lock_init(&ctrl->comp_lock);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 785 mutex_init(&ctrl->port_lock);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 786 INIT_WORK(&ctrl->slave_work, qcom_swrm_slave_wq);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 787
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 788 /*
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 789 * add sdw_master_device.
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 790 * For the Qualcomm implementation there is no driver.
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 791 */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 @792 ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 793 dev->fwnode,
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 794 NULL, /* no link ops */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 795 0, /* only one link supported */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 796 NULL); /* no context */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 797 if (IS_ERR(ctrl->md)) {
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 798 dev_err(dev, "Could not create sdw_master_device\n");
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 799 ret = PTR_ERR(ctrl->md);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 800 goto err_clk;
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 801 }
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 802
3a4d863b21f4e30 Pierre-Louis Bossart 2020-04-09 803 /* add bus handle */
3a4d863b21f4e30 Pierre-Louis Bossart 2020-04-09 804 ctrl->md->bus = &ctrl->bus;
3a4d863b21f4e30 Pierre-Louis Bossart 2020-04-09 805
02efb49aa805cee Srinivas Kandagatla 2020-01-13 806 ctrl->bus.ops = &qcom_swrm_ops;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 807 ctrl->bus.port_ops = &qcom_swrm_port_ops;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 808 ctrl->bus.compute_params = &qcom_swrm_compute_params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 809
02efb49aa805cee Srinivas Kandagatla 2020-01-13 810 ret = qcom_swrm_get_port_config(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 811 if (ret)
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 812 goto err_md;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 813
02efb49aa805cee Srinivas Kandagatla 2020-01-13 814 params = &ctrl->bus.params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 815 params->max_dr_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 816 params->curr_dr_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 817 params->col = SWRM_DEFAULT_COL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 818 params->row = SWRM_DEFAULT_ROWS;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 819 ctrl->reg_read(ctrl, SWRM_MCP_STATUS, &val);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 820 params->curr_bank = val & SWRM_MCP_STATUS_BANK_NUM_MASK;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 821 params->next_bank = !params->curr_bank;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 822
02efb49aa805cee Srinivas Kandagatla 2020-01-13 823 prop = &ctrl->bus.prop;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 824 prop->max_clk_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 825 prop->num_clk_gears = 0;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 826 prop->num_clk_freq = MAX_FREQ_NUM;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 827 prop->clk_freq = &qcom_swrm_freq_tbl[0];
02efb49aa805cee Srinivas Kandagatla 2020-01-13 828 prop->default_col = SWRM_DEFAULT_COL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 829 prop->default_row = SWRM_DEFAULT_ROWS;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 830
02efb49aa805cee Srinivas Kandagatla 2020-01-13 831 ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &ctrl->version);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 832
02efb49aa805cee Srinivas Kandagatla 2020-01-13 833 ret = devm_request_threaded_irq(dev, ctrl->irq, NULL,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 834 qcom_swrm_irq_handler,
4f1738f4c24b448 Samuel Zou 2020-05-06 835 IRQF_TRIGGER_RISING |
4f1738f4c24b448 Samuel Zou 2020-05-06 836 IRQF_ONESHOT,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 837 "soundwire", ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 838 if (ret) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 839 dev_err(dev, "Failed to request soundwire irq\n");
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 840 goto err_md;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 841 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 842
3f2a586205030f4 Pierre-Louis Bossart 2020-04-24 843 ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 844 if (ret) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 845 dev_err(dev, "Failed to register Soundwire controller (%d)\n",
02efb49aa805cee Srinivas Kandagatla 2020-01-13 846 ret);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 847 goto err_md;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 848 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 849
02efb49aa805cee Srinivas Kandagatla 2020-01-13 850 qcom_swrm_init(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 851 ret = qcom_swrm_register_dais(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 852 if (ret)
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 853 goto err_master_add;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 854
02efb49aa805cee Srinivas Kandagatla 2020-01-13 855 dev_info(dev, "Qualcomm Soundwire controller v%x.%x.%x Registered\n",
02efb49aa805cee Srinivas Kandagatla 2020-01-13 856 (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 857 ctrl->version & 0xffff);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 858
02efb49aa805cee Srinivas Kandagatla 2020-01-13 859 return 0;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 860
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 861 err_master_add:
3f2a586205030f4 Pierre-Louis Bossart 2020-04-24 862 sdw_bus_master_delete(&ctrl->bus);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 863 err_md:
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 @864 err = sdw_master_device_del(ctrl->md);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 865 if (err < 0) /* log but return initial status */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 866 dev_err(dev, "master device del failed %d\n", err);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 867 err_clk:
02efb49aa805cee Srinivas Kandagatla 2020-01-13 868 clk_disable_unprepare(ctrl->hclk);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 869 err_init:
02efb49aa805cee Srinivas Kandagatla 2020-01-13 870 return ret;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 871 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 872
:::::: The code at line 792 was first introduced by commit
:::::: 5156c376c827fdcb7526d5eec54616f3612e2423 soundwire: qcom: add sdw_master_device support
:::::: TO: Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
:::::: CC: Pierre Bossart <pierre-louis.bossart(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[efi:next 39/40] drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head: e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier
# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85...
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c
c625d1c203941f drivers/firmware/efi/efi-stub-helper.c H. Peter Anvin 2013-09-20 258 options_bytes++; /* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c Leif Lindholm 2014-04-04 259
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10 260 status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c Roy Franz 2013-09-22 261 if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c Roy Franz 2013-09-22 262 return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c Roy Franz 2013-09-22 263
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar 2020-05-18 264 snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
^
The "l" doesn't make sense here?
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar 2020-05-18 @265 options_bytes - 1, options);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c Roy Franz 2013-09-22 266
c625d1c203941f drivers/firmware/efi/efi-stub-helper.c H. Peter Anvin 2013-09-20 267 *cmd_line_len = options_bytes;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c Roy Franz 2013-09-22 268 return (char *)cmdline_addr;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c Roy Franz 2013-09-22 269 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[hch-misc:kernel_setsockopt 10/32] net/core/sock.c:807:6: warning: no previous prototype for '__sock_set_rcvbuf'
by kbuild test robot
tree: git://git.infradead.org/users/hch/misc.git kernel_setsockopt
head: 43d0f0870df329db68ecbae8e699615ff0c009f1
commit: 14a156d7bffb7051e47cada85e62cbaccea7fd03 [10/32] net: add sock_set_rcvbuf
config: nios2-defconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 14a156d7bffb7051e47cada85e62cbaccea7fd03
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> net/core/sock.c:807:6: warning: no previous prototype for '__sock_set_rcvbuf' [-Wmissing-prototypes]
807 | void __sock_set_rcvbuf(struct sock *sk, int val)
| ^~~~~~~~~~~~~~~~~
vim +/__sock_set_rcvbuf +807 net/core/sock.c
806
> 807 void __sock_set_rcvbuf(struct sock *sk, int val)
808 {
809 /* Ensure val * 2 fits into an int, to prevent max_t() from treating it
810 * as a negative value.
811 */
812 val = min_t(int, val, INT_MAX / 2);
813 sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
814
815 /* We double it on the way in to account for "struct sk_buff" etc.
816 * overhead. Applications assume that the SO_RCVBUF setting they make
817 * will allow that much actual data to be received on that socket.
818 *
819 * Applications are unaware that "struct sk_buff" and other overheads
820 * allocate from the receive buffer during socket buffer allocation.
821 *
822 * And after considering the possible alternatives, returning the value
823 * we actually used in getsockopt is the most desirable behavior.
824 */
825 WRITE_ONCE(sk->sk_rcvbuf, max_t(int, val * 2, SOCK_MIN_RCVBUF));
826 }
827
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [patch 5/7] x86/kvm/svm: Move guest enter/exit into .noinstr.text
by kbuild test robot
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on kvm/linux-next]
[cannot apply to tip/auto-latest linus/master linux/master v5.7-rc6 next-20200519]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Thomas-Gleixner/x86-KVM-Async-PF...
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: i386-allyesconfig (attached as .config)
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> arch/x86/kvm/svm/svm.c:3330:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu,
^~~~
arch/x86/kvm/svm/svm.c: In function 'svm_vcpu_run':
>> arch/x86/kvm/svm/svm.c:3446:2: error: implicit declaration of function 'svm_vcpu_enter_exit'; did you mean 'kvm_vcpu_mtrr_init'? [-Werror=implicit-function-declaration]
svm_vcpu_enter_exit(vcpu, svm);
^~~~~~~~~~~~~~~~~~~
kvm_vcpu_mtrr_init
cc1: some warnings being treated as errors
vim +3330 arch/x86/kvm/svm/svm.c
3329
> 3330 static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu,
3331 struct vcpu_svm *svm)
3332 {
3333 /*
3334 * VMENTER enables interrupts (host state), but the kernel state is
3335 * interrupts disabled when this is invoked. Also tell RCU about
3336 * it. This is the same logic as for exit_to_user_mode().
3337 *
3338 * This ensures that e.g. latency analysis on the host observes
3339 * guest mode as interrupt enabled.
3340 *
3341 * guest_enter_irqoff() informs context tracking about the
3342 * transition to guest mode and if enabled adjusts RCU state
3343 * accordingly.
3344 */
3345 instrumentation_begin();
3346 trace_hardirqs_on_prepare();
3347 lockdep_hardirqs_on_prepare(CALLER_ADDR0);
3348 instrumentation_end();
3349
3350 guest_enter_irqoff();
3351 lockdep_hardirqs_on(CALLER_ADDR0);
3352
3353 __svm_vcpu_run(svm->vmcb_pa, (unsigned long *)&svm->vcpu.arch.regs);
3354
3355 #ifdef CONFIG_X86_64
3356 wrmsrl(MSR_GS_BASE, svm->host.gs_base);
3357 #else
3358 loadsegment(fs, svm->host.fs);
3359 #ifndef CONFIG_X86_32_LAZY_GS
3360 loadsegment(gs, svm->host.gs);
3361 #endif
3362 #endif
3363
3364 /*
3365 * VMEXIT disables interrupts (host state), but tracing and lockdep
3366 * have them in state 'on' as recorded before entering guest mode.
3367 * Same as enter_from_user_mode().
3368 *
3369 * guest_exit_irqoff() restores host context and reinstates RCU if
3370 * enabled and required.
3371 *
3372 * This needs to be done before the below as native_read_msr()
3373 * contains a tracepoint and x86_spec_ctrl_restore_host() calls
3374 * into world and some more.
3375 */
3376 lockdep_hardirqs_off(CALLER_ADDR0);
3377 guest_exit_irqoff();
3378
3379 instrumentation_begin();
3380 trace_hardirqs_off_prepare();
3381 instrumentation_end();
3382 }
3383
3384 static fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
3385 {
3386 fastpath_t exit_fastpath;
3387 struct vcpu_svm *svm = to_svm(vcpu);
3388
3389 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX];
3390 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP];
3391 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP];
3392
3393 /*
3394 * A vmexit emulation is required before the vcpu can be executed
3395 * again.
3396 */
3397 if (unlikely(svm->nested.exit_required))
3398 return EXIT_FASTPATH_NONE;
3399
3400 /*
3401 * Disable singlestep if we're injecting an interrupt/exception.
3402 * We don't want our modified rflags to be pushed on the stack where
3403 * we might not be able to easily reset them if we disabled NMI
3404 * singlestep later.
3405 */
3406 if (svm->nmi_singlestep && svm->vmcb->control.event_inj) {
3407 /*
3408 * Event injection happens before external interrupts cause a
3409 * vmexit and interrupts are disabled here, so smp_send_reschedule
3410 * is enough to force an immediate vmexit.
3411 */
3412 disable_nmi_singlestep(svm);
3413 smp_send_reschedule(vcpu->cpu);
3414 }
3415
3416 pre_svm_run(svm);
3417
3418 sync_lapic_to_cr8(vcpu);
3419
3420 svm->vmcb->save.cr2 = vcpu->arch.cr2;
3421
3422 /*
3423 * Run with all-zero DR6 unless needed, so that we can get the exact cause
3424 * of a #DB.
3425 */
3426 if (unlikely(svm->vcpu.arch.switch_db_regs & KVM_DEBUGREG_WONT_EXIT))
3427 svm_set_dr6(svm, vcpu->arch.dr6);
3428 else
3429 svm_set_dr6(svm, DR6_FIXED_1 | DR6_RTM);
3430
3431 clgi();
3432 kvm_load_guest_xsave_state(vcpu);
3433
3434 if (lapic_in_kernel(vcpu) &&
3435 vcpu->arch.apic->lapic_timer.timer_advance_ns)
3436 kvm_wait_lapic_expire(vcpu);
3437
3438 /*
3439 * If this vCPU has touched SPEC_CTRL, restore the guest's value if
3440 * it's non-zero. Since vmentry is serialising on affected CPUs, there
3441 * is no need to worry about the conditional branch over the wrmsr
3442 * being speculatively taken.
3443 */
3444 x86_spec_ctrl_set_guest(svm->spec_ctrl, svm->virt_spec_ctrl);
3445
> 3446 svm_vcpu_enter_exit(vcpu, svm);
3447
3448 /*
3449 * We do not use IBRS in the kernel. If this vCPU has used the
3450 * SPEC_CTRL MSR it may have left it on; save the value and
3451 * turn it off. This is much more efficient than blindly adding
3452 * it to the atomic save/restore list. Especially as the former
3453 * (Saving guest MSRs on vmexit) doesn't even exist in KVM.
3454 *
3455 * For non-nested case:
3456 * If the L01 MSR bitmap does not intercept the MSR, then we need to
3457 * save it.
3458 *
3459 * For nested case:
3460 * If the L02 MSR bitmap does not intercept the MSR, then we need to
3461 * save it.
3462 */
3463 if (unlikely(!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)))
3464 svm->spec_ctrl = native_read_msr(MSR_IA32_SPEC_CTRL);
3465
3466 reload_tss(vcpu);
3467
3468 x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
3469
3470 vcpu->arch.cr2 = svm->vmcb->save.cr2;
3471 vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax;
3472 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp;
3473 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;
3474
3475 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI))
3476 kvm_before_interrupt(&svm->vcpu);
3477
3478 kvm_load_host_xsave_state(vcpu);
3479 stgi();
3480
3481 /* Any pending NMI will happen here */
3482 exit_fastpath = svm_exit_handlers_fastpath(vcpu);
3483
3484 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI))
3485 kvm_after_interrupt(&svm->vcpu);
3486
3487 sync_cr8_to_lapic(vcpu);
3488
3489 svm->next_rip = 0;
3490 svm->nested.nested_run_pending = 0;
3491
3492 svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING;
3493
3494 /* if exit due to PF check for async PF */
3495 if (svm->vmcb->control.exit_code == SVM_EXIT_EXCP_BASE + PF_VECTOR)
3496 svm->vcpu.arch.apf.host_apf_reason = kvm_read_and_reset_pf_reason();
3497
3498 if (npt_enabled) {
3499 vcpu->arch.regs_avail &= ~(1 << VCPU_EXREG_PDPTR);
3500 vcpu->arch.regs_dirty &= ~(1 << VCPU_EXREG_PDPTR);
3501 }
3502
3503 /*
3504 * We need to handle MC intercepts here before the vcpu has a chance to
3505 * change the physical cpu
3506 */
3507 if (unlikely(svm->vmcb->control.exit_code ==
3508 SVM_EXIT_EXCP_BASE + MC_VECTOR))
3509 svm_handle_mce(svm);
3510
3511 mark_all_clean(svm->vmcb);
3512 return exit_fastpath;
3513 }
3514
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months