Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54103
b: refs/heads/master
c: 2345df8
h: refs/heads/master
i:
  54101: 99cf743
  54099: d653879
  54095: d3a809f
v: v3
  • Loading branch information
Avi Kivity committed May 3, 2007
1 parent e35ff70 commit ab49d2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9047f533373e934b96d19d6a3d313ca2132fbe5
refs/heads/master: 2345df8c555ecb92c0c36172c07d5ac321a92dc7
12 changes: 11 additions & 1 deletion trunk/drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ static const u32 vmx_msr_index[] = {
};
#define NR_VMX_MSR ARRAY_SIZE(vmx_msr_index)

#ifdef CONFIG_X86_64
static unsigned msr_offset_kernel_gs_base;
#endif

static inline int is_page_fault(u32 intr_info)
{
return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
Expand Down Expand Up @@ -1129,6 +1133,10 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
vcpu->host_msrs[j].reserved = 0;
vcpu->host_msrs[j].data = data;
vcpu->guest_msrs[j] = vcpu->host_msrs[j];
#ifdef CONFIG_X86_64
if (index == MSR_KERNEL_GS_BASE)
msr_offset_kernel_gs_base = j;
#endif
++vcpu->nmsrs;
}

Expand Down Expand Up @@ -1760,7 +1768,9 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
fx_save(vcpu->host_fx_image);
fx_restore(vcpu->guest_fx_image);

save_msrs(vcpu->host_msrs, vcpu->nmsrs);
#ifdef CONFIG_X86_64
save_msrs(vcpu->host_msrs + msr_offset_kernel_gs_base, 1);
#endif
load_msrs(vcpu->guest_msrs, NR_BAD_MSRS);

asm (
Expand Down

0 comments on commit ab49d2b

Please sign in to comment.