提交 82ca2d10 编写于 作者: A Avi Kivity

KVM: SVM: Fold save_host_msrs() and load_host_msrs() into their callers

This abstraction only serves to obfuscate.  Remove.
Signed-off-by: NAvi Kivity <avi@redhat.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 dacccfdd
...@@ -187,9 +187,6 @@ static int nested_svm_vmexit(struct vcpu_svm *svm); ...@@ -187,9 +187,6 @@ static int nested_svm_vmexit(struct vcpu_svm *svm);
static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr, static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
bool has_error_code, u32 error_code); bool has_error_code, u32 error_code);
static void save_host_msrs(struct kvm_vcpu *vcpu);
static void load_host_msrs(struct kvm_vcpu *vcpu);
static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu) static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu)
{ {
return container_of(vcpu, struct vcpu_svm, vcpu); return container_of(vcpu, struct vcpu_svm, vcpu);
...@@ -1002,7 +999,9 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu) ...@@ -1002,7 +999,9 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
svm->asid_generation = 0; svm->asid_generation = 0;
} }
save_host_msrs(vcpu); #ifdef CONFIG_X86_64
rdmsrl(MSR_GS_BASE, to_svm(vcpu)->host.gs_base);
#endif
savesegment(fs, svm->host.fs); savesegment(fs, svm->host.fs);
savesegment(gs, svm->host.gs); savesegment(gs, svm->host.gs);
svm->host.ldt = kvm_read_ldt(); svm->host.ldt = kvm_read_ldt();
...@@ -1371,20 +1370,6 @@ static void svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) ...@@ -1371,20 +1370,6 @@ static void svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
update_db_intercept(vcpu); update_db_intercept(vcpu);
} }
static void load_host_msrs(struct kvm_vcpu *vcpu)
{
#ifdef CONFIG_X86_64
wrmsrl(MSR_GS_BASE, to_svm(vcpu)->host.gs_base);
#endif
}
static void save_host_msrs(struct kvm_vcpu *vcpu)
{
#ifdef CONFIG_X86_64
rdmsrl(MSR_GS_BASE, to_svm(vcpu)->host.gs_base);
#endif
}
static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *sd) static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *sd)
{ {
if (sd->next_asid > sd->max_asid) { if (sd->next_asid > sd->max_asid) {
...@@ -3426,8 +3411,9 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) ...@@ -3426,8 +3411,9 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
#endif #endif
); );
load_host_msrs(vcpu); #ifdef CONFIG_X86_64
#ifndef CONFIG_X86_64 wrmsrl(MSR_GS_BASE, svm->host.gs_base);
#else
loadsegment(fs, svm->host.fs); loadsegment(fs, svm->host.fs);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册