diff options
Diffstat (limited to 'arch/ia64/kvm/vcpu.c')
-rw-r--r-- | arch/ia64/kvm/vcpu.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c index a18ee17b9192..a2c6c15e4761 100644 --- a/arch/ia64/kvm/vcpu.c +++ b/arch/ia64/kvm/vcpu.c | |||
@@ -788,13 +788,29 @@ void vcpu_set_fpreg(struct kvm_vcpu *vcpu, unsigned long reg, | |||
788 | setfpreg(reg, val, regs); /* FIXME: handle NATs later*/ | 788 | setfpreg(reg, val, regs); /* FIXME: handle NATs later*/ |
789 | } | 789 | } |
790 | 790 | ||
791 | /* | ||
792 | * The Altix RTC is mapped specially here for the vmm module | ||
793 | */ | ||
794 | #define SN_RTC_BASE (u64 *)(KVM_VMM_BASE+(1UL<<KVM_VMM_SHIFT)) | ||
795 | static long kvm_get_itc(struct kvm_vcpu *vcpu) | ||
796 | { | ||
797 | #if defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC) | ||
798 | struct kvm *kvm = (struct kvm *)KVM_VM_BASE; | ||
799 | |||
800 | if (kvm->arch.is_sn2) | ||
801 | return (*SN_RTC_BASE); | ||
802 | else | ||
803 | #endif | ||
804 | return ia64_getreg(_IA64_REG_AR_ITC); | ||
805 | } | ||
806 | |||
791 | /************************************************************************ | 807 | /************************************************************************ |
792 | * lsapic timer | 808 | * lsapic timer |
793 | ***********************************************************************/ | 809 | ***********************************************************************/ |
794 | u64 vcpu_get_itc(struct kvm_vcpu *vcpu) | 810 | u64 vcpu_get_itc(struct kvm_vcpu *vcpu) |
795 | { | 811 | { |
796 | unsigned long guest_itc; | 812 | unsigned long guest_itc; |
797 | guest_itc = VMX(vcpu, itc_offset) + ia64_getreg(_IA64_REG_AR_ITC); | 813 | guest_itc = VMX(vcpu, itc_offset) + kvm_get_itc(vcpu); |
798 | 814 | ||
799 | if (guest_itc >= VMX(vcpu, last_itc)) { | 815 | if (guest_itc >= VMX(vcpu, last_itc)) { |
800 | VMX(vcpu, last_itc) = guest_itc; | 816 | VMX(vcpu, last_itc) = guest_itc; |
@@ -809,7 +825,7 @@ static void vcpu_set_itc(struct kvm_vcpu *vcpu, u64 val) | |||
809 | struct kvm_vcpu *v; | 825 | struct kvm_vcpu *v; |
810 | struct kvm *kvm; | 826 | struct kvm *kvm; |
811 | int i; | 827 | int i; |
812 | long itc_offset = val - ia64_getreg(_IA64_REG_AR_ITC); | 828 | long itc_offset = val - kvm_get_itc(vcpu); |
813 | unsigned long vitv = VCPU(vcpu, itv); | 829 | unsigned long vitv = VCPU(vcpu, itv); |
814 | 830 | ||
815 | kvm = (struct kvm *)KVM_VM_BASE; | 831 | kvm = (struct kvm *)KVM_VM_BASE; |