aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorNadav Amit <namit@cs.technion.ac.il>2015-03-29 09:33:04 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2015-03-30 10:46:42 -0400
commitb32a99180027ec980af971d548781eac1f6bb9b5 (patch)
tree1b782f2d3443a1d3567c0ce6f45372e31f71bb3d /arch/x86/kvm/vmx.c
parent0efb04406de834d820f7ba150a00d1d3194aa8a6 (diff)
KVM: x86: Remove redundant definitions
Some constants are redfined in emulate.c. Avoid it. s/SELECTOR_RPL_MASK/SEGMENT_RPL_MASK s/SELECTOR_TI_MASK/SEGMENT_TI_MASK No functional change. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Message-Id: <1427635984-8113-3-git-send-email-namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index fdd9f8b88e10..63ca692fa673 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3263,8 +3263,8 @@ static void fix_pmode_seg(struct kvm_vcpu *vcpu, int seg,
3263 * default value. 3263 * default value.
3264 */ 3264 */
3265 if (seg == VCPU_SREG_CS || seg == VCPU_SREG_SS) 3265 if (seg == VCPU_SREG_CS || seg == VCPU_SREG_SS)
3266 save->selector &= ~SELECTOR_RPL_MASK; 3266 save->selector &= ~SEGMENT_RPL_MASK;
3267 save->dpl = save->selector & SELECTOR_RPL_MASK; 3267 save->dpl = save->selector & SEGMENT_RPL_MASK;
3268 save->s = 1; 3268 save->s = 1;
3269 } 3269 }
3270 vmx_set_segment(vcpu, save, seg); 3270 vmx_set_segment(vcpu, save, seg);
@@ -3837,7 +3837,7 @@ static bool code_segment_valid(struct kvm_vcpu *vcpu)
3837 unsigned int cs_rpl; 3837 unsigned int cs_rpl;
3838 3838
3839 vmx_get_segment(vcpu, &cs, VCPU_SREG_CS); 3839 vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
3840 cs_rpl = cs.selector & SELECTOR_RPL_MASK; 3840 cs_rpl = cs.selector & SEGMENT_RPL_MASK;
3841 3841
3842 if (cs.unusable) 3842 if (cs.unusable)
3843 return false; 3843 return false;
@@ -3865,7 +3865,7 @@ static bool stack_segment_valid(struct kvm_vcpu *vcpu)
3865 unsigned int ss_rpl; 3865 unsigned int ss_rpl;
3866 3866
3867 vmx_get_segment(vcpu, &ss, VCPU_SREG_SS); 3867 vmx_get_segment(vcpu, &ss, VCPU_SREG_SS);
3868 ss_rpl = ss.selector & SELECTOR_RPL_MASK; 3868 ss_rpl = ss.selector & SEGMENT_RPL_MASK;
3869 3869
3870 if (ss.unusable) 3870 if (ss.unusable)
3871 return true; 3871 return true;
@@ -3887,7 +3887,7 @@ static bool data_segment_valid(struct kvm_vcpu *vcpu, int seg)
3887 unsigned int rpl; 3887 unsigned int rpl;
3888 3888
3889 vmx_get_segment(vcpu, &var, seg); 3889 vmx_get_segment(vcpu, &var, seg);
3890 rpl = var.selector & SELECTOR_RPL_MASK; 3890 rpl = var.selector & SEGMENT_RPL_MASK;
3891 3891
3892 if (var.unusable) 3892 if (var.unusable)
3893 return true; 3893 return true;
@@ -3914,7 +3914,7 @@ static bool tr_valid(struct kvm_vcpu *vcpu)
3914 3914
3915 if (tr.unusable) 3915 if (tr.unusable)
3916 return false; 3916 return false;
3917 if (tr.selector & SELECTOR_TI_MASK) /* TI = 1 */ 3917 if (tr.selector & SEGMENT_TI_MASK) /* TI = 1 */
3918 return false; 3918 return false;
3919 if (tr.type != 3 && tr.type != 11) /* TODO: Check if guest is in IA32e mode */ 3919 if (tr.type != 3 && tr.type != 11) /* TODO: Check if guest is in IA32e mode */
3920 return false; 3920 return false;
@@ -3932,7 +3932,7 @@ static bool ldtr_valid(struct kvm_vcpu *vcpu)
3932 3932
3933 if (ldtr.unusable) 3933 if (ldtr.unusable)
3934 return true; 3934 return true;
3935 if (ldtr.selector & SELECTOR_TI_MASK) /* TI = 1 */ 3935 if (ldtr.selector & SEGMENT_TI_MASK) /* TI = 1 */
3936 return false; 3936 return false;
3937 if (ldtr.type != 2) 3937 if (ldtr.type != 2)
3938 return false; 3938 return false;
@@ -3949,8 +3949,8 @@ static bool cs_ss_rpl_check(struct kvm_vcpu *vcpu)
3949 vmx_get_segment(vcpu, &cs, VCPU_SREG_CS); 3949 vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
3950 vmx_get_segment(vcpu, &ss, VCPU_SREG_SS); 3950 vmx_get_segment(vcpu, &ss, VCPU_SREG_SS);
3951 3951
3952 return ((cs.selector & SELECTOR_RPL_MASK) == 3952 return ((cs.selector & SEGMENT_RPL_MASK) ==
3953 (ss.selector & SELECTOR_RPL_MASK)); 3953 (ss.selector & SEGMENT_RPL_MASK));
3954} 3954}
3955 3955
3956/* 3956/*