mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 13:46:24 +00:00
KVM: Replace MSR_IA32_TIME_STAMP_COUNTER with MSR_IA32_TSC of msr-index.h
Use standard msr-index.h's MSR declaration. MSR_IA32_TSC is better than MSR_IA32_TIME_STAMP_COUNTER as it also solves 80 column issue. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
ae0bb3e011
commit
af24a4e4ae
4 changed files with 6 additions and 9 deletions
|
@ -752,8 +752,6 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code)
|
||||||
kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
|
kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MSR_IA32_TIME_STAMP_COUNTER 0x010
|
|
||||||
|
|
||||||
#define TSS_IOPB_BASE_OFFSET 0x66
|
#define TSS_IOPB_BASE_OFFSET 0x66
|
||||||
#define TSS_BASE_SIZE 0x68
|
#define TSS_BASE_SIZE 0x68
|
||||||
#define TSS_IOPB_SIZE (65536 / 8)
|
#define TSS_IOPB_SIZE (65536 / 8)
|
||||||
|
|
|
@ -1953,7 +1953,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
|
||||||
struct vcpu_svm *svm = to_svm(vcpu);
|
struct vcpu_svm *svm = to_svm(vcpu);
|
||||||
|
|
||||||
switch (ecx) {
|
switch (ecx) {
|
||||||
case MSR_IA32_TIME_STAMP_COUNTER: {
|
case MSR_IA32_TSC: {
|
||||||
u64 tsc;
|
u64 tsc;
|
||||||
|
|
||||||
rdtscll(tsc);
|
rdtscll(tsc);
|
||||||
|
@ -2043,7 +2043,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
|
||||||
struct vcpu_svm *svm = to_svm(vcpu);
|
struct vcpu_svm *svm = to_svm(vcpu);
|
||||||
|
|
||||||
switch (ecx) {
|
switch (ecx) {
|
||||||
case MSR_IA32_TIME_STAMP_COUNTER: {
|
case MSR_IA32_TSC: {
|
||||||
u64 tsc;
|
u64 tsc;
|
||||||
|
|
||||||
rdtscll(tsc);
|
rdtscll(tsc);
|
||||||
|
|
|
@ -941,7 +941,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
|
||||||
case MSR_EFER:
|
case MSR_EFER:
|
||||||
return kvm_get_msr_common(vcpu, msr_index, pdata);
|
return kvm_get_msr_common(vcpu, msr_index, pdata);
|
||||||
#endif
|
#endif
|
||||||
case MSR_IA32_TIME_STAMP_COUNTER:
|
case MSR_IA32_TSC:
|
||||||
data = guest_read_tsc();
|
data = guest_read_tsc();
|
||||||
break;
|
break;
|
||||||
case MSR_IA32_SYSENTER_CS:
|
case MSR_IA32_SYSENTER_CS:
|
||||||
|
@ -1001,7 +1001,7 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
|
||||||
case MSR_IA32_SYSENTER_ESP:
|
case MSR_IA32_SYSENTER_ESP:
|
||||||
vmcs_writel(GUEST_SYSENTER_ESP, data);
|
vmcs_writel(GUEST_SYSENTER_ESP, data);
|
||||||
break;
|
break;
|
||||||
case MSR_IA32_TIME_STAMP_COUNTER:
|
case MSR_IA32_TSC:
|
||||||
rdtscll(host_tsc);
|
rdtscll(host_tsc);
|
||||||
guest_write_tsc(data, host_tsc);
|
guest_write_tsc(data, host_tsc);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -466,7 +466,7 @@ static u32 msrs_to_save[] = {
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
|
MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
|
||||||
#endif
|
#endif
|
||||||
MSR_IA32_TIME_STAMP_COUNTER, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
|
MSR_IA32_TSC, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
|
||||||
MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA
|
MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -644,8 +644,7 @@ static void kvm_write_guest_time(struct kvm_vcpu *v)
|
||||||
|
|
||||||
/* Keep irq disabled to prevent changes to the clock */
|
/* Keep irq disabled to prevent changes to the clock */
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
kvm_get_msr(v, MSR_IA32_TIME_STAMP_COUNTER,
|
kvm_get_msr(v, MSR_IA32_TSC, &vcpu->hv_clock.tsc_timestamp);
|
||||||
&vcpu->hv_clock.tsc_timestamp);
|
|
||||||
ktime_get_ts(&ts);
|
ktime_get_ts(&ts);
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue