[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <201711281250.yawWBIYb%fengguang.wu@intel.com>
Date: Tue, 28 Nov 2017 12:54:37 +0800
From: kbuild test robot <lkp@...el.com>
To: Sagar Arun Kamble <sagar.a.kamble@...el.com>
Cc: kbuild-all@...org, linux-kernel@...r.kernel.org,
Sagar Arun Kamble <sagar.a.kamble@...el.com>,
John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...eaurora.org>
Subject: Re: [PATCH 1/1] timecounter: Make cyclecounter struct part of
timecounter struct
Hi Sagar,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v4.14]
[cannot apply to net-next/master net/master jkirsher-next-queue/dev-queue v4.15-rc1 next-20171127]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sagar-Arun-Kamble/timecounter-Make-cyclecounter-struct-part-of-timecounter-struct/20171128-075230
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64
All error/warnings (new ones prefixed by >>):
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 'kvm_phys_timer_read':
>> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:56:24: error: invalid type argument of '->' (have 'struct cyclecounter')
return timecounter->cc->read(timecounter->cc);
^~
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 'kvm_timer_compute_delta':
>> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:122:28: error: incompatible type for argument 1 of 'cyclecounter_cyc2ns'
ns = cyclecounter_cyc2ns(timecounter->cc,
^~~~~~~~~~~
In file included from include/clocksource/arm_arch_timer.h:20:0,
from arch/arm64/include/asm/arch_timer.h:31,
from arch/arm64/include/asm/timex.h:19,
from include/linux/timex.h:65,
from include/linux/jiffies.h:10,
from include/linux/ktime.h:25,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/srcu.h:34,
from include/linux/notifier.h:16,
from include/linux/memory_hotplug.h:7,
from include/linux/mmzone.h:780,
from include/linux/gfp.h:6,
from include/linux/idr.h:16,
from include/linux/kernfs.h:14,
from include/linux/sysfs.h:16,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:19:
include/linux/timecounter.h:79:19: note: expected 'const struct cyclecounter *' but argument is of type 'struct cyclecounter'
static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc,
^~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 'kvm_timer_hyp_init':
>> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:577:6: error: wrong type argument to unary exclamation mark
if (!timecounter->cc) {
^
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 'kvm_phys_timer_read':
>> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:57:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
vim +/cyclecounter_cyc2ns +122 arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 @19 #include <linux/cpu.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 20 #include <linux/kvm.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 21 #include <linux/kvm_host.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 22 #include <linux/interrupt.h>
b452cb52 virt/kvm/arm/arch_timer.c Christoffer Dall 2016-06-04 23 #include <linux/irq.h>
99a1db7a virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 24 #include <linux/uaccess.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 25
372b7c1b arch/arm/kvm/arch_timer.c Mark Rutland 2013-03-27 26 #include <clocksource/arm_arch_timer.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 27 #include <asm/arch_timer.h>
488f94d7 virt/kvm/arm/arch_timer.c Jintack Lim 2016-12-01 28 #include <asm/kvm_hyp.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 29
7275acdf virt/kvm/arm/arch_timer.c Marc Zyngier 2013-05-14 30 #include <kvm/arm_vgic.h>
7275acdf virt/kvm/arm/arch_timer.c Marc Zyngier 2013-05-14 31 #include <kvm/arm_arch_timer.h>
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 32
e21f0910 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-08-30 33 #include "trace.h"
e21f0910 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-08-30 34
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 35 static struct timecounter *timecounter;
5ae7f87a virt/kvm/arm/arch_timer.c Anup Patel 2013-04-30 36 static unsigned int host_vtimer_irq;
cabdc5c5 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-08-16 37 static u32 host_vtimer_irq_flags;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 38
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 39 static const struct kvm_irq_level default_ptimer_irq = {
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 40 .irq = 30,
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 41 .level = 1,
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 42 };
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 43
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 44 static const struct kvm_irq_level default_vtimer_irq = {
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 45 .irq = 27,
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 46 .level = 1,
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 47 };
85e69ad7 virt/kvm/arm/arch_timer.c Christoffer Dall 2017-05-02 48
9b4a3004 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-01-29 49 void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu)
9b4a3004 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-01-29 50 {
fbb4aeec virt/kvm/arm/arch_timer.c Jintack Lim 2017-02-03 51 vcpu_vtimer(vcpu)->active_cleared_last = false;
9b4a3004 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-01-29 52 }
9b4a3004 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-01-29 53
7b6b4631 virt/kvm/arm/arch_timer.c Jintack Lim 2017-02-03 54 u64 kvm_phys_timer_read(void)
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 55 {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 @56 return timecounter->cc->read(timecounter->cc);
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 @57 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 58
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 59 static bool timer_is_armed(struct arch_timer_cpu *timer)
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 60 {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 61 return timer->armed;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 62 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 63
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 64 /* timer_arm: as in "arm the timer", not as in ARM the company */
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 65 static void timer_arm(struct arch_timer_cpu *timer, u64 ns)
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 66 {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 67 timer->armed = true;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 68 hrtimer_start(&timer->timer, ktime_add_ns(ktime_get(), ns),
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 69 HRTIMER_MODE_ABS);
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 70 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 71
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 72 static void timer_disarm(struct arch_timer_cpu *timer)
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 73 {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 74 if (timer_is_armed(timer)) {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 75 hrtimer_cancel(&timer->timer);
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 76 cancel_work_sync(&timer->expired);
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 77 timer->armed = false;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 78 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 79 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 80
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 81 static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 82 {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 83 struct kvm_vcpu *vcpu = *(struct kvm_vcpu **)dev_id;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 84
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 85 /*
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 86 * We disable the timer in the world switch and let it be
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 87 * handled by kvm_timer_sync_hwstate(). Getting a timer
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 88 * interrupt at this point is a sure sign of some major
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 89 * breakage.
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 90 */
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 91 pr_warn("Unexpected interrupt %d on vcpu %p\n", irq, vcpu);
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 92 return IRQ_HANDLED;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 93 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 94
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 95 /*
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 96 * Work function for handling the backup timer that we schedule when a vcpu is
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 97 * no longer running, but had a timer programmed to fire in the future.
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 98 */
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 99 static void kvm_timer_inject_irq_work(struct work_struct *work)
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 100 {
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 101 struct kvm_vcpu *vcpu;
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 102
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 103 vcpu = container_of(work, struct kvm_vcpu, arch.timer_cpu.expired);
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 104
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 105 /*
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 106 * If the vcpu is blocked we want to wake it up so that it will see
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 107 * the timer has expired when entering the guest.
1a748478 virt/kvm/arm/arch_timer.c Christoffer Dall 2015-03-13 108 */
1b6502e5 virt/kvm/arm/arch_timer.c Andrew Jones 2017-06-04 109 kvm_vcpu_wake_up(vcpu);
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 110 }
53e72406 arch/arm/kvm/arch_timer.c Marc Zyngier 2013-01-23 111
9171fa2e virt/kvm/arm/arch_timer.c Jintack Lim 2017-02-03 112 static u64 kvm_timer_compute_delta(struct arch_timer_context *timer_ctx)
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 113 {
a5a1d1c2 virt/kvm/arm/arch_timer.c Thomas Gleixner 2016-12-21 114 u64 cval, now;
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 115
9171fa2e virt/kvm/arm/arch_timer.c Jintack Lim 2017-02-03 116 cval = timer_ctx->cnt_cval;
9171fa2e virt/kvm/arm/arch_timer.c Jintack Lim 2017-02-03 117 now = kvm_phys_timer_read() - timer_ctx->cntvoff;
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 118
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 119 if (now < cval) {
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 120 u64 ns;
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 121
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 @122 ns = cyclecounter_cyc2ns(timecounter->cc,
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 123 cval - now,
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 124 timecounter->mask,
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 125 &timecounter->frac);
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 126 return ns;
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 127 }
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 128
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 129 return 0;
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 130 }
1c5631c7 virt/kvm/arm/arch_timer.c Marc Zyngier 2016-04-06 131
:::::: The code at line 122 was first introduced by commit
:::::: 1c5631c73fc2261a5df64a72c155cb53dcdc0c45 KVM: arm/arm64: Handle forward time correction gracefully
:::::: TO: Marc Zyngier <marc.zyngier@....com>
:::::: CC: Christoffer Dall <christoffer.dall@...aro.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (36702 bytes)
Powered by blists - more mailing lists