diff options
Diffstat (limited to 'virt/kvm/arm/arch_timer.c')
| -rw-r--r-- | virt/kvm/arm/arch_timer.c | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index f182b2380345..0d9438e9de2a 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -805,6 +805,7 @@ static u64 kvm_arm_timer_read(struct kvm_vcpu *vcpu,  	switch (treg) {  	case TIMER_REG_TVAL:  		val = timer->cnt_cval - kvm_phys_timer_read() + timer->cntvoff; +		val &= lower_32_bits(val);  		break;  	case TIMER_REG_CTL: @@ -850,7 +851,7 @@ static void kvm_arm_timer_write(struct kvm_vcpu *vcpu,  {  	switch (treg) {  	case TIMER_REG_TVAL: -		timer->cnt_cval = kvm_phys_timer_read() - timer->cntvoff + val; +		timer->cnt_cval = kvm_phys_timer_read() - timer->cntvoff + (s32)val;  		break;  	case TIMER_REG_CTL: @@ -1022,7 +1023,7 @@ static bool timer_irqs_are_valid(struct kvm_vcpu *vcpu)  bool kvm_arch_timer_get_input_level(int vintid)  { -	struct kvm_vcpu *vcpu = kvm_arm_get_running_vcpu(); +	struct kvm_vcpu *vcpu = kvm_get_running_vcpu();  	struct arch_timer_context *timer;  	if (vintid == vcpu_vtimer(vcpu)->irq.irq)  |