diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2017-02-09 18:01:23 +0300 | 
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-02-09 18:01:23 +0300 | 
| commit | 2e751dfb5ffd20d1a31837dbc9718741df69bffe (patch) | |
| tree | 8b7e0e47cf0ef4efda0f1090f0ccbbeb17e5a085 /include/kvm/arm_arch_timer.h | |
| parent | a0e136d436ded817c0aade72efdefa56a00b4e5e (diff) | |
| parent | 7b6b46311a8562fb3a9e035ed6ffab6d49c28886 (diff) | |
| download | linux-2e751dfb5ffd20d1a31837dbc9718741df69bffe.tar.xz | |
Merge tag 'kvmarm-for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
kvmarm updates for 4.11
- GICv3 save restore
- Cache flushing fixes
- MSI injection fix for GICv3 ITS
- Physical timer emulation support
Diffstat (limited to 'include/kvm/arm_arch_timer.h')
| -rw-r--r-- | include/kvm/arm_arch_timer.h | 40 | 
1 files changed, 22 insertions, 18 deletions
| diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h index b717ed9d2b75..fe797d6ef89d 100644 --- a/include/kvm/arm_arch_timer.h +++ b/include/kvm/arm_arch_timer.h @@ -23,20 +23,24 @@  #include <linux/hrtimer.h>  #include <linux/workqueue.h> -struct arch_timer_kvm { +struct arch_timer_context { +	/* Registers: control register, timer value */ +	u32				cnt_ctl; +	u64				cnt_cval; + +	/* Timer IRQ */ +	struct kvm_irq_level		irq; + +	/* Active IRQ state caching */ +	bool				active_cleared_last; +  	/* Virtual offset */  	u64			cntvoff;  };  struct arch_timer_cpu { -	/* Registers: control register, timer value */ -	u32				cntv_ctl;	/* Saved/restored */ -	u64				cntv_cval;	/* Saved/restored */ - -	/* -	 * Anything that is not used directly from assembly code goes -	 * here. -	 */ +	struct arch_timer_context	vtimer; +	struct arch_timer_context	ptimer;  	/* Background timer used when the guest is not running */  	struct hrtimer			timer; @@ -47,21 +51,15 @@ struct arch_timer_cpu {  	/* Background timer active */  	bool				armed; -	/* Timer IRQ */ -	struct kvm_irq_level		irq; - -	/* Active IRQ state caching */ -	bool				active_cleared_last; -  	/* Is the timer enabled */  	bool			enabled;  };  int kvm_timer_hyp_init(void);  int kvm_timer_enable(struct kvm_vcpu *vcpu); -void kvm_timer_init(struct kvm *kvm);  int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu, -			 const struct kvm_irq_level *irq); +			 const struct kvm_irq_level *virt_irq, +			 const struct kvm_irq_level *phys_irq);  void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);  void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu);  void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu); @@ -70,10 +68,16 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu);  u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid);  int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value); -bool kvm_timer_should_fire(struct kvm_vcpu *vcpu); +bool kvm_timer_should_fire(struct arch_timer_context *timer_ctx);  void kvm_timer_schedule(struct kvm_vcpu *vcpu);  void kvm_timer_unschedule(struct kvm_vcpu *vcpu); +u64 kvm_phys_timer_read(void); +  void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu); +void kvm_timer_init_vhe(void); + +#define vcpu_vtimer(v)	(&(v)->arch.timer_cpu.vtimer) +#define vcpu_ptimer(v)	(&(v)->arch.timer_cpu.ptimer)  #endif | 
