mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-03 11:13:56 +08:00
KVM: VMX: remove unneeded vmx_load_host_state() calls.
vmx_load_host_state() does not handle msrs switching (except
MSR_KERNEL_GS_BASE) since commit 26bb0981b3
. Remove call to it
where it is no longer make sense.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
95d4c16ce7
commit
46199f33c2
@ -1747,7 +1747,6 @@ static void setup_msrs(struct vcpu_vmx *vmx)
|
|||||||
int save_nmsrs, index;
|
int save_nmsrs, index;
|
||||||
unsigned long *msr_bitmap;
|
unsigned long *msr_bitmap;
|
||||||
|
|
||||||
vmx_load_host_state(vmx);
|
|
||||||
save_nmsrs = 0;
|
save_nmsrs = 0;
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
if (is_long_mode(&vmx->vcpu)) {
|
if (is_long_mode(&vmx->vcpu)) {
|
||||||
@ -2142,12 +2141,10 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
|
|||||||
return 1;
|
return 1;
|
||||||
/* Otherwise falls through */
|
/* Otherwise falls through */
|
||||||
default:
|
default:
|
||||||
vmx_load_host_state(to_vmx(vcpu));
|
|
||||||
if (vmx_get_vmx_msr(vcpu, msr_index, pdata))
|
if (vmx_get_vmx_msr(vcpu, msr_index, pdata))
|
||||||
return 0;
|
return 0;
|
||||||
msr = find_msr_entry(to_vmx(vcpu), msr_index);
|
msr = find_msr_entry(to_vmx(vcpu), msr_index);
|
||||||
if (msr) {
|
if (msr) {
|
||||||
vmx_load_host_state(to_vmx(vcpu));
|
|
||||||
data = msr->data;
|
data = msr->data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2171,7 +2168,6 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
|
|||||||
|
|
||||||
switch (msr_index) {
|
switch (msr_index) {
|
||||||
case MSR_EFER:
|
case MSR_EFER:
|
||||||
vmx_load_host_state(vmx);
|
|
||||||
ret = kvm_set_msr_common(vcpu, msr_index, data);
|
ret = kvm_set_msr_common(vcpu, msr_index, data);
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
@ -2220,7 +2216,6 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
|
|||||||
break;
|
break;
|
||||||
msr = find_msr_entry(vmx, msr_index);
|
msr = find_msr_entry(vmx, msr_index);
|
||||||
if (msr) {
|
if (msr) {
|
||||||
vmx_load_host_state(vmx);
|
|
||||||
msr->data = data;
|
msr->data = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user