Skip to content

Commit

Permalink
KVM: VMX: Remove a duplicated ia32e mode vm entry control
Browse files Browse the repository at this point in the history
Remove a duplicated ia32e mode VM Entry control definition and use the
proper one.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Li, Xin B authored and Avi Kivity committed Oct 13, 2007
1 parent a477034 commit 1e4e6e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 4 additions & 4 deletions drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ static void enter_lmode(struct kvm_vcpu *vcpu)
find_msr_entry(to_vmx(vcpu), MSR_EFER)->data |= EFER_LMA | EFER_LME;
vmcs_write32(VM_ENTRY_CONTROLS,
vmcs_read32(VM_ENTRY_CONTROLS)
| VM_ENTRY_CONTROLS_IA32E_MASK);
| VM_ENTRY_IA32E_MODE);
}

static void exit_lmode(struct kvm_vcpu *vcpu)
Expand All @@ -1120,7 +1120,7 @@ static void exit_lmode(struct kvm_vcpu *vcpu)

vmcs_write32(VM_ENTRY_CONTROLS,
vmcs_read32(VM_ENTRY_CONTROLS)
& ~VM_ENTRY_CONTROLS_IA32E_MASK);
& ~VM_ENTRY_IA32E_MODE);
}

#endif
Expand Down Expand Up @@ -1185,13 +1185,13 @@ static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
if (efer & EFER_LMA) {
vmcs_write32(VM_ENTRY_CONTROLS,
vmcs_read32(VM_ENTRY_CONTROLS) |
VM_ENTRY_CONTROLS_IA32E_MASK);
VM_ENTRY_IA32E_MODE);
msr->data = efer;

} else {
vmcs_write32(VM_ENTRY_CONTROLS,
vmcs_read32(VM_ENTRY_CONTROLS) &
~VM_ENTRY_CONTROLS_IA32E_MASK);
~VM_ENTRY_IA32E_MODE);

msr->data = efer & ~EFER_LME;
}
Expand Down
3 changes: 0 additions & 3 deletions drivers/kvm/vmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ enum vmcs_field {
/* segment AR */
#define SEGMENT_AR_L_MASK (1 << 13)

/* entry controls */
#define VM_ENTRY_CONTROLS_IA32E_MASK (1 << 9)

#define AR_TYPE_ACCESSES_MASK 1
#define AR_TYPE_READABLE_MASK (1 << 1)
#define AR_TYPE_WRITEABLE_MASK (1 << 2)
Expand Down

0 comments on commit 1e4e6e0

Please sign in to comment.